Main Content

Tune a Control System Using Control System Tuner

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 modelrct_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 vectorx = [u,w,q,theta,v,p,phi,r]consists of:

  • Longitudinal velocityu(m/s)

  • Normal velocityw(m/s)

  • Pitch rateq(deg/s)

  • Pitch angletheta(deg)

  • Lateral velocityv(m/s)

  • Roll ratep(deg/s)

  • Roll anglephi(deg)

  • Yaw rater(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 blockSOF.The outer loop has a PI controller for each of the three attitude angles. The controller generates commandsds,dc,dTin degrees for the longitudinal cyclic, lateral cyclic, and tail rotor collective using measurements oftheta,phi,p,q, andr.This loop provides the desired setpoint tracking for the three angles.

This example uses these control objectives:

  • Track setpoint changes intheta,phi, andrwith zero steady-state error, rise times of about 2 seconds, minimal overshoot, and minimal cross-coupling.

  • 为了防止negle限制控制带宽cted 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 thediskmarginreference 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, underControl Systemsin theAppstab, selectControl System Tuner

In Control System Tuner, on theTuningtab, clickSelect Blocks.Use the Select tuned blocks dialog box to specify the blocks to tune.

ClickAdd Blocks.控制系统调谐器分析模型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 blocksPI1,PI2,PI3, andSOF

ClickOK.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$1+1/s$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 usingtuning goals

First, create a tuning goal for the setpoint-tracking requirement ontheta,phi, andr.On theTuningtab, in theNew Goaldrop-down list, selectTracking of step commands

In the Step Tracking Goal dialog, specify the reference signals for tracking. UnderSpecify step-response inputs, clickAdd signal to list.Then clickSelect signal from model

In the Simulink model editor, select the reference signalstheta_ref,phi_ref, andr_ref.These signals appear in the Select signals dialog box. ClickAdd Signal(s)to add them to the step tracking goal.

Next, specify the outputs that you want to track those references. UnderSpecify step-response outputs, add the outputstheta,phi, andr

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 theDesired Responsesection of the dialog box. Also, for this example setKeep mismatch below为20。这瓦尔ue 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. ClickOKto 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 inputsuand plant outputsymust be at least 5 dB and 40 degrees. Create separate tuning goals for the input and output margin constraints. In theNew Goaldrop-down list, selectMinimum stability margins.In the Margins Goal dialog box, add the input signaluunderMeasure stability margins at the following locations.Also, enter the gain and phase values 5 and 40 in theDesired Marginssection of the dialog box. ClickOKto save the input stability margin goal.

Create another Margins Goal for the output stability margin. Specify the output signalyand 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 theNew Goaldrop-down list, selectConstraint on closed-loop dynamics.In thePoles Goaldialog box, specify the maximum natural frequency of 25, and clickOKto 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 theTuningtab, clickTune.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, theMarginsGoal1andMarginsGoal2plots provide a visual assessment of the multivariable stability margins. (See thediskmarginreference 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 theTuning Reportat 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 theControl Systemtab, clickUpdate 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, andr-refat 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.

See Also

Related Topics