and Implementation of Servo Motor Sliding Mode Control Matlab … · 2008. 7. 5. · Motivation •...

Post on 24-Jan-2021

0 views 0 download

transcript

Simulation and Implementation of  Servo Motor Control 

with Sliding Mode Control (SMC) using Matlab

and LabView

Bondhan

Novandyhttp://bono02.wordpress.com/

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

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

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:

AC Servo Motor

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

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

Hardware Block Diagram

PXI‐7358 InverterAC Servo 

Motor

Encoder

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

Position, Speed, Acceleration

x22

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:

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):

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

λ θ

θ θλ λ θ

θ λθ λ θ

θ θ λ θ θ λ θ θ

= +

= + +

= + +

= − + − + −

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

θ

λ θ θ λ θ θ− − − −

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

θ θ θ θ θ

λ θ θ λ θ θ φ

= + + + + + +

− − − − −

Lyapunov

Function

If there exist Lyapunov

function, so that 

It is stable in the sense of Lyapunov

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≤

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

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.

Simulation Result With SMC Controller

Step Response

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

Step Response

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

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αα

= + + + + +

======

Quintic

polynomial trajectory for position, velocity and acceleration

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

Error

Simulation Using LabViewTrajectory Generator

Simulation Using LabView

plantSMC controller

Step Response

Trajectory Response

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)

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

λ θ θ θ θ−= + = −∫