Speed PI Control Improvements for a DC Servomotor
Lab activity 4 adds two ingredients to the basic PI speed loop of the DC servomotor (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 →): a feedforward action (FFWD) and an anti-windup mechanism (AWU). The motor model comes from Modeling a DC ServomotorA permanent-magnet DC motor is modeled by an electrical equation with a back-EMF term and a mechanical equation with inertia and viscous friction, a gearbox just adds the load inertia and friction divided by N squared on the motor side, and for the laboratory servomotor (voltage driver plus gearmotor plus disc) this gives a transfer function from input voltage to load angle that reduces to a first-order lag times an integrator.Modeling a DC Servomotor →; the digital implementation is treated in Sampled-Data Control Design - Emulation and Direct DesignA digital control system is a continuous-time plant controlled by a digital controller, and it can be designed either by emulation (design C(s) in continuous time then discretize it) or by direct digital design (exactly discretize the plant and design in discrete time), with poles mapped by z = e^{sT}.Sampled-Data Control Design - Emulation and Direct Design →.
1. Feedforward compensation
Why feedback is not enough
Using feedback (closed loop) in a control system allows to:
- reduce the sensitivity to parameter variations and external disturbances;
- stabilise unstable plants;
- enhance both the control precision and the speed of response.
Using feedforward (open loop) allows to:
- pre-filter the reference signal to match the overall transfer function;
- improve the control accuracy and the speed of response;
- compensate known (measured or estimated) input or output disturbances.
The two are complementary: feedforward acts immediately but only as well as the model is accurate; feedback corrects what the model misses (see The Feedback Control Scheme and RequirementsThe basic control scheme feeds the plant G(s) with the output of a controller C(s) acting on the tracking error e = r - y, giving the closed-loop transfer function W(s) = C(s)G(s) / (1 + C(s)G(s)); the requirement y close to r splits into steady-state conditions (small error for some references, disturbances, model uncertainty) and transient conditions on rise time, settling time and overshoot, which become a region of the complex plane where the poles of W(s) must lie.The Feedback Control Scheme and Requirements →).
1.1 Pre-filtering the reference
Put a filter before the closed loop made by and :
r --> [ H1(s) ] --r'--> (+)--e--> [ C(s) ]--u--> [ P(s) ]--y-->
^- |
+-------------------------------+With the overall transfer function is
Choosing
gives : the filter inverts the closed loop.
Handwritten example, inverting a plant. Let . The inverse is
Feeding the plant with gives (the cascade is ). In the time domain
For a sinusoidal reference one has and , hence
(The reference derivatives are needed, so the reference must be known in advance, or be smooth enough to be differentiated.)
Handwritten example, static plant. With (a pure gain) and an integral controller in feedback, the feedback response to a step rises exponentially towards , whereas the feedforward in front of the plant gives immediately (cascade ): the benefit is exact tracking of "also in the future". If the plant gain is only known approximately, , the open-loop cascade is and settles at the wrong level, while the integral feedback (, i.e. the PI structure with the integrator) still drives the error to zero; also a constant disturbance acting at the plant input is rejected by the feedback but not by the open-loop path. This is the reason to combine the two: , a feedforward path in parallel with the feedback controller.
r ---> [ H_FF(s) ] --------(+)--u--> [ P(s) ] ---+--> y
| ^+ |
| | |
+--(+)--> [ C(s) ] --------+ |
^ - |
+------------------------------------------+Handwritten example, non-minimum phase. For (a zero at in the right half plane) the filter gives . On paper the zero is cancelled, but itself has a pole at (unstable): this is why a minimum-phase plant is required below. The factor makes proper.
1.2 Perfect tracking: feedforward of the plant inverse
Add a feedforward path from the reference directly to the plant input:
+----------[ H2(s) ]---- u_ff,2 ---+
| v
r -------+--(+)-e->[ C(s) ]-- u_c -------->(+)-- u -->[ P(s) ]--+--> y
^ - |
+-------------------------------------------------+Then
makes ("perfect tracking"): the numerator becomes with , so .
Conditions (slide): must be minimum phase, i.e. without zeros with positive real part (otherwise is unstable). The conditions that can be relaxed are:
- is a proper transfer function;
- the plant dynamics does not contain relevant input-output (I/O) time delays.
1.3 Compensating known disturbances
Two disturbance paths are considered, with measurable or estimated and the disturbance model known:
- output disturbance: enters through and adds (with the sign of the diagram) to the plant output; the compensator feeds to the plant input, together with ;
- input disturbance: enters through and is subtracted from the plant input ; the compensator adds to .
The closed-loop expressions are
In both cases the coefficient of is made zero.
1.4 Application to the DC gearmotor with torque disturbance
The gearmotor model (blocks as in the slides, gearbox ratio, a load torque disturbance):
tau_d
|
[1/N]
|
v -
u --[k_drv]--u_drv--(+)--[k_t/R_eq]--tau_m--(+)--[1/(J_eq s+B_eq)]--w_m--+--[1/N]--> w_l
^ - ^ - |
| |
+------------------[ k_e ]<------------------------+- : command, : voltage driver gain, ;
- : back-EMF constant (feedback of on the armature voltage), : torque constant, : equivalent armature resistance;
- , : equivalent inertia and viscous friction at the motor shaft; motor speed, load speed.
Moving the disturbance to the input. A torque at the motor shaft is equivalent to a voltage disturbance at the input :
(the torque produced by through must equal , so ). The loop becomes
with the plant from the command to the load speed
Feedforward of the reference ():
With the speed reference, this corresponds to
- It is not implementable in practice as a filter, since it needs the derivative of the reference signal.
- When the reference is known in advance, the derivative can be computed offline and the feedforward is implemented as a simple algebraic expression of the reference and of its pre-computed derivative.
Feedforward of the disturbance ():
Here is the static friction torque , so
(the measured speed is replaced by the reference in the sign, since the reference is available).
Total feedforward :
which, splitting the coefficient of into a friction part and a back-EMF part, is regrouped as
(Check of the regrouping: and .)
Implementation scheme. Inputs: reference acceleration and reference speed . Three parallel branches are summed with the PI output to produce :
a_l* ------------------------------------[ N Req Jeq/(kdrv kt) ]-- Inertia comp. -----+
|
w_l* --+--[ N^2 Beq ]--(+)--[ Req/(kdrv kt N) ]---------------- Friction comp. ---+ |
| ^ | |
+--[ tau_sf sign(.) ] | |
| | |
+----------------------------------[ N ke/kdrv ]------ BEMF comp. ---+ | |
v v v
w_l* --(+)-e->[ C(s) PI ]-- u_c -----------------------------------------------(+)-(+)-(+)--> u
^ -
+------------------------------------------------------------------ w_lOn the slide, the inertia branch (which needs the future reference signal) is marked "future reference signal exploitation", and the friction and BEMF branches "disturbance compensation".
1.5 Trapezoidal speed profile to validate the scheme
The test reference is a trapezoidal speed profile whose derivative is piecewise constant:
so goes up to , stays constant for , goes down to and repeats (periodic with period ). The slide shows the two time-histories (acceleration and speed reference) over , followed by two columns of results (speed , error in rpm, command in V over ). In the first column the tracking error shows offsets of the order of (changing sign with the direction of motion) and spikes, in the second the error stays close to zero. The columns are not labelled on the slide; the reading consistent with the theory is PI only on the left and PI plus feedforward on the right. The slide notes that the behaviour is the same both in simulation and in the real experiment.
2. Anti-windup
The problem
- In any real control system the actuator output has a limited dynamic range.
- Whenever the actuator saturates, the command provided to the plant is constant, regardless of the tracking error: the feedback loop is effectively disabled and both the plant and the PI controller act in open loop.
With the actuator saturation in a PID scheme (controller with branches , , followed by an actuator saturation and the plant ):
- windup: the integrator still continues to integrate the (positive) tracking error;
- the controller output keeps growing (ineffective for the plant, because the actuator is saturated);
- when the tracking error is back to zero the actuator is still saturated (because of the windup);
- only when the tracking error stays negative for enough time does the actuator desaturate (unwinding).
The slide shows an example: the process output overshoots the set point and oscillates for a long time, the control signal remains at its limit well past the moment the error changes sign, and the integral term grows during saturation and takes a long time to come back.
The remedy: saturation detection and back-calculation
A saturation detection mechanism is added inside the controller:
- a "simulated saturation" is implemented within the controller (a copy of the actuator saturation);
- when saturation is detected, the integration is stopped/compensated;
- the compensation is proportional to the amount of saturation occurring;
- a local feedback around the integrator is used: a first-order low-pass filtering action.
+-----------[ K_P ]---------------------+
e ------+------+-----------[ K_D s ]-------------------+--(+)-- u~ --+--[ sat (simulated) ]--+-- u --> [ actuator sat ]-->[ P(s) ]--> y
| +--(+)-[ K_I ]--(+)--[ 1/s ]------------+ | |
| (integrator input corrected by K_W times the amount of saturation u~ - u)
+--------------------------------------------------[ K_W ]<--(difference u~ and u)--+The gain of the local loop around the integrator acts as a design parameter; the handwritten remark says to make this local loop time scale faster than the original closed loop, so that the integrator is pulled back quickly while the real loop is not disturbed. With anti-windup the same scenario as above settles after the saturation without the long recovery: the integral term stays bounded and the output has no large overshoot.
Versione ripasso
- Feedback: less sensitivity to parameters and disturbances, stabilises, improves precision and speed.
- Feedforward: pre-filter the reference, improve accuracy and speed, compensate known (measured or estimated) disturbances.
Pre-filter: , , so gives . Example : , .
Perfect tracking: , so . Needs minimum phase; proper and no relevant delays can be relaxed. A non-minimum-phase zero (e.g. at ) cannot be cancelled by an unstable inverse.
Disturbances: (output disturbance), (input disturbance).
DC gearmotor ( ratio, load torque)
- , , .
- , ; .
- : not implementable online (derivative of the reference), fine offline if the reference is known.
- Static friction: , .
- Total feedforward:
- Added to the PI output . Validation: trapezoidal profile, acceleration for or , speed up to ; error close to zero with the feedforward.
Anti-windup
- Saturated actuator: loop open, integrator keeps integrating (windup), actuator stays saturated after the error returns to zero, desaturates only after a negative error for long enough (unwinding).
- Cure: simulated saturation inside the controller, stop/compensate the integration in proportion to the saturation, local feedback around the integrator (first-order low-pass), time scale faster than the closed loop.
Typical error: forgetting that the inertia term needs the derivative of the reference, or that the feedforward is computed from the reference (not from the measured speed) and added to the PI output.
Passi della feedforward:
- Pre-filtro: rende ; se ha uno zero a parte reale positiva, ha un polo instabile e il metodo non vale.
- Tracking perfetto: , con a fase minima e senza ritardi rilevanti. Nel gearmotor e .
- Disturbo di coppia: sull'albero equivale a un disturbo di tensione ; attrito statico compensato con .
- Somma delle tre componenti (inerzia, attrito, BEMF) e aggiunta a del PI.
Anti-windup, sequenza del problema: attuatore saturo, anello di fatto aperto; l'integratore continua a sommare l'errore; l'attuatore resta saturo anche quando l'errore torna a zero; si sblocca solo dopo un errore negativo per abbastanza tempo.
Rimedio: saturazione simulata dentro il regolatore; l'integrazione viene compensata in proporzione alla saturazione () con un guadagno ; la dinamica di questo anello locale è più veloce di quella del loop.
Validazione: profilo trapezoidale con rpm/s per s, per s, periodo s; sale fino a rpm. L'errore di inseguimento con solo PI oscilla di circa rpm, con feedforward resta vicino a zero; il comportamento è lo stesso in simulazione e in laboratorio.
Errori tipici:
- Calcolare la feedforward dalla velocità misurata invece che da quella di riferimento.
- Usare quando ha uno zero a parte reale positiva: il filtro risulta instabile.
- Dimenticare che la compensazione d'inerzia richiede la derivata del riferimento: va calcolata offline se il riferimento è noto.