30
Simulation and Implementation of Servo Motor Control with Sliding Mode Control (SMC) using Matlab and LabView Bondhan Novandy http://bono02.wordpress.com/

and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Simulation and Implementation of  Servo Motor Control 

with Sliding Mode Control (SMC) using Matlab

and LabView

Bondhan

Novandyhttp://bono02.wordpress.com/

Page 2: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Outline

• Background• Motivation• AC Servo Motor• Inverter & Controller• Hardware Block Diagram• Mathematical Modeling• Sliding Mode Controller Design• Simulation using Matlab• Simulation & Implementation using LabView• Several Ideas

Page 3: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Motivation

• Sliding Mode Control is a robust control scheme based on 

the concept of changing the structure of the controller in 

response to the changing state of the system in order to 

obtain a desired response • The biggest advantage of SMC is its insensitivity to variation 

in system parameters, external disturbances and modeling 

errors• This can be achieved by forcing the state trajectory of the 

plant to the desired surface and maintain the plants state 

trajectory on this surface for subsequent time• Because of these factors SMC is chosen as the controller 

for our device

Page 4: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

AC Servo Motor

• The difference between AC Servo Motor and DC servo motor 

is the design of the motor where in AC motor the permanent 

magnet is on the rotor. The block diagram of an AC servo 

motor is very similar to the block diagram of DC servo motor:

Page 5: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

AC Servo Motor

Page 6: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Inverter and Controller

• Inverter is used to transform electricity from 1 single phase 

into 3 phase

• It works by controlling the rotational speed of an AC motor by 

controlling the frequency of the electrical power supplied to 

the motor

• Our inverter the we use the linear V/F mode

Output max voltage is equalto max input voltage = 220 V RMS

The default frequency is 50 Hz

Page 7: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Inverter and Controller Cont’d• Analog input voltage 0‐

10 V is used to change  the volt/frequency of 

the inverter output

• The scale between  input : output = 10 : 220 

depending on the  configuration of V/F

• NI‐PXI 7358 is chosen as  the controller and it has  DAC 0‐10 output

Page 8: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Hardware Block Diagram

PXI‐7358 InverterAC Servo 

Motor

Encoder

DAC 0‐10 V 0‐220V/0‐50 Hz

Position, Speed, Acceleration

x22

Page 9: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Mathematical Modeling

2

2

2

2

* * ...(1)

* ...(2)

1 ( )...(3)

Load Load

Load

dI dIa Ra La Kb Vdt dt

d dT T Kt Ia T Tj Tb J Bdt dt

d dIa J B TKt dt dt

θ

θ θ

θ θ

+ + =

− = − = + = +

= + +

Position control:

Page 10: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Mathematical Modeling Cont’d

1 2

2 3

3 3 3 2 2* * 1 '

* * * *Load LoadKt B Ra Ra B Kb Kt La RaV T T

J La J La La J La J J Kt La J

θ θ

θ θ

θ θ θ θ θ

=

=

= − − − − − −

2 2

2 2

2 3 2

2 3 2

(3) (1)

( ) ( )

* * * * '

Load Load

Load Load

Ra d d La d d d dJ B T J B T Kb VKt dt dt Kt dt dt dt dtJ Ra d B Ra d Ra J La d B La d La dT T Kb V

Kt dt Kt dt Kt Kt dt Kt dt Kt dt

θ θ θ θ θ

θ θ θ θ θ

+ + + + + + =

+ + + + + + =

Finally we get (4):

Page 11: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Sliding Surface

• We have 3rd

order system1( ) , choosing n=3 and is tracking errorn

ddsdt

λ θ θ θ θ−= + = −

2

22

2

2

2

( )

( 2 )

2

( ) 2 ( ) ( )d d d

ddtd ddt dt

λ θ

θ θλ λ θ

θ λθ λ θ

θ θ λ θ θ λ θ θ

= +

= + +

= + +

= − + − + −

Page 12: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Equivalent Control

• We try to force the state trajectory to slide on  our surface so that: 0

0ss==

2

3 3 2 2

23 2

3 3 2 2

( ) 2 ( ) ( )* * 10 '

* * *

2 ( ) ( )*

* * * *' *

d d d

Load

Load d d d

eq Load Load

sKt B Ra Ra B Kb Kt LaV T

J La J La La J La J J KtRa T

La JB La La Ra J Ra B Ra La JV T T Kb

Kt Kt Kt Kt Kt K

θ θ λ θ θ λ θ θ

θ θ θ θ

θ λ θ θ λ θ θ

θ θ θ θ

= − + − + −

= − − − − −

− − + − + −

= + + + + + +

23 2

* *2 ( ) ( )

d

d d

tLa J La J

Kt Kt

θ

λ θ θ λ θ θ− − − −

Page 13: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

SMC Controller

, * ( / )

and is the function: ( ) abs( ) / abs( )

eq switching switchingV V V where V K sat s

satsign s if ss if s

φ

φφ φ

= + = −

><

3 3 2 2

23 2

* * * *' *

* *2 ( ) ( ) * ( / )

eq Load Load d

d d

B La La Ra J Ra B Ra La JV T T KbKt Kt Kt Kt Kt Kt

La J La J K sat sKt Kt

θ θ θ θ θ

λ θ θ λ θ θ φ

= + + + + + +

− − − − −

Page 14: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Lyapunov

Function

If there exist Lyapunov

function, so that 

It is stable in the sense of Lyapunov

Page 15: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Stability

We ensure the stability of our system choosing K to be  large enough so that stable in the sense of Lyapunov.

Lyapunov

candidate:2

3 3 2 2

23 2

1 02

* * 1( '* * *

2 ( ) ( ) * ( / ))*( * ( / ))

*

Load

Load d d d

V s

Kt B Ra Ra B Kb Kt LaV ss s V TJ La J La La J La J J Kt

Ra T K sat sLa J

V s f K sat sf s K s

θ θ θ θ

θ λ θ θ λ θ θ φ

φ

=

= = − − − − −

− − + − + − −

= −

= − 0≤

Page 16: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Simulation Using Matlab

Plant parameter:j=0.01;b=0.1;Kt=0.01;Kb=0.29098;Ra=1;La=0.5;

The unity feedback transfer function is:

2------------------s^2 + 12 s + 22.58

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-1.4

-1.2

-1

-0.8

-0.6

-0.4

-0.2

0

x1

x2

phase portrait

Page 17: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Transient Response Without  Controller

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

0.02

0.04

0.06

0.08

0.1

0.12

0.14Impulse Response

Time (sec)

Ampl

itude

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09Step Response

Time (sec)

Ampl

itude

Stability Analysis (Linear System)Controllability:% Number of uncontrollable states>> unco = length(A)-rank(ctrb(A,B))unco =

0Observability:% Number of unobservable statesunob = length(A)-rank(Ob)unob =

0Thus the system is stable.

Page 18: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Simulation Result With SMC Controller

Page 19: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Step Response

K = 50;     Lambda = 10;   delta = 0.5;

Page 20: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Step Response

K = 100;     Lambda = 10;   delta = 0.9;

Page 21: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Trajectory Following

The trajectory is defined so that it will not produce shock while 

moving because of discontinuity.

Quintic

polynomial:

2 3 4 50 0 1* 2* 3* 3* 5*:

0 start positionfinal position

0 start velocityfinal velociy

0 start accelerationfinal acceleration

q a a t a t a t a t a twhereqqfvfv

fαα

= + + + + +

======

Page 22: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Quintic

polynomial trajectory for position, velocity and acceleration

Page 23: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Trajectory Following Response K = 80;     Lambda = 10;   delta = 0.9;

Page 24: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Error

Page 25: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Simulation Using LabViewTrajectory Generator

Page 26: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Simulation Using LabView

plantSMC controller

Page 27: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Step Response

Page 28: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Trajectory Response

Page 29: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Implementation

• Implementation in NI Real‐Time can be done  by replacing the runge‐kutta

ODE solver and 

array composition with the real motor which  is the SERVO Motor

• The feedback of the motor must be available  (encoder)

Page 30: and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation • Sliding Mode Control is a robust control scheme based on the concept of changing

Problems and Discussion

• Real‐time clock generation ‐> Sampling time 

• Motor parameters

• The feedback of the system are:– Position– Velocity– Acceleration *) In the simulation when acceleration feedback was defined 

as 0, the error is still small

• Integral sliding mode control1

0

( ) , choosing n=4 and is tracking errort

nd

dsdt

λ θ θ θ θ−= + = −∫