computer aided control systems design for a simple positioning mechanism

21
Computer Aided Control Systems Design for a simple Positioning Mechanism. Vibrations and Control of Dynamic Systems.

Upload: chathura-hewage

Post on 16-Apr-2015

256 views

Category:

Documents


0 download

DESCRIPTION

The translational equivalent of a rotational system can be built or represented on the computer instead of going to the workshop to fabricate such system and its performance under various conditions can also beobserved without having to subject the real system to these conditions hence, you save materialsand money, since the system can be used countless times. Energy is also saved because suchsystem is more easily built on a computer than physically. Moreover, it may be very difficult tomeasure some outputs of some systems such as displacement but such values can be measuredwith ease through simulation. With this project, the aim is to investigate the performance and to control a translational equivalent of a rotational system under various conditions, through modelling, such as • The rise time smaller than 0.5 seconds• The percentage overshoot less than 5%• The settling time less than 5 seconds The results are obtained in visual forms so that they can be readily interpreted and discussed.

TRANSCRIPT

Page 1: Computer Aided Control Systems Design for a simple Positioning Mechanism

Computer Aided Control Systems Design for a simple Positioning Mechanism.

Vibrations and Control of Dynamic Systems.

CHATHURA LAKMAL HEWAGE090418138

Page 2: Computer Aided Control Systems Design for a simple Positioning Mechanism

ContentsAbstract..........................................................................................................................................3Introduction....................................................................................................................................3PD Controller Design....................................................................................................................4

Modelling a spring mass damping system..............................................................................6

Dampers....................................................................................................................................7

Notch Filter Design and Tuning.................................................................................................121st property...............................................................................................................................13

2nd Property..............................................................................................................................13

3rd property............................................................................................................................. 13

Conclusions....................................................................................................................................16Recommendation................................................................................................................... 16

Reference.......................................................................................................................................16

2

Page 3: Computer Aided Control Systems Design for a simple Positioning Mechanism

Abstract The translational equivalent of a rotational system can be built or represented on the computer instead of going to the workshop to fabricate such system and its performance under various conditions can also beobserved without having to subject the real system to these conditions hence, you save materialsand money, since the system can be used countless times. Energy is also saved because suchsystem is more easily built on a computer than physically. Moreover, it may be very difficult tomeasure some outputs of some systems such as displacement but such values can be measuredwith ease through simulation. With this project, the aim is to investigate the performance and to control a translational equivalent of a rotational system under various conditions, through modelling, such as

The rise time smaller than 0.5 seconds The percentage overshoot less than 5% The settling time less than 5 seconds

The results are obtained in visual forms so that they can be readily interpreted and discussed.

IntroductionMechanical systems may undergo free vibrations or they may be subjected to forced vibrations.The vibrations are damped when friction forces are present and un-damped otherwise. Thesuspension system of an automobile, for example, consists essentially of a spring and a shockabsorber (damper), which will cause the body of the car to undergo damped forced vibrationswhen the car is driven over an uneven road. Most vibrations in machines and structures are undesirable because of the increased stresses and energy losses which accompany them. They should therefore be eliminated or reduced as much as possible by appropriate design. This

exercise was to design several controllers for a system with transfer function, G (s )= 1

ms2.Firstly

a PD controller had to be designed to move or steer the body from the origin to a desired point (xd ¿ after an initial force. This PD controller has to then be configured so that it can meet criteria

for rise time, percentage overshoot and settling time outlined in the brief. In this case the 10% - 90% rise time (time taken for body to go from 0.1 xd to 0.9 xd) must be within 0.5 seconds, the percentage overshoot (the steady state deviation) must be within 5% and the settling time (time taken for body to remain within 2% of xd) is less than 5 seconds.

A PD controller has both proportional and derivative components to it. The Proportional component acts to increase the speed of the system thus the rise time decreases. The derivative component aims to move the settling time towards zero. The general transfer of a transfer function is given by C (s )=K p+K DS.

If there are disturbances to the system at a frequency a Notch filter can be used to attenuate the gain of the system at that particular frequency.

3

Page 4: Computer Aided Control Systems Design for a simple Positioning Mechanism

PD Controller Design

In order to understand the project, firstly a derivation of the closed loop transfer function must be carried out.

A simple cart with mass (m) is shown in figure 2. This consists of a cart with mass m that rolls with a forward force u without any friction.

Using, F=ma,

m x=u

Using Laplace transforms

m(s2 L¿x) - sx(0) - x (0) = U(s)

sx(0) = 0 and x (0) = 0

Therefore, ms2 X (s )=U ( s)

G(s) = X (s)U (s) =

1

ms2

Using a PD controller the cart movement can be controlled and able to tune the controller in such a way that some extra requirements are met by defining the error between the desired point xd and the actual position x(t) by,

e (t )=xd−x (t)

u(t )=K p e (t )+Kd e (t )

4

Page 5: Computer Aided Control Systems Design for a simple Positioning Mechanism

Using Laplace transforms

U (s )=(K p+K D s)E(s)

C ( s )=U (s )E (s )

(K p+K D s)

X(S) = 1

ms2U ( s)= 1

ms2 (K p+K D s ) E (s )= 1

ms2 (K p+K D s )(Xd ( s)−X (s ) )

¿ 1

ms2 [K p X d (s )−X ( s) K p+K D s Xd (s )−K D s X (s ) ]

X ( s)[1+KD s+K p

ms2 ]= Xd(s)[K p+K D s ]

ms2

∴Gcl ( s )= Kp+KD s

m s2+K D s+K p

In order to tune the PD controller to satisfy the requirements outlined in the brief, different values of K p and K D were input into MATLAB. These values ranged between 0 and 1.5 for K p and 0 and 4.4 for K D. These values were changed in order to try and obtain a relationship between changing these values and the shape of the step response plot as well as the performance measures. Included in the appendix are the step response plots, including the performance measures. It can be seen that all plots have parameters which fall outside the ones required. Further trial and error has to be implemented to find ideal K p and K D values.

5

Page 6: Computer Aided Control Systems Design for a simple Positioning Mechanism

After some time these ideal K p and K D values were found. The step response plot for this is shown below. It can be seen that all performance measures are within the limits. In this case, K p=1.16 and K D=4.4, thus the rise time recorded is 0.469s, the overshoot is 4.99% and the settling time is 5s. It can be observed that when K p is kept constant and K D is increased, the overshoot is reduced but the system is made slower. If on the other hand, K D is kept constant and K p is increased, the system is made faster but the steady state error is introduced. Since steady state error is not being measured in this report, it as well as its effects can be ignored.

Modelling a spring mass damping systemSprings usually occur physically as a coil of metal, and their idealizations have pretty simplebehaviour: compressing the spring will result in the spring pushing back, and stretching the spring will have it trying to pull back towards the start position, so any displacement along the axis of the spring will be countered by an opposite force that will tend to move the spring back to its original position. The fundamental spring equation is given as:

F = -kx Where k is the spring constant (how loose or springy the spring is), x is the difference between the springs current length and its rest length, and F is the force on both endpoints of the spring. Usually one endpoint is fixed, the other is the one that bounces around- which is usually what happens: an initial impulse displaces the spring, the unfixed end of the spring acquires some velocity moving back, but it passes through the zero-displacement point, is pulled back in the other direction, and may bounce perpetually in the absence of any dampening forces. Physical

6

Page 7: Computer Aided Control Systems Design for a simple Positioning Mechanism

springs have more complex behaviour (like the transverse vibration and accompanying sound when they're bent away from their axis) and could be described by more complex models.

Dampers

Ideally, one could assume that all vibrating systems are free of damping. However, in actuality,all vibrations are damped to some degree by friction forces. These forces can be caused by dryfriction, or Coulomb friction, between rigid bodies, by fluid friction when a rigid body moves ina fluid, or by internal friction between the molecules of a seemingly elastic body. These all fallunder the category of free, damped vibrations. Hence, we have dampers of the viscous type,Coulomb type or hysteresis type. The equation of motion (E.O.M) for viscously damped freevibration is given by:

mx + cx + kx = 0

A derivation of G (s ) and H (s ) shown below as well as all steps leading up to these. Derivations of equations 10, 11 and 12 are also shown to aid better understanding.

Applying Newton’s second law of motion to figure 6:

F=ma

For mass 1 of 1kg,

Spring force = −k (x− y )=K ( y−x )

Damping force = −c ( x− y )=c ( y− x )

Resultant force = m1 x

m1 x=c ( y− x )+k ( y−x )

Assuming k= 20N /m and c = 5Ns /m

x. .

=5( y− x )+20( y−x ) ……. (a)

For mass 2 of 0.1kg

7

Page 8: Computer Aided Control Systems Design for a simple Positioning Mechanism

Spring force = −k ( y−x )

Damping force = −c ( y− x )

Resultant force = m2 y−u

m1 y−u=−c ( y− x )−k ( x− y )

Assuming k= 20N /m and c = 5Ns /m

0 .1 y=−5( y− x )−20( y−x )+u ……. (b)

Equations of motion obtained from system:

x. .

=5( y− x )+20( y−x )

0 .1 y=−5( y− x )−20( y−x )+u …… (10)

By taking the Laplace transform of equation (10), assuming the system is at rest:

s2 X (s )−sx (0 )− x (0 )=−5 sX (s )−5x (0 )+5 sY (s )+5 y (0 )−20 X ( s )+20Y (s )where x (0 )=x (0)= y (0)=0s2 X (s )=−5 s (X (s )−Y (s ))−20( X (s )−Y (s ))

Also taking Laplace of the second part of 10

0 .1[ s2Y (s )−sy(0 )− y (0 ) ]=−5 [ ( sY ( s )− y (0 ))−( sX ( s )−x (0 )) ]−20(Y (s )−X (s ))−U ( s )where y (0 )= y (0 )=x (0 )=0

0 .1 s2Y (s )=−5 s(Y (s )−X (s ))−20(Y ( s )−X (s ))+U (s )

Above equation (11a) follows that:

s2 X (s )=−5 s (X (s )−Y (s )−20(X ( s )−Y ( s ))s2 X (s )=−5 sX ( s )+5 sY (s )−20 X (s )+20Y ( s )

∴ X (s )=s2X ( s )+5 sX ( s )+20 X ( s )5 s+20

8

0 .1s2Y ( s )=−5s (Y (s )−X (s ))−20(Y ( s )−X (s ))+U (s ) . .. . .(b) . . .. .. .(11 )0 .1 s2Y (s )=−5 s(Y (s )−X (s ))−20(Y ( s )−X (s ))+U (s )

Page 9: Computer Aided Control Systems Design for a simple Positioning Mechanism

Now, if X ( s )is substituted into part (b) of (11), i.e.

0 .1 s2 (s2 X (s )+5 sX (s )+20 X ( s )5 s+20 )=−5 s[(s2 X ( s )+5 sX ( s )+20 X ( s )

5 s+20 )−X ( s )]−20 [(s2 X ( s )+5 sX (s )+20 X ( s )

5 s+20 )−X ( s )]+U ( s )

0 . 1 s2 (s2 X ( s )+5 sX ( s )+20 X (s ))=(−5 s3 X ( s )−25 s2 X (s )−100 sX ( s )+25 s2 X (s )+100 sX (s )−20 s2 X (s )−100 sX (s )−400 X ( s )+100 sX ( s )+400 X (s )+(5 s+20 )U (s )0 .1 s4 X (s )+0 .5 s3 X ( s )+2 s2 X (s )=−5 s3X ( s )−20 s2 X ( s )+(5 s+20 )U (s )

0 .1 s4 X (s )+5 .5 s3 X (s )+22 s2 X (s )=(5 s+20)U ( s )

(0 . 1 s4+5. 5 s3+22 s2 ) X (s )=(5 s+20 )U (s )

X ( s )= 5 s+20

s2 (0 . 1 s2+5 .5 s+22 s )U (s )

……...(12a)

Above equation (11b) follows that:

0 .1 s2Y ( s )=−5 s (Y (s )+X (s ))−20 (Y (s )+20 X ( s ))+U ( s )0 .1 s2Y ( s )=−5 sY (s )+5 X ( s )−20Y ( s )+20 X (s )+U (s )0 .1 s2Y ( s )+5 sY ( s )+20Y (s )=5 X (s )+20 X (s )+U ( s )(0 .1 s2+5 s+20)Y (s )=(5+20 )X (s )+U (s )

X ( s )=(0 . 1 s2+5 s+20)Y ( s )−U ( s )5+20

Now, if X ( s ) is substituted into part (b) of (11), i.e.

9

0 .1 s2Y (s )=−5 s(Y (s )−X (s ))−20(Y ( s )−X (s ))+U (s )

0 .1 s2Y (s )=−5 s(Y (s )−X (s ))−20(Y ( s )−X (s ))+U (s )

Page 10: Computer Aided Control Systems Design for a simple Positioning Mechanism

s2 [0. 1 s2Y (s )+5 sY ( s )+20Y (s )−U (s )5+20 ]=−5 s [0 .1 s2Y ( s )+20Y (s )−U (s )

5+20−Y (s )]

−20 [0 . 1 s2Y (s )+5 sY (s )+20Y ( s )−U ( s )5+20

−Y (s )]0 . 1 s4Y ( s )+5 s3Y (s )+20 s2Y ( s )−s2U (s )=−0 .5 s3Y ( s )−25 s2−100 sY (s )+5 sU ( s )+25 sY ( s )+100 sY (s )−2 s2Y ( s )−100 sY (s )−400Y (s )+20U (s )+100Y (s )+400Y (s )

0 .1 s4Y ( s )+5 s3Y (s )+0 . 5 s3Y ( s )+20 s2Y (s )+2 s2Y ( s )=s2U ( s )+5 sU (s )+20U ( s )

(0 .1 s4+5 . 5 s3+22 s2 )Y ( s )=(s2+5 s+20 )U (s )

Y ( s )= s2+5 s+20s2 (0 .1 s2+5 .5 s+22 )

U (s ) …(12b)

Thus, we have transfer function:

from (12a )G (s )=outputinput

=X (s )U (s )

from (12b ) H ( s )=outputinput

=Y ( s )U ( s )

∴ G(s )=5 s+20s2(0 . 1 s2+5 .5 s+22 )

, H (s )=s2+5 s+20s2(0 .1 s2+5 .5 s+22 )

.. .. .(13 )

X(s) = G(s)U(s)=G(s)C(s)E(s)=G(s)C(s)[X d (s )−H (s )G ( s ) X (s)¿X(s) =G(s)C(s)X d (s )−G2 (s )C (s )H ( s ) X (s )

X(s) = G(s )C (s )X d (s )

1+G2 ( s)C ( s) H (s )

Gcl ( s)= G(s)C(s)1+G2 (s )C (s )H ( s)

The closed loop transfer function obtained for figure 7 can be shown:

2.2 s6+130.4 s5+1002 s4+2191 s3+510.4 s2

0.01 s8+1.54 s7+61.17 s6+475.6 s5+1512 s4+2191 s3+510.4 s2

10

Page 11: Computer Aided Control Systems Design for a simple Positioning Mechanism

Next the step response plot for the closed loop system given in figure 7 was plotted (also shown below). For this plot, the same values for both K p and K D were used and the result met all performance measures except for the overshoot. The overshoot was recorded at 6.26%, 1.26% above the maximum 5% limit. To counteract this different values of K p and K D were used but the overshoot could not be reduced to a value under 5%.

The Bode magnitude plot for this closed loop system was obtained and shown on the next page. Both magnitude and phase plots are shown on the Bode plot for simplification. By looking at this Bode plot it can be seen that the resonance frequency ωr=1.34 rad s−1, and the magnitude of the resonance peak, M r=0.692.

From this, values for γ and δ may be found. Thus by using equations, γ=10−M r

20 and δ=10−0.7M r

20

γ=0.921 and δ=0.945. Also seen at 0.7M r , ω0=0.112, therefore, f 0.7 Mr=0.459Hz.

11

Page 12: Computer Aided Control Systems Design for a simple Positioning Mechanism

Notch Filter Design and TuningThe use of tuned system is another widely used passive vibration damping treatment. These devices are viscously damped 2nd order systems appended to a vibrating system. Proper selection of the parameters of these appendages, tunes the systems to one of the natural frequencies of the under damped flexible system, resulting in the addition of damping to that resonance. Unlike dashpot which is most effective in adding damping to the first mode, tuned system can target any mode, including the first, and add considerable amount of damping to it. Another distinction between tuned system and dashpot is that tuned system is a single point device and can simply be attached to a system at one end with its other end being free. tuned system consists of mass, which moves relatively to the system and is attached to it by a spring and a viscous damper in parallel. The system vibration generates the excitation of the tuned system. As a result, the kinetic energy is transferred from the structure to the tuned system and is absorbed by the damping component of the device. The tuned system usually experience large displacements. tuned system incorporated into a system where the first mode of the system response dominates, it is expected to be very effective. The optimum tuning and damping ratios that result in the maximum absorbed energy have been studied by several investigators. tuned systems have been found effective in reducing the response of system to winds and harmonic loads and have been installed in a number of buildings.

A poor step response (in terms of rise time, percentage overshoot and settling time) is often due to the presence of resonances. A notch filter can be used to eliminate the resonance without changing the high and low frequency characteristics of the system. Below is a derivation of equation 14 showing the transfer function of a notch filter. Also shown is values for ξ1 , ξ2 and ω0.

12

Bode Diagram

Frequency (rad/sec)10-1

100

101

102

-90

-45

0

Pha

se (

deg)

-30

-20

-10

0

10

Mag

nitu

de (

dB)

Page 13: Computer Aided Control Systems Design for a simple Positioning Mechanism

F ( s )=s2+2 ζ 1ωn s+ωn

2

s2+2 ζ 2ωn s+ωn2 , ζ 1<ζ 2 (14)

The magnitude of its frequency response satisfies following properties which are given with derivation:

1st property

|F (iω )|2=|ωn

2−ω2+2 ζ 1ωn iω

ωn2−ω2+2 ζ 2ωn iω|

2

=|1−~ω+2 ζ 1i( ωωn)

1−~ω+2 ζ 2i( ωωn )|2

((1−~ω)2+4 ζ 12~ω

(1−~ω)2+4 ζ 22~ω )=(1−~ω)2+4 ζ 2

2~ω+4(ζ 12−ζ 2

2)~ω

(1−~ω)2+4 ζ 22~ω

¿1−4(ζ 2

2−ζ 12)~ω

(1−~ω)2+4 ζ 22~ω

2nd Property

limω→0

|F (iω )|=√1−4(ζ 2

2−ζ 12)~ω

(1−~ω)2+4 ζ 22~ω

limω→ 0

|F (iω )|=√1=1

limω→∞

|F (iω )|= lim~ω→∞

|F (i~ω)|=√~ω2[(1~ω

−1)2

+( 4ξ12/~ω )]

~ω2[(1~ω

−1)2

+( 4ξ22/~ω )]

3rd property

|F (iω )|2=1−

4 (ζ 22−ζ 1

2)~ω(1−~ω)2+4 ζ 2

2~ω=1−4(ζ 2

2−ζ 12)

~ω(1−~ω)2+4 ζ 2

2~ω

d|F (iω )|2

dω=0−[4 (ζ 2

2−ζ 12 )][ (1−~ω)2+4 ζ 2

2~ω−~ω [−2(1−~ω)+4 ζ 22]

[(1−~ω)2+4 ζ 22~ω]2 ]

13

limω→∞

|F ( iω )|=√ (−1 )2

(−1 )2=1 ,⇒ lim

ω→∞|F ( iω )|= lim

~ω→∞|F ( i~ω)|=1

Page 14: Computer Aided Control Systems Design for a simple Positioning Mechanism

0=−[4 (ζ 22−ζ 1

2 )] [(1−~ω)2+4 ζ 22~ω−~ω[−2(1−~ω)+4 ζ 2

2]

[(1−~ω)2+4 ζ 22~ω ]2 ]

0=(1−~ω)2+4 ζ 22~ω−~ω[−2(1−~ω)+4 ζ 2

2]

0=1−2~ω+~ω2+4 ζ 22~ω+2~ω−2~ω2−4 ζ 2

2~ω

0=1−~ω2

1=~ω2

~ω=√1=1

t h ismeansω=ωn

So substituting back into |F (iω )|2=( (1−~ω)2+4 ζ 1

2~ω

(1−~ω)2+4 ζ 22~ω )=( (1−1 )2+4 ζ 1

2 (1 )

(1−1 )2+4 ζ 22 (1 ) )

|F (iω )|2=( ζ 1

2

ζ 22 )

|F (iω )|=√ ζ 12

ζ 22=

ζ 1

ζ 2

ξ1=2.11ξ2=2.29ω0=0.112

Below is a graph of the amplitude of the oscillations in respect of time for a system with a notch filter. It can be seen that the amplitude reaches an asymptote when time approaches infinity.

14

Step Response

Time (sec)

Am

plitu

de

0 5 10 15 20 25 300.96

0.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

Page 15: Computer Aided Control Systems Design for a simple Positioning Mechanism

On the following page is a system step response plot and Bode plot for the transfer function with the notch filter in parallel (figure 8 in appendixes). It can be seen that there is a linier increase of amplitude with time until T=17.7s. Once amplitude reaches the value of 1, it suddenly becomes horizontal, indicating that both the overshoot and settling time are zero. This would be ideal however with current technology also impossible. This has been put down to errors in the MATLAB programme. This can be solved by simplifying the transfer function (divide both top and bottom bys2) and then re-entering it using the MATLAB ‘tf’ command.

The step response graph as shown below makes comparing with original function difficult. However it is already known that the notch filter removes resonance, reducing the overshoot, without affecting any other performance characteristics i.e. the rise and settling time will remind the same, so the graph would more or less resemble the closed loop transfer function given by figure 7 with a lower overshoot percentage. This would then meet all the required criteria.

15

Page 16: Computer Aided Control Systems Design for a simple Positioning Mechanism

ConclusionsFrom the results achieved above in chapter 4, we conclude that a spring mass

damper system,which is widely

used in

mechanical

applications, can be well represented and simulated on acomputer to reproduce real-life situations and accurately predict different conditions and outputs

desired.Thus it can be used to design systems which have not been

manufactured for testing

16

Step Response

Time (sec)

Am

plitu

de

0 50 100 150 200 250 300 350 4000

0.2

0.4

0.6

0.8

1

1.2

1.4

Bode Diagram

Frequency (rad/sec)10-1

100

101

102

103

104

-180

-135

-90

-45

0

Pha

se (

deg)

-150

-100

-50

0

50

Mag

nitu

de (

dB)

Page 17: Computer Aided Control Systems Design for a simple Positioning Mechanism

Recommendation

A mathematical model of the system, considering the friction forces (i.e. a more complex system).

Reference

Ferdinand P. Beer & E. Russell Johnston (1997). Vector Mechanics for Engineers, Sixth

Edition. Pgs. 1172 – 1174.

Katsuhiko Ogata (2002). Modern Control Engineering, Fourth Edition. Pgs. 53-54, 70-90.

Allen S. Hall, Alfred R. Holowenko, Herman G. Laughlin (2002). Schaum’s Outlines Machine Design. Pgs. 89-92

John Wiley & Sons, Inc. Edited by Myer Kutz (2006). Mechanical Engineers’ Handbook: Materials and Mechanical Design, Volume 1, Third Edition. Pgs. 1204-1209.

www.matlabcentral.com – The official MATLAB® website.

The MathWorks Incorporated (2007) – MATLAB® product help.

Karnopp, D. (1990). Design Principles for Vibration Control Systems using Semi-Active Dampers. ASME Journal of Dynamic Systems, Measurement and Control. 112:448-455.

17