Catto / Topic Map · Control Systems Level 5
Control Systems · 96 h · Topic 2 of 8

Modeling and simulation of dynamic systems

Neglecting the inductance of a small motor is almost always reasonable. With 10 mH and low inertia, the simplified model fails to see that the speed overshoots by 70 % before settling.

Analogies DC motor State space Transfer function Runge-Kutta

01From the physical system to the equations

To design a controller you need a model of the plant: equations that describe how it responds to its inputs. It is obtained by applying the physical laws of each domain, Kirchhoff's laws in circuits, Newton's laws in mechanics, energy and mass balances in thermal and chemical processes, and linearizing around the operating point. The analogies between domains mean that the same type of equation describes very different systems:

DomainEffortFlowStores energyDissipates
ElectricalVoltageCurrentCapacitance, inductanceResistance
Rotational mechanicalTorqueAngular velocityInertia, springViscous friction
ThermalTemperatureHeat flowThermal capacitanceThermal resistance
HydraulicPressureFlow rateTank, fluid inertanceRestriction

02A complete example: the DC motor

The permanent-magnet DC motor couples an electrical circuit, with resistance \( R \) and inductance \( L \), and a mechanical load, with inertia \( J \) and friction \( b \). The back EMF is \( K\omega \) and the torque is \( Ki \). With the state variables \( i \) and \( \omega \):

\[ L \frac{di}{dt} = v - R\,i - K\omega \] \[ J \frac{d\omega}{dt} = K\,i - b\,\omega - T_L \] Two first-order equations, one for each element that stores energy. \( T_L \) is the load torque. How the motor works was covered in DC machines.

03State space and transfer function

The same model can be written in two ways. In state space, as a system of first-order equations in matrix form, which admits several inputs and outputs, initial conditions and nonlinearities, and is integrated numerically. With the Laplace transform and zero initial conditions, as a transfer function between one input and one output:

\[ \dot{\mathbf x} = A\mathbf x + B u, \quad y = C\mathbf x + D u \] \[ \frac{\Omega(s)}{V(s)} = \frac{K}{(Ls + R)(Js + b) + K^2} \] The poles of the transfer function are the eigenvalues of \( A \). If the electrical constant \( L/R \) is much smaller than the mechanical one, the motor is approximated with a single pole: \( \Omega/V = K_m/(\tau_m s + 1) \), with \( \tau_m = RJ/(Rb + K^2) \).
Lab · the DC motor, full and approximate

A motor with R = 1 Ω, K = 0.05 V·s/rad and b = 10⁻⁵ N·m·s, driven by a 12 V step. The blue curve is the speed of the full model, integrated with fourth-order Runge-Kutta in 4000 steps; the dotted one, that of the first-order model; below, the current.

04Simulation

To simulate is to integrate the state equations numerically. Euler's method advances using the derivative at the start of the step; fourth-order Runge-Kutta averages four derivatives and is much more accurate with the same step. The step has to be considerably smaller than the fastest time constant of the system: if there are very different constants, the system is stiff and a variable-step or implicit integrator is preferable. The usual tools, such as Simulink, Xcos, Modelica or the Python libraries, do this automatically, but the model is written by the engineer.

05In the lab

Activity 1 · Identify a motor

Measure R with the motor stalled, K with the motor unloaded as a generator, and τm with the speed step response. Build the model and compare the simulation with the measurement.

Activity 2 · Euler and Runge-Kutta

Simulate the motor in Python with both methods and different steps, and compare with the exact solution.

Activity 3 · A thermal process

Model a heated block with its thermal capacitance and resistance and verify the time constant with a measurement.

06Common mistakes

  • Using the model away from the point where it was linearized. With large excursions, the nonlinearities change the response.
  • Neglecting the inductance without checking. It is only valid if the electrical constant is much smaller than the mechanical one.
  • Simulating with a large step. The simulation can oscillate or diverge even if the system is stable.
  • Confusing the transfer function with the system. It describes one input and one output with zero initial conditions.

07Self-assessment

What final speed does the lab motor reach with 12 V?

\( K V/(Rb + K^2) = 0.6/0.00251 \approx 239 \) rad/s.

What is τm with J = 10⁻⁵ kg·m²?

\( 10^{-5}/0.00251 \approx 4 \) ms.

How many state variables does a system with two independent capacitors and one inductor need?

Three.

What is the relationship between the poles of the transfer function and the matrix A?

The poles are the eigenvalues of A.

08Further reading

  • Katsuhiko Ogata. System Dynamics. 4th ed., Pearson Prentice Hall, 2004 (Spanish edition: “Dinámica de sistemas”, Prentice Hall Hispanoamericana, 1987). The modeling of mechanical, electrical, thermal and hydraulic systems with the same method.
  • Norman S. Nise. Control Systems Engineering. 8th ed., Wiley, 2019. State-space and transfer-function modeling with many examples.
  • Gene F. Franklin, J. David Powell and Abbas Emami-Naeini. Feedback Control of Dynamic Systems. 8th ed., Pearson, 2019. Models of real systems, from the motor to the airplane, and their simulation.
Development of the topic “Modeling and simulation of dynamic systems” of Control Systems (Level 5), based on the curriculum of the UTN Electronic Engineering program, 2023 curriculum — Ordinance No. 1849 of the UTN Higher Council. Back to the Topic Map · catto.ar