Documente Academic
Documente Profesional
Documente Cultură
Nizamuddin Patel
21/02/2018
ENGD3038 – Dynamics and Control
Contents
Introduction ............................................................................................................................................... 2
Objective .................................................................................................................................................... 2
Procedure.................................................................................................... Error! Bookmark not defined.
Methodology.............................................................................................................................................. 2
Theory ........................................................................................................................................................ 2
Theoretical calculations .............................................................................. Error! Bookmark not defined.
Results ......................................................................................................... Error! Bookmark not defined.
Discussion.................................................................................................... Error! Bookmark not defined.
References ............................................................................................................................................... 12
1. Introduction
This report has been written to verify the theory behind the one degree of freedom configuration
dynamic model. The experiment conducted consists of an electric motor with an attached inertia load
in the form of a rotating disk, Analysis is taken of transient dynamics of the system using dynamic
system transfer function.
Transient dynamics analysis is a method of looking at the dynamic response of a structure under
general time dependent loads. In this analysis the time-varying displacement, stress, strains and forces
are determined in a structure when it responds to a combination of harmonic, static and transient
loads.1
Feedback control strategies are studied in the experiment. This is done through an attached disk being
displaced on a recommended angle. This also controls the speed of rotation accordingly to the applied
control input.
During the experiment the kp and kd are changed to see the differences of the values produced such as
the rise time, settling time and overshoot. Most importantly these changes will allow determining what
produces the ideal transition value
Equipment used
ECP M205 system
ECP Torsional plant
Methodology
The book produced by M. Goman and B. Ulanicki referenced below provided a step by step onto how
to use the software and these instructions were used to get the results for this report.
In summary the ECP control box and PC were turned on and the ECP executive programme was used
to instruct the torsional software to operate and provide data to be analysed. The disk had two masses
of 500g each on the attached disk to match the disk and the cylinder edges.
Open-loop system
A pre-set file called, ‘default.cfg’ preinstalled on the computer was used with the following
parameters:
Control effort = 0.25V
Dwell time = 4,000ms
No of repetition = 1
1Ansys.stuba.sk. (2018). STRUCTURAL: Chapter 5: Transient Dynamic Analysis (UP19980818). [online] Available
at: http://www.ansys.stuba.sk/html/guide_55/g-str/gstr5.htm [Accessed 20 Feb. 2018].
A control algorithm was used again for the velocity feedback using the following parameters:
Kp = 0.02
Ki = 0
Kd = 0.004
Step size = 240 degrees
Dwell time = 4,000ms
No of repetition = 1
This experiment was ran a couple of times using Kd = 0.002, 0.006
Speed Control
A closed loop ramp input trajectory was used using the following parameters:
Distance = 360 degrees
Velocity = 180 degrees/second
Dwell time = 1000ms
No of repetitions = 1
This experiment was ran a few times replacing s1 (Kp) with 0.03 and 0.07
2. Identify the parameters of the 1DoF systems using the approach described in Section 3
Acceleration (θ1 )
𝛼̈ 𝑝 5.605998
𝜃1 = = = 16.2493 𝑟𝑎𝑑/𝑠 2
𝑡𝑎 0.345
Deceleration (θ2 )
𝛼̈ 𝑝 5.605998
𝜃2 = − =− = −0.6076 𝑟𝑎𝑑/𝑠 2
𝑡𝑑 9.226
Jθ1 = Ta − Tr
Tr = 0.0054787
Deceleration interval
Jθ2 = − Tr
Tr = 0.005404
𝐽𝛼1 = 𝑇𝑎 − 𝑐𝜔 − 𝑇𝑓
The motion equation for deceleration interval the equation is transformed to:
𝐽𝜔 + 𝑐𝜔̇ = 0
To find 𝜏 value draw tangent lines on the deceleration line draw it close to the exponential
dependence. This means the effects of dry friction is lower than the viscous friction effects.
𝐽
𝜏= 𝑠𝑒𝑐
𝑐
𝜏 = 8.048 − 3.993 = 4.055𝑠
3. Plot transient responses for different values of the proportional gain Kp (in one coordinate
system) using the Matlab ‘plot’ command for the proportional controller investigated in
Sections 2.2.1
Figure 3: graph showing collective test results for closed loop position control
Figure 3 shows the results of all three tests into one graph. For individual graphs and their reference
points refer to appendix chapter 3.
4. Evaluate the parameters of the transient response (OverShoot %, Tpeak, Tr, Ts, Ess) and describe
how they are affected by gains 𝑲𝒑
Kp 0.005 0.008 0.01 For Kp @ 0.01
OS% 61.736 % 79.482% 76.87 %
𝑃𝑒𝑎𝑘 𝑡𝑖𝑚𝑒 = 𝑡𝑝𝑒𝑎𝑘 = 0.646 𝑠
Tpeak 0.974 s 0.779 s 0.646 s
Tr 0.7792 s 0.6232 s 0.5168 s 𝑌𝑃𝑒𝑎𝑘 − 𝑌𝑠𝑠
𝑂𝑆 = × 100
𝑌𝑠𝑠
Ts 3.86 s 4.613 s 5.242 s
Ess 0.8 ° 0.6 ° 0.7 ° 439 − 248.2
× 100
Table 1: Parameters effected when Kp is changed 248.2
= 76.873%
Table 1 shows the changes in parameters as Kp
is increased. As Kp increases the rise time and Time rise:
the peak time decreases. The settling time and 𝑡𝑟 = ( 10%𝑡𝑝𝑒𝑎𝑘 − 90%𝑡𝑝𝑒𝑎𝑘 )
overshoot increases. The steady-state error
decreases slightly. 𝑡𝑟 = 0.5814 − 0.0646 = 0.5168𝑠
5. Plot transient responses (in one co-ordinate system) for changing 𝑲𝒅 values using the Matlab
‘plot’ command for the PD controller investigated in Section 2.2.2
Figure 4 shows the results of all three tests of transient changes of Kd put into one graph. For
individual graphs and their reference points refer to appendix chapter 5.
6. Evaluate the parameters of the transient response (OverShoot %, Tpeak, Tr, Ts, Ess) and describe
how they are affected by gains 𝑲𝒅 for the PD controller investigated in section 2.2.2
From table 2 it is obvious to see that there overshoot only clearly occurs when Kd is 0.002, this is
because when Kd is increased, the damping of the system is also increased. The higher the Kd, the less
chance that there will be overshoot and the lower the oscillations.
Table 2 also shows that the settling time also decreases as Kd increases. Although the 0.004 result
maybe an anomaly, this can only be confirmed with further testing.
Figure 5 shows the correlation between Kd and Tp. There is a strong positive correlation which
suggests that as Kd increase so does the peak time. Looking at table 2, it can also be noted that the
rise time (Tr) also increase as Kd increases. Tpeak is increasing significantly when the dampening is
increased.
7. For speed control in Section 2.3 plot transient responses in one co-ordinate system for changing
𝑲𝒑 values using the Matlab ‘plot’ command
Figure 6: graph showing the collective results of the change in speed control
Figure 6 shows the results of all three tests of transient changes of speed (S1) put into one graph. For
individual graphs and their reference points refer to appendix chapter 7.
1.625 10
8
1.62
6
1.615
4
1.61
2
1.605 0
0 0.02 0.04 0.06 0.08 0 0.02 0.04 0.06 0.08
8. Describe how the increase of proportional gain Kp in servo-system for speed control affects the
response of the closed-loop system
Figure 6 shows the output velocity of the gain of the Kp value. As Kp increases, the final velocity is
reached much faster as compared with the lower values of Kp. As Kp increases the accuracy also
increases.
It can be assumed that the difference between the set-point signal and the system response could be
due to friction. As Kp is increased the speed increases which leads to less friction, which could suggest
why the results are more accurate.
In theory the proportional controller (Kp) will reduce the rise time and also reduce but not eliminate
the steady-state error.
Figure 7 shows the relationship between Kp and the settling time (Ts). There is a positive relationship
which suggests that as Kp increases so does the settling time.
Figure 8 shows a confused result in which the over rise time increases but from Kp0.03 – Kp0.07, the
rise time decreased. This confusion could be resolved if more experiments were ran which may show if
the Kp0.03/ Kp0.07 value is an anomaly.
Figure 9 shows that when Kp increases, the steady-state error decreases. This matches the theory so
we can assume that this result is correct.
9. For the controller configuration in Sections 2.2.2 derive the closed-loop system transfer function
and investigate how the location of poles changes with the changes of gains 𝑲𝒑 and 𝑲𝒅 using
Matlab
Khw = 14.928 J
𝑃(𝑠) =
𝐾ℎ𝑤 J = 0.008894 𝒌𝒈. 𝒎𝟐
𝐽𝑠 2 +𝑐𝑠
𝑵
14.928 C = 0.0021933 𝒓𝒂𝒅
∴ 𝑃(𝑠) = 𝒔
0.008894𝑠 2 + 0.0021933𝑠
The proportional controller is denoted as CP and the derivative controller is denoted as CD:
𝑃(𝑠) × 𝐶𝑃𝐼
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
1 + (𝑃(𝑠) × 𝐶𝑃𝐼 ) + (𝑃(𝑠) × 𝐶𝐷 )
𝐾ℎ𝑤
× 𝐾𝑃
+ 𝑐𝑠 𝐽𝑠2
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) = 𝐾 𝐾
1 + ( 2 ℎ𝑤 × 𝐾𝑃 ) + ( 2 ℎ𝑤 × 𝐾𝑑 𝑠)
𝐽𝑠 + 𝑐𝑠 𝐽𝑠 + 𝑐𝑠
𝐾ℎ𝑤 × 𝐾𝑝
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
𝐽𝑠 2 + 𝑐𝑠 + (𝐾ℎ𝑤 × K d )s + (𝐾ℎ𝑤 × 𝐾𝑝 )
For this part t will be kept constant [𝐾𝑝 = 0.02] as well as [𝐾ℎ𝑤 = 14.928].
The 𝐾𝑑 𝑣𝑎𝑙𝑢𝑒 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑐ℎ𝑎𝑛𝑔𝑒𝑑 𝑖𝑛 𝑠𝑡𝑒𝑝𝑠 𝑜𝑓: 0.02, 0.04 and 0.06
[𝐽𝑠 2 + 𝑐𝑠 + (𝐾ℎ𝑤 × K d )s + (𝐾ℎ𝑤 × 𝐾𝑝 )] of the transfer function will be used to calculate the poles.
14.928 × 𝐾𝑝
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
0.008894𝑠 2 + (0.0021933𝑠 + 14.928 × K d )s + (14.928 × 𝐾𝑝 )
14.928
0.008994 s2 + 0.00212s
14.928
1 + (1 × )
0.008994 s 2 + 0.0212s
Pole positions
The matlab code in the appendix was used to create the pole positions on MATLAB. The code will
define the parameters for Gopen and Gclosed, using the feedback code. Once these parameters were
identified, the pzmap instruction can be used to plot the pole positions:
Figure 10 shows the pole positions for all of the possible Kp gains. It is clear from the map that when
Kp is increased there is an increase in the physical oscillations of the physical system. Along the
imaginary axis of the graph the plotted pole positions where Kp is increasing the angle of the poles is
decreasing, this reinforces the point that when Kp is increased so is the physical oscillations. When Kp
is increased the Damping ratio, there will be a noticeable increase in the overshoot of the physical
system.
Figure 11 shows the pole positions for all of the possible Kd gains. An increase in Kd on the map does
not show a significant move to the left where it is more stable. However the complex poles move to
the left, this suggests a reduction in the oscillation of the system. This is mainly due to the increase in
the dampening, which will reduce the oscillation. For this we can conclude that an increase in Kd will
lead to a reduction in the oscillation.
10. Conclusions
The testing respected table 4 and followed through the theoretical characteristics of PID
controllers except for test 7 (chapter 7) where it increased instead of decreasing
increasing in Kp will cause more oscillations within the system
An Increase in Kp will cause more peaks and greater settling times
Increasing the Kd will increase the damping effect, which will lead to a decrease in oscillations
An increase in Kd will cause rise time to increase and a decrease in overshooting
We concluded when analysing a PID controller that the Kp which is the proportional will cause
a reduction in the steady state error whereas increasing the integral term will cause the
elimination of the steady state error
The main of conducting analysis on a PID controller was to improve stability, accuracy and
disturbance rejection
References
Ulaniki, B. and Goman, M. (2018). Error – Blackboard Learn. [online] Vle.dmu.ac.uk. Available at:
https://vle.dmu.ac.uk/webapps/blackboard/execute/content/file?cmd=view&content_id=_3845
054_1&course_id=_460920_1 [Accessed 19 Feb. 2018].
[1] S. W. Sung, J. Lee and I. Lee, Process Identification and PID Control. (1. Aufl.;1; ed.) 2009.
Bing.com. (2018). Cite a Website - Cite This For Me. [online] Available at:
http://www.bing.com/cr?IG=B8F502636B5E4DCDB7F6D7F855C85E6C&CID=213CB1D7500C69EC
0489BA7A51A36835&rd=1&h=XyzLH8FeL_oXP6KDbCOA6e17Ms5iiQSpASfyWO-
bSXA&v=1&r=http%3a%2f%2fengineering.nyu.edu%2fmechatronics%2fControl_Lab%2fCriag%2f
Craig_RPI%2f2001%2fPhysical_Modeling_Mechanical.pdf&p=DevEx,5063.1 [Accessed 3 Mar.
2018].
Bing.com. (2018). Cite a Website - Cite This For Me. [online] Available at:
http://www.bing.com/cr?IG=624898370A2E4B409A1D8040B2CE4B8B&CID=32684D4619EB6985
25B846EB184468EA&rd=1&h=SkI7W_fYRNJ9VImsVPJgClF09RQvMpjypa-
7I0R07oc&v=1&r=http%3a%2f%2ffaculty.uml.edu%2fpavitabile%2f22.451%2fDynamic_Systems_
Mechanical_Systems_031906_DYNSYS.pdf&p=DevEx,5042.1 [Accessed 1 Mar. 2018].
Blog.opticontrols.com. (2018). PID Controllers Explained | Control Notes. [online] Available at:
http://blog.opticontrols.com/archives/344 [Accessed 2 Mar. 2018].
Csimn.com. (2018). PID for Dummies - Control Solutions. [online] Available at:
https://www.csimn.com/CSI_pages/PIDforDummies.html [Accessed 3 Mar. 2018].
Wang, L. (2015). PID and predictive control of electrical drives and power converters using MATLAB.
Singapor: Wiley, IEEE Press.
Appendix
Chapter 3. Graphs showing different test results
Test 2 Kp = 0.005
Test 3 Kp = 0.01
Test 3 Kp=0.008
Chapter 5
Test 4 Kp=0.02, Kd=0.004
Chapter 7
Test 7 Ramp Kp=0.01
MATLAB coding
poles kp code:
Khw=14.9928
Khw =
14.9928
J=0.007601
J =
0.0076
Tao=3.585
Tao =
3.5850
c=J/c
Undefined function or variable 'c'.
c=J/Tao
c =
0.0021
s=tf('s')
Transfer function:
s
kp=0.01
kp =
0.0100
p=(kp*Khw)/(J*(s^2))+(c*s))
p=(kp*Khw)/(J*(s^2))+(c*s))
|
Error: Unbalanced or unexpected parenthesis or bracket.
p=(kp*Khw)/((J*(s^2))+(c*s))
Transfer function:
0.1499
------------------------
0.007601 s^2 + 0.00212 s
Gclosed=feedback(p,1)
Transfer function:
0.1499
---------------------------------
0.007601 s^2 + 0.00212 s + 0.1499
pzmap(Gclosed)
hold
Current plot held
kp=0.02
kp =
0.0200
p=(kp*Khw)/((J*(s^2))+(c*s))
Transfer function:
0.2999
------------------------
0.007601 s^2 + 0.00212 s
Gclosed=feedback(p,1)
Transfer function:
0.2999
---------------------------------
0.007601 s^2 + 0.00212 s + 0.2999
pzmap(Gclosed)
kp=0.03;
p=(kp*Khw)/((J*(s^2))+(c*s))
Transfer function:
0.4498
------------------------
0.007601 s^2 + 0.00212 s
Gclosed=feedback(p,1)
Transfer function:
0.4498
---------------------------------
0.007601 s^2 + 0.00212 s + 0.4498
pzmap(Gclosed)
hold
Current plot released
hold
Current plot held
kp=0.04;
p=(kp*Khw)/((J*(s^2))+(c*s))
Transfer function:
0.5997
------------------------
0.007601 s^2 + 0.00212 s
Gclosed=feedback(p,1)
Transfer function:
0.5997
---------------------------------
0.007601 s^2 + 0.00212 s + 0.5997
pzmap(Gclosed)
grid on
Kd change code:
%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_002_ki0;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(3);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
legend('demand signal','system respond');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_004_ki0;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(3);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
legend('demand signal','system respond');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_04_ki0;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(3);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
legend('demand signal','system respond');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_06_ki0;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(3);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
legend('demand signal','system respond');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_08_ki0;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(3);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
legend('demand signal','system respond');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
poles kd change:
Khw=14.928
Khw =
14.9280
J=0.007601
J =
0.0076
Tao=3.585
Tao =
3.5850
c=J/Tao
c =
0.0021
kp=0.01
kp =
0.0100
ki=0
ki =
kd=0.02
kd =
0.0200
s=tf('s')
Transfer function:
s
Gclosed=(Khw*kp)/((J*(s^2))+(((c+Khw)*kd)*s)+(Khw*kp))
Transfer function:
0.1493
--------------------------------
0.007601 s^2 + 0.2986 s + 0.1493
pzmap(Gclosed)
hold
Current plot held
kd=0.4
kd =
0.4000
Gclosed=(Khw*kp)/((J*(s^2))+(((c+Khw)*kd)*s)+(Khw*kp))
Transfer function:
0.1493
-------------------------------
0.007601 s^2 + 5.972 s + 0.1493
pzmap(Gclosed)
hold
Current plot released
hold
Current plot held
kd=0.6
kd =
0.6000
Gclosed=(Khw*kp)/((J*(s^2))+(((c+Khw)*kd)*s)+(Khw*kp))
Transfer function:
0.1493
-------------------------------
0.007601 s^2 + 8.958 s + 0.1493
pzmap(Gclosed)
hold
Current plot released
hold
Current plot held
kd=0.8
kd =
0.8000
Gclosed=(Khw*kp)/((J*(s^2))+(((c+Khw)*kd)*s)+(Khw*kp))
Transfer function:
0.1493
-------------------------------
0.007601 s^2 + 11.94 s + 0.1493
pzmap(Gclosed)
grid on
S1 change code:
%% read data open "filename.m"
closeloop_m205_r0_1_r1_0_004_s1_0_01;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(4);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
title('Speed control ramp: \theta_{dem}=360 deg, velocity=90 deg/s Gains:
k_p=0.01, s filter standard');
% calculation of angular velocity using finite difference method
N=size(D(:,2)); omega=zeros(N);
for i=1:N-1
omega(i)=(D(i+1,3)-D(i,3))*360/16000/(D(i+1,2)-D(i,2));
end
plot(D(:,2),omega(:),'b-')
legend('demand signal \theta_{dem}','system respond \theta(t)','esimated
angular velocity \omega_{e} [deg/s]');
%% read data open "filename.m"
closeloop_m205_r0_1_r1_0_004_s1_0_03;
% plot results for Encoder 1 in counts converted to degrees vs time
figure(4);
plot(D(:,2),D(:,3)*360/16000,'-r');
hold on; grid on;
plot(D(:,2),D(:,4)*360/16000,'-k');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');