Design Home Assignment-2
Design Home Assignment-2
For a proportional controller with unity feedback, the control signal 𝑢(𝑡) is given by,
𝑢(𝑡) = 𝐾𝑝 ⋅ 𝑒(𝑡)
where 𝐾𝑝 is the proportional gain and 𝑒(𝑡) is the error signal, which is the difference between the
reference signal 𝑟(𝑡) and the output of the system 𝑥(𝑡). In unity feedback,
By considering all 3 cases separately ,& take 𝐾𝑥 , 𝐾𝑦 , 𝐾𝑧 are proportional gains for each controllers.
And 𝑟𝑥 , 𝑟𝑦 , 𝑟𝑧 are the references.
Reference Position : Origin of the Coordinate system [(0,0,0)] Initial Conditions: x(0)=y(0)=z(0)=0 ,
̇ x(0)=ẏ(0)=ż(0)=0
𝑋(𝑠) 𝐾𝑥
=
𝑅𝑥 (𝑀𝑥 + 𝑚)𝑠 2 + 𝐷𝑥 𝑠 + 𝐾𝑥
𝐾𝑥
𝐶𝐿𝑇𝐹𝑥 (𝑠) =
(𝑀𝑥 +𝑚)𝑠2 +𝐷𝑥 𝑠 + 𝐾𝑥
To derive the closed-loop transfer function for hoist control while incorporating the load mass 𝑚m
into the proportional control law, we adjust the control equation to compensate for the gravitational
force acting on the load.
𝑚𝑔
(𝑀𝑧 + 𝑚)𝑧(𝑡) + 𝐷𝑧 𝑧(𝑡) − 𝑚𝑔 = 𝐾𝑧 (𝑟𝑧 (𝑡) − 𝑧(𝑡) − )
𝐾𝑧
Take Laplace Transform,
𝑚𝑔
ℒ{(𝑀𝑧 + 𝑚)𝑧(𝑡) + 𝐷𝑧 𝑧(𝑡) − 𝑚𝑔} = ℒ{𝐾𝑧 (𝑟𝑧 (𝑡) − 𝑧(𝑡) − )}
𝐾𝑧
(𝑀𝑧 + 𝑚)ℒ{𝑧(𝑡)} + 𝐷𝑧 ℒ{𝑧(𝑡)} − 𝑚𝑔ℒ{1} = 𝐾𝑧 ℒ{𝑟𝑧 (𝑡)} − 𝐾𝑧 ℒ{𝑧(𝑡)} − 𝑚𝑔ℒ{1}
(𝑀𝑧 + 𝑚)[𝑠 2 𝑍(𝑠) – 𝑠 𝑧(0) – 𝑧’(0)] + 𝐷𝑧 [𝑠𝑍(𝑠)– 𝑧(0)] = 𝐾𝑧 𝑅𝑧 (𝑠) − 𝐾𝑧 𝑍(𝑠)
• 𝑀x= 600𝑘𝑔
• 𝐷x= 400𝑘𝑔
• 𝑚 = 400𝑘𝑔
When we know the Closed-Loop transfer function, Routh’s criterion can be applied to check the
conditions for stability.
Routh’s Array:
S2 1000 𝐾𝑥
S1 400 0
S0 𝐾𝑥
1
𝐾
1000 𝑥
𝐶𝐿𝑇𝐹𝑥 (𝑠) = 400 1
𝑠2 + 𝑠+ 𝐾
1000 1000 𝑥
1 1
𝜔2 = 𝐾 , 0.22 = 𝐾 , 𝐾𝑥 = 40
1000 𝑥 1000 𝑥
Then ,
40
𝐶𝐿𝑇𝐹𝑥 (𝑠) =
1000𝑠 2 +400𝑠 + 40
The system exhibits a desirable non-oscillatory response with zero overshoot and steady-state
error, indicating stability. However, the rise time of 16.7917 seconds and settling time of 29.1706
seconds are unacceptably high. The prolonged duration, approximately 40 seconds, for the crane
to traverse just 1 meter along the X direction is deemed unacceptable due to the sluggish
movement.
• Increasing 𝐾𝑥 can potentially reduce both rise and settling times, improving system
responsiveness.
However, this action may introduce overshoot and oscillatory behavior, which compromise
stability.
for kx = 200:200:1000;
Observations
• However, with higher 𝐾𝑥 values, overshoot and oscillatory behavior in the step response
gradually increase.
Overshoot: 39.5903 %
Observations
• Comparing to the previous case, there's a noticeable reduction in both rise time and
settling time.
• 𝑀y= 100𝑘𝑔
• 𝐷y= 40𝑘𝑔/s
• 𝑚 = 400𝑘𝑔
When we know the Closed-Loop transfer function, Routh’s criterion can be applied to check the
conditions for stability.
Routh’s Array:
S2 500 𝐾𝑦
S1 40 0
S0 𝐾𝑦
1
𝐾
500 𝑥
𝐶𝐿𝑇𝐹𝑥 (𝑠) = 40 1
𝑠2 + 𝑠 + 𝐾
500 500 𝑥
1 1
𝜔2 = 𝐾 , 0.042 = 𝐾 , 𝐾𝑦 = 0.8
500 𝑦 500 𝑦
Then ,
0.8
𝐶𝐿𝑇𝐹𝑦 (𝑠) =
500𝑠 2 +40𝑠 + 0.8
step(Sysy);
grid on;
% Set the x-axis range up to 350
xlim([0 350]);
Sy = stepinfo(Sysy);
• Similar to the previous case, the system exhibits a non-oscillatory response with zero
overshoot and steady-state error, indicating stability.
However, the rise time and settling time are even higher than the previous case.
the crane takes long time to traverse 1m along Y direction, which is not acceptable. As in the
previous case the crane is moving very slowly.
• Increasing the proportional gain 𝐾𝑦 may reduce the rise and settling times, improving
system responsiveness.
• However, higher 𝐾𝑦 values could lead to increased overshoot and oscillatory behavior in the
step response, which compromises stability.
for ky = 10:10:40;
Sysy = tf(ky, [My+m Dy ky]);
step(Sysy)
grid on
hold on
end
• Similar to the previous case, increasing the proportional gain 𝐾𝑦 leads to a reduction in rise
time.
• However, with higher 𝐾𝑦 values, the overshoot and oscillatory behavior in the step response
gradually increase.
The rise time and the settling time has reduced when comparing to the critically damped system.
Even though the settling time has reduced it is still almost 110 seconds. But in mean time there is
overshoot in the step response.
• 𝑀z= 100𝑘𝑔
• 𝐷z= 200𝑘𝑔/𝑠
• 𝑚 = 400𝑘𝑔
When we know the Closed-Loop transfer function, Routh’s criterion can be applied to check the
conditions for stability.
Routh’s Array:
S2 500 𝐾𝑧
S1 200 0
S0 𝐾𝑧
1
𝐾
500 𝑧
𝐶𝐿𝑇𝐹𝑧 (𝑠) = 40 1
𝑠2 + 𝑠 + 𝐾
500 500 𝑧
1 1
𝜔2 = 𝐾, 0.22 = 𝐾 , 𝐾𝑧 = 20
500 𝑧 500 𝑧
Then ,
20
𝐶𝐿𝑇𝐹𝑧 (𝑠) =
500𝑠 2 +200𝑠 + 20
we can increase the proportional gain Kz to obtain lower rise time and settling time
50
𝐶𝐿𝑇𝐹𝑧 (𝑠) =
500𝑠 2 +200𝑠 + 50
Overshoot: 7.6893 %
The rise time has reduced to 7.5975 seconds, indicating improved system responsiveness
Undesirable Overshoot:
Despite the reduced rise time, proportional control alone is insufficient to achieve the desired
outcome due to overshoot.
3] Select a PID controller or one of its variants in the continuous time domain and tune the
controller based on the step response for each sub-control problem. Assume unity feedback.
Clearly give the design steps supported by the mathematical manipulations, codes written, and
the step responses obtained.
• Steady state error is nearly zero for all step responses across different proportional
gain values for each sub-control problem.
• The absence of steady state error indicates that an Integral Controller is not
necessary for this application.
Derivative Controller:
• To address the overshoot while decreasing the rise time, a Derivative Controller
should be used in conjunction with the Proportional Controller.
𝐺𝑐(𝑠)=𝐾𝑝+𝑠𝐾𝑑
Where:
1] for Travelling:
𝐺𝑝 (𝑠)𝐺𝑐 (𝑠)
𝐶𝐿𝑇𝐹𝑥 (𝑠) =
1+𝐺𝑝 (𝑠)𝐺𝑐 (𝑠)
𝐾𝑝𝑥+ 𝐾𝐷𝑥𝑆
𝐶𝐿𝑇𝐹𝑥 (𝑠) = (𝑀 2 +(𝐷 +𝐾 )𝑠+𝐾
𝑥 +𝑚)𝑠 𝑥 𝐷𝑥 𝑝𝑥
Similarly,
2] for Traversing
𝐾𝑝𝑦+ 𝐾𝐷𝑦𝑆
𝐶𝐿𝑇𝐹𝑦 (𝑠) =
(𝑀𝑦 +𝑚)𝑠 2 +(𝐷𝑦 +𝐾𝐷𝑦 )𝑠+𝐾𝑝𝑦
3] for Hoisting
𝑚𝑔
(𝑀𝑧 + 𝑚)𝑧(𝑡) + 𝐷𝑧 𝑧(𝑡) − 𝑚𝑔 = 𝐾𝑝𝑧 (𝑟𝑧 (𝑡) − 𝑧(𝑡) − ) + 𝐾𝐷𝑧 [ 𝑟𝑧 − ż(t)]
𝐾𝑧
Taking the Laplace Transform ,
𝑚𝑔
ℒ{(𝑀𝑧 + 𝑚)𝑧(𝑡) + 𝐷𝑧 𝑧(𝑡) − 𝑚𝑔} = ℒ{ 𝐾𝑝𝑧 (𝑟𝑧 (𝑡) − 𝑧(𝑡) − )}+
𝐾𝑝𝑧
ℒ{ 𝐾𝐷𝑧 [ 𝑟𝑧 − ż(t)] }
1. We start by setting the derivative gain to zero and focus on adjusting the proportional gain
only. This helps us establish a stable response without considering the derivative term.
2. We gradually increase the proportional gain until the system starts to swing back and forth,
which we call the "ultimate gain" or "critical gain".
3. Once we find this ultimate gain, we reduce the proportional gain by half. This helps us
maintain stability without the swinging motion.
4. Next, we slowly introduce the derivative gain. This helps the system respond more quickly
and reduces how much it swings back and forth.
5. Finally, we fine-tune both gains to get the response we want. We consider things like how
stable the system is, how fast it responds, and how much it swings back and forth
1. Start by setting the derivative gain 𝐾𝐷𝑥 to zero and observe the system's Step Response
while increasing the proportional gain 𝐾𝑃𝑥 value.
2. Choose the 𝐾𝑃𝑥 value that corresponds to a Step Response with minimal overshoot and a
shorter rise time.
3. Once the optimal 𝐾𝑃𝑥 value is determined, fix it and then increase the derivative gain 𝐾𝐷𝑥
value gradually until achieving a Step Response with zero overshoot.
when KDx = 1400 can obtain a step response with zero overshoot and lower rise time .
Closed-Loop transfer function of the tuned system for Travelling Motion (along X axis)
600+ 1400𝑠
𝐶𝐿𝑇𝐹𝑥 (𝑠) =
1000𝑠 2 +1800𝑠+600
Overshoot: 0.3950
steps
1. Begin by setting the derivative gain 𝐾𝐷𝑦to zero and observe the system's Step Response
while gradually increasing the proportional gain 𝐾𝑃𝑦 value.
3. Once the optimal 𝐾𝑃𝑦 value is determined, keep it fixed and incrementally increase the
derivative gain 𝐾𝐷𝑦 value until achieving a Step Response with zero overshoot
Overshoot: 0
Mz = 100; m = 400;
Dz = 200;
kp = 200;
for kd = 300:100:600;
Sysz = tf([kd kp], [Mz+m Dz+kd kp]);
step(Sysz)
grid on
hold on
end
Overshoot: 0
I . Give the Bode plots for a situation when the system is stable and discuss.
ii. Give the Bode plots for a situation when the system is unstable and discuss.
iii. Give the Bode plots for the tuned system as in Part-3 and state the PM and GM.
S2 1000 𝐾𝑝𝑥
S1 400+𝐾𝐷𝑥 0
S0 𝐾𝑝𝑥
For stability 400 + 𝐾𝐷𝑥 >0→ 𝐾𝐷𝑥 > −400 & 𝐾𝑝𝑥 > 0
• Traversing (along Y axis)
𝐾𝑝𝑦+ 𝐾𝐷𝑦𝑆
𝐶𝐿𝑇𝐹𝑦 (𝑠) = 2
500𝑠 +(40+𝐾𝐷𝑦 )𝑠+𝐾𝑝𝑦
Routh’s Array:
S2 500 𝐾𝑝𝑦
S1 40+𝐾𝐷𝑦 0
S0 𝐾𝑝𝑦
For stability 40 + 𝐾𝐷𝑦 >0→ 𝐾𝐷𝑦 > −400 & 𝐾𝑝𝑦 > 0
• Hoisting (along Z axis)
𝐾𝑝𝑧+ 𝐾𝐷𝑧𝑆
𝐶𝐿𝑇𝐹𝑧 (𝑠) =
500𝑠 2 +(200+𝐾𝐷𝑧 )𝑠+𝐾𝑝𝑧
S2 500 𝐾𝑝𝑧
S1 200+𝐾𝐷𝑧 0
S0 𝐾𝑝𝑧
For stability 200 + 𝐾𝐷𝑧 >0→ 𝐾𝐷𝑧 > −400 & 𝐾𝑝𝑧 > 0
1).Bode plots for each system when they are stable
Choose Kpy = 40 & KDy = -10 (For stability 𝑲𝑫y > −𝟒𝟎 & 𝑲𝒑y > 𝟎 )
• Gain margins and Phase margins are both positive for the open-loop transfer functions of
each sub-control system.
• Positive gain margin indicates that the system can handle an increase in gain before
instability occurs.
• Similarly, positive phase margin suggests that the phase shift around the loop remains below
180 degrees at the unity gain frequency
(ii) Bode plots for each system when they are unstable
Choose Kpy = 40 & KDy = -50 (For stability 𝑲𝑫y > −𝟒𝟎 & 𝑲𝒑y > 𝟎 )
40−50𝑠
𝑂𝐿𝑇𝐹𝑦 (𝑠) = Gp(𝑠)𝐺𝑐 (𝑠)𝐻(𝑠) =
500𝑠2 +40𝑠
• Both gain and phase margins are negative for the open-loop transfer functions of each
sub-control system.
• Negative margins suggest potential instability, indicating that the system's gain is too
high at certain frequencies and the phase shift exceeds 180 degrees.
• Operating close to the stability boundary, the system lacks robustness and may
become unstable due to parameter changes or external disturbances.
• The system may exhibit erratic behavior or oscillations, limiting its suitability for real-
world applications.
Discussion
• The tuned sub-control systems exhibit infinite gain margins and larger phase margins,
close to 90 degrees.
• Infinite gain margin signifies the system's open-loop gain can be increased
indefinitely without instability.
• It reflects high robustness against parameter variations, ensuring stability even with
uncertainties.
• A 90-degree phase margin indicates optimal stability, with the phase shift around the
loop at unity gain frequency.
• Having both infinite gain margin and a 90-degree phase margin (or close) indicates
the highest level of stability and robustness.
• This level of stability is crucial for critical applications like overhead crane position
control, where reliability and performance are paramount
5] Evaluate the closed-loop control performances of the controllers designed in Part-4 in terms
of the step response for 3 different sampling frequencies if the digital control is designed and
implemented using the indirect approach. Discuss the results [Note: here, select the sampling
frequencies so that control performance dependence on finite sampling is clearly
demonstrable]
Designing a digital PD controller using indirect approach for each sub control systems: • Travelling
sub control (along X axis)
600+ 1400𝑠
𝐶𝐿𝑇𝐹𝑥 (𝑠) =
1000𝑠2 +1800𝑠+600
Select Sampling frequencies as 10Hz, 20Hz and 1kHz to obtain the step responses of the discretized
system.
When f=10Hz
num = [1400 600];
den = [1000 1800 600];
T = 0.1;
[numd, dend] = c2dm(num, den, T, 'imp');
printsys(numd, dend, 'z')
dstep(numd,dend)
When f =1KHz
When f=20Hz
For f=10Hz
For 1KHz
• When designing a digital controller using discrete-time PD control, the sampling frequency
significantly influences the closed-loop system's performance characteristics, such as
overshoot, settling time, and offset in the step response
• When designing a digital controller using discrete-time PD control, the sampling frequency
significantly influences the closed-loop system's performance characteristics, such as
overshoot, settling time, and offset in the step response.
• Sampling frequency affects offset by influencing the controller's ability to regulate the system
accurately. Higher frequencies allow more frequent adjustments, potentially reducing
steady-state errors. Yet, quantization errors and noise can introduce disturbances, affecting
control accuracy and contributing to offset.
• Increasing the sampling frequency significantly extends the settling time, which is highly
undesirable. Higher frequencies can amplify noise, particularly if the system is susceptible
to high-frequency disturbances. This noise interference can degrade control signal
accuracy and prolong settling time, negatively impacting system performance.