mimo control of diesel engine -凯发k8网页登录
this example uses systune
to design and tune a mimo controller for a diesel engine. the controller is tuned in discrete time for a single operating condition.
diesel engine model
modern diesel engines use a variable geometry turbocharger (vgt) and exhaust gas recirculation (egr) to reduce emissions. tight control of the vgt boost pressure and egr massflow is necessary to meet strict emission targets. this example shows how to design and tune a mimo controller that regulates these two variables when the engine operates at 2100 rpm with a fuel mass of 12 mg per injection-cylinder.
open_system('rct_diesel')
the vgt/egr control system is modeled in simulink. the controller adjusts the positions egrlift
and vgtpos
of the egr and vgt valves. it has access to the boost pressure and egr massflow targets and measured values, as well as fuel mass and engine speed measurements. both valves have rate and saturation limits. the plant model is sampled every 0.1 seconds and the control signals egrlift
and vgtpos
are refreshed every 0.2 seconds. this example considers step changes of 10 kpa in boost pressure and 3 g/s in egr massflow, and disturbances of 5 mg in fuel mass and -200 rpm in speed.
for the operating condition under consideration, we used system identification to derive a linear model of the engine from experimental data. the frequency response from the manipulated variables egrlift
and vgtpos
to the controlled variables boost
and egr mf
appears below. note that the plant is ill conditioned at low frequency which makes independent control of boost pressure and egr massflow difficult.
sigma(plant(:,1:2)), grid
title('frequency response of the linearized engine dynamics')
control objectives
there are two main control objectives:
respond to step changes in boost pressure and egr massflow in about 5 seconds with minimum cross-coupling
be insensitive to (small) variations in speed and fuel mass.
use a tracking requirement for the first objective. specify the amplitudes of the step changes to ensure that cross-couplings are small relative to these changes.
% 5-second response time, steady-state error less than 5% tr = tuninggoal.tracking({'boost ref';'egrmf ref'},{'boost';'egrmf'},5,0.05); tr.name = 'setpoint tracking'; tr.inputscaling = [10 3];
for the second objective, treat the speed and fuel mass variations as step disturbances and specify the peak amplitude and settling time of the resulting variations in boost pressure and egr massflow. also specify the signal amplitudes to properly reflect the relative contribution of each disturbance.
% peak<0.5, settling time<5 dr = tuninggoal.steprejection({'fuelmass';'speed'},{'boost';'egrmf'},0.5,5); dr.name = 'disturbance rejection'; dr.inputscaling = [5 200]; dr.outputscaling = [10 3];
to provide adequate robustness to unmodeled dynamics and aliasing, limit the control bandwidth and impose sufficient stability margins at both the plant inputs and outputs. because we are dealing with 2-by-2 mimo feedback loops, this requirement guarantees stability for gain or phase variations in each feedback channel. the gain or phase can change in both channels simultaneously, and by a different amount in each channel. see and for details.
% roll off of -20 db/dec past 1 rad/s ro = tuninggoal.maxloopgain({'egrlift','vgtpos'},1,1); ro.loopscaling = 'off'; ro.name = 'roll-off'; % 7 db of gain margin and 45 degrees of phase margin m1 = tuninggoal.margins({'egrlift','vgtpos'},7,45); m1.name = 'plant input'; m2 = tuninggoal.margins('diesel engine',7,45); m2.name = 'plant output';
tuning of blackbox mimo controller
without a-priori knowledge of a suitable control structure, first try "blackbox" state-space controllers of various orders. the plant model has four states, so try a controller of order four or less. here we tune a second-order controller since the "ss2" block in the simulink model has two states.
figure 1: second-order blackbox controller.
use the sltuner
interface to configure the simulink model for tuning. mark the block "ss2" as tunable, register the locations where to assess margins and loop shapes, and specify that linearization and tuning should be performed at the controller sampling rate.
st0 = sltuner('rct_diesel','ss2'); st0.ts = 0.2; addpoint(st0,{'egrlift','vgtpos','diesel engine'})
now use systune
to tune the state-space controller subject to our control objectives. treat the stability margins and roll-off target as hard constraints and try to best meet the remaining objectives (soft goals). randomize the starting point to reduce exposure to undesirable local minima.
opt = systuneoptions('randomstart',2);
rng(0), st1 = systune(st0,[tr dr],[m1 m2 ro],opt);
final: soft = 1.05, hard = 0.95708, iterations = 338 final: soft = 1.05, hard = 0.98021, iterations = 525 final: soft = 1.05, hard = 0.98868, iterations = 472
all requirements are nearly met (a requirement is satisfied when its normalized value is less than 1). verify this graphically.
figure('position',[10,10,1071,714])
viewgoal([tr dr ro m1 m2],st1)
plot the setpoint tracking and disturbance rejection responses. scale by the signal amplitudes to show normalized effects (boost pressure changes by 10 kpa, egr massflow by 3 g/s, fuel mass by 5 mg, and speed by -200 rpm).
figure('position',[100,100,560,500]) t1 = getiotransfer(st1,{'boost ref';'egrmf ref'},{'boost','egrmf','egrlift','vgtpos'}); t1 = diag([1/10 1/3 1 1]) * t1 * diag([10 3]); subplot(211), step(t1(1:2,:),15), title('setpoint tracking') subplot(212), step(t1(3:4,:),15), title('control effort')
d1 = getiotransfer(st1,{'fuelmass';'speed'},{'boost','egrmf','egrlift','vgtpos'}); d1 = diag([1/10 1/3 1 1]) * d1 * diag([5 -200]); subplot(211), step(d1(1:2,:),15), title('disturbance rejection') subplot(212), step(d1(3:4,:),15), title('control effort')
the controller responds in less than 5 seconds with minimum cross-coupling between the boost
and egrmf
variables.
tuning of simplified control structure
the state-space controller could be implemented as is, but it is often desirable to boil it down to a simpler, more familiar structure. to do this, get the tuned controller and inspect its frequency response
c = getblockvalue(st1,'ss2'); clf bode(c(:,1:2),c(:,3:4),{.02 20}), grid legend('ref to u','y to u')
bodemag(c(:,5:6)), grid
title('bode response from fuelmass/speed to egrlift/vgtpos')
the first plot suggests that the controller essentially behaves like a pi controller acting on ref-y (the difference between the target and actual values of the controlled variables). the second plot suggests that the transfer from measured disturbance to manipulated variables could be replaced by a gain in series with a lag network. altogether this suggests the following simplified control structure consisting of a mimo pi controller with a first-order disturbance feedforward.
figure 2: simplified control structure.
using variant subsystems, you can implement both control structures in the same simulink model and use a variable to switch between them. here setting mode=2
selects the mimo pi structure. as before, use systune
to tune the three 2-by-2 gain matrices kp
, ki
, kff
in the simplified control structure.
% select "mimo pi" variant in "controller" block mode = 2; % configure tuning interface st0 = sltuner('rct_diesel',{'kp','ki','kff'}); st0.ts = 0.2; addpoint(st0,{'egrlift','vgtpos','diesel engine'}) % tune mimo pi controller. st2 = systune(st0,[tr dr],[m1 m2 ro]);
final: soft = 1.09, hard = 0.99774, iterations = 303
again all requirements are nearly met. plot the closed-loop responses and compare with the state-space design.
clf t2 = getiotransfer(st2,{'boost ref';'egrmf ref'},{'boost','egrmf','egrlift','vgtpos'}); t2 = diag([1/10 1/3 1 1]) * t2 * diag([10 3]); subplot(211), step(t1(1:2,:),t2(1:2,:),15), title('setpoint tracking') legend('ss2','pi ff') subplot(212), step(t1(3:4,:),t2(3:4,:),15), title('control effort')
d2 = getiotransfer(st2,{'fuelmass';'speed'},{'boost','egrmf','egrlift','vgtpos'}); d2 = diag([1/10 1/3 1 1]) * d2 * diag([5 -200]); subplot(211), step(d1(1:2,:),d2(1:2,:),15), title('disturbance rejection') legend('ss2','pi ff') subplot(212), step(d1(3:4,:),d2(3:4,:),15), title('control effort')
the blackbox and simplified control structures deliver similar performance. inspect the tuned values of the pi and feedforward gains.
showtunable(st2)
block 1: rct_diesel/controller/mimo pid/kp = d = u1 u2 y1 -0.007937 -0.0008099 y2 -0.02029 0.01454 name: kp static gain. ----------------------------------- block 2: rct_diesel/controller/mimo pid/ki = d = u1 u2 y1 -0.01053 -0.01428 y2 -0.03012 0.04637 name: ki static gain. ----------------------------------- block 3: rct_diesel/controller/mimo pid/kff = d = u1 u2 y1 0.01405 -0.0001001 y2 0.03233 -0.001443 name: kff static gain.
nonlinear validation
to validate the mimo pi controller in the simulink model, push the tuned controller parameters to simulink and run the simulation.
writeblockvalue(st2)
the simulation results are shown below and confirm that the controller adequately tracks setpoint changes in boost pressure and egr massflow and quickly rejects changes in fuel mass (at t=90) and in speed (at t=110).
figure 3: simulation results with simplified controller.
see also
(simulink control design) | (simulink control design) | | | |