Digital Control Systems
In questa pagina 9
Analog control systems
In an analog control system the controller operates with analog signals (continuous in time and amplitude). When implemented with electronic circuits it typically relies on operational amplifiers (op-amps). The loop is the usual one: error , analog controller, command , plant, output .
| Advantages | compatible with continuous-time plant dynamics; well-established design methods |
| Drawbacks | sensitive to component tolerances and aging; difficult to diagnose and reconfigure (limited flexibility) |
Example: analog PID with op-amps
Parallel implementation. The input is sent to three op-amp branches whose outputs are summed by a final op-amp (with resistor in the feedback and in series with each branch output):
- proportional branch: input resistor , feedback resistor ;
- integral branch: input resistor , feedback capacitor ;
- derivative branch: input capacitor in series with resistor , feedback resistor .
The transfer function is
with
(The derivative is of real form, see PID Controllers and Bode Method DesignPID controllers exist in parallel and series forms, ideal and real (with a pole on the derivative), and are designed with the Bode method by choosing the controller type and gain from the steady-state specifications and then the PID parameters that give the required gain and phase correction at the crossover frequency.PID Controllers and Bode Method Design →; signs from the inverting stages are not discussed on the slide.)
Series implementation. A single op-amp whose input path is the parallel of and followed by the series resistor , and whose feedback path contains and in series (as drawn on the slide):
with, as printed on the slide,
Flag: on the slide and are printed with the same expression, which would make the lead-lag factor equal to 1, so one of the two is probably a misprint in the original slide (a direct analysis of the circuit as drawn gives ). Check against the source before using it.
Digital control systems
In a digital control system the controller operates on digital signals (discrete in time and amplitude). It consists of a digital processing unit (microcontroller, DSP, FPGA, PLC, ...) properly interfaced with the plant.
Digital processing unit
+-------------------------------------------+
r[k] | e[k] +-----------+ u[k] +-----+ | u(t) +-------+ y(t)
------>O------->| Digital |----->| D/A |----------|-------->| Plant |---+--->
^ - | controller| +-----+ | +-------+ |
| +-----------+ | |
| y[k] +-----+ | |
+------------------| A/D |<------------------|---------------------+
+-----+ |
+-------------------------------------------+Signals: reference, error, digital command (coded values on the vertical axis of the slide: 001 to 101), piecewise-constant analog command, plant output, digital measurement.
| Advantages | flexible and easy to reconfigure (even during operation); possibility to integrate advanced functionalities (supervision logic, fault management, alarms, etc.); not affected by component tolerances and aging |
| Drawbacks | piecewise-constant control signal; feedback from the output only at the sampling instants; possible instability if the sampling period is large |
Sampling
The controller operates on samples of the analog signal , taken at the sampling instants , where is the sampling period and is the sampling frequency:
Note: uniform sampling is assumed, i.e. is constant. See 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 → and Aliasing and Anti-Aliasing FiltersAliasing is the overlap of spectral replicas that occurs when the band-limited or Nyquist assumptions of the sampling theorem fail; an anti-aliasing low-pass filter with cut-off omega_s/2 applied before sampling removes it at the price of losing the high frequencies; two worked exercises.Aliasing and Anti-Aliasing Filters → for the theory.
Analog-to-digital conversion (A/D)
A/D conversion consists of sampling the signal at the instants , followed by encoding the samples into numerical values . These operations are performed by an analog-to-digital converter (ADC); however, there are cases in which the sensor directly provides a numerical value (for example a position encoder).
The A/D chain of the slides is
- Ideal sampler: provides the samples of the input analog signal.
- Quantizer: discretizes ("quantizes") the amplitudes of the samples into a finite number of possible levels.
- Encoder: assigns a numerical code (for example binary) to each output level of the quantizer.
Rounding quantization and binary coding
The slide shows a rounding quantizer with quantization step :
The staircase has transitions at and output levels . The example in the slide has eight levels, from to , and two binary codings:
| Level | Two's complement | Offset binary |
|---|---|---|
| 011 | 111 | |
| 010 | 110 | |
| 001 | 101 | |
| 000 | 100 | |
| 111 | 011 | |
| 110 | 010 | |
| 101 | 001 | |
| 100 | 000 |
Digital-to-analog conversion (D/A)
D/A conversion typically consists of holding the control signal constant over the entire sampling interval . It is performed by a digital-to-analog converter (DAC); however, there are cases in which the actuator directly accepts a numerical value (for example a stepper motor).
The D/A chain of the slides is
- Decoder: assigns an output level to each numerical input code (for example binary).
- Quantizer: discretizes the amplitudes of the samples into a finite number of levels (which may differ from those of the ADC).
- Zero-Order Hold (ZOH): holds the value constant over the entire sampling interval .
The control routine
The digital controller runs a control routine at regular time intervals. The execution is typically triggered by an interrupt generated by a hardware timer (real-time clock).
real-time clock interrupt
|
v
start of control routine
1. acquire the reference r[k] and the output y[k]
2. compute the control error e[k]
3. compute the control input u[k] (typically by a difference equation relating e[k] with u[k])
4. send the control signal to the actuator
end of control routineThe difference equation is the discrete-time model of the controller, see 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 →.
Nature of a digital control system
A digital control system is:
- time-varying, due to sampling;
- nonlinear, due to quantization in the A/D and D/A conversions, and in the execution of the control routine (fixed-point versus floating-point arithmetic).
Sampled-data systems
For simplicity, quantization effects are neglected from now on. The resulting control system is called sampled-data or hybrid-time system.
- The A/D and D/A blocks are replaced by an ideal sampler and a ZOH.
- Continuous-time and discrete-time signals coexist.
- Signals are not discretized in amplitude (no quantization).
The discrete-time control unit contains the discrete-time controller (input , output ); the ZOH produces for the plant; the output is sampled with period to give .
Note on quantization: quantization generally affects steady-state accuracy (it may induce persistent oscillations, known as limit cycles). It can be neglected if the quantization step is sufficiently small compared to the full scale of the signals.
Error-sampled control system
Rather than sampling the reference and the output, one may sample the tracking error . The resulting sampled-data control system is known as an error-sampled control system: is sampled at to give , then discrete-time controller, ZOH, plant.
Design of a sampled-data control system
- Continuous-time design (design by emulation): the controller is designed in continuous time and then converted to discrete time using a discretization procedure. The part replaced is: sampler, discrete-time controller, ZOH. The methods are in Discretization Methods for ControllersDesign by emulation discretizes a continuous-time controller with impulse or step invariance or with numerical integration rules (forward Euler, backward Euler, Tustin), choosing the sampling frequency 10 to 20 times or more above the bandwidth, and accounting for the half-sample delay of the zero-order hold.Discretization Methods for Controllers →.
- Discrete-time design (direct digital design): the controller is designed directly in the discrete-time domain, using a discrete-time equivalent model of the plant (the ZOH, the plant and the sampler together, seen from to ).
Versione ripasso
Analog control: continuous signals, op-amp circuits; compatible with continuous plants and well-known design, but sensitive to tolerances and aging and hard to reconfigure.
Op-amp PID (parallel): , , , , . Series form: , (the printed and coincide: probable misprint).
Digital control: processing unit (microcontroller, DSP, FPGA, PLC) + A/D + D/A. Flexible, reconfigurable, immune to aging; but piecewise-constant command, feedback only at sampling instants, possible instability for large .
Sampling: , , , uniform.
A/D: ideal sampler, quantizer, encoder. Rounding quantizer: for . Codings: two's complement, offset binary.
D/A: decoder, quantizer, ZOH (holds over ).
Control routine (timer interrupt): acquire , ; compute ; compute with a difference equation; send to actuator.
Nature: time-varying (sampling), nonlinear (quantization, fixed vs floating point).
Sampled-data system: no quantization; ideal sampler + ZOH; mixed continuous/discrete signals. Quantization may cause limit cycles; negligible for a small step. Variant: error-sampled system.
Design: (1) emulation: design in continuous time, then discretize; (2) direct digital design: design in discrete time on the discrete-time equivalent of the plant.
Quantizzatore arrotondato: soglie a e livelli . Esempio a 8 livelli da a :
- complemento a due: , , ;
- binario con offset: , , .
Routine di controllo (ad ogni interrupt del timer):
- acquisizione di e ;
- calcolo di ;
- calcolo di con l'equazione alle differenze;
- invio di all'attuatore.
Natura del sistema digitale: tempo variante per il campionamento, non lineare per la quantizzazione (aritmetica in virgola fissa o mobile).
Sistema campionato (senza quantizzazione): A/D e D/A diventano campionatore ideale e ZOH; è costante a tratti; viene campionato con . Variante: si campiona l'errore invece di e .
Due vie di progetto:
- Emulazione: si progetta in tempo continuo e poi si discretizza il regolatore (metodi in Discretization Methods for ControllersDesign by emulation discretizes a continuous-time controller with impulse or step invariance or with numerical integration rules (forward Euler, backward Euler, Tustin), choosing the sampling frequency 10 to 20 times or more above the bandwidth, and accounting for the half-sample delay of the zero-order hold.Discretization Methods for Controllers →).
- Progetto diretto: si progetta in tempo discreto sul modello equivalente di ZOH, impianto e campionatore visti da a .
Errori tipici:
- Confondere campionamento (discretizza il tempo) con quantizzazione (discretizza l'ampiezza).
- Ritenere il sistema digitale lineare: la quantizzazione lo rende non lineare.
- Dimenticare lo ZOH nel modello discreto equivalente dell'impianto.
- Ignorare i limit cycle con quantizzazione grossolana.
Teoria collegata
- Case Study - Temperature Control of a Heated-Air Tube
- Continuous-Time Modeling of Dynamic Systems
- Course Overview and Laboratory Setup
- Discretization Methods for Controllers
- Non-Idealities in a Control Loop
- Numerical Lab - Simulation with Noise and Quantization
- Sampled-Data Control Design - Emulation and Direct Design