Ramin_Shamshiri_Control_Project_Ball_Beam

April 30, 2018 | Author: RaminShamshiri | Category: Control Theory, Equations, Torque, Stability Theory, Angle
Share Embed Donate


Short Description

Descripción: Ramin_Shamshiri_Control_Project_Ball_Beam...

Description

1

EML 4312 Control of Mechanical Engineering Systems Project Ball and Beam Instructor: Instructor: Dr. D ixon

RAMIN SHAMSHIRI Fall 2009

Due Dec 7th , 2009

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

2

BALL AND BEAM I.

PHYSICAL SETUP AND SYSTEM EQUATIONS

A ball is placed on a beam, (Figure.1), where it is allowed to roll with 1 degree of freedom along the length of the beam. A lever arm is attached to the beam at one end and a servo gear at the other. As the servo gear turns ( ), the lever changes the angle of the beam ( ). When the angle is changed from the vertical position, gravity causes the ball to roll along the beam. A controller will be designed for this system so that the ball’s position can be manipulated. For this problem, assume that the ball rolls without slipping and friction between the beam and ball is negligible. The constants and variables are defined as





        

   

Figure 1. Schematic view of Ball and Beam.

    /       

Mass of the ball, = 0.15 0.15 Radius of the ball = 0.01 0.015 5 Lever arm offset = 0.05 0.05 Gravitational acceleration = 9.8 Length of the beam = 1.0 1.0 Ball’s moment of inertia = 10−6 Ball position coordinate Beam angle coordinate Servo gear angle



2

2

The Lagrangian equation of motion for the ball is given by

   +      + −   2

2

= 0

Linearization of this equation about the beam angle,

 = 0, gives the following linear approximation of the system:

   +      = − 2

The equation which relates the beam angle to the angle of the gear can be approximated by the linear relationship

 =   Hence, the following simplified dynamics can be obtained:

   +      = −  

(1)

2

II.

DESIGN CRITERIA  

≤ 

Settling time 2 Overshoot 4%

Ramin Shamshiri



EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

3

III.

PROBLEM STATEMENT

For a step input of  1. 2. 3. 4. 5. 6. 7.

0.25/ / you are required to:  = 0.25

   )

Draw the block diagram of the closed loop system labeling all the signals (e.g.,  , , , Determine the transfer function between  and ( ) using the set of equations in (1) Check the stability of the open-loop and closed-loop systems. Draw the root locus of the given system Design a Lead-Lag Compensator PID Controller Using Bode plots determine the gain and phase margins for the closed-loop system.

Ramin Shamshiri





EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

4

Report: The purpose of this project was to control ball position on a beam by varying the angle of a servo gear connected to the beam through a lever arm. A linear differential equation describing the dynamic of the ball and beam to model (transfer function) the relation between input ( ) and output ( ) was first derived using basic laws of physic. This transfer function was used to analyze the performance of the system and to design proper controllers (Lead compensator and PID) to meet the design criteria. The locations of the desired poles were found from the design criteria (settling time, percent overshoot). Using root locus, it was found that a lead compensator is required to meet this design criteria and to place poles in the desired locations. The result of  the lead compensator on the closed loop response of the system is shown in figure 2. Using this controller, settling time of 1.59 seconds and percent overshoot of 4% and zero steady state error were achieved. PD controller was also used in this problem to meet the design criteria. Using a trial and error approach, PD gains were first tuned and implemented. The closed loop response of the PD controller is shown in figure 3. A settling time of 1.43 seconds with 3.74% percent overshoot and zero steady state error were achieved with PD controller. Details of the design procedure and MATLAB code are shown in the following pages.





Figure 2. Ball and beam control with Lead compensator.

Figure 3. Ball and beam beam control with PD controller. controller.

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

5

I.

Block diagram of the closed loop system labeling all the signals (e.g.,

 , , , )

The block diagram of the closed loop system is shown in figure 4.

Figure 4. Closed loop block diagram.

II.

Determine the transfer function between

 and () using the set of equations in (1)

We can find the open loop transfer function by taking the Laplace transform from both sides of equation (1).

ℒ    +       = ℒ−      +    () = −  () 2

2

2

 = −  ()   +   

(2)

Replacing the given constants values of the ball and beam system in equation (2) yields the open-loop transfer function with

θ(s) as input and Rs as output. This equation indicates the behavior of the ball and beam for any servo gear angle.  = .  () 

(3)

Entering the above transfer function in Matlab: % m R g L d J

Ball and Beam constants = 0.15; % mass of the ball = 0.015; % radius of the ball = -9.8; % gravitational acceleration = 1.0; % length of the beam = 0.05; % lever arm offset = 1e-6; % ball’s moment of inertia

K = (m*g*d)/(L*(J/R^2+m));

%simplifies input

% Open loop Transfer Function num = [-K]; den = [1 0 0]; disp('Open disp('Open loop Transfer function without controller') controller') TF_BallBeam=tf(num,den)

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

6

The closed loop transfer function that indicates the relationship between

 = .   1 +   0.4759  = 0.4759 1+ 

 and () can be determined from Figure 4.

Figure 5. Closed loop block diagram of Ball and beam.

2

2

 = .    + . 

(4)

The following Matlab code can was used to determine the closed loop transfer function with a constant gain K=1. % Closed loop Transfer function of Ball and beam cloop(num,den);

Figure 6. Open loop response of ball and beam without controller.

Figure 7. Closed loop response of ball and beam without controller.

As it can be seen from the system response, our system is unstable and we need a controller to greatly improve performance, i.e. steady state and settling time. Before designing the controller, we need to check the stability of the system as well as controllability and observability.

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

7

III.

Check the stability of the open-loop and closed-loop systems.

The Routh-Hurwitz criterion which uses the coefficients of the characteristic equation was used to test the stability of the system. For this reason, the following Matlab code was written and used.

%========================================================================= % Routh-Hurwitz Stability Criterion % Reference: % Modern Control system, Richard Dorf, 11th Edition, pages 360-366 % % The Routh-Hurwitz criterion states that the number of roots of D(s) with % positive real part is equal to the number of changes in sign of the first % column of the root array. % % The necessary and sufficient requirement for a system to be "Stable" is % that there should be no changes in sign in the first column of the Routh % array. %========================================================================= % % % % %

======Example 6.2. Page 363 ====== Checking the stability of D=s^3 +s^2 + 2s +24 Solution: >> D=[1 1 2 24]; ================================== ===================== =============

%++++++++++++++++++++++++++++++++++ % Nov.25.2009, Ramin Shamshiri + % [email protected] + % Dept of Ag & Bio Eng + % University of Florida + % Gainesville, Florida + %++++++++++++++++++++++++++++++++++ clc; disp(' disp(' ') D=input('Input D=input('Input coefficients of characteristic equation,i.e:[an an-1 an-2 ... a0]= '); l=length (D); disp(' disp(' ') disp('----------------------------------------' disp('----------------------------------------') disp('Roots disp('Roots of characteristic equation is:') is:') roots(D) %%=======================Program %%=======================Pr ogram Begin====================== Begin========================== ==== % --------------------------------------Begin -Begin of Bulding array-------------------------------if mod(l,2)==0 m=zeros(l,l/2); [cols,rows]=size(m); for i=1:rows m(1,i)=D(1,(2*i)-1); m(2,i)=D(1,(2*i)); end else m=zeros(l,(l+1)/2); [cols,rows]=size(m); for i=1:rows m(1,i)=D(1,(2*i)-1); end for i=1:((l-1)/2) m(2,i)=D(1,(2*i)); end end

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

8

for j=3:cols if m(j-1,1)==0 m(j-1,1)=0.001; end for i=1:rows-1 m(j,i)=(-1/m(j-1,1))*det([m(j-2,1) m(j,i)=(-1/m(j-1,1))* det([m(j-2,1) m(j- 2,i+1);m(j-1,1) m(j-1,i+1)]); end end disp('--------The disp('--------The Routh-Hurwitz array is:--------'),m % --------------------End of Bulding a rray-------------------------rray------------------------------------% Checking for sign change Temp=sign(m);a=0; for j=1:cols a=a+Temp(j,1); end if a==cols disp(' disp(' ----> System is Stable System is Unstable System is Unstable System is Stable System is NOT Controllable System is NOT Observable System is Controllable System is Observable Observable > rlocus(num,den)

Figure 8. Root locus plot of Ball and beam transfer function without controller.

We can decide about using lead/lag compensator from the root locus plot. If the root locus should be shifted to the right, we will need a lag compensator and if the root locus should be shifted to the left to place poles at the desired locations, we will need lead compensator.

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

11

V.

Design a Lead-Lag Co mpensator

Figure 9. Closed loop block diagram.

 = () = .   From the closed loop block diagram in figure 9 and the system transfer function, the actual characteristic equation of the closed loop system is:

∆  =  ≤ 



Design criteria are settling time 2 , overshoot 4 % . Using the equations for settling time and percent overshot given in (11) and (12), we can determine the desired damping ratio ( ) and natural frequency (  ) as follow:

 = 4  = 1.5  . . = 100−   − / 1





(5) 2

(6)

Therefore:

−   − = 4 −   − = 0.04 0.04 −  1 −  ln () = l n (0.04)  = .   = .  2

/ 1

100

/ 1

2

2

Using the desired natural frequency and damping ration, the desired characteristic equation to achieve 2 second settling time and maximum 4% of overshoot will become:

∆ =  + 2  +  (7) ∆=  + 5.33  + . −.   5.33 + .  =  + .  + .  Now our goal is to place closed loop poles at s = −2.66 2.66 ± 2.602 2.602 . In order to do that, we should first check if we need a 2

2

1,2

simple constant gain (K) or a lead/lag compensator to place poles at the desired locations. This can be checked either from root-locus or angle condition. It can be seen from figure (4) that the root locus does not go through the desired poles. Using the angle condition, we can also see that the desired poles does not satisfy the angle condition for the actual characteristic equation.

∠ ∠ = ∠ − 1 = ±1802 + 1, ∀ = 0,1,2 0,1,2,3, ,3, …

or

∠−∠ = ±180 ±180 (−∠−∠)− = −∠ − 2.66 2.66 + 2.602 2.602jj − ∠ − 2.66 2.66 + 2.602 2.602jj 2.602 2.602 −−  2.66 −−  2.66  = −44.3 − 44.3 44.3 = −88.6 ≠ ±180 2.66+2.602j

1

Ramin Shamshiri

1

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

12

From root locus and the location of desired closed loop pole, it can be found that a lead compensator is needed to shift the current root locus to left. The transfer function of a lead compensator is of the form

  =    ,  < . +

1

+

Multiplying the lead compensator transfer function to the the Ball and beam TF yields;

( + )   = 0.4759  + ( ) 1

2

Using coefficient matching, we can place the closed loop poles at the desired locations;

∆  = ∆

0.4759 59( + ) ∆  = + ( ) + 0.47 =  +  + .  + .  5.33 + 13.88)( 13.88)( +  ) ∆ = ( + 5.33  + .  =  + .  +  + .  + .   = 5.33 +  0.4759  = 13.8 13.88 8 + 5.33 5.33 0.4759  = 13.8 13.88 8 2

2

Since we have three equations and four unknowns ( a,b,c,K), we have one degree of design flexibility. Let’s assume a = 0.00 0.0000 001 1 therefore:

 = . ,  = . ,  + 0.00001 0.00001   = 29.1 29.17 7  + 5.33 5.33

Ramin Shamshiri

EML 4312, Control of Mechanical Engineering Systems

st

Due Dec 1 2009

13

Testing the performance of the Lead controller: The following Matlab code was written to test the performance of the system with the designed lag controller. The corresponding plots are shown in figure 10 through 12.

% Design Criteria Ts=1.5; % Settling time
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF