ecse 4440 control system engineering project 1

12
ECSE 4440 Control System Engineering Project 1 Controller Design of a Second Order System TA Contents 1. Abstract 2. Introduction 3. Controller Design for a Single Pendulum 4. Conclusion

Upload: others

Post on 12-Jun-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECSE 4440 Control System Engineering Project 1

ECSE 4440 Control System Engineering

Project 1

Controller Design of a Second Order System TA

Contents 1. Abstract 2. Introduction 3. Controller Design for a Single Pendulum 4. Conclusion

Page 2: ECSE 4440 Control System Engineering Project 1

2

1. Abstract The purpose of this project is to design a controller for a second order system(the most common prototype control problem). A Proportional Integral derivative(PID) will be adopted for the give system. The study will be approached analytically and experimentally. 2. Introduction Practically, there are few systems that don’t have any control system inside. More complicated become systems, more sophisticated controllers are needed. To design a controller, several issues should be considered e.g., modeling, system performance, tuning gain and stability. For a simple second order system, those issues will be studied in this project. The given single pendulum system is a basic second order system to be controlled. The system will be modeled as a linear system. The poles and zeros of the system will be found to test the stability of the given system. The controller will be

developed in the order of proportional(P) controller, proportional-derivative(PD) controller-proportional and proportional- integral-derivative(PID) controller. To meet the given specifications and stability, the gains will be tuned. The controllers will be implemented in continuous time domain(S plane) and in discrete time domain(Z plane), respectively. The analytical controller will be verified by simulation with simulink of Matlab. 3. Controller Design for A Single Pendulum 3.1 Linearization(Task 1) The analysis and control design are far easier for the linear than for nonlinear models. Linearization is the process of finding a linear mode that approximates a nonlinear one. Linearization process depends on the expanding the nonlinear state equation in to a Taylor series. In the given dynamic equation (1), two non- linear functions exist,

e.g., θθ sin),sgn(.

.

( ) KvmglFFmlII gcvgm ==+++++ τθθθθ sin)sgn(....

22 (1)

Parameter Name Value

m Mass .048Kg I Link Inertia .000187 Kg m2

mI Motor Inertia 2.2e-7 Kg m2

gl Distance .051 m

N Gear Ratio 70.35

cF Coulomb Friction Coefficient .014 N-m

vF Viscous Friction Coefficient .0034 N-m-sec

K Torque Constant .01447

Page 3: ECSE 4440 Control System Engineering Project 1

3

)sgn(.

θ can be set to be zero since at the equilibrium state, .0.

=θ For θsin , the first two terms(linear terms) of the Taylor series expansion(2) are used.

( ) ( ) ⋅⋅⋅⋅+−−−+= 2sin5.cossinsin θθθθθθθθ (2) The the linearized system becomes

( ) desgdesgvgm mglmglFmlINI θτθθθθ sincos...

22 −=∆+∆+∆++ (3)

where ( )desθθθ −=∆ The Laplace transform of the equation is

( ) ( ) ( )ssmglsFs desgv Ι=Θ++ θα cos2 (4)

where 22gm mlINI ++=α and I(s) is the Laplace transform of desgmgl θτ sin− .

Then, the transfer function of the system is

desgv mglsFssIs

sHθα cos

1

)(

)()(

2 ++=Θ= (5)

From the transfer function, it has poles at

2

cos4

2

αθ

ααdesgvv

mglFF

s

±−

= (6)

and no zeros. For the system to be stable, every poles should be in left hand side of s-plane. In the equation (6), 0cos >desθ is the condition for the system to be stable. In

other words, πθππθ 22

3

20 <<<< desdes or . With those given parameter values and

2

πθ =des , the poles are at 0 and -4.8549 and for πθ =des , poles are at 6.1984 and

-11.0532. Therefore the system is marginally stable or unstable by itself. 3.2 Implementation Simulink diagram for the given system and the top level diagram(with PID Controller) are shown in Figure 1 and Figure 2. The parameters are defined in the file ‘pendinit.m’. To initialize the parameters, the subsystem block(initialization) is in the system.

Page 4: ECSE 4440 Control System Engineering Project 1

4

Figure 1

Figure 2

With only the single pendulum system, the step response goes infinity in figure 3.

Figure 3

3.3 P Feed Back Controller(task 3)

Page 5: ECSE 4440 Control System Engineering Project 1

5

As a basic controller operation, the controller is simply an amplifier with a constant gain pK and a feedback loop, ( )despK θθτ −−= . Hence the output of P controller is

related with the input of the controller by a proportional constant. Adding a P controller to the given system results in changing the transfer function of overall system such as

pdesgvdes

pdesgv KmglsFasd

KmglsFss

++++

+++=

θθ

θαθ

coscos 22 (7)

where disturbance desgmgld θsin−= .

From (7), the location of the poles depends on the given parameters and pK . The

poles are

2

cos4

2

αθ

ααpdesgvv

KmglFF

s

+−

±−

= (8)

The locations of the poles are changing by varying pK . If desgp mglK θcos> , the system

becomes stable. With given parameters and pK = 5, the poles are located at

i1194274.2 ± for πθ =des and 2

πθ =des such that the system is stable. The analytical

result is verified by the simulation( pK =5, iK =0 and iK =0). In figure 4, the system is

stable for both values.

Figure 4

3.4 PD Feed Back Controller(task 4) Even though the system with P controller is stable, the output has relatively high peak overshoot and is oscillating. The oscillation results from the excessive amount of

Page 6: ECSE 4440 Control System Engineering Project 1

6

torque and the lack of damping. Adding the derivative of the input makes the system critical damped. In the equation (9), the locations of poles are

2

cos4

2

αθ

ααpdesgdvdv

KmglKFKF

s

+−

+

±+

−= (9)

As it is shown in (9), tuning dK and pK make it possible for the system to meet the

given specifications e.g., rise time (90%), settling time (2%) small overshoot(less 5%) and steady state error(less then 2%). Once the inside of the square root is negative, the damping depends on its magnitude. For fixed 1.=dK , the step responses are shown for various pK values in the figure 5.

Figure 5

The plots show increasing pK results in decreasing rise time( pK =1,10) but

increasing overshoot( pK =10).

For fixed pK =1 in the figure 6, the step responses are shown for various dK values.

Page 7: ECSE 4440 Control System Engineering Project 1

7

Figure 6

In the figure, decreasing dK values leads to decrease the rise time. For the given

specification, dK =.1 and pK =2 make the system meet the specifications very well in

Figure 7.

Figure 7

From the given transfer function for the system with PD controller (10), steady state error can be calculated by setting .0=s

( ) ( ) pdesgdvdes

pdesgdv KmglsKFasd

KmglsKFss

+++++

++++=

θθ

θαθ

coscos 22

where desgmgld θsin−= (10)

Therefore the steady state error is the function of desθ in (11).

pdesg

desgss Kmgl

mgle

+−

θcos

sin (11)

Page 8: ECSE 4440 Control System Engineering Project 1

8

With simulation with the parameters 2πθ =des , pK =1, the error in Figure 8 is almost

same with .024 calculated by (11).

Figure 8

3.5 Washout Filter Design(task 5)

In practice, .

θ is not measured. In stead of that, one high pass filter which has one zero at the origin in feedback loop.

t1

t i m e

s

s+3

T r a n s f e r F c n

t h e t a

T o W o r k s p a c e

T e r m i n a t o r

S u b S y s t e m

S t e p

In1

t h e t a

the tado t

S i n g l e

P e n d u l u m

S i m u l a t o r

S c o p e

K p . s + K i

s

P I c o n t r o l

K d

G a i n

C l o c k

d o u b l e d o u b l e

d o u b l e

d o u b l e

d o u b l e

d o u b l e

d o u b l e

d o u b l e

d o u b l e

Figure 8-1

The step response of the washout filter controller is oscillated at transient part and has damping. But the filter reduces the steady state error in Figure 8-2.

Page 9: ECSE 4440 Control System Engineering Project 1

9

Figure 8-2

3.6 PD controller in sample data implementation(task 6) So far, the controller has been implemented in continuous time domain. The discrete implementation, however, becomes more popular by appearing computers and small digital microprocessors. In continuous domain, a differential equation can be

approximated with a difference equation e.g., ( ) ( ) ( )( ) stkkk /1−−≈•

θθθ .

With the approximation, the PD controller system is implemented in figure 9.

Figure 9

The simulation result is well approximated in sampled data implementation in figure 10.

Page 10: ECSE 4440 Control System Engineering Project 1

10

Figure 10

3.7 PID controller in continuous and sampled data implementation (task 7,8) To compensate the steady state error, the integral controller should be added. One obvious effect of the integral control is that it increases the type of the system by one; that is, if the steady-state error to a given input is constant, the integral control reduces it to zeros. The transfer function of the PID controller system is

( ) ( ) ( ) ( ) iddesgdvdes

ipdesgdv

idd

KsKmglsKFasds

KsKmglsKFs

KsKsK

++++++

+++++++

θθα

θcoscos 323

2

where desgmgld θsin−= (12)

then 0→

−sdes θθ goes to zero as 0→S . In other word, the integral controller

compensates steady state error. The continuous and sampled data implemented PID controllers are simulated and compared in figure 11 and figure 12.

t1

t i m e

t h e t a

T o W o r k s p a c e

S u b S y s t e m

S t e p

I n 1

t h e t a

t h e t a d o t

S i n g l e

P e n d u l u m

S i m u l a t o r

S c o p e

K p . s + K i

s

P I c o n t r o l

K dG a i n

C l o c k

d o u b l e d o u b l e d o u b l e d o u b l e

d o u b l e

d o u b l e

d o u b l e

d o u b l e

Figure 11

Page 11: ECSE 4440 Control System Engineering Project 1

11

The performances of both controllers meet the given specifications in figure 12 and figure 13.

Figure 13

Figure 14

Parameter Continuous Controller Sampled ZOH controller πθ =des 2/πθ =des πθ =des 2/πθ =des

Overshoot(%) 4.42 3.5 4.37 3.45

pt (sec) .27 .354 .269 .368

rt (sec) .079 .079 .079 .08

st (sec) 1.113 1.053 1.113 1.056 Steady error (%) 1.4e-4 1.5e-4 1.47e-4 1.57e-4

3.8 Tracking(task 9)

Up to now, the input has been a step function. But in real system, the input tends to be a time varying function such as a sinusoidal function. The given input ( ) ( )ttdes ππθ 4sin=

Page 12: ECSE 4440 Control System Engineering Project 1

12

increases the transfer function by 2 because the Laplace transform of the input is

22

2

16

4

ππ

+s. The total system becomes (13).

( ) ( )

( ) ( ) iddesgdv

ipdesgdv

idd

KsKmglsKFas

ds

sKsKmglsKFs

KsKsK

+++++

++

⋅+++++

++=

θ

ππ

θαθ

cos

16

4

cos

3

22

2

23

2

(13)

As shown in (13), the system is a fifth order system. First of all, dominant second order system needs to be found which has the poles most close to imaginary axis. Then tuning the poles of the second system to make the system meet the specifications. With the same gains with task 8, the output is shown in Figure 15.

Figure 15

3.9 Experimental 4. Conclusion In this project, the controller design of a second order system(a single pendulum) has been studied. As a controller, PID controller has been adopted. Mathematical analysis of the transfer function has been used and simulation justify the analysis. Even though, a PID controller is simple, the robust of the controller has been experienced and justified.