tune a control system using control system tuner -凯发k8网页登录
this example shows how to use the control system tuner app to tune a mimo, multiloop control system modeled in simulink®.
control system tuner lets you model any control architecture and specify the structure of controller components, such as pid controllers, gains, and other elements. you specify which blocks in the model are tunable. control system tuner parameterizes those blocks and tunes the free parameters system to meet design requirements that you specify, such as setpoint tracking, disturbance rejection, and stability margins.
control system model
this example uses the simulink model rct_helico
. open the model.
open_system('rct_helico')
the plant, helicopter
, is an 8-state helicopter model trimmed to a steady-state hovering condition. the state vector x = [u,w,q,theta,v,p,phi,r]
consists of:
longitudinal velocity
u
(m/s)normal velocity
w
(m/s)pitch rate
q
(deg/s)pitch angle
theta
(deg)lateral velocity
v
(m/s)roll rate
p
(deg/s)roll angle
phi
(deg)yaw rate
r
(deg/s)
the control system of the model has two feedback loops. the inner loop provides static output feedback for stability augmentation and decoupling, represented in the model by the gain block sof
. the outer loop has a pi controller for each of the three attitude angles. 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
. this loop provides the desired setpoint tracking for the three angles.
this example uses these control objectives:
track setpoint changes in
theta
,phi
, andr
with zero steady-state error, rise times of about 2 seconds, minimal overshoot, and minimal cross-coupling.limit the control bandwidth to guard against neglected high-frequency rotor dynamics and measurement noise. (the model contains low-pass filters that partially enforce this objective.)
provide strong multivariable gain and phase margins. (multivariable margins measure robustness to simultaneous gain or phase variations at the plant inputs and outputs. see the
diskmargin
reference page for details.)
set up the model for tuning
using control system tuner, you can jointly tune the inner and outer loops to meet all the design requirements. to set up the model for tuning, open the app and specify which blocks of the simulink model you want to tune.
in the simulink model window, under control systems in the apps tab, select control system tuner.
in control system tuner, on the tuning tab, click select blocks. use the select tuned blocks dialog box to specify the blocks to tune.
click add blocks. control system tuner analyzes your model to find blocks that can be tuned. for this example, the controller blocks to tune are the three pi controllers and the gain block. check the corresponding blocks pi1
, pi2
, pi3
, and sof
.
click ok. the select tuned blocks dialog box now reflects the blocks you added.
when you select a block to tune, control system tuner automatically parameterizes the block according to its type and initializes the parameterization with the block value in the simulink model. in this example, the pi controllers are initialized to and the static output-feedback gain is initialized to zero on all channels. simulating the model shows that the control system is unstable for these initial values.
specify tuning goals
the design requirements for this system, discussed previously, include setpoint tracking, minimum stability margins, and a limit on fast dynamics. in control system tuner, you capture design requirements using tuning goals.
first, create a tuning goal for the setpoint-tracking requirement on theta
, phi
, and r
. on the tuning tab, in the new goal drop-down list, select tracking of step commands
.
in the step tracking goal dialog, specify the reference signals for tracking. under specify step-response inputs, click add signal to list. then click select signal from model.
in the simulink model editor, select the reference signals theta_ref
, phi_ref
, and r_ref
. these signals appear in the select signals dialog box. click add signal(s) to add them to the step tracking goal.
next, specify the outputs that you want to track those references. under specify step-response outputs, add the outputs theta
, phi
, and r
.
the requirement is that the responses at the outputs track the reference commands with a first-order response that has a one-second time constant. enter these values in the desired response section of the dialog box. also, for this example set keep mismatch below to 20. this value sets a 20% relative mismatch between the target first-order response and the tuned response.
this figure shows the configuration of the step tracking goal dialog box. click ok to save the tuning goal.
next, create tuning goals for the desired stability margin requirements. for this example, the multivariable gain and phase margins at the plant inputs u
and plant outputs y
must be at least 5 db and 40 degrees. create separate tuning goals for the input and output margin constraints. in the new goal drop-down list, select minimum stability margins. in the margins goal dialog box, add the input signal u
under measure stability margins at the following locations. also, enter the gain and phase values 5 and 40 in the desired margins section of the dialog box. click ok to save the input stability margin goal.
create another margins goal for the output stability margin. specify the output signal y
and the target margins, as shown, and save the output stability margin goal.
the last requirement is to limit fast dynamics and jerky transients. to achieve this, create a tuning goal that constrains the magnitude of the closed-loop poles to less than 25 rad/s. in the new goal drop-down list, select constraint on closed-loop dynamics. in the poles goal dialog box, specify the maximum natural frequency of 25, and click ok to save the tuning goal.
as you create each tuning goal, control system tuner creates a new figure that displays a graphical representation of the tuning goal. when you tune your control system, you can refer to this figure for a graphical representation of how closely the tuned system satisfies the tuning goal.
tune the control system
tune the control system to meet the design requirements you have specified.
on the tuning tab, click tune. control system tuner adjusts the tunable parameters to values that best meet those requirements.
control system tuner automatically updates the tuning-goal plots to reflect the tuned parameter values. examine these plots to see how well the requirements are satisfied by the design. for instance, examine the tuned step responses of tracking requirements.
the blue line shows that the tuned response is very close to the target response, in pink. the rise time is about two seconds, and there is no overshoot and little cross-coupling.
similarly, the marginsgoal1
and marginsgoal2
plots provide a visual assessment of the multivariable stability margins. (see the diskmargin
reference page for more information about multivariable stability margins.) these plots show that the stability margin is out of the shaded region, satisfying the requirement at all frequencies.
you can also view a numeric report of the tuning results. click the tuning report at the bottom right of control system tuner.
when you tune the model, control system tuner converts each tuning goal to a function of the tunable parameters of the system and adjusts the parameters to minimize the value of those functions. for this example, the tuning report shows that the final values for all tuning goals are close to 1, which indicates that all the requirements are nearly met.
validate the tuned design
in general, your simulink model represents a nonlinear system. control system tuner linearizes the model at the operating point you specify in the app, and tunes parameters using the linear approximation of your system. therefore, it is important to validate the controller design on the full simulink model.
to do so, write the tuned parameter values back to the simulink model. on the control system tab, click update blocks. in the simulink model window, simulate the model with the new parameter values. observe the response to the step changes in setpoint commands, theta-ref
, phi-ref
, and r-ref
at 0, 3, and 6 seconds respectively.
examine the simulation to confirm that you get the desired responses in the simulink model. here, the rise time of each response is about 2 seconds with no overshoot, no steady-state error, and minimal cross-coupling, as specified in the design requirements.