Sampled-Data Control Design - Emulation and Direct Design
In questa pagina 6
This note collects the slides of lab activity 5 (digital speed PI control of a DC servomotor). It complements Digital Control SystemsA digital control system replaces the analog controller with a processing unit interfaced to the plant through an A/D converter (sampling plus quantization) and a D/A converter (zero-order hold), and neglecting quantization it becomes a sampled-data system that can be designed by emulation or directly in discrete time.Digital Control Systems → and Sampling and the Sampling TheoremSampling multiplies a continuous-time signal by a pulse train, which replicates its spectrum every omega_s; if the signal is band-limited with maximum angular frequency omega_M and omega_s exceeds 2 omega_M, an ideal low-pass filter recovers it exactly (Shannon theorem and sinc interpolation formula).Sampling and the Sampling Theorem →; the controller to be designed is the speed PI of Lab Activity - Speed P and PI Control Loop SimulationSimulation tasks to close a speed loop around the Simulink servomotor model, first with a proportional controller that cannot give zero steady-state error and then with a PI controller that does, using a square-wave speed reference of plus and minus 250 rpm and the three speed filters.Lab Activity - Speed P and PI Control Loop Simulation →, and a numerical exercise on the same loop is in Numerical Lab - Simulation with Noise and QuantizationNumerical lab session on a sampled-data speed controller for a DC motor: discrete-time derivative filters compared on Bode plots and on a noisy ramp, then a P and a PI speed loop simulated first with the Control System Toolbox and then in Simulink with DAC and encoder quantization and actuator saturation.Numerical Lab - Simulation with Noise and Quantization →.
1. Sampled-data and digital control systems
- Sampled-data system: a system where continuous-time and discrete-time signals coexist.
- Digital control system: a closed-loop control system where a continuous-time plant is controlled by a digital controller.
r[k] e[k] u[k] u(t) y(t)
---->(+)---> C(z) ---> DAC ---> ZOH-like staircase ---> P(s) ---+------>
^ - |
| y[k] |
+------------- ADC <--------------------------------------+
|<---- digital controller ---->|<----------- continuous-time plant ----------->|The digital controller works on the sequences , , , ; the DAC turns the sequence into a piecewise-constant signal , the plant produces the continuous output , and the ADC samples it into . Seen from the digital controller, the part DAC + + ADC is a discrete-time plant . The handwritten remark stresses that the continuous-time controller and its digital counterpart are not the same system: , which is why the discretization has to be designed.
2. Two design routes
- Design by emulation (design in continuous time). The design is done in the continuous-time domain, with classical methods (Bode's method, root locus, ...) or modern methods (state space). Then a discrete-time controller approximating the response of the original continuous-time controller is obtained by a discretization procedure.
- Direct digital design (design in discrete time). The design is done directly in the discrete-time domain, after having obtained a discrete-time model of the plant (exact discretization of the continuous-time plant model).
The overview diagram of the lectures (labels in Italian in the original) is a cycle with four nodes: continuous plant, discrete plant, continuous controller, discrete controller.
- : discretization of period , either approximate (Euler, trapezoidal: a rational function of , , ) or exact (, , ).
- (continuous design): from the transfer function, PID design by dominant poles (root locus) or in frequency (phase margin, Bode); from the state-space model, pole placement (closed chain ) or a linear quadratic regulator (LQR, treated in the Systems Theory course).
- (direct design): digital PID (a different course), pole placement (poles from the continuous ones as ) or discrete LQR.
- : discretization of the controller with the same two families (approximate with Euler or trapezoidal, or exact).
The slides highlight the emulation path as and the direct design path as .
3. Design by emulation
Let be the transfer function of the controller designed in continuous time with classical or modern methods. The discretization problem consists in finding a discrete-time controller such that the input-output transfer function of the sampled-data controller approximates (in some sense) the transfer function .
All the usual methods are obtained from one substitution with a parameter :
The meaning of is the rule used to approximate the area under the curve between and in a numerical integration (the controller integral action):
- : rectangle with height (left value);
- : rectangle with height (right value);
- : trapezoid with vertices and .
| Discretization method | Variable substitution | |
|---|---|---|
| Forward Euler | ||
| Backward Euler | ||
| Trapezoidal / Tustin |
Image of the stable region
Which part of the -plane receives the left half plane under each substitution (figures of the slides, in the -plane, with the unit circle drawn):
- Forward Euler: the whole half plane (a stable continuous pole can land outside the unit circle, so stability may be lost);
- Backward Euler: the disc of radius centred at (inside the unit circle, so stability is always preserved, but the stable region is shrunk);
- Trapezoidal (Tustin): exactly the unit disc (the left half plane is mapped onto the stable region of discrete systems).
(These regions are checked directly on the substitutions: for , ; for , ; for the trapezoidal rule, .)
4. Direct design: exact discretization of
Place a zero-order hold and a sampler of period around : the discrete plant must give the same samples as the continuous plant, .
+----------------------------> [ P(z) ] -----------> y(k)
u(k) ----+ ||
+--> [ H0 ] --> [ P(s) ] --> ( sampler T ) -----------> y~(k)Start from the state-space form of :
With the ZOH, for , and the variation-of-constants formula gives
(The slide writes the exponent as and the upper limit as ; the second line shows the result after the change of variable and with constant over the interval.) Hence the exact discrete-time model
with transfer function
In MATLAB this is the c2d routine with the 'zoh' method, as used in Numerical Lab - Simulation with Noise and QuantizationNumerical lab session on a sampled-data speed controller for a DC motor: discrete-time derivative filters compared on Bode plots and on a noisy ramp, then a P and a PI speed loop simulated first with the Control System Toolbox and then in Simulink with DAC and encoder quantization and actuator saturation.Numerical Lab - Simulation with Noise and Quantization →. See also Difference EquationsRecursive constant-coefficient linear difference equations (ARMA models) are the discrete-time counterpart of ODEs: the delay operator replaces the derivative, the modes are k^m lambda^k with lambda a root of the characteristic polynomial, and the solution splits into a natural and a forced response.Difference Equations → and Bilateral Z-TransformThe bilateral Z-transform X_B(z) = sum x(k) z^{-k} is the discrete-time counterpart of the Laplace transform; it converges only on a region of convergence (an annulus-type region), extends the DTFT when the unit circle is in the ROC, has an inversion formula and properties such as linearity, shift, time reversal and convolution.Bilateral Z-Transform → for the discrete-time side.
5. Eigenvalue (pole) mapping
Fact (relationship between continuous- and discrete-time plant eigenvalues). The eigenvalues , , of are related to the eigenvalues of by
In particular:
- the imaginary axis is mapped into the unit circle ;
- the point is mapped into ;
- the left half plane of the -plane is mapped into the region within the unit circle in the -plane.
For a pair of complex poles characterised by natural frequency and damping :
Links with the continuous-time specifications (Second-Order System Step ResponseThe unit step response of a BIBO stable second-order system with complex conjugate poles is W(0) times one minus an exponentially decaying sinusoid, and its rise time, settling time and overshoot are approximately 1.8 over the natural frequency, 4.6 over the real part of the pole magnitude, and exp of minus pi times the damping ratio over the square root of one minus its square.Second-Order System Step Response →, Stability of Dynamical SystemsFor an LTI system the response to a perturbation of an equilibrium does not depend on the equilibrium or on the perturbation amplitude, so stability reduces to the free evolution being bounded (stable) or vanishing (asymptotically stable), decided by the roots of the characteristic polynomial, and is related to BIBO stability.Stability of Dynamical Systems →):
- Isodecay curves ( constant, vertical lines in the -plane) map into circles of radius centred at the origin. The region of eigenvalues associated with modes decaying faster than is which is a half plane in the -plane and a disc centred at in the -plane (radius ).
- Isodamping curves ( constant, rays from the origin in the -plane) map into spirals in the -plane. The region of eigenvalues with damping ratio greater than is a wedge in the -plane and, in the -plane, a heart-shaped region touching the unit circle at . (The slide writes the set as , while the caption and the picture shade the region with damping ratio greater than : the inequality printed on the slide appears reversed.)
- The -plane figures also carry the grid of constant (labels like ) and constant (labels ), which allows reading and from the position of a discrete pole for a given .
6. Direct digital design with the Control System Designer
The slide shows the Control System Designer (sisotool) of the Control System Toolbox, used with the root locus method (Bode editor and root locus editor open on the loop transfer function LoopTransfer_C). In the architecture the blocks are F, C, G, H; the available responses are LoopTransfer_C, IOTransfer_r2y, IOTransfer_r2u, IOTransfer_du2y, IOTransfer_dy2y, IOTransfer_n2y. The tunable block in the example has sample time and value : a discrete PI controller with a zero at and a pole at . The root locus editor shows the locus on the -plane together with the unit circle and the regions of constant damping and natural frequency, so the poles can be placed with the specifications of Section 5. (Controller structure in The Root LocusThe positive root locus is the set of closed-loop poles of the loop with a proportional controller C(s)=K, K>=0, as K varies; it consists of n branches that start at the poles of G(s) and end at its zeros or at infinity along asymptotes, and four sketching rules (real-axis rule, asymptotes with centroid, multiple points) let one draw it and read off stability and transient requirements.The Root Locus →.)
Versione ripasso
Definitions
- Sampled-data system: continuous and discrete signals coexist. Digital control system: continuous plant, digital controller (DAC, ADC); .
Two routes
- Emulation: design in continuous time, then discretize to get .
- Direct digital design: exactly discretize to , design in discrete time.
Emulation:
| Method | ||
|---|---|---|
| Forward Euler | ||
| Backward Euler | ||
| Tustin |
- Stable region image: FE gives the half plane (can destabilise); BE gives the disc of radius centred at (always stable); Tustin gives exactly the unit disc.
Exact discretization (ZOH)
(c2d with 'zoh').
Pole mapping: . Imaginary axis to unit circle; to ; left half plane to the interior of the unit circle. .
- Isodecay : vertical lines to circles (radius ); gives a disc.
- Isodamping : rays to spirals; damping greater than gives a heart-shaped region touching .
Tool: sisotool (Control System Designer), root locus on -plane; example PI with sample time : .
Typical error: placing discrete poles by reading the -plane specifications directly, without mapping them through .
Percorsi di progetto:
- Emulazione: , cioè progetto continuo (Bode, luogo delle radici o stato) poi discretizzazione del controllore.
- Progetto diretto: , cioè discretizzazione esatta dell'impianto poi progetto in .
Significato di : la regola per l'area sotto tra e : rettangolo con il valore a sinistra; rettangolo con il valore a destra; trapezio.
Controlli sulla regione stabile (dalle sostituzioni):
- FE: , con che dà .
- BE: , cioè il disco di centro e raggio .
- Tustin: , cioè il disco unitario.
Discretizzazione esatta, passi:
- Stato: , .
- Con ZOH costante su : .
- Modello discreto: , , , ; .
Mappatura dei poli per una coppia complessa: diventa . Le curve isodecay ( costante, rette verticali) diventano cerchi di raggio ; le isodamping (raggi) diventano spirali.
Esempio con sisotool: controllore tunable con tempo di campionamento s e valore , cioè un PI discreto con zero in e polo in .
Errori tipici:
- Confondere con il suo equivalente discreto : sono sistemi diversi.
- Usare BE come metodo sempre stabile senza notare che restringe la regione stabile al disco di raggio .
- Leggere le specifiche sul piano come se fossero sul piano : il mapping è .