Lab 2
Lab 2
Lab 2
ecam.fr
Objectives
• Determination of the different parts that constitute the considered LAB system
depicted in Figure 1 (DC Motor)
• Model Validation (Comparison between the response of the real system and
the response of the proposed model)
ecam.fr 17/05/2024 2
1. Setup of the device with Matlab
Question 1
• Using Table 1, identify the elements of the considered device (Use the Figure
1 to circle each part)
ecam.fr 17/05/2024 4
Table 1: The LAB process components
ecam.fr 17/05/2024 5
Question 2
ecam.fr 17/05/2024 6
• Using the Simulink file “Model1.mdl”, click on File Menu ->Model Properties
sim(„T:\Control_Lab2\stopXi.mdl‟)
ecam.fr 17/05/2024 7
sim(„T:\Control_Lab2\stopXi.mdl‟)
ecam.fr 17/05/2024 8
1.2.2. Data Aquisition Toolbox
• In the “Simulink Library Browser”, under the tab “Data Acquisition Toolbox”,
you will find the blocks:
Question 3
3.1. What does input means for the DAQ Card?
Double-click on the analog input block to set its parameters, select only “ai0”
then choose the property “SingleEndedNonReferenced” and verify that the
range is +/- 10 Volt
3.2. Why the DAQ Card input is in Volt and why should it have a limited range?
3.3. Enter 0.001 for the sample time. Comment this parameter
ecam.fr 17/05/2024 9
B. Analog output configuration
Question 4
Remark:
If the DAQ Card receives a command that exceeds its voltage range, it will shut
down or gives wrong measurement. To avoid errors and not to damage the
DAQ Card, a “Saturation” block should be used and the range of limitation
should be set from -9.99 to 9.99 volt
The saturation block could be found within the category “Discontinuities”
of the “Simulink Library Browser”
ecam.fr 17/05/2024 10
1.2.4. Simulation parameters
• We want to plot the step response of the DC motor, the amplitude of the
applied step should be 6 Volt.
• The signal that we want to observe will be an image of the motor rotation
velocity, to do so, in the same file “Model1.slx” plot the block diagram of the
figure 3
ecam.fr 17/05/2024 11
Question 5
Stop time = 3s
Solver options “Fixed-step”
Fixed-step size = 0.001s (under “Solver details tab”)
Solver “auto”
5.2. Place a scope to plot the step (input reference ) and the motor rotation
speed (output) in the same figure. Turn the switch of the LAB system on
position “ON” (the motor supply) and Launch the simulink simulation
ecam.fr 17/05/2024 12
1.2.5. Filtering of the measure
• From Figure 1, you can observe that the device integrate a low-pass filter
Question 6
6.1. Place a scope to plot the unfiltered measure signal, the filtered measure
signal as well as the input reference on the same figure
In the remaining, you have to use only the filtered measure, i.e. “ai0”
ecam.fr 17/05/2024 13
STEP 1: Identification
ecam.fr 17/05/2024 14
2. DC Motor model identification
2.1. Open-loop system identification from a step response test
ecam.fr 17/05/2024 15
• The Broïda method is a graphical approach that can be applied to the
identification of open-loop stable process. The system can be approximate
to a first order with a pure time delay
𝒀(𝒔) 𝑲 𝒆−𝒅 𝒔
𝑮 𝒔 = =
𝑼(𝒔) 𝟏 + 𝝉 𝒔
ecam.fr 17/05/2024 16
𝐲
𝒚(+∞)
∆𝐲
∆𝐲𝟐 ∆𝐲𝟏 𝐭𝟎 𝐲𝟎
𝒕
𝐭𝟏
𝐭𝟐
ecam.fr 17/05/2024 17
Table 2: Variables used for the Identification (Broida method)
Remark:
The time delay might be negligible for some DC motor, but it is good practice to
include it in the model
ecam.fr 17/05/2024 18
• From the step response displayed in Figure 5, it is necessary to determine
the steady-state gain 𝐾, the time-constant 𝜏 and the pure time-delay 𝑑 . The
procedure is as follows:
1. Find the final and initial values of the response and of the step. Deduce 𝐾
from
𝑦 ∞ − 𝑦(0)
𝐾=
𝑢 ∞ − 𝑢(0)
2. Find ∆𝑦1 = 0.28 ∆𝑦 and ∆𝑦2 = 0. 4 ∆𝑦 , deduce 𝑡1 and 𝑡2
𝑡1 = 𝑡 ∆𝑦1 = 𝑡 28% ∆𝑦
𝑡2 = 𝑡 ∆𝑦2 = 𝑡 40% ∆𝑦
3. Calculate 𝜏 and 𝑑
𝜏 = 5.5 𝑡2 − 𝑡1
𝑑 = 2.8 𝑡1 − 1.8 𝑡2
𝑲 𝒆−𝒅 𝒔
Model obtained by Broida Method 𝑮 𝒔 =
𝟏+𝝉𝒔
ecam.fr 17/05/2024 19
7.3. Follow the aformentioned procedure to determine the gain 𝐾 , the time
constant 𝜏 and the time delay 𝑑 and deduce the broida Model
7.4. What is the objective behind approximating real system to a mathematical
model (the model obtained via the Broida method)
ecam.fr 17/05/2024 20
STEP 2: Validation
ecam.fr 17/05/2024 21
2.2. Model validation
• Every model must be validated in order to confirm that it fits well enough the
reality (Comparison between the output of the process (real system) and the
output of model (virtual)) (see Figure 6)
• Open a new simulink file and plot a new block diagram using the model
obtained in 7.3, the new model should be entitled “Broida_Model”
𝐾
• To define the simulink block 𝐺 𝑠 = 1+𝜏𝑠 × 𝑒 −𝑑𝑠 you have to use:
• Both the transport delay and the transfer function can be found within the
category “continuous” of the library browser
ecam.fr 17/05/2024 22
Question 8
In this part you have to realize a simulink block diagram that has the same
principle as the figure 6
Experimental Part
Simulation Part
Figure 6: Validation of the open loop model
ecam.fr 17/05/2024 23
8.1. Apply a step response of amplitude 6 volts on “Broida_Model” then place a
scope to plot the output of the Broida model
8.2. Copy and paste “Model1” into “Broida_Model” and run the simulink
simulation. Compare the step response of the Broida model (the output of the
model) to the step response of the real device (the output of the real system)
8.3. Based on the results obtained in 8.2, Adjust the parameters of the
“Broida_model” (propose suitable optimal values for the gain 𝐾𝑜𝑝𝑡𝑖𝑚𝑎𝑙 , the time
constant 𝜏𝑜𝑝𝑡𝑖𝑚𝑎𝑙 and the pure time delay 𝑑𝑜𝑝𝑡𝑖𝑚𝑎𝑙 so that the output of the
model tracks perfectly the output of the real system, (superposition of the two
graphs))
8.4. Based on these proposed values give the expression of
𝐾𝑜𝑝𝑡𝑖𝑚𝑎𝑙 −𝑑𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑠
𝐺𝐵𝑟𝑜𝑖𝑑𝑎 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑠 = 1+𝜏 × 𝑒
𝑜𝑝𝑡𝑖𝑚𝑎𝑙𝑠
In the remaining, the used model should be the one described by
𝑮𝑩𝒓𝒐𝒊𝒅𝒂 𝒐𝒑𝒕𝒊𝒎𝒂𝒍 (𝒔)
ecam.fr 17/05/2024 24
STEP 3: Control
ecam.fr 17/05/2024 25
3. The feedback control and Evaluation of the performances
• The Broida model (with the optimal parameters values) and the real system
will be placed in a unitary feedback loops
ecam.fr 17/05/2024 26
𝐮(𝐭) 𝛚𝐬𝐲𝐬𝐭𝐞𝐦 (𝐭)
Process
+ Controller
− (Real system)
Figure 7: The system and the Broida Model in a Unitary feedback loop
ecam.fr 17/05/2024 27
3.1. Empirical method for PID tuning
• These methods are always better and faster than individual gain tuning with
a trial-and-error approach (the tuning problem you have faced in LAB 1)
ecam.fr 17/05/2024 28
Variable description (from Table 3)
• 𝑇: time constant (should be replaced by 𝜏)
• 𝐿: delay (it stands for 𝑑)
• 𝑘𝑝 : Steady state gain ( corresponds to 𝐾)
100
• 𝑃𝐵: Proportional Border (𝑃𝐵% = 𝑘𝑐
)
ecam.fr 17/05/2024 29
3.1.1. Impact of the proportional action
Question 9
9.1. Open a new simulink model, copy-paste the optimal “Broïda model”. Save
the file as “Real_Vs_Broida_Controller_P.slx”
9.2. Add a proportional controller 𝒌𝒄 and complete the simulink design to get a
unitary feedback. Plot in the same figure the step response of the model as
well as the step input. Explain the impact of the proportional action and
illustrate it with plots
ecam.fr 17/05/2024 30
3.1.2. Impact of the Integral action
Question 10
1
𝑃𝐼 𝑠 = 𝑘𝑐 1+
𝑇𝑖 𝑠
ecam.fr 17/05/2024 31
10.3. Reproduce the block diagram of Figure 8, and use the Table 4, to write a
Matlab script in order to compute the values of the PI parameters (𝑘𝑐 𝑎𝑛𝑑 𝑇𝑖 )
𝒌𝒄 𝑻𝒊 Optimum
conditions
Hrones PI 100 𝜏 𝑇𝑖 = 1.2 𝜏 No overshoot
-Type A 𝑘𝑐 =
286 𝐾 𝑑 Minimum
response time
ecam.fr 17/05/2024 32
10.4. Create a feedback loop with the virtual model
10.5. Prove that the system answer to the following specifications:
Zero-overshoot
Gain = 1
No steady-state error for a step input
Response time = 0.2s
Question 11
11.1. Implement the same controller PI on the real device
Make sure that the DAQ Protection is in place with the Saturation block
(section 1.2.3)
ecam.fr 17/05/2024 33
11.2. Run the simulation and eventually refine the tuning of the values
11.3. Observe and comment
11.4. Plot on the same figure the virtual model response and the real device
response after correction
11.5. Adjust parameters in order to superpose the two curves
ecam.fr 17/05/2024 34
3.1.4. Impact of the Derivative action
Question 12
1
𝑃𝐼𝐷 𝑠 = 𝑘𝑐 1+ + 𝑇𝑑 𝑠
𝑇𝑖 𝑠
ecam.fr 17/05/2024 35
Figure 9 : Mixed PID cotroller
Table 5: The used approach for computing the PID parameters (Reswick‟s method)
𝒌𝒄 𝑻𝒊 𝑻𝒅 Optimum
conditions
Reswi No
ck- PID 100 𝜏 𝑇𝑖 = 𝜏 𝑇𝑑 = 0.5 𝑑 overshoot
Type A 𝑘𝑐 =
167 𝐾 𝑑 Minimum
response
time
12.5. Choose a final design for the controller and justify your choice. Give its
block diagram
ecam.fr 17/05/2024 36
3.2. Disturbances analysis
Question 13
13.1. Propose a simulation method using the Broida model to analyze the
impact of a perturbation
13.2. Insert the same type of disturbances on the real system and comment
the system‟s behaviour in the presence of these disturbances
13.4. Evaluate the performance of the real system and the Broida optimal
Model in terms of precision and rapidity
13.5. if the obtained results are not satisfactory you could use the the table 3
(the line colored in blue to tune the PID parameters)
ecam.fr 17/05/2024 37