multiloop control of a helicopter -凯发k8网页登录
this example shows how to use sltuner
and systune
to tune a multiloop controller for a rotorcraft.
helicopter model
this example uses an 8-state helicopter model at the hovering trim condition. the state vector x = [u,w,q,theta,v,p,phi,r]
consists of
longitudinal velocity
u
(m/s)lateral velocity
v
(m/s)normal velocity
w
(m/s)pitch angle
theta
(deg)roll angle
phi
(deg)roll rate
p
(deg/s)pitch rate
q
(deg/s)yaw rate
r
(deg/s).
the controller generates commands ds,dc,dt
in degrees for the longitudinal cyclic, lateral cyclic, and tail rotor collective using measurements of theta
, phi
, p
, q
, and r
.
control architecture
the following simulink model depicts the control architecture:
open_system('rct_helico')
the control system consists of two feedback loops. the inner loop (static output feedback) provides stability augmentation and decoupling. the outer loop (pi controllers) provides the desired setpoint tracking performance. the main control objectives are as follows:
track setpoint changes in
theta
,phi
, andr
with zero steady-state error, rise times of about 2 seconds, minimal overshoot, and minimal cross-couplinglimit the control bandwidth to guard against neglected high-frequency rotor dynamics and measurement noise
provide strong multivariable gain and phase margins (robustness to simultaneous gain/phase variations at the plant inputs and outputs, see
diskmargin
for details).
we use lowpass filters with cutoff at 40 rad/s to partially enforce the second objective.
controller tuning
you can jointly tune the inner and outer loops with the systune
command. this command only requires models of the plant and controller along with the desired bandwidth (which is function of the desired response time). when the control system is modeled in simulink, you can use the sltuner
interface to quickly set up the tuning task. create an instance of this interface with the list of blocks to be tuned.
st0 = sltuner('rct_helico',{'pi1','pi2','pi3','sof'});
each tunable block is automatically parameterized according to its type and initialized with its value in the simulink model ( for the pi controllers and zero for the static output-feedback gain). simulating the model shows that the control system is unstable for these initial values:
mark the i/o signals of interest for setpoint tracking, and identify the plant inputs and outputs (control and measurement signals) where the stability margin are measured.
addpoint(st0,{'theta-ref','phi-ref','r-ref'}) % setpoint commands addpoint(st0,{'theta','phi','r'}) % corresponding outputs addpoint(st0,{'u','y'});
finally, capture the design requirements using tuninggoal
objects. we use the following requirements for this example:
tracking requirement: the response of
theta
,phi
,r
to step commandstheta_ref
,phi_ref
,r_ref
must resemble a decoupled first-order response with a one-second time constantstability margins: the multivariable gain and phase margins at the plant inputs
u
and plant outputsy
must be at least 5 db and 40 degreesfast dynamics: the magnitude of the closed-loop poles must not exceed 25 to prevent fast dynamics and jerky transients
% less than 20% mismatch with reference model 1/(s 1) trackreq = tuninggoal.steptracking({'theta-ref','phi-ref','r-ref'},{'theta','phi','r'},1); trackreq.relgap = 0.2; % gain and phase margins at plant inputs and outputs marginreq1 = tuninggoal.margins('u',5,40); marginreq2 = tuninggoal.margins('y',5,40); % limit on fast dynamics maxfrequency = 25; polereq = tuninggoal.poles(0,0,maxfrequency);
you can now use systune
to jointly tune all controller parameters. this returns the tuned version st1
of the control system st0
.
allreqs = [trackreq,marginreq1,marginreq2,polereq]; st1 = systune(st0,allreqs);
final: soft = 1.12, hard = -inf, iterations = 71
the final value is close to 1 so the requirements are nearly met. plot the tuned responses to step commands in theta, phi, r:
t1 = getiotransfer(st1,{'theta-ref','phi-ref','r-ref'},{'theta','phi','r'}); step(t1,5)
the rise time is about two seconds with no overshoot and little cross-coupling. you can use viewgoal
for a more thorough validation of each requirement, including a visual assessment of the multivariable stability margins (see diskmargin
for details):
figure('position',[100,100,900,474])
viewgoal(allreqs,st1)
inspect the tuned values of the pi controllers and static output-feedback gain.
showtunable(st1)
block 1: rct_helico/pi1 = 1 kp ki * --- s with kp = 1.05, ki = 2.07 name: pi1 continuous-time pi controller in parallel form. ----------------------------------- block 2: rct_helico/pi2 = 1 kp ki * --- s with kp = -0.101, ki = -1.35 name: pi2 continuous-time pi controller in parallel form. ----------------------------------- block 3: rct_helico/pi3 = 1 kp ki * --- s with kp = 0.134, ki = -2.2 name: pi3 continuous-time pi controller in parallel form. ----------------------------------- block 4: rct_helico/sof = d = u1 u2 u3 u4 u5 y1 2.207 -0.3103 -0.003366 0.7854 -0.01519 y2 -0.1922 -1.292 0.01817 -0.08519 -0.1195 y3 -0.0166 -0.01174 -1.892 -0.004019 0.06756 name: sof static gain.
benefit of the inner loop
you may wonder whether the static output feedback is necessary and whether pid controllers aren't enough to control the helicopter. this question is easily answered by re-tuning the controller with the inner loop open. first break the inner loop by adding a loop opening after the sof
block:
addopening(st0,'sof')
then remove the sof
block from the tunable block list and re-parameterize the pi blocks as full-blown pids with the correct loop signs (as inferred from the first design).
pid = pid(0,0.001,0.001,.01); % initial guess for pid controllers removeblock(st0,'sof'); setblockparam(st0,... 'pi1',tunablepid('c1',pid),... 'pi2',tunablepid('c2',-pid),... 'pi3',tunablepid('c3',-pid));
re-tune the three pid controllers and plot the closed-loop step responses.
st2 = systune(st0,allreqs);
final: soft = 4.94, hard = -inf, iterations = 67
t2 = getiotransfer(st2,{'theta-ref','phi-ref','r-ref'},{'theta','phi','r'}); figure, step(t2,5)
the final value is no longer close to 1 and the step responses confirm the poorer performance with regard to rise time, overshoot, and decoupling. this suggests that the inner loop has an important stabilizing effect that should be preserved.
see also
(simulink control design) | (simulink control design) | | |