Sunteți pe pagina 1din 23

De Montfort University

Position and speed


control of a
Torsional
Mechanical System
ENGD3038- Dynamics and Control

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

De Montfort University 1 P15219444


ENGD3038 – Dynamics and Control

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

Position control – Proportional control


For the positon control a control algorithm was used using the following parameters:
Kp = 0.005
Ki = 0
Kd = 0
Step size = 240 degrees
Dwell time = 6,000ms
No of repetition = 1
This experiment was ran a couple of times using Kp = 0.008, 0.01

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].

De Montfort University 2 P15219444


ENGD3038 – Dynamics and Control

Position Control - Proportional control with velocity feedback

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 control algorithm was used using the following parameters:


Type: Continuous time
Control Algorithm: Dynamic Forward path
r0 = 1
r1 = 0.004
s1 (Kp) = 0.01

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

De Montfort University 3 P15219444


ENGD3038 – Dynamics and Control

2. Identify the parameters of the 1DoF systems using the approach described in Section 3

Figure 1: MATLAB graph showing open loop

Figure 2: Graph shown from ECP software

Identification of the 1DoF system parameters


∆𝑦 2437 − 1965
𝛼1 = = = 674.2857 degrees /s = 11.768506 rads/𝑠 2
∆𝑥 4.693 − 3.993
∆𝑦 413.3 − (−11.36)
𝛼2 = = = 278.83 = 4.8665 𝑟𝑎𝑑𝑠/𝑠 2
∆𝑥 9.571 − 8.048

𝜃𝑃 = 321.2 𝑡𝑎 = 0.345 𝑥𝑠𝑡𝑎𝑏𝑙𝑒 = 9.571

𝑡𝑑 = 𝑥𝑠𝑡𝑎𝑏𝑙𝑒 − 𝑡𝑎 = 9.571 − 0.345 = 9.226


𝜋
𝛼̈ 𝑝 = 321.2 × = 5.605998 𝑟/𝑠 2
180

De Montfort University 4 P15219444


ENGD3038 – Dynamics and Control

Acceleration (θ1 )
𝛼̈ 𝑝 5.605998
𝜃1 = = = 16.2493 𝑟𝑎𝑑/𝑠 2
𝑡𝑎 0.345

Deceleration (θ2 )
𝛼̈ 𝑝 5.605998
𝜃2 = − =− = −0.6076 𝑟𝑎𝑑/𝑠 2
𝑡𝑑 9.226

Applied Torque (Ta )


𝑇𝑎 = 0.6 × 𝑉𝑎 = 0.6 × 0.25 = 0.15𝑁𝑚

Moment of Inertia of Disk with Two Attached Masses (J)


Acceleration and Deceleration are assumed constant, whereas the angular velocity is assumed to be
linear.
𝑇𝑎 0.15
𝐽= = = 8.894 × 10−3 𝑘𝑔/𝑚2
𝜃1 − 𝜃2 16.2493 − −0.6076
Acceleration interval

Jθ1 = Ta − Tr

Tr = −((8.894 × 10−3 ) × 16.2493) + 0.15 = 0.0054787

Tr = 0.0054787
Deceleration interval

Jθ2 = − Tr

− Tr = ((8.894 × 10−3 ) × 0.6076) = −5.40399 × 10−3

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𝑠

Viscous damping coefficient (c)


𝐽 8.894 × 10−3 𝑁
𝑐= = = 0.0021933 /𝑠
𝜏 4.055 𝑟𝑎𝑑

De Montfort University 5 P15219444


ENGD3038 – Dynamics and Control

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𝑠

When Kp increases the oscillations tend to Settling time:


increase too.
𝑡𝑠 = 𝑡0 ± 2%
𝑡𝑠 = 5.242
Steady state error:

𝑒𝑠𝑠 = 𝑌𝑠𝑠 − 𝑠𝑖𝑔𝑛𝑎𝑙 𝑠𝑡𝑒𝑎𝑑𝑦 𝑠𝑡𝑎𝑡𝑒

247.5 − 248.2 = 0.7 degrees

De Montfort University 6 P15219444


ENGD3038 – Dynamics and Control

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: Collective results for transient responses for changing Kd

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

Tpeak (s) against Kd


1.2
Kd 0.002 0.004 0.006
1
OS% 28.394% 0.929% 0.51%
0.8
Tpeak 0.514s 0.638s 1.018s
0.6
Tr 0.4112s 0.5104s 0.8144s 0.4
Ts 1.771s 0.841s 1.248s 0.2
Ess 0.1° 7.5° -4.5° 0
Table 2: The parameters that are affected when Kd is changed 0 0.002 0.004 0.006 0.008
Figure 5: Tp graph against Kd

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.

De Montfort University 7 P15219444


ENGD3038 – Dynamics and Control

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.

Kp 0.01 0.03 0.07 Ts (s) against Kp


OS% 0.2574% 0.1144% 0.1967% 5.05
Tpeak 2.01s 2.036s 2.019s 5.04
Tr 1.608s 1.6288s 1.6152s 5.03
Ts 5.029s 5.047s 5.047s
5.02
Ess 10.3° 10.2° 4.2° 0 0.02 0.04 0.06 0.08
Table 3: Table showing the OS%, Tpeak, Tr, Ts and Ess for
Figure 7: Graph showing Ts against Kp
speed control servo-system

Tr (s) against Kp Ess against Kp


1.63 12

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

Figure 8: Tr against Kp Figure 9: Ess against Kp

De Montfort University 8 P15219444


ENGD3038 – Dynamics and Control

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:

 The proportional controller: CP = KP


 the derivative controller CD=KDs

Analysis of the open-loop system


1⁄
1 K
hw K J
GOpen = K hw × s(Js+c) = s(Js+c) = Js2hw
+cs
= s2 +cs⁄J

∴ 𝐺𝑜𝑝𝑒𝑛(𝑠) = 𝐾𝑃 × 𝐾ℎ𝑤 × 𝑃(𝑠) × 𝐾𝐷 𝑠

𝑃(𝑠) × 𝐶𝑃𝐼
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
1 + (𝑃(𝑠) × 𝐶𝑃𝐼 ) + (𝑃(𝑠) × 𝐶𝐷 )
𝐾ℎ𝑤
× 𝐾𝑃
+ 𝑐𝑠 𝐽𝑠2
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) = 𝐾 𝐾
1 + ( 2 ℎ𝑤 × 𝐾𝑃 ) + ( 2 ℎ𝑤 × 𝐾𝑑 𝑠)
𝐽𝑠 + 𝑐𝑠 𝐽𝑠 + 𝑐𝑠
𝐾ℎ𝑤 × 𝐾𝑝
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
𝐽𝑠 2 + 𝑐𝑠 + (𝐾ℎ𝑤 × K d )s + (𝐾ℎ𝑤 × 𝐾𝑝 )

De Montfort University 9 P15219444


ENGD3038 – Dynamics and Control

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.

Using 𝐺4(𝑠) poles can be derived as is illustrated below:

14.928 × 𝐾𝑝
∴ 𝐺𝑐𝑙𝑜𝑠𝑒𝑑(𝑠) =
0.008894𝑠 2 + (0.0021933𝑠 + 14.928 × K d )s + (14.928 × 𝐾𝑝 )

Openloop transfer function


Feedback function = 1+(Feedback )×(Open loop tansfer function)

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: Pole positions for Kp gain

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.

De Montfort University 10 P15219444


ENGD3038 – Dynamics and Control

Figure 11: pole positions for Kd gain

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

Table 4: Theoretical characteristics of PID controllers

 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

De Montfort University 11 P15219444


ENGD3038 – Dynamics and Control

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.

De Montfort University 12 P15219444


ENGD3038 – Dynamics and Control

Appendix
Chapter 3. Graphs showing different test results

Test 2 Kp = 0.005

Test 3 Kp = 0.01

Test 3 Kp=0.008

De Montfort University 13 P15219444


ENGD3038 – Dynamics and Control

Chapter 5
Test 4 Kp=0.02, Kd=0.004

Test 5 Kp=0.02, Kd=0.006

Test 6 Kp=0.02, Kd=0.002

De Montfort University 14 P15219444


ENGD3038 – Dynamics and Control

Chapter 7
Test 7 Ramp Kp=0.01

Test 8 Ramp Kp=0.03

Test 9 Ramp Kp=0.07

De Montfort University 15 P15219444


ENGD3038 – Dynamics and Control

MATLAB coding

Section 2.2.2 Kp change:


%% read data from m-file, type just "filename"
closeloop_m205_kp0_01_kd0_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');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_02_kd0_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');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_03_kd0_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');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');
%% read data from m-file, type just "filename"
closeloop_m205_kp0_04_kd0_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');
xlabel('Time [s]');
ylabel('Rotation angle \theta [deg]');

poles kp code:
Khw=14.9928

Khw =

14.9928

J=0.007601

J =

0.0076

Tao=3.585

Tao =

3.5850

De Montfort University 16 P15219444


ENGD3038 – Dynamics and Control

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)

De Montfort University 17 P15219444


ENGD3038 – Dynamics and Control

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

De Montfort University 18 P15219444


ENGD3038 – Dynamics and Control

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

De Montfort University 19 P15219444


ENGD3038 – Dynamics and Control

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 =

De Montfort University 20 P15219444


ENGD3038 – Dynamics and Control

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]');

De Montfort University 21 P15219444


ENGD3038 – Dynamics and Control

%% read data open "filename.m"


closeloop_m205_r0_1_r1_0_004_s1_0_05;
% 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]');
%% read data open "filename.m"
closeloop_m205_r0_1_r1_0_004_s1_0_07;
% 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]');

De Montfort University 22 P15219444

S-ar putea să vă placă și