This example gives a tour of available time-domain requirements for control system tuning withsystune
orlooptune
.
Thesystune
andlooptune
commands tune the parameters of fixed-structure control systems subject to a variety of time- and frequency-domain requirements. TheTuningGoal
package is the repository for such design requirements.
TheTuningGoal.StepTracking
requirement specifies how the tuned closed-loop system should respond to a step input. You can specify the desired response either in terms of first- or second-order characteristics, or as an explicit reference model. This requirement is satisfied when the relative gap between the actual and desired responses is small enough in the least-squares sense. For example,
R1 = TuningGoal.StepTracking('r','y',0.5);
stipulates that the closed-loop response fromr
toy
should behave like a first-order system with time constant 0.5, while
R2 = TuningGoal.StepTracking('r','y',zpk(2,[-1 -2],-1));
specifies a second-order, non-minimum-phase behavior. UseviewGoal
to visualize the desired response.
viewGoal(R2)
This requirement can be used to tune both SISO and MIMO step responses. In the MIMO case, the requirement ensures that each output tracks the corresponding input with minimum cross-couplings.
TheTuningGoal.StepRejection
requirement specifies how the tuned closed-loop system should respond to a step disturbance. You can specify worst-case values for the response amplitude, settling time, and damping of oscillations. For example,
R1 = TuningGoal.StepRejection('d','y',0.3,2,0.5);
limits the amplitude of
to 0.3, the settling time to 2 time units, and the damping ratio to a minimum of 0.5. UseviewGoal
to see the corresponding time response.
viewGoal(R1)
You can also use a "reference model" to specify the desired response. Note that the actual and specified responses may differ substantially when better disturbance rejection is possible. Use theTuningGoal.Transient
当接近的比赛所需的要求。为喜神贝斯t results, adjust the gain of the reference model so that the actual and specified responses have similar peak amplitudes (seeTuningGoal.StepRejection
documentation for details).
TheTuningGoal.Transient
requirement specifies the transient response for a specific input signal. This is a generalization of theTuningGoal.StepTracking
requirement. For example,
R1 = TuningGoal.Transient('r','y',tf(1,[1 1 1]),'impulse');
requires that the tuned response from to look like the impulse response of the reference model .
viewGoal(R1)
The input signal can be an impulse, a step, a ramp, or a more general signal modeled as the impulse response of some input shaping filter. For example, a sine wave with frequency can be modeled as the impulse response of .
w0 = 2; F = tf(w0^2,[1 0 w0^2]);% input shaping filterR2 = TuningGoal.Transient('r','y',tf(1,[1 1 1]),F); viewGoal(R2)
Use theTuningGoal.LQG
requirement to create a linear-quadratic-Gaussian objective for tuning the control system parameters. This objective is applicable to any control structure, not just the classical observer structure of LQG control. For example, consider the simple PID loop of Figure 2 where
and
are unit-variance disturbance and noise inputs, and
and
are lowpass and highpass filters that model the disturbance and noise spectral contents.
Figure 2: Regulation loop.
To regulate around zero, you can use the following LQG criterion:
The first term in the integral penalizes the deviation of
from zero, and the second term penalizes the control effort. Usingsystune
, you can tune the PID controller to minimize the cost
. To do this, use the LQG requirement
Qyu = diag([1 0.05]);% weighting of y^2 and u^2R4 = TuningGoal.LQG({'d','n'},{'y','u'},1,Qyu);
TuningGoal.StepTracking
|TuningGoal.StepRejection
|TuningGoal.Transient
|TuningGoal.LQG