Tune FIR Filter Type Controller for Flexible Transmission System Using Virtual Reference Feedback Tuning Block
This example shows how to use the Virtual Reference Feedback Tuning (VRFT) block to tune an FIR filter type controller for a flexible transmission system. To tune the controller, this example uses input and output data sequences collected while simulating a flexible transmission plant model in an open-loop configuration.
Flexible Transmission Plant Model
The flexible transmission system consists of three wheels and two belts. The input is from the left wheel and the output is to the right wheel.
Ts = 0.05; sys_tf = tf([0.28261 0.50666],[1 -1.41833 1.58939 -1.31608 0.88642],Ts)
sys_tf = 0.2826 z + 0.5067 ---------------------------------------------- z^4 - 1.418 z^3 + 1.589 z^2 - 1.316 z + 0.8864 Sample time: 0.05 seconds Discrete-time transfer function. Model Properties
In order to describe the reference model for the desired closed-loop dynamics, define a linear mechanism alpha
.
alpha = exp(-Ts*10);
The reference model is defined as a discrete-time transfer function sys_ref
.
sys_ref = tf((1-alpha)^2,[1 -2*alpha alpha^2 0],Ts); figure; step(sys_tf,sys_ref); legend('plant dynamics','reference dynamics')
By comparing the two step responses, it is obvious that the tuned controller needs to remove the oscillation and the steady-state error from the plant model. In this example, the controller is a FIR filter type linear controller, for which you tune the filter coefficients using the VRFT block.
Open-Loop Model
Open the prototype Simulink® model that includes an LTI plant model object.
mdl = 'OpenLoopTuningOfFIRControllerUsingVRFT.slx';
open_system(mdl);
In the VRFT block,the controller type is set to FIR controller with the default order of 5. Simulate the model.
SimOut = sim(mdl);
The block only stores the tuned controller gains at the end of the experiment. The tuned controller gains converge quickly during the experiment process.
FIRGains = SimOut.ScopeData.signals(4).values; b0 = FIRGains(1)
b0 = 0.3176
b1 = FIRGains(2)
b1 = -0.7992
b2 = FIRGains(3)
b2 = 0.8450
b3 = FIRGains(4)
b3 = -0.5061
b4 = FIRGains(5)
b4 = 0.2400
b5 = FIRGains(6)
b5 = -0.0975
Close the current Simulink model without any changes.
close_system(mdl,0);
Process Prelogged Data Sequences
The open-loop configuration also allows the VRFT block processing prelogged data sequences from plant models. The tuned gains can then be applied back to the implemented controller to examine the closed-loop control performance. Here is a screenshot of the block diagram that processes pre-logged data.
VRFT allows you to tune controllers with data sequences either collected from the plant model during simulation or logged beforehand. As a result, VRFT block provides a versatile tool to tune controller in open-loop using only data sequences from the plant model.
See Also
Virtual Reference Feedback Tuning