Simulink Control Design™ - MathWorks

(Tuis.) #1
For example, suppose you generate a MATLAB script after completing all steps in the
example “Control of a Linear Electric Actuator Using Control System Tuner” (Control
System Toolbox). The generated script computes the operating point used for tuning,
designates the blocks to tune, creates the tuning goals, and performs other operations to
reproduce the result at the command line.

The first section of the script creates the slTuner interface to the Simulinkmodel
(rct_linact in this example). The slTuner interface stores a linearization of the model
and parameterizations of the blocks to tune.
%% Create system data with slTuner interface
TunedBlocks = {'rct_linact/Current Controller/Current PID'; ...
'rct_linact/Speed Controller/Speed PID'};
AnalysisPoints = {'rct_linact/Speed Demand (rpm)/1'; ...
'rct_linact/Current Sensor/1'; ...
'rct_linact/Hall Effect Sensor/1'; ...
'rct_linact/Speed Controller/Speed PID/1'; ...
'rct_linact/Current Controller/Current PID/1'};
OperatingPoints = 0.5;
% Specify the custom options
Options = slTunerOptions('AreParamsTunable',false);
% Create the slTuner object
CL0 = slTuner('rct_linact',TunedBlocks,AnalysisPoints,OperatingPoints,Options);

The slTuner interface also specifies the operating point at which the model is linearized,
and marks as analysis points all the signal locations required to specify the tuning goals
for the example. (See “Create and Configure slTuner Interface to Simulink Model” on
page 10-210.)

If you are tuning a control system modeled in MATLAB instead of Simulink, the first
section of the script constructs a genss model that has equivalent dynamics and
parameterization to the genss model of the control system that you specified Control
System Tuner.

Next, the script creates the three tuning goals specified in the example. The script uses
TuningGoal objects to capture these tuning goals. For instance, the script uses
TuningGoal.Tracking to capture the Tracking Goal of the example.
%% Create tuning goal to follow reference commands with prescribed performance
% Inputs and outputs
Inputs = {'rct_linact/Speed Demand (rpm)/1'};
Outputs = {'rct_linact/Hall Effect Sensor/1[rpm]'};
% Tuning goal specifications
ResponseTime = 0.1; % Approximately reciprocal of tracking bandwidth
DCError = 0.001; % Maximum steady-state error
PeakError = 1; % Peak error across frequency
% Create tuning goal for tracking
TR = TuningGoal.Tracking(Inputs,Outputs,ResponseTime,DCError,PeakError);
TR.Name = 'TR'; % Tuning goal name

10 Control System Tuning

Free download pdf