Design Optimization to Meet Step Response Requirements (GUI)

This example shows how to optimize controller parameters to meet step response design requirements using the Design Optimization tool. You specify the design requirements in a Check Step Response Characteristics block.

Model Structure

The model sldo_model1 includes the following blocks:

  • Controller block, which is a PID controller. This block controls the output of the Plant subsystem.

  • Unit Step block applies a step input and produces the model output that should meet step response requirements.

    You can also use other types of inputs, such as ramp, to optimize the response to meet step response requirements generated by such inputs.

  • Plant subsystem is a second-order system with delay. It contains Transfer Function and Transport Delay blocks.

Design Requirements

The plant output must meet the following step response requirements:

  • Rise time less than 2.5 seconds

  • Settling time less than 30 seconds

  • Overshoot less than 5%

Specify Step Response Requirements

  1. Open Simulink® model.

    sys = 'sldo_model1';

    To learn more about the model, see Model Structure.

  2. Add a Check Step Response Characteristics block to the model.

    1. In the Simulink model window, select View > Library Browser.

    2. In the Libraries pane, expand the Simulink Design Optimization node and select Signal Constraints.

    3. Drag and drop the Check Step Response Characteristics block into the model window.

    4. Connect the block to the output.

      You must connect the block to the signal on which you want to specify design requirements.

  3. Double-click the Check Step Response Characteristics block to open the Sink Block Parameters: Check Step Response Characteristics dialog box.

  4. Specify step response requirements:

    • In Rise time (seconds), enter 2.5

    • In Settling time (seconds), enter 30

    • In % Overshoot, enter 5

    Click OK.

Instead of specifying time-domain requirements in the Check blocks, you can specify them in the Design Optimization tool without adding blocks. For an example, see Specify Reference Signal.

Specify Design Variables

Before you begin this task, specify the design requirements as described in Specify Step Response Requirements.

When you optimize the model response, the software modifies the design variable (parameter) values to meet the design requirements.

  1. In the Simulink model window, select Analysis > Response Optimization.

    Alternatively, click Response Optimization in the Block Parameters dialog box.

    A Design Optimization tool for the model opens.

    The amplitude versus time plot graphically shows the step response requirements specified in the Check Step Response Characteristics block.

  2. Select New in the Design Variables Set drop-down list.

    A window opens where you specify design variables.

  3. Click Kd, Ki and Kp to select them.

  4. Click to add the selected parameters to a design variables set.

    The software displays the following parameter settings:

    • Variable — Parameter name

    • Value — Current parameter value

    • Minimum and Maximum — Parameter bounds

    • Scale — Scaling factor for the parameter

    The check-box indicates that the parameter is included in the design variable set. The default design variable set name is DesignVars.

  5. To limit the parameters to positive values, enter the minimum value of each parameter as 0 in the corresponding Minimum field and press Enter.

    Click OK. A new variable DesignVars appears in Design Optimization Workspace of the Design Optimization tool. You can click the variable to view its contents in the Variable Preview area.

Optimize Model Response

Before you begin this task, you must have already specified the design requirements and design variables as described in Specify Step Response Requirements, and Specify Design Variables, respectively.

  1. (Optional) View the current response of the model. Click .

    The plot shows that the model output does not meet the specified step response requirements.

  2. Click Optimize.

    An Optimization Progress window opens.

      Tip   To view the model response and optimization progress windows simultaneously, tile them using the plot layout area .

    At each optimization iteration, the software simulates the model, and the default optimization solver Gradient descent (fmincon) modifies the design variables to reduce the distance between the simulated response and the design requirement line segments. For more information, see Selecting Optimization Methods and How the Optimization Algorithm Formulates Minimization Problems.

    After the optimization completes, the optimization progress window resembles the next figure.

    The message Optimization converged indicates that the optimization solver found a solution that meets the design requirements within the tolerances and parameter bounds. For more information about the outputs displayed in the optimization, see Iterative Display in the Optimization Toolbox™ documentation.

  3. Verify that the model output meets the step response requirements.

    The plot displays the last five iterations. The final response using the optimized parameter values appears as the thick line.

    The optimized response lies in the white region bounded by the design requirement line segments and thus meets the requirements.

  4. View the optimized parameter values. Click DesignVars in Design Optimization Workspace and view the updated values in the Variable Preview area.

    The optimized values of the design variables are automatically updated in the Simulink model.

Save the Session

After you optimize the model response to meet design requirements, you can save the Design Optimization tool session which includes the optimized parameter values.

  1. Click the Design Optimization tab of the Design Optimization tool.

  2. In the Save drop-down list, select Save to model workspace.

    A window opens where you specify the session name.

  3. Specify a session name in the Session field.

    Click OK.

      Tip   To open the saved session, click the Open from model workspace option in the Open drop-down list of the Design Optimization tool for the model.

 Related Examples

Was this topic helpful?