0% found this document useful (0 votes)
4 views

Process Control

1. The student identified a first-order process model to represent the dynamics of a DC motor driving the right wheel of a robot. The model was validated against experimental data and showed good matching characteristics. 2. A PI controller was selected to eliminate steady-state error and reduce rise time for the motor system. The PI controller combines proportional and integral terms based on historical error between a setpoint and measured output. 3. Experimental results showed the measured output of the left wheel motor closely followed the setpoint when controlled by the PI controller, validating the controller design.

Uploaded by

Y ZW
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Process Control

1. The student identified a first-order process model to represent the dynamics of a DC motor driving the right wheel of a robot. The model was validated against experimental data and showed good matching characteristics. 2. A PI controller was selected to eliminate steady-state error and reduce rise time for the motor system. The PI controller combines proportional and integral terms based on historical error between a setpoint and measured output. 3. Experimental results showed the measured output of the left wheel motor closely followed the setpoint when controlled by the PI controller, validating the controller design.

Uploaded by

Y ZW
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

EEEN60441&40441

Process control assignment report

December 2023

Student Name: Yu Zhengwen


Student ID: 11308748
settling time.
Task 2 2. Line7: calculate the gain.
right wheel
3. Line 8: Get the transfer function of the process.
13.87 measured output

12
X 0.15 Model validation, conclusions and reflections
Y 13.75
left wheel
15
ω(rad/s)

9
measured output
estimated model output
6 12

ω(rad/s)
3 9

0 6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(s)
3

Fig.2.1 right wheel rpm 0


0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
duty of input voltage time(s)
1
input voltage duty

0.8 Fig.2.3 measured output and estimated model output


left wheel
0.6
5
duty

measured output
estimated model output
0.4
4

ω(rad/s)
0.2
3
0
0 0.2 0.4 0.6 0.8 1 2
time(s)
1

Fig.2.2 right wheel input voltage duty


0 0.1 0.2 0.3
System identification time(s)

1. The sampling time is 0.01s. Assume this is a first Fig.2.4 details of last diagram
order system. Therefore, the structure of transfer In Fig.2.3, we can observe that the estimated model
function is: behaves similar to the real process. But at the beginning
¿ K of step response, the estimated model rise faster than
G ( s) = the real process. The reason is that the DC motors have
τs+1
2. The duty of input voltage on right wheel is 100%. second order dynamics. If a second order system have
Consequently, the gain K of the transfer function is two real poles and no zeros, the gradient at t=0 is 0,
determined as: which is smaller than that in a first order system. While
K=13.87 /1=13.87 we use a first order system to identify the model, there
3. From Fig. 2.1, we observe that +/- 1% settling time will be some mismatch.
is 0.15s. Therefore, the time constant is calculated
Task 3
as:
τ =0.15/5=0.03 Controller selection
4. Therefore, G*(s) is To eliminate steady-state error, I will incorporate an
¿ 13.87 integrator into the controller. Additionally, to reduce the
G ( s) =
0.03 s+1 response rise time, I will employ a PI controller.
Description of program used for system identification Controller description
program used for system identification:
for m=1:1:length(wR_all)// ‘wR_all’, sampled rpm data.
if wR_all(m)>0.99*wR
tao =(m-1)*t_sampling/5;//tao, time constant
break
end Fig.3.1 PI controller
end A PI controller regulates a system by combining and
K=wR/uR;//wR, steady state value;uR, input voltage duty accumulated historical error between reference and
TF_R=tf([K],[tao 1]); output. In software, implement a positional PI controller
1. Line 1~ line 6: Use a for loop to find the +/- 1% with the formula:
U ( k ) =Kp× e ( k )+ Ki × Ie(k) 1.5
left wheel set value and measured output
wL all
Ie ( k )=Ie ( k−1 )+Ts∗e (k ) 1.25
wL set all

Here, U(k) represents the output of the PI controller, 1

w(rad/s)
e(k) is the error between the reference and the output, 0.75

0.5
Ie(k) is the integral of the error, and Ts is the sampling
0.25
time. 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
The following pseudo-code illustrates the time(s)

implementation of the PI controller based on these Fig.3.3 step response when reference is 1 rad/s
formulas:
// Calculate the error 1
left wheel input
uL
0.75
error= setpoint – process Variable 0.5
upper boundary
lower boundary

// Proportional term 0.25

duty
0
Proportional Term = Kp * error -0.25
// Integral term -0.5
-0.75
integral = (integral + Ts * error)*ki -1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
// Control output time(s)

Control Output = proportional Term + integral Fig.3.4 output of controller when reference is 1 rad/s
// Update previous error for the next iteration When increase the reference to 13 rad/s, it is observed
Previous Error = error that there is saturation in the response in Fig.3.5 and
In this task, sampling time is 0.01s. Fig.3.6.
right wheel set value and measured output
Ziegler-Nichols method Tuning procedure 15
saturation wR all
wR set all
1. Implement a P controller in the close loop system. 12.5

10
2. keep increasing gain of P controller until it oscillates
ω(rad/s)

7.5
constantly. When Ku = 1.022 (gain of P controller),
5
response is shown in the Fig3.2.
2.5
left wheel set value and measured output
X 0.29 X 0.32
7 0
Y 6.412 Y 6.414 wL all
wL set all
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
6 time(s)
5
ω(rad/s)

4 Fig.3.5 step response when reference is 13 rad/s


3 right wheel input
1
2 uR
0.75 saturation
upper boundary
1 0.5 lower boundary

0.25
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6
duty

time(s) 0
-0.25

Fig.3.2 constant oscillation when Ku=1.022 -0.5


-0.75
3. Record period of oscillations Pu=0.03s. -1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
4. According to Ziegler-Nichols method, time(s)

Kp=1.022*0.45=0.46, Ti=0.03/1.2=0.025. Fig.3.6 controller output when reference is 13 rad/s


5. Implement PI controller with these parameters in Therefore, anti-windup should be incorporated to
the close loop system. restrict the integration of error in the system.
Control algrorithm performance
When the reference is set to 1 rad/s, it is observed that the
response exhibits an overshoot of 56% and the +/- 1%
settling time is approximately 0.16s in Fig.3.3 and Fig.3.4.
Notably, there is no steady state error in the response.
Fig.3.7 implement anti-windup in PI controller
After trial and error, Ke(anti-windup coefficient) has
been set to 0.06. As a result, the saturation has
disappeared in Fig.3.8, and there is no overshoot or
steady-state error in the response.
left wheel set value and measured output right wheel set value and measured output
15 15
wL all wR all
13 wL set all 13 wR set all
X 0.5
10 Y 12.88
w(rad/s) 10

w(rad/s)
7.5
7.5
5
5
2.5
2.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(s) 0
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2
time(s)
Fig.3.8 step response with anti-windup
1
left wheel input
Fig.3.11 IMC tuning method designing controller(ref=13)
uL
0.75 upper boundary left wheel set value and measured output
4
0.5 lower boundary X 0.5 wL all
Y 3.968 wL set all
0.25
3
duty

w(rad/s)
-0.25
2
-0.5
-0.75 1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(s) 0
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2
time(s)

Fig.3.9 controller output with anti-windup Fig.3.12 IMC tuning method designing controller(ref=4)
IMC tuning method Quasi-Direct Synthesis Method
Given that there is a pole and no zero in the plant
transfer function, the objective is for the closed-loop
system to exhibit second-order behavior, a PI controller
is suitable.
1. The transfer function of PI controller is:
C ( s )=kp+ ki/s
2. the transfer function of plant is:
Fig.3.10 IMC tuning method 13.87
G ( s )=
1. Assume G*(s)=G(s), determine desired closed loop 0.03 s +1
transfer function T*(s): 3. calculate the closed loop transfer function is:
¿ 1 C (s)G(s) 462 kp ∙ s +462 ki
T ( s )= T ( s )= = 2
0.1 s+ 1 1+C (s)G (s) s + ( 462 kp +33 ) s +462 k i
2. Calculate GIMC(s):
¿
4. The requirement is that the natural frequency of
T (s) 0.03 s+1 the system is 20 rad/s and damping ratio is 0.85.
G IMC ( s )= ¿ =
G (s) 1.387 s+13.87 Therefore,
2
3. So, C(s) is: ω =20∗20=462 ki
2 ω ζ =2∗0.85∗20=462 kp+ 33
G IMC (s ) Therefore, kp=0.0022, ki=0.87.
C ( s )= =0.02163+ 0.721/s
1−GIMC (s) G¿ ( s) 5. Close loop transfer function is:
So, kp=0.02163, ki=0.721. 462 kp ∙ s+ 462 ki 462∗0.022 s+ 462∗0
T ( s )= 2
= 2
The reference for the right wheel is set at 13 rad/s, and s + ( 462 kp+33 ) s+ 462 k i s + ( 462∗0.022+33 ) s +46
for the left wheel, it is set at 4 rad/s. It can be observed Control performance
in Fig.3.11 and Fig.3.12, due to the integral term in the Fig.3.13 and Fig.3.14 illustrate the output of the
controller, there is no steady-state error observed in the controller and the step response of the closed-loop
wheel speed plot. The system tracks the reference quite system. I have set the reference for the right wheel at
well, and the +/- 1% settling time is approximately 0.5s, 10 rad/s. In Fig.3.13, the settling time is approximately
indicating a time constant of 0.1s. Thus, it essentially 0.4s. However, due to a damping ratio smaller than 1,
meets the design requirements. an overshoot is observed. In Fig.3.14, the output of the
controller rises smoothly and exhibits no saturation.
12
right wheel set value and measured output
wR all
variable, while the outer loop adjusts a slower one.
10 wR set all

8
ω(rad/s)

0
Fig.4.1 cascade control
0 0.5 1 1.5 2
time(s) Below is a segment of pseudo code illustrating the
Fig.3.13 Quasi direct method (step response) implementation of cascade control (assume both inner
1
right wheel input
uR
loop and outer loop employ PI controller):
upper boundary
lower boundary
// Outer Loop (Slow Process Variable)
0.5
outer error = outer set point - outer process Variable
duty

0
outer control output = Kp_outer * outer error+
-0.5 Ki_outer * outer cumulative Error
outer cumulative Error += outer Ts*outer error
-1
0 0.5 1
time(s)
1.5 2
// Inner Loop (Fast Process Variable)
Inner error = outer control output – inner process
Fig.3.14 Quasi direct method (controller output) Variable
Reflection of tuning methods control Output = Kp_inner * error + Ki_inner *inner
In this task, the Ziegler-Nichols method, IMC, and Quasi- cumulative Error
Direct synthesis methods were applied. The Ziegler- cumulative Error += inner Ts*error
Nichols method is considered an experimental tuning In this task, sampling time is 0.01s.
technique, particularly useful when the physics model The output of outer loop controller is the set point of
of the process is unknown, providing an initial starting inner loop. This hierarchical structure enables precise
point. However, its limitation lies in the inability to control of the slower variable while considering the
precisely shape the process behavior according to dynamics of the faster one.
specific requirements, such as designing a system with Cascade controller Tuning steps
specified settling time or overshoot criteria. Therefore, 1. the inner loop controller is tuned using standard
some modification should be made to the parameters tuning rules, which has been done in task 3.
according to difference between the behavior of system 2. With the slave controller in automatic, standard
and desired dynamics. What’s more, the practice of tuning rules can be applied to the master loop.
adding controller gain to induce oscillations, as In this task, the direct synthesis method is
employed in the Ziegler-Nichols method, can be employed to tune the controller. Firstly, the system
deemed risky in real-world systems. between output of outer loop controller and the
In contrast, both IMC and Quasi-Direct synthesis are distance robot travelled should be identified.
analytical tuning methods. IMC excels in accurately 4.5
distance
distance
tracking and suppressing disturbances in a system 4 X 4.8
Y 4.155

through an internal model. Quasi-direct synthesis, on


distance(m)

3.5

the other hand, is preferable when natural frequency 3

2.5
and damping ratio requirements are known. The
2 X 0.6
observed outcomes suggest that these methods Y 2.209
1.5
effectively meet design requirements, especially when 0 1 2 3
time(s)
4 5 6

the transfer function of the open-loop system is known.


Fig.4.2 robot travelled distance
Task 4
Description of cascade control implementation
Cascade control is a control strategy employing multiple
controllers in series to manage different aspects of a
system. The inner loop governs a faster process
inner loop input distance
-9
inner loop input 3 distance
d set
-9.5 2.8

distance(m)
w(rad/s)
2.6
-10
2.4

-10.5 2.2

2
-11
0 1 2 3 4 5 6
time(s) 0 5 10 15 20 25 30 35 40
time(s)

Fig.4.3 input of inner loop Fig.4.6 reference and robot travelled distance (kp=-40)
Fig.4.2 and Fig.4.3 illustrate robot travelled distance some information of outer loop controller output
when the input of inner loop is -10 rad/s. will miss, and the inner loop cannot catch up with
As the trend is a slash, we can make the assumption outer loop controller output, if continue to
that it behaves as an integrator. decrease time constant it won’t response faster. So
here I assume:
¿ 1
T ( s)=
4 s+ 1
3. Assume the gain of P controller is kp, we can get the
Fig.4.4 cascade control close loop transfer function is:
According to Fig.4.2, the gain of D(s) equals to ¿ kp∗D (s ) 1
T ( s )= =
(4.155-2.209)/[(4.8-0.6)*(-10)]=-0.047. 1+kp∗D(s) 1
s+1
D ( s )=−0.047/s −0.047 kp
Where D(s) is the transfer function between the 4. Therefore, kp=1/(-0.047)/4=-5.3
inner loop input and robot traveled distance. 5. Implement in the process.
Since there is already an integral in the transfer Controller performance
function, adding another integrator to eliminate distance
3 distance
steady-state error is unnecessary. Therefore, a P X 20.1 d set
2.8 Y 2.976
controller will be utilized in this task.
distance(m)

2.6
When selecting the time constant of the closed-
2.4
loop transfer function, it's important not to choose
2.2
a value that is too small. In such cases, the output
2
of the outer loop controller may be constrained by
0 5 10 15 20 25 30 35 40
saturation, as illustrated in Fig.4.5 and Fig.4.6 with time(s)
Kp=-40. When Kp=-40, time constant should be 0.5. Fig.4.7 reference and robot travelled distance
But because of saturation, inner loop fails to catch In Fig.4.7, the +/- 1% settling time is approximately 20s,
up with the output of outer loop controller output. indicating a time constant of 4. Moreover, there is no
As a result, the response is not as fast as we expect. steady-state error observed, validating that the design
ω* and inner loop output
0 w*
essentially meets the specified requirements.
w ω* and inner loop output
0 w*
w
w*(rad/s)

-5
-1
w*(rad/s)

-2
-10
-3

-4
-15
0 5 10 15 20 25 30 35 40 -5
time(s)
-6
0 5 10 15 20 25 30 35 40
Fig.4.5 outer controller output and inner loop output time(s)

Fig.4.8 outer controller output and inner loop output


In Fig.4.8, the output of the outer loop controller and
the tracking performance of the inner loop are
depicted. It is noticeable that, except at the beginning for navigation. In my opinion, an ideal algorithm would
of the simulation, the system can effectively track the enable the robot to travel at the maximum speed until it
reference and the output of the outer loop controller. is close to or approaching the set point. Then, the speed
Cascade Control Reflection would gradually decrease as it approaches the set point,
Cascade control involves utilizing multiple control loops, rather than continuously adjusting the travel speed
where the output of an inner loop regulates the based on the distance between the robot and the set
setpoint of an outer loop. When designing the inner point. I believe this method will save more time than
loop controller, it is crucial to ensure a relatively faster current algorithm in use.
response and sampling, while the outer loop should be
relatively slow. This design helps prevent a situation
where the inner loop cannot follow the outer loop,
ensuring the entire system behaves as desired.
Implementing 'Leader-Follower' Navigation
The outer loop controller employed in the 'leader-
follower' navigation remains the same as the previous
controller, with no modification to the inner loop
controller.
In this segment, the setpoint changes 3 times within
one simulation:
Between 0-30s, the setpoint is 4m.
Between 30-60s, the setpoint is 3m.
Between 60-90s, the setpoint is 1m.
Between 90-120s, the setpoint is 2m.
ω* and inner loop output
15
ω*
10 w

5
ω*(rad/s)

-5

-10

-15
0 20 40 60 80 100 120
time(s)

Fig.4.9 outer controller output and inner loop output


distance
4
distance
3.5
distance(m)

2.5

1.5

1
0 20 40 60 80 100 120
time(s)

Fig.4.10 robot travelled distance


Reflections on ‘leader-follower’ navigation
Based on the controller designed in previous tasks, it is
observed that the robot can successfully reach the set
point.
However, this may not be the most optimal algorithm

You might also like