Simulation and Implementation of Servo Motor Control with Sliding Mode Control (SMC) using Matlab and LabView Bondhan Novandy http://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 equal to 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 DAC 0 10 V x22 Inverter 0 220V/0 50 Hz AC Servo Motor Encoder Position, Speed, Acceleration
Mathematical Modeling Position control: di dθ Ia * Ra + La * + Kb = V...(1) dt dt 2 d θ dθ T TLoad = Kt * Ia TLoad = Tj + Tb = J + B...(2) 2 dt dt 2 1 d θ dθ ( 2 Load )...(3) Ia = J + B + T Kt dt dt
Mathematical Modeling Cont d (3) (1) 2 2 Ra d d La d d d d ( ) ( ) 2 Load 2 Load θ θ θ θ θ J + B + T + J + B + T + Kb = V Kt dt dt Kt dt dt dt dt θ θ θ θ θ + + T + + + T + Kb = V Kt dt Kt dt Kt Kt dt Kt dt Kt dt 2 3 2 J* Rad B* Rad Ra J* Lad B* Lad La d ' 2 Load 3 2 Load Finally we get (4): θ1= θ2 θ = θ 2 3 Kt B Ra Ra * B Kb* Kt 1La Ra θ3= V θ3 θ3 θ2 θ2 T' Load T J* La J La La* J La* J J Kt La* J Load
Sliding Surface We have 3 rd order system d s = + = dt n 1 ( λ) θ, choosing n=3 and θ θ θd is tracking error d 2 = ( + λ) θ dt 2 d θ d θ 2 = ( + 2 λ + λ θ) 2 dt dt 2 = θ + 2λθ + λ θ = θ θ + λ θ θ + λ θ θ 2 ( d) 2 ( d) ( d)
Equivalent Control We try to force the state trajectory to slide on our surface so that: s = 0 s = + + 2 ( θ θd) 2 λ( θ θd) λ ( θ θd) s = Kt B Ra Ra* B Kb* Kt 1 La 0 = V θ3 θ3 θ2 θ2 T' Load J* La J La La* J La* J J Kt Ra 2 T Load θd + 2 λ( θ3 θd ) + λ ( θ2 θd ) La* J B* La La Ra * J Ra* B Ra La* J Veq = θ3 + T' Load + θ3 + θ2 + TLoad + Kb* θ2 + θd Kt Kt Kt Kt Kt Kt La* J 2 La* J 2 λ ( θ3 θd) λ ( θ2 θd) Kt Kt 0
SMC Controller V = V + V, where V = K* sat( s/ φ) eq switching switching and sat is the function: sign( s) if abs( s) s/ φ if abs( s) < φ > φ B* La La Ra* J Ra* B Ra La* J Veq = θ3+ T' Load + θ3+ θ2 + TLoad + Kb* θ2 + θd Kt Kt Kt Kt Kt Kt La* J 2 La* J 2 λ ( θ3 θd) λ ( θ2 θd) K* sat( s/ φ) Kt 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: 1 2 V = s 0 2 Kt B Ra Ra* B Kb* Kt 1 La V = ss = s( V θ3 θ3 θ2 θ2 T' J* La J La La* J La* J J Kt Ra 2 T Load θd + 2 λ( θ3 θd ) + λ ( θ2 θd ) K * sat ( s / φ)) La* J V = s( f K* sat( s/ φ)) = f * s K s 0 Load
Simulation Using Matlab Plant parameter: j=0.01; b=0.1; Kt=0.01; Kb=0.29098; Ra=1; La=0.5; x2 0-0.2-0.4-0.6 phase portrait -0.8 The unity feedback transfer function is: 2 ------------------ s^2 + 12 s + 22.58-1 -1.2-1.4 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x1
Transient Response Without Stability Analysis (Linear System) Controllability: % Number of uncontrollable states >> unco = length(a)-rank(ctrb(a,b)) unco = 0 Observability: % Number of unobservable states unob = length(a)-rank(ob) unob = 0 Thus the system is stable. Controller 0.14 Impulse Response 0.09 Step Response 0.08 0.12 0.07 0.1 0.06 Amplitude 0.08 0.06 Amplitude 0.05 0.04 0.04 0.03 0.02 0.02 0.01 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (sec) 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (sec)
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: q0= a0+ a1* t+ a2* t + a3* t + a3* t + a5* t where : q0 = start position qf = final position v0 = start velocity fv = final velociy α0 = start acceleration α f = final acceleration 2 3 4 5
Quintic polynomial trajectory for position, velocity and acceleration
Trajectory Following Response K = 80; Lambda = 10; delta = 0.9;
Error
Simulation Using LabView Trajectory Generator
Simulation Using LabView SMC controller plant
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 control s t d n 1 ( λ) θ, choosing n=4 and θ θ θd is tracking error dt 0 = + =