Electrical Engineering Projects

Compensation Example

Home
Hybrid Solar RC Vehicle
MOTOMAN SV3 Revamp Project
Compensation Example
Under Construction
Under Construction
Under Construction
Under Construction
Under Construction

Compensation Example

 

Back to Electrical Engineering Projects home page.

 

Contents:

  • The Problem
  • Root Locus Before Compensation
  • Mapping of Poles and Zeros After Compensation
  • Root Locus Plot After Compensation
  • Bode Plot After Compensation
  • Step Response After Compensation
  • Design Process

 

 

The Problem

f)          For the given plant G(s), a set of specifications are given.  You are to design a compensator to satisfy the specs.

image050.gif

Specs: %O.S. ≈10%  ,    Ts≈2 sec   ,   PM≈40 degrees

 

 

Root Locus Before Compensation

image055.gif

                                  Figure 1.0

 

Figure 1.0 is a plot of the given plant G(s) before compensation.

 

 

Mapping of Poles and Zeros After Compensation

image057.gif

                       Figure 1.1

 

Figure 1.1 is a mapping of the poles and zeros for G(s) after compensation.

 

Root Locus Plot After Compensation

image059.gif

                               Figure 1.2

 

Figure 1.2 is the root locus of G(s) after compensation.

 

 

 

Bode Plot After Compensation

image061.gif

                                   Figure 1.3

 

Figure 1.3 is a Bode plot of G(s) after compensation.  The specifications asked for a phase margin of approximatly 40. The phase margin that I ended up with after compensation is 40.4.

 

 

Step Response After Compensation

image063.gif

                                                                                Figure 1.4

Figure 1.4 is the closed loop step response of G(s) after compensation.  The specifications asked for an percent overshoot less than or equal to 10%, and settling time less than or equal to 2 seconds.  After compensation the percent overshoot that I got is 5.19%, and a the settling time is 1.39 seconds.

       

 

Design Process

 

>> g=tf([100],[1,10,0,0])

 

Transfer function:

    100

------------

s^3 + 10 s^2

 

>> k=tf([1,0],[1,11])

 

Transfer function:

  s

------

s + 11

 

>> kg=k*g*30*.8

 

Transfer function:

        2400 s

---------------------------

s^4 + 21 s^3 + 110 s^2

 

>> k1=tf([3.68,3.68*5.476],[1,20.16])

 

Transfer function:

3.68 s + 20.15

--------------

  s + 20.16

 

>> kg1=kg*k1

 

Transfer function:

        8832 s^2 + 4.836e004 s

--------------------------------------------------

s^5 + 41.16 s^4 + 533.4 s^3 + 2218 s^2

 

>> kg11=kg1*.349

 

Transfer function:

        3082 s^2 + 1.688e004 s

---------------------------------------------------

s^5 + 41.16 s^4 + 533.4 s^3 + 2218 s^2

 

 

>> k2=tf([1,11],[1,64])

 

Transfer function:

s + 11

------

s + 64

 

>> k3=tf([1,10],[1,85])

 

Transfer function:

s + 10

------

s + 85

 

>> kg111=kg11*k2*k3

 

Transfer function:

 

        3082 s^4 + 8.161e004 s^3 + 6.935e005 s^2 + 1.857e006 s

-------------------------------------------------------------------------------------------------------------

s^7 + 190.2 s^6 + 1.211e004 s^5 + 3.056e005 s^4 + 3.232e006 s^3 + 1.206e007 s^2     

                                                                       

                                                                                                                    

>> kg2=kg111*6.94

 

Transfer function:

 

      2.139e004 s^4 + 5.664e005 s^3 + 4.813e006 s^2 + 1.289e007 s

-------------------------------------------------------------------------------------------------------------

s^7 + 190.2 s^6 + 1.211e004 s^5 + 3.056e005 s^4 + 3.232e006 s^3 + 1.206e007 s^2      

                                                                       

                                                                                                                          

 

>> k4=tf([1,5.476],[1])

 

Transfer function:

s + 5.476

 

>> kg3=kg2*k4

 

Transfer function:

 

2.139e004 s^5 + 6.835e005 s^4 + 7.914e006 s^3 + 3.924e007 s^2 + 7.056e007 s                                                                                                                                                                                                          

-------------------------------------------------------------------------------------------------------------

s^7 + 190.2 s^6 + 1.211e004 s^5 + 3.056e005 s^4 + 3.232e006 s^3 + 1.206e007 s^2     

                                                                                                                                                                                       

 

>> kg4=kg3*.233

 

Transfer function:

 

4984 s^5 + 1.593e005 s^4 + 1.844e006 s^3 + 9.143e006 s^2 + 1.644e007 s

-------------------------------------------------------------------------------------------------------------

s^7 + 190.2 s^6 + 1.211e004 s^5 + 3.056e005 s^4 + 3.232e006 s^3 + 1.206e007 s^2

                                                                       

                                                                                                                      

>> k5=tf([1],[1,80])

 

Transfer function:

  1

------

s + 80

>> kg5=kg4*k5

 

Transfer function:

 

   4984 s^5 + 1.593e005 s^4 + 1.844e006 s^3 + 9.143e006 s^2 + 1.644e007 s

------------------------------------------------------------------------------------------------------------------------------

s^8 + 270.2 s^7 + 27319 s^6 + 1.274e006 s^5 + 2.768e007 s^4 + 2.706e008 s^3 + 9.651e008 s^2

                                                                                                                                                                                                   

>> kg6=kg5*311

 

Transfer function:

 

  1.55e006 s^5 + 4.953e007 s^4 + 5.735e008 s^3 + 2.844e009 s^2 + 5.113e009 s                                                                                                                                                                                                              

------------------------------------------------------------------------------------------------------------------------------

s^8 + 270.2 s^7 + 27319 s^6 + 1.274e006 s^5 + 2.768e007 s^4 + 2.706e008 s^3 + 9.651e008 s^2

                                                                                                                                                                                                             

>> figure(10)

>> bode(kg6)

margin(kg6)

figure(11)

t=minreal(kg6/(1+kg6))

 

Transfer function:

 

 1.55e006 s^4 + 4.798e007 s^3 + 5.41e008 s^2 + 2.627e009 s + 4.648e009

--------------------------------------------------------------------------------------------------------------------------------------------

s^7 + 269.2 s^6 + 2.706e004 s^5 + 2.8e006 s^4 + 7.465e007 s^3 + 7.95e008 s^2 + 3.505e009 s + 4.648e009    

                                                                                                                                                                    

>> step(t)

 

>> figure(3)

>> rlocus(kg6)

>> pole(kg6)

 

ans =

 

         0

         0

  -85.0000

  -80.0000

  -64.0000

  -20.1600

  -11.0000

  -10.0000

 

>> zero(kg6)

 

ans =

 

         0

  -11.0000

  -10.0000

   -5.4760

   -5.4760

 

End of Compensation Example