59
Sliding Mode Control of a Non-Collocated Flexible System A Thesis Presented to The Academic Faculty by Aimee M. Beargie In Partial Fulfillment of the Requirements for the Degree Masters of Science in Mechanical Engineering The Woodruff School of Mechanical Engineering Georgia Institute of Technology November 2002

Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Sliding Mode Control of a

Non-Collocated Flexible System

A ThesisPresented to

The Academic Faculty

by

Aimee M. Beargie

In Partial Fulfillmentof the Requirements for the Degree

Masters of Science in Mechanical Engineering

The Woodruff School of Mechanical EngineeringGeorgia Institute of Technology

November 2002

Page 2: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Sliding Mode Control of a

Non-Collocated Flexible System

Approved by:

Doctor Wayne Book, Advisor

Doctor Nader Sadegh

Doctor Stephen Dickerson

Date Approved

Page 3: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

“One thing I’ve learned. You can know anything. It’s all there. You just have to find it.”

- Neil Gaiman, (John Constantine in Sandman #3: “Dream a Little Dream of Me”)

iii

Page 4: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

ACKNOWLEDGEMENTS

This research has been partially funded by CAMotion, Inc. and the National Science

Foundation.

I would like to thank Dr. Wayne Book for his guidance and insight in carrying out this

research. I would also like to thank the members of my committee for their advice and

suggestions throughout the development of this work.

Thank you to CAMotion, Inc. for the opportunity to work on this project. A special

thanks to Sungsoo and Scott for their time and help with the experimental set-up and

programming.

Thanks is also due to the members of the Intelligent Machine Dynamics Laboratory for

their friendship, support and assistance, including those who have come and gone through

the duration of this work.

In addition, the love and support of my family has been truly invaluable. Especially the

care packages that always seemed to arrive when I needed them the most. Finally, I would

like to thank Nick for his love, support, and patience this past year.

iv

Page 5: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

TABLE OF CONTENTS

DEDICATION iii

ACKNOWLEDGEMENTS iv

LIST OF TABLES vii

LIST OF FIGURES viii

SUMMARY ix

I INTRODUCTION 1

II SYSTEM MODEL 5

2.1 Two Mass Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2 Pendulum Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.3 Determining Pendulum Model Parameters . . . . . . . . . . . . . . . . . . 9

III VARIABLE STRUCTURE CONTROL 12

3.1 Sliding Surface Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.2 Switched State Feedback Control Design . . . . . . . . . . . . . . . . . . . 14

IV SIMULATION 18

4.1 Overview of Control System . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.2 Outer Loop (VSC) Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.3 Inner Loop (PID) Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4.4 Simulation Using Estimated States . . . . . . . . . . . . . . . . . . . . . . 22

4.5 Robustness of Control Strategy . . . . . . . . . . . . . . . . . . . . . . . . 24

V EXPERIMENTS 27

5.1 Experimental Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.2 Implementation of Variable Structure Control . . . . . . . . . . . . . . . . 28

5.3 Comparison to Other Control Methods . . . . . . . . . . . . . . . . . . . . 31

5.4 Robustness Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

VI CONCLUSIONS 34

6.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

6.2 Further Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

v

Page 6: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

APPENDIX A — MATLAB CODE 37

APPENDIX B — EQUIPMENT DATA SHEETS 44

REFERENCES 49

vi

Page 7: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

LIST OF TABLES

1 Two Mass Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Pendulum Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Kalman Filter Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4 Robustness Ranges for Pendulum Model Parameters . . . . . . . . . . . . . 25

5 PD Gain Conversion Factors . . . . . . . . . . . . . . . . . . . . . . . . . . 29

6 Tracking Error Comparison of Control Methods . . . . . . . . . . . . . . . . 32

vii

Page 8: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

LIST OF FIGURES

1 Two Mass Model Schematic [18] . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Pendulum Model Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Measurement of ∆ω, used to Calculate ζ [9] . . . . . . . . . . . . . . . . . . 11

4 Control System Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5 VSC Simulation with Perfect State Feedback: Time Response and TrackingError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6 VSC Simulation with Perfect State Feedback: Control Signal . . . . . . . . 21

7 VSC and PID Simulation with Perfect State Feedback: Time Response andTracking Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

8 Simulation with Kalman Filter: Time Response and Tracking Error . . . . 24

9 Simulation with Tip Position and Base Velocity Penalized: Time Responseand Tracking Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

10 Simulation with Tip Mass Halved: Time Response and Tracking Error . . . 25

11 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

12 Camera Calibration: Data and Linear Fit . . . . . . . . . . . . . . . . . . . 29

13 Accelerometer Calibration: Data and Linear Fit . . . . . . . . . . . . . . . . 29

14 Experimental Results: Tip and Base Position . . . . . . . . . . . . . . . . . 30

15 Comparison of Control Methods . . . . . . . . . . . . . . . . . . . . . . . . 31

16 Experimental Results of Robustness Testing . . . . . . . . . . . . . . . . . . 33

viii

Page 9: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

SUMMARY

A new control method for position tracking control of a flexible, non-collocated

system is developed. The problem consists of a flexible beam that moves along a horizontal

track, actuated at the top by a linear motor, where the desired trajectory for the bottom,

free end of the beam is specified. An accelerometer and vision system can measure the free

end’s acceleration and position, respectively. Also, an encoder measures the position of the

fixed end along the track.

First, a system model is reformulated based on a pendulum with stiffness and damp-

ening. Small angle approximations are used so that a linear model can be obtained. The

required system parameters are determined experimentally to obtain a complete model for

use in the new control method design.

Next, variable structure control is chosen for the control method due to its seemingly

robust nature. Based on literature describing various variable structure control techniques,

the sliding surface and feedback gains are designed using the developed model. The process

is generalized for any linear state-matrices so that it can be applied to other system models.

Simulations are then conducted to verify the control method. An inner PD control

loop for the motor position is added due its existence in the actual system of interest. The

resulting tracking errors with perfect state feedback are on the order of 10−5 meters. When a

Kalman filter is added to the simulation as a state estimator based on vision, accelerometer,

and encoder measurements, the resulting tracking error is on the order of 10−4 meters.

Finally, the method is implemented on an actual system resulting in a root mean squared

traking error of 1.167e-3 meters. Additionally, the end mass is increased to verify the robust-

ness of this control strategy, resulting in stable responses. The method is then compared to

PD and LQR control methods, leading to the conclusion that this method performs better

than LQR.

ix

Page 10: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER I

INTRODUCTION

One of the main goals for industrial machinery has been to increase motion speed while

maintaining or achieving a certain level of precision. This has led to increased interest in

modeling and control schemes that are aimed at improving the performance of industrial

robots. In general, the weight of the mechanism affects the maximum speed that can be

reached, thus lightweight machinery is preferable. Though the lighter machines can reach

higher speeds, they also tend to be less rigid, thus leading to larger deflections. This

increased flexibility can cause vibrations that will reduce the precision and accuracy of the

machinery. As a result, the flexibility of the system needs to be addressed when developing

a control strategy.

There have been some recently developed algorithms, such as command shaping and

adaptive learning control, that attempt to improve the motion control of flexible systems.

This has added to the attractiveness of lightweight robots since the additional cost incurred

from the complex control algorithms is small when compared to the lower cost of the ma-

chinery needed. However, these algorithms generally address collocated systems in which

the sensors and actuators are at the same place.

To address the exact placement of the mechanism’s end of arm, a non-collocated sys-

tem usually arises because the sensors and actuators are not located at the same point.

A local company, CAMotion Inc., has been investigating the non-collocated problem for

a lightweight, flexible manipulator that is prismatically actuated by a linear motor. The

system consists of a rigid motor-driven base mass that is flexibly linked to a tip mass. The

main objective of the work has been to move the tip mass through a desired periodic refer-

ence trajectory while minimizing error and vibration. So far, this has been achieved through

the use of command shaping and learning control in conjunction with a PID controller that

uses encoder data from the motor.

1

Page 11: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

In the recent past, CAMotion examined the use of a Kalman filter to estimate the

end-of-arm position based on feedback from an accelerometer mounted at the tip. During

the investigation, a machine vision system was used to verify their results. Since machine

vision systems are more readily available in industry, CAMotion would like to incorporate

them into a state-feedback and Kalman filter control strategy. Accelerometers are still used

so that the control algorithm can use the best aspects of each sensor. For example, the

accelerometer measurements can be taken at a faster rate than those of the machine vision

system. On the other hand, the machine vision sensors can directly measure the tip position.

Since these sensors have different sampling rates, the Kalman filter previously used must

be reformulated to incorporate the disparate sampling times.

Once the states can be obtained from the Kalman filter, they can be used in a feed-

back control scheme. An important issue that needs to be addressed when developing the

controller is robustness to parameter variation. For example, mass may be increased when

the manipulator picks up a part. Also, the non-collocation of the sensors and actuators

may result in non-minimum phase behavior that could also add additional complexity to

the control algorithm. For these reasons, it was decided to investigate a method other than

the pole placement or linear quadratic optimal control techniques. Thus, variable structure

control became a strategy of interest due to its seemingly robust nature.

The application of variable structure control to flexible systems has become of growing

concern in the past decade due to the increased interest in the advantages of flexible robots

over their rigid counterparts. However, most of the work has been for trajectory tracking

of a system consisting of a flexible beam that rotates in a horizontal plane. Furthermore,

the assumed mode method is usually used to model such a system as in the work done by

Qian and Ma [15, 16, 21]. This system was also used for force control by Chang and Chen

[4] by converting the problem into a tracking control problem. An interesting part of their

work is the use of nested control loops. The inner loop used PD control to force the system

to a desired angle. The outer control loop used variable structure control to calculate the

desired angle based on current states and the reference input. Other systems have been

used, such as DC motor control [19] and a two-mass vibrational system [8].

2

Page 12: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

To demonstrate the benefits of variable structure control, experiments have been per-

formed that compare it to other control methods. For example, Hisseine and Lohmann

compared variable structure control to the singular perturbation method [10], where the

slow control was done using the computed torque method and the fast control was done

with LQR. The experimental results showed similar performances, but the authors conclude

that variable structure control is preferred due to its simplicity. Variable structure control

was also compared to the pole placement method by Chen and Zhai [5]. Their experimental

results showed a much better performance with the variable structure control method.

In addition to comparing variable structure control performance to other control meth-

ods, its robustness was also evaluated using an inverted pendulum system in [11]. The LQ

controller design deteriorated during the test in which the pendulum’s length was double

the nominal design value. However, the variable structure control controller presented in

the paper remained stable during the same testing conditions leading to the conclusion that

it is a more robust method of control.

Recently, variable structure control has been used in combination with other control

methods. For example, Romano, Agrawal and Bernelli-Zazzera used input shaping along

with variable structure control in their experiments with a two-link system [17]. Li, Samali,

and Ha have combined variable structure control with fuzzy logic to control the vibrations

of a five-story building [12]. Yuksek, et al., has also used variable structure control with

cluster control to control road vibrations [23].

Although all of this work uses variable structure control, there is no unified approach

to the design. Most use the equivalent control method as described in Section 3.2, however

their choice of sliding surfaces vary. Furthermore, many of the designs use a reduced order

system by exploiting the fact that the control drives the system to a surface in the state-

space. However, Cao and Xu have recently proposed a different method that uses the

full-order system [3]. Since there is no unified method for variable structure control, the

method used in this research is described in detail in Chapter 3. But first, the modeling of

the system used in this research is discussed in Chapter 2.

The rest of this thesis details the application of variable structure control to the flexible

3

Page 13: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

link problem posed by CAMotion. The simulation of the proposed method can be found

in Chapter 4 along with the results. Chapter 5 discusses the experimental results and

comparision to other methods. Finally, Chapter 6 discusses the contributions of this work

and gives some further recommendations.

4

Page 14: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER II

SYSTEM MODEL

Though mode shape analysis is widely used in flexible link problems, a different modeling

approach was used for this problem. Since the previous work done by CAMotion has used

a lumped mass-spring-damper approach [18], it was again used for this research. However,

there are many ways to configure such systems. Concern that the configuration used in

the previous research, which is described in Section 2.1, may not appear to resemble a

robotic manipulator led to the development of a second model configuration, described in

Section 2.2. Each configuration leads to a finite number of differential equations based on

Newton’s laws that can be easily written into state-space representation. The resulting

matrices can then be used in conjunction with the control formulation described in Chapter

3 to determine the necessary control gains.

2.1 Two Mass Model

Figure 1: Two Mass Model Schematic [18]

The flexible system considered in previous research has been the two-mass configuration

shown in Figure 1. The base mass, which is driven by the linear motor, is constrained to

only move in the horizontal direction. The tip mass is connected to the base by a pair of

symmetric flexible beams. These beams are modeled as a spring with stiffness, k , and a

5

Page 15: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Parameters ValueBase mass, m1 8 kgTip mass, m2 2 kgSpring constant, k 7928.3 N/mDamping coefficient, b 1.258 Ns/m

Table 1: Two Mass Model Parameters

damper with a damping coefficient, b. The horizontal tip displacement is the one of interest

and is assumed to be small enough so that the assumption of a linear system can be used.

The choice of positions and velocities of both masses as states and the motor force as

the control input, u, was made to establish the state-space representation in Equation 2.1.

It is assumed that the positions are measured from a fixed point along the horizontal track

that is equal to zero and that the control force acts only on the base mass. Furthermore,

the outputs are the encoder, accelerometer and vision measurements that relate to the base

position, tip acceleration, and tip position, respectively. Since a vision measurement is not

available at all times, the last row of Equation 2.2 will be zero except when there is a vision

measurement. Thus, the system is time varying. Table 1 gives the numerical values for the

parameters in Equations 2.1 and 2.2 as listed in [18].

xbase

xtip

xbase

xtip

=

0 0 1 0

0 0 0 1

−km1

km1

−bm1

bm1

km2

−km2

bm2

bm2

xbase

xtip

xbase

xtip

+

0

0

1m1

0

u (2.1)

y =

1 0 0 0

km2

−km2

bm2

−bm2

0 0 or 1 0 0

xbase

xtip

xbase

xtip

(2.2)

2.2 Pendulum Model

Since the two-mass model described in the previous section does not seem to resemble actual

robotic manipulators, a new model was developed as shown in Figure 2. The base mass,

6

Page 16: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Figure 2: Pendulum Model Schematic

m1, is still constrained to move in the horizontal direction with the control force, F , acting

on it. However, the tip mass is now connected to m1 by a long flexible beam. The mass of

the beam and tip are considered to be a single inertial mass, m2. Finally, torsional stiffness

and damping are chosen to act at the connection point.

In order to derive the state-space representation of this new model, a set of differential

equations is developed. The equations of motion, (2.3) and (2.4), can be obtained by using

Newton’s Second law for the forces acting in the horizontal direction since that is the motion

of interest. Equation 2.5 can be obtained by summing the moments about the connection

point. Since the reaction force at the joint will not create a moment, only the horizontal

reaction force, f , is needed.

m1x1 = F − f (2.3)

m2xcg = f (2.4)

Iθ = fr − kθ − bθ (2.5)

Again, it is assumed that the motion of the second mass relative to the first is small.

This allows the use of small angle approximations for θ, (2.6) and (2.7), so that the states

can again be chosen as the mass positions and velocities.

θ ≈ x1 − xcg

r(2.6)

θ ≈ x1 − x2

L(2.7)

7

Page 17: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

xcg =(

1 − r

L

)x1 +

r

Lx2 (2.8)

f = m2

[(1 − r

L

)x1 +

r

Lx2

](2.9)

An expression for xcg in terms of x1 and x2, Equation 2.8, is obtained by equating the

right-hand sides of Equations 2.6 and 2.7. It can then be substituted into Equation 2.4, thus

creating an equation for f in terms of the state variables, x1 and x2. The result, (2.9), can

then be substituted into (2.3) to create a second-order differential equation, (2.10), in terms

of state variables, input force and system parameters. The other second-order differential

equation, (2.11), is obtained by substituting (2.7) and (2.9) into (2.5).

[m1L + m2 (L − r)] x1 + m2rx2 = LF (2.10)

[I − m2r (L − r)] x1 −[I + m2r

2]x2 = −kx1 + kx2 − bx1 + bx2 (2.11)

Equations 2.10 and 2.11 can then be used to get expressions for x1 and x2 by rewriting

them in a matrix equation of the form Mx = Kx + Bx + [L 0]T F where x = [x1 x2]T .

Therefore, the state-space model can be written as follows if the state vector is chosen to

be X = [x1 x2 x1 x2]T .

X = AX + BF (2.12)

y = CX + DF (2.13)

Where

A =

0 0 1 0

0 0 0 1

m2krδ

−m2krδ

m2brδ

−m2brδ

−k[m1L+m2(L−r)]δ

k[m1L+m2(L−r)]δ

−b[m1L+m2(L−r)]δ

b[m1L+m2(L−r)]δ

(2.14)

B =

0

0

−L(I+m2r2)δ

L[m2r(L−r)−I]δ

(2.15)

8

Page 18: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

C =

1 0 0 0

−k[m1L+m2(L−r)]δ

k[m1L+m2(L−r)]δ

−b[m1L+m2(L−r)]δ

b[m1L+m2(L−r)]δ

0 0 or 1 0 0

(2.16)

D =

0

L[m2r(L−r)−I]δ

0

(2.17)

δ = −m1L(I + m2r2) − m2IL (2.18)

The term δ, described by (2.18), arises when the M matrix is inverted while solving for

x1 and x2. Also, since a vision measurement is not available at all times, the last row of

(2.16) will be zero except when there is a vision measurement.

2.3 Determining Pendulum Model Parameters

Once the state-space representation is developed, it is desirable to have actual values for

each of the system parameters. The best option would be to obtain the values from the

manufacturer or user’s manual. However, this information may not be available so the

values must be determined experimentally. The following describes the procedures used to

determine the parameters listed in Table 2.

Direct measurement can be used to obtain some of the parameters. For example, the

base and tip masses, m1 and m2, can be measured using a scale. Similarly, a tape measure

can be used to directly measure the overall length, L.

Parameters ValueBase mass, m1 8 kgTip mass, m2 2.55 kgBeam length, L 0.526 mDistance to center of mass, r 0.377 mMass moment of inertia, I 0.4367 kgm2

Spring constant, k 32,199 NmDamping coefficient, b 9.8863 Nms

Table 2: Pendulum Model Parameters

9

Page 19: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

The fourth parameter, r, was found by dividing the second mass into two sections, a

bar with uniform cross-section and a rectangular end mass. Assuming that the center of

mass for each section is located at the section’s center, Equation 2.19 can be used to find

the center of mass. Each section’s mass and height can be measured directly using a scale

and tape measure.

r =0.5h1m1 + (h1 + 0.5h2)m2

m1 + m2(2.19)

The sections were also used to calculate the mass moment of inertia. First, the inertias

for each section were calculated about their assumed center of mass using equations found

in [2]. The parallel axis theorem (2.20) was then used to obtain the total mass moment of

inertia about the pivot point, where d is the distance from the section’s center of mass to

the point O.

Io = Icg + md2 (2.20)

Frequency response techniques were used to obtain the remaining two parameters. Using

an oscilloscope, a frequency response function can be experimentally taken by hitting the

end of the second mass and measuring the output from the accelerometer. The second mass

was disconnected from the base mass and clamped to a fixed surface so that the beam’s

vibration could be isolated. Therefore, x1 and m1 in (2.12)-(2.15) can be set equal to zero,

creating a second-order model described by Equation 2.21. x2

x2

=

0 1

km2(L−r)−m2IL

bm2(L−r)−m2IL

x2

x2

+

0

L[m2r(L−r)−I]−m2IL

F (2.21)

The characteristic equation for a second-order system can be written in terms of the

natural frequency, ωn, and damping ratio, ζ, as in Equation 2.22. Also, the characteristic

equation for (2.21) can be derived by setting the determinant of λI −A equal to zero. The

coefficients of the resulting equation, (2.23), can then be equated to those of (2.22) to get

Equations 2.24 and 2.25.

λ2 + 2ζωnλ + ω2n = 0 (2.22)

λ2 +b(L − r)

ILλ +

k(L − r)IL

= 0 (2.23)

k =ω2

nIL

L − r(2.24)

10

Page 20: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Figure 3: Measurement of ∆ω, used to Calculate ζ [9]

b =2ζωnIL

L − r(2.25)

In order to use Equations 2.24 and 2.25, ωn and ζ are found from the frequency response

function of the accelerometer data. The natural frequency is taken to be the frequency at

which the peak value occurs. The damping ratio is obtained by measuring ∆ω as shown in

Figure 3 and using it in Equation 2.26 to calculate ζ.

∆ω =4ζωn

m2(2.26)

Once the parameters are determined, the transfer function between the tip position and

the input can be calculated and used to determine the properties of the system. It is found

that the poles of the transfer function are all stable, which helps verify the validity of the

parameters since the system is inherently stable. The zeros of the transfer function are also

examined and are found to be in the left half plane. Therefore, the system is minimum

phase which does not add complexity to the control design. However, since many of the

parameters are not found by direct measurement, there is a great amount of uncertainty

in the values obtained. Therefore, the controller design must be robust enough to handle

these uncertainties as well as any other variations due to outside influences.

11

Page 21: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER III

VARIABLE STRUCTURE CONTROL

Variable Structure Control (VSC) can be described as a switched feedback control method

that drives a system trajectory to a specified surface in the state space. This surface, σ = 0,

is called a sliding surface because ideally the plant’s trajectory slides along it for all time

once the surface is reached, which is referred to as a sliding mode. To reach the surface, the

control gains are switched based on whether the states are “above” or “below” the sliding

surface. Thus, the VSC design is a two-part process: the switching surface is designed first

and then the switched feedback law [6].

3.1 Sliding Surface Design

The sliding surface design is critical because it determines the behavior of the plant while

in sliding mode. Thus the design is based on the plant dynamics of the state space repre-

sentation. For linear systems, a linear transformation, z = TX, into regular form is usually

done to aid in the design process. Regular form consists of partitioned matrices as shown

in (3.1), where B2 is a square matrix with order equal to the number of inputs. The sliding

surface can also be partitioned in the same manner where S2 is a also square matrix with

order equal to the number of inputs (3.2).

X1

X2

=

A11 A12

A21 A22

X1

X2

+

0

B2

u (3.1)

σ = [S1 S2]

X1

X2

(3.2)

Using the fact that σ = 0, Equation 3.2 can be used to solve for X2 and substituted into

the top row of (3.1) to produce Equation 3.3. Thus, the sliding surface design problem now

becomes that of a state feedback problem where the state matrix is A11, the input matrix

12

Page 22: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

is A12 and feedback gain is −S−12 S1 [6].

X1 = (A11 − A12S−12 S1)X1 (3.3)

This allows the use of conventional feedback methods, such as pole placement or LQG, in

the sliding surface design. For convenience, S2 is set equal to the identity matrix so that

S1 is equal to the gain obtained from the feedback method used. Once the surface is found

using regular form, it must be transformed so that it can be used with the original state

space representation. Therefore, σ = Sz = STX = SX.

The transformation into controllable canonical form as found in Chapter 8 of [1] could

be used for the single input models described earlier since the result could be classified as

regular form. However, a considerable change in the order of magnitude of the matrices

occurs in order to transform the matrix into a stricter form than actually needed. Therefore,

assuming that the nth value of the input matrix is non-zero, a different transformation

matrix (3.4) was used that would keep the order of magnitude of the new matrices close to

that of the old ones.

T =

1 0 · · · 0 −b1bn

0 1. . .

... −b2bn

.... . . . . . 0

...

0 · · · 0 1 −bn−1

bn

0 0 · · · 0 1

(3.4)

A linear-quadratic approach with a cost function described by Equation 3.5 was used

to determine the sliding surface for this research.

J =12

∫ tf

to[XT (t)QX(t) + uT (t)ru(t)]dt (3.5)

Since the control objective is to minimize position error of the manipulator’s tip, Q was

chosen to be a (n− 1)th order square matrix whose only non-zero term is the diagonal term

associated with x2, which is chosen to be a value greater than one. To further penalize the

cost of x2, r is chosen to be a value less than one, thus reducing the input cost. The sliding

surface gains can then be found by first solving the Algebraic Riccati Equation (3.6) for P .

13

Page 23: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Then, by choosing S2 to be one, S1 is calculated using (3.7).

0 = PBr−1BT P − Q − PA − AT P (3.6)

S1 = −r−1BTP (3.7)

Thus, the sliding surface design process is now complete. If the system dynamics along

the sliding surface are unsatisfactory, the surface can be redesigned using the same process.

For example, the values for Q may be altered to obtain better position tracking control by

increasing the non-zero value.

3.2 Switched State Feedback Control Design

Once the sliding surface is determined, the next step is to design the switched feedback law

that will drive the state trajectories to that surface. Since switching causes the problem to

be non-linear, Lyapunov stability theory is used in the design process. This theory states

that given a positive definite function, V (x), the system is stable if the time derivative of

the function is negative definite. That is, V (x) < 0. To ensure that the switching surface is

reached in a finite number of steps, V (x) < −η|s| can be used, where η is a strictly positive

number [20]. However, for most practical applications, negative definiteness is a sufficiently

convergent condition. The typical positive definite function used for single input systems,

such as the ones discussed in Chapter 2 is described by Equation 3.8. Furthermore, if the

sliding surface is chosen to be that described by (3.9), the time derivative of V (x) can be

described by (3.10).

V (x) =12σ2(x) (3.8)

σ = s1x1 + s2x2 + · · · + snxn (3.9)

= SX

V (x) = σSX (3.10)

= σS[AX + Bu]

Knowing that (3.10) needs to be strictly less than zero to ensure stability, the control,

u, can now be determined. One way in which the control structure is determined is the

14

Page 24: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

equivalent control method. This method divides the control into two parts. The first term,

ueq, represents the input to the system that produces motion on the sliding surface whenever

the trajectory starts on the surface [6] and can be described by (3.11) for the surface given

by (3.9). The second term, uN , is the control structure that drives the system trajectories

to the surface. By substituting u = ueq + uN into (3.10), V (x) can now be described by

(3.12). Thus, any control structure for uN that ensures that V (x) is negative definite can

be used, such as relays with constant gains, linear continuous feedback, etc. For detailed

information on the various control structures see [6].

ueq = −[SB]−1SAX (3.11)

V (x) = σSBuN (3.12)

Although the method of equivalent control is widely used, the controller can also be

designed by choosing a particular control structure. It can then be substituted directly into

Equation 3.10 to directly determine the control gains. This is the method that was used

for this research. First, the desired switched feedback control structure was chosen to be

that of Equations 3.13 and 3.14. This is the general structure for a feedback controller with

switched gains. It was then substituted into (3.10) to obtain (3.15). Since σ is a scalar,

it can be moved into the vector X. This leads to a series of terms (3.17) that contain a

coefficient multiplied by σxi. Since the coefficient of σxi is only dependent on gi, it can then

be used to determine the allowable values for αi and βi. For example, if σx1 is positive, then

the corresponding coefficient must be negative so that the entire term is negative. Thus,

by solving the inequality Ψi < 0 for gi an expression for αi is found.

u = g1x1 + g2x2 + · · · + gnxn (3.13)

= KX

gi =

αi σxi > 0

βi σxi < 0(3.14)

V (x) = S[A + BK]σX (3.15)

= [s1(a11 + b1g1) + s2(a21 + b1g1) + · · · + sn(an1 + bng1)]σx1 + · · · (3.16)

15

Page 25: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

= Ψ1σx1 + Ψ2σx2 + · · · + Ψnσxn (3.17)

In order to include this method in a control software program, it is desired to have a

generic algorithm that can be used for any given set of state matrices with a single input.

Since this process involves the algebraic manipulation of parameters specific to the chosen

model, a process for calculating the controller gains based only on the state matrices and

sliding surface was developed. First, the right-hand side of Equation 3.15 is said to be less

than zero since it is a scalar, resulting in the following.

[SA + SBK]

σx1

σx2

...

σnxn

< 0 (3.18)

Noting that SB is a scalar quantity for a single input, the equation can be rewritten as

follows.

SB

[SA

SB+ K

]

σx1

σx2

...

σnxn

< 0 (3.19)

A new variable, γ, is chosen such that γ = −SASB , which is a vector with the same

dimensions as K. Thus, the coefficient of σxi is SB(−γi + Ki) which then leads to the

following statements.

if SB > 0αi < γi

βi > γi

(3.20)

if SB < 0αi > γi

βi < γi

This generalization only deals with a single input system, but the method can be ex-

tended to multi-input systems. First, a sliding surface is defined for each input, thus creating

an S matrix with multiple rows. The gains for each input can then be determined using

Equation 3.20 where S is the row and B is the column corresponding to the input of interest.

16

Page 26: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Thus, a general method to calculate the control gains has been derived for the control

structure described by (3.13) for any given A, B, and S matrices. When implementing this

method on a computer, round-off errors may give slightly different values for the inequalities

than those obtained using algebraic manipulation of the parameters. Therefore, the method

was verified using the two mass model from Section 2.1. First, (3.17) was used to obtain

expressions (3.21)-(3.24) in terms of the system paramters and unknown control gains.[s3k

m2+

s4(g1 − k)m1

]σx1 < 0 (3.21)

[−s3k

m2+

s4(g2 + k)m1

]σx2 < 0 (3.22)

[s2 − s3b

m2+

s4(g3 + b)m1

]σx3 < 0 (3.23)

[s1 +

s3b

m2+

s4(g4 − b)m1

]σx4 < 0 (3.24)

From these inequalities, the upper limit on αi and lower limit on βi, which happen to

be the same for each xi since the system is linear, can be calcluated using the paramter

values listed in Table 1 and a particular sliding surface. In this case, the sliding surface

was calculated using Matlab code that can be found in Appendix A and was found to be

σ = [187.7644 128.4634 4.5639 1]X. Thus, using (3.21)-(3.24), the conditions on the

control gains are as follows.

α1 < −1.3681e5 < β1 (3.25)

α2 < 1.3681e5 < β2 (3.26)

α3 < −1.006e3 < β3 (3.27)

α4 < −1.5238e3 < β4 (3.28)

Using the same sliding surface gains, γ was then calculated so that the results could

be compared. The resulting vector was exactly the same as the limits calculated using the

actual parameters. The exact results are most likely due to truncation of the numbers since

they are relatively big. Differences may show for smaller numbers, but as long as the gains

are chosen to be much greater than or less than the value calculated, the errors should be

small enough so that stability is still guaranteed.

For further details on Sliding Mode Control, refer to [6, 7, 22].

17

Page 27: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER IV

SIMULATION

Before the control strategy is implemented on the test structure, it is first simulated using

Matlab. The simulation allows the control to be executed with perfect state feedback first

and then with the estimated feedback, which helps isolate any problem areas. Also, stability,

input requirements and methodology can be verified through simulation, thus reducing the

possibility of harming the equipment when the control method is tested on an actual system.

4.1 Overview of Control System

The electronic portion of the system that will be used for testing consists of a computer,

Remote Axis Serial Interface Device (RASID), and amplifier. The RASID is a compact unit

that is located close to the motor and contains a digital signal processor that controls much

of the motion. Since it only requires a USB cable from the computer and a power cable,

the wiring between the computer and motor is significantly reduced.

Currently, the computer is used as an operator interface to the RASID and to do tra-

jectory planning. The resulting desired positions and velocities are sent to the RASID

through the USB cable at a rate of 1 kHz. The RASID then uses an internal PID routine

Motor & Amp

System Dynamics RASID

(PID cntrl @ 10kHz)

VSC Control Algorithm

Kalman Filter

Encoder Meas. Accelerometer Meas.

Vision Meas.

Desired Trajectory

Computer @ 1kHz

Figure 4: Control System Schematic

18

Page 28: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

at 10 kHz to calculate the control signal necessary to drive the error to zero using encoder

measurements. This signal is then passed through the amplifier to the linear motor.

To implement state-feedback control, a Kalman filter and additional output measure-

ments are added to the current system to create the overall schematic shown in Figure 4.

This now creates two levels of control, the inner PD loop at 10 kHz and the outer VSC loop

at 1 kHz. Thus, to isolate the problems that may occur during the simulation process, it is

divided into three stages that build upon each other. First, the outer loop is simulated at

1 kHz with perfect feedback in order to tune the sliding mode control strategy. Next, the

inner PD loop, which then needs to be run at 10 kHz, is added to the simulation. Finally,

the perfect feedback is replaced by the estimated states obtained from a Kalman filter.

4.2 Outer Loop (VSC) Simulation

The first step in simulation of the outer loop is to discretize the system model, which is

accomplished using Matlab’s c2d function. A first order hold is used, since the RASID

uses linear approximation to determine the intermediate steps. The discretized matrices

are then transformed into regular from as described by (3.4) so that the sliding surface can

be calculated using a linear-quadratic approach. To find the gain matrix using LQR, the

dare function is used, which solves the Discrete Algebraic Ricatti Equation. The result can

then be used, along with the discretized B matrix, to find the sliding gains by Equation

3.7, assuming that S2 is equal to one.

To calculate the control gains, the method described in Section 3.2 is used. However,

Equation 3.20 only gives an upper bound for αi and a lower bound for βi. Thus, an exact

value must be chosen. This is done by subtracting or adding a fixed value, ε, to each of the

bounds.

Once the surface and control gains are calculated, they can be used to control the system

so that the tip follows a specified trajectory. This trajectory is obtained using the existing

computer software that calculates a jerk-limited path from one point to the next. In this

case, a repetitive motion from the home position, 0, to a point fifty-five millimeters away

and back is used. An error vector, E(k), is then calculated using the desired position at the

19

Page 29: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

kth timestep. Since the tip position error is the only state penalized during the calculation

of the sliding surface, the desired position and velocity for the base mass are said to be the

same as those at the tip. Thus, the error vector can be calculated using Equation 4.1.

E(k) =

x1

x2

x1

x2

xd

xd

xd

xd

(4.1)

The error vector is first used to calculate the sliding surface, σ = SE. Next, Equation

(3.14) is used to determine the gain matrix, K, using ei instead of xi. Finally, the input,

u = KE, is used to obtain the next set of state values where X(k +1) = AX(k)+Bu. This

process continues for every desired point of the trajectory.

Once the simulation code was written, which can be found in Appendix A, it was

initially run using r = 1, ε = 5, and Q = [0 0 0; 0 1 0; 0 0 0]. This resulted

in a maximum tracking error of about 0.4 millimeters. One way to improve the tracking is

to increase the penalty on tip position in the cost function, either by making r smaller or

the nonzero diagonal term of Q bigger. However, since the actual system has a maximum

force value of 100 Newtons, there has to be a balance between error reduction and input

required. Therefore, a maximum error of 0.02 millimeters can be achieved while keeping

the required input under 100 Newtons. The simulation results for the pendulum model are

shown in Figures 5 and 6.

0.6 0.8 1 1.254.990

54.992

54.994

54.996

54.998

55.000

55.002

55.004

55.006

55.008

55.010System Response

Time (s)

Posi

tion

(mm

)

basetipdesired

0 1 2 3 4 5-2

-1.5

-1

-0.5

0

0.5

1

1.5

2x 10-5 Tracking Error

Time (s)

Erro

r (m

)

Figure 5: VSC Simulation with Perfect State Feedback: Time Response and Tracking Error

20

Page 30: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0 1 2 3 4 5-100

-50

0

50

100Control Signal

Time (s)

Forc

e (N

)Figure 6: VSC Simulation with Perfect State Feedback: Control Signal

In addition to Q and r, the value of ε can be used to alter the resulting time response

of the system. For example, as the value increases, the system responds faster. However,

the control effort also increases which induces more vibration in the system. Thus, there

is more switching in the control signal to counteract these vibrations. Thus, choosing a

smaller value of ε and altering the sliding surface seems to be the best approach to tuning

the controller.

4.3 Inner Loop (PID) Simulation

Once a suitable time response was achieved with the VSC simulation, the next step was to

add the inner PD control loop. First, the force input calculated from the VSC loop must be

converted into position, r, and velocity, r, terms that serve as inputs to the RASID. This

is done by equating the force to the proportional and derivative gains to get Equation 4.2.

It is then differentiated to get an expression for the change in force (4.3), assuming that r

is zero since the RASID uses linear interpolation.

ui = Kpr + Kdr (4.2)

ui = Kpr (4.3)

These equations can then be used, along with a difference approximation for ui, to

obtain the following expressions for the input position and velocity.

r(k) =u(k) − u(k − 1)

KpT1kHz(4.4)

21

Page 31: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

r(k) =u(k) − Kdr(k)

Kp(4.5)

Since the PD loop runs at a faster rate than the outer VSC loop, the intermediate control

values must be determined for simulation purposes. Since the RASID uses linear interpo-

lation, the intermediate points are found by incrementing u(k − 1) by (u(k)−u(k−1))T10kHz

T1kHz

until u(k) is reached. These values are then used to calculate the inputs using the above

equations.

The new states can then be calculated using X(k + 1) = AX(k) + B[Kp Kd][r r]T ,

where A and B are discretized at 10 kHz using a zero-order hold. It is important to note

that the sliding surface and control gains are calculated in the same manner described in

the Section 4.2 using the state matrices discretized at 1 kHz using a first-order hold. Also,

the r value used to calculate the sliding surface was adjusted to maintain a control effort

under 100 Newtons. The simulation results for the pendulum model are shown in Figure 7.

0.6 0.8 1 1.254.990

54.992

54.994

54.996

54.998

55.000

55.002

55.004

55.006

55.008

55.010System Response

Time (s)

Posi

tion

(mm

)

basetipdesired

0 1 2 3 4 5-3

-2

-1

0

1

2

3x 10-5 Tracking Error

Time (s)

Erro

r (m

)

Figure 7: VSC and PID Simulation with Perfect State Feedback: Time Response andTracking Error

4.4 Simulation Using Estimated States

The final step in the simulation procedure is to use the outputs to obtain state estimates

instead of using perfect feedback, by using a Kalman Filter. Since the vision measurement

is not available at all times and is delayed by a significant number of time steps, a multirate

Kalman Filter has to be formulated, such as the one designed by Mashner [13]. In addition

to the system model, Mashner’s design requires the specification of other parameters such

22

Page 32: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

as the frequency of the vision measurement, noise covariance matrices, and the number of

time steps the vision measurement is delayed. Therefore, to incorporate this Kalman Filter

into the simulation, the parameters used are listed in Table 3.

The vision frequency and delay were estimated based on knowledge of the vision system

to be used during the experiments. The input covariance is multiplied by a factor relating to

the unknown noise in the amplifier. The output covariance matrix is obtained by assuming

that the covariance of each sensor is independant, thus it becomes a diagonal matrix. The

standard deviation of the accelerometer is given by the manufacturer as +/- 0.005G, which is

then squared to obtain the covariance. The other two covariances are obtained by Equation

4.6, where ∆ is the value of one increment, since the measurements can only be taken at

discrete points.

cov =∆2

12(4.6)

The outputs are calculated using y(k + 1) = CX(k + 1) + Bu(k + 1) with the states

obtained from X(k + 1) = AX(k) + Bu(k). The filter uses the outputs to calculate the

estimated states, which are then used to obtain the control value for the next time step.

The results for the pendulum model are shown in Figure 8. As expected, the tracking error

is not as good since the estimates are used instead of the actual states.

Although the tracking error results in the previous simulations are acceptable, the base

mass overshoots the desired position during the control process, as can be seen in Figure

8. Since large overshoot may not be desirable on an actual system due to limits on the

mainpulator’s range of motion, the penalization of tip velocity was investigated to address

this problem. Thus, Q is altered to contain two non-zero diagonal terms. The term corre-

sponding to the velocity is chosen to be the same penalty, r, used for the control signal so

that the tip position remains the most penalized term. The results of this change in the

Vision measurement frequency 30 HzVision measurement delay 25 msInput covariance matrix (0.01)BBT (0.01)Output covariance matrix diag[2.08e-12 2.41e-3 2.03e-9]

Table 3: Kalman Filter Parameters

23

Page 33: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0.6 0.8 1 1.254.90

54.92

54.94

54.96

54.98

55.00

55.02

55.04

55.06

55.08

55.10System Response

Time (s)

Posi

tion

(mm

)

basetipdesired

0 1 2 3 4 5-2

-1.5

-1

-0.5

0

0.5

1

1.5

2x 10-4 Tracking Error

Time (s)

Erro

r (m

)

Figure 8: Simulation with Kalman Filter: Time Response and Tracking Error

0.6 0.8 1 1.254.5

54.6

54.7

54.8

54.9

55.0

55.1

55.2

55.3

55.4

55.5System Response

Time (s)

Posi

tion

(mm

)

basetipdesired

0 1 2 3 4 5-5

0

5x 10-4 Tracking Error

Time (s)

Erro

r (m

)

Figure 9: Simulation with Tip Position and Base Velocity Penalized: Time Response andTracking Error

cost function are shown in Figure 9.

4.5 Robustness of Control Strategy

Up to this point, the simulations have been done asuming a perfect model. Since there are

uncertainties in these parameters, it is desirable to use an imperfect model for the simulation

to verify that the system remains stable. To obtain variations in the model, the A and B

matrices were calculated using altered parameters before being discretized.

The response to a change in the mass of the tip is of particular interest since it may

vary as the manipulator grabs and releases items. The mass parameter was halved in the

imperfect model because the simulation could easily be verified experimentally by adding

or subtracting mass from the end of the beam. The resulting response for the pendulum

24

Page 34: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0.6 0.8 1 1.254.5

54.6

54.7

54.8

54.9

55.0

55.1

55.2

55.3

55.4

55.5System Response

Time (s)

Posi

tion

(mm

)

basetipdesired

0 1 2 3 4 5-3

-2

-1

0

1

2

3

4x 10-4 Tracking Error

Time (s)

Erro

r (m

)

Figure 10: Simulation with Tip Mass Halved: Time Response and Tracking Error

model with the estimated state feedback is shown in Figure 10.

From Figure 10, this control method seems to be robust to a change tip mass variations.

Since the variation originally caused the input to be above that of the motor force, the

saturation of the motor had to be added to the simulatation in order to better reflect

the response of the system to parameter variances. Futher simulations indicate that the

saturation of the motor will cause the system to become unstable when the tip mass is less

than 25% or more than 105% of the designed value. The other system parameters were also

varied from 10% to 200% of the design value in order to determine the ranges at which the

tracking error remained less than one millimeter. The results with perfect state feedback

are listed in Table 4. Perfect feedback is used to isolate the robustness of the control method

since the Kalman filter also uses an assumed model in its calculations.

The instability due to the induced non-linearity from the motor saturation can be

avoided by increasing the penalty on the control signal in the cost function during the

m1 40% - 140%m2 25% - 105%k 30% - 135%b 10% - 200%r 45% - 200%L 75% - 102%I 96% - 175%

Table 4: Robustness Ranges for Pendulum Model Parameters

25

Page 35: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

sliding surface design process. If frequent motor saturation occurs when implemented on

the real system, it would indicate that the paramters need to be redetermined in order to

obtain a more accurate system model or that the sliding surface needs to be redesigned.

The preceding simulation results verify that the control method presented in Chapter 3

can achieve an acceptable level of tracking control. They also indicate that the choice of Q

and r in the cost function used for the surface design directly impacts the behavior of the

system. For example, the overshoot and oscillations are reduced when the base mass was

penalized. Also, the penalty on tip position must be kept small enough so that the motor

will not saturate causing the system to become unstable. The robustness to paramater

variations was also verified through simulations. Although the system is not robust to an

increase in tip mass, it is when the tip mass is halved. Thus, the controller design should

use a higher nominal value for the tip mass since a reduction in mass does not cause the

system to become unstable.

The implementation of the control method on an actual system is discussed in the next

chapter.

26

Page 36: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER V

EXPERIMENTS

5.1 Experimental Set-up

Figure 11 depicts the actual structure used to test the developed control algorithm, which

consists of a rectangular block of steel attached to the end of a one-half meter long piece

of extruded aluminum. A notch is cut near the other end of the aluminum to increase

its flexibility. The structure is then mounted to a base plate, which is attached to an

Anorad LW-10 linear stage that contains a brushless linear motor. The stage is mounted

horizontally onto a support frame that was built using Parker’s structural framing system.

The motor is powered by an Anorad High Voltage Brushless Servo Amplifier configured to

run in current mode.

An Anorad MER-50 encoder is embedded into the linear stage to measure the position

of the base plate. This encoder has a resolution of one micrometer and is powered by an

external 5V Tenma power supply. In addition to the encoder, an acceleromter is mounted

onto the block of steel to measure the tip acceleration. The accelerometer used is a MEMS-

type from Analog Devices and can measure +/- 4 G with an error of 0.005 G.

Furthermore, a DVT Camera with strobe is used to measure the tip’s position at a

frequency of 28 Hz. Due to the process time, this measurement is delayed by 25 ms. The

vision system detects a strip of reflective tape that is attached to the center of the steel

block. To reduce the exposure time, a black background is placed behind the entire system

so that the reflective tape is the brightest image captured by the DVT Camera.

As discussed in Section 4.1, a Remote Axis Serial Interface Device (RASID) is used as

the interface between the PC and the rest of the system. Thus, the sensors and amplifier

are wired into the RASID using the pin out diagram provided by CAMotion. The RASID

is then connected to the PC through the USB port. The CAMotion software is installed on

the PC, which uses Linux as its operating system.

27

Page 37: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Figure 11: Experimental Setup

5.2 Implementation of Variable Structure Control

A separate program could be written to directly control the motor force, bypassing the

RASID, using a Servo-To-Go card or some other digital to analog interface. However,

since CAMotion would like to incorporate this new control algorithm into their existing

software, the algorithm was added to the existing graphical user interface (GUI) software.

The programming was done with the aid of CAMotion’s engineers who also incorporated

the Kalman filter design by Mashner [13]. Thus, the estimated states are available for the

control signal calculation.

In order to obtain the correct estimated values, the sensor outputs had to be converted

into the proper units. The encoder measurements, which are in number of counts from the

home position, were converted into meters by multiplying the number of encoder counts

by 10−6 meters/count. The vision measurement, which is positioned so that 0.35 meters

can be viewed over its 640 pixel span, was calibrated by recording the number of pixels at

certain distances and then fitting a line to the data points (Figure 12). This results in an

28

Page 38: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Camera Calibration

y = 0.0006x - 0.0067R2 = 0.9998

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0 100 200 300 400 500 600pixels

met

ers

datatrendline

Accelerometer Calibration

y = 0.1001x - 51.336R2 = 0.9997

-15

-10

-5

0

5

10

15

400 450 500 550 600 650

ADC Conversion

New

tons data

trendline

Figure 12: Camera Calibration: Data andLinear Fit

Figure 13: Accelerometer Calibration: Dataand Linear Fit

Motor Force Constant 9.9 N/AAmplifier Gain 2 A/VRASID Output Signal 1.193 V/error

Table 5: PD Gain Conversion Factors

equation that could be used to convert pixels into meters. Similarly, the analog to digital

conversion of the accelerometer measurement was obtained by recording the values at 0, 1,

and -1 G and fitting a line to the data as seen in Figure 13.

The control effort, based on the PD gains, also had to be converted into the correct

units by using the conversion factors for the motor, amplifier and RASID as specified in the

user’s manuals. The factors can be found in Table 5 and the data sheets can be found in

Appendix B. The Kp and Kd gains were then multiplied by all three factors to obtain an

expression in Newtons.

During the implementation of the variable structure control algorithm, it was discovered

that the conversion of the calculated force into a position input for the RASID, as described

by Equations 4.4 and 4.5, needed to be modified since the Kd gain includes the time step

division used in numerical differentiation. Also, the actual position has to be included so

that the calculated reference position does not become zero when the force is zero, resulting

in the Equation (5.1). This could then be rearranged to obtain an expression for r(k) in

terms of u(k), r(k−1), x1(k), x1(k−1), which are all known values. The resulting equation,

(5.2), was then used to convert the force calculated by the control algorithm into a reference

29

Page 39: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0 0.2 0.4 0.60

0.01

0.02

0.03

0.04

0.05

0.06Experimental Results

Time (s)

Posi

tion

(m) Desired

BaseTip

Figure 14: Experimental Results: Tip and Base Position

position for the RASID.

u(k) = Kp[r(k) − x1(k)] + Kd[r(k) − r(k − 1) − x1(k) + x1(k − 1)] (5.1)

r(k) =u(k) + Kdr(k − 1) + (Kp + Kd)x1(k) − Kdx1(k − 1)

Kp + Kd(5.2)

The variable structure control algorithm was then tested using the same 55 milimeter

jerk-limited trajectory used in the simulations. The sliding surface and control gains used

are determined by the method outlined in Chapter 3 using a relative penalty on control

effort of 0.001, a relative penalty on tip position of 100, and a relative penalty on base

velocity of 0.001, which results in the following sliding surface and control gains. Figure 14

shows the experimental results of this test.

S = [138.55 − 59.665 − 0.5562 2.1303]

α = [−5, 325, 907 3, 414, 075 8, 517.5 − 48, 587]

β = [−5, 325, 897 3, 414, 085 8, 527.5 − 48, 577]

As can be seen in Figure 14, the tracking error is not as good as indicated by simulation.

This may be a result of modeling uncertainties, which affect the performance of the Kalman

filter and control algorithms. Also, while the motor’s time constant is small, about 1.1 ms,

30

Page 40: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0 0.1 0.2 0.3 0.4 0.5-0.01

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07Comparison of Control Methods

Time (s)

Tip

Posi

tion

(m)

DesiredPD ControlLQR ControlVSC Control

VSC Control

Figure 15: Comparison of Control Methods

it does not respond infinitely fast as in the simulations. Furthermore, there are time delays

of about 2 ms on the encoder and accelerometer measurements due to the use of the RASID,

which transmits the collected data via a USB cable, that are not accounted for in the control

algorithm.

Another observation is the chattering affect seen at the end of the move. This is usually

a result of constant switching of the control gains as the states oscillate around the sliding

surface. Thus, the chattering can be reduced by inserting a boundary layer around the

surface so that the control becomes zero when a state is inside the boundary.

5.3 Comparison to Other Control Methods

To verify that the test system was set-up correctly, it was first run using the existing PD

control of the RASID in conjunction with CAMotion’s GUI trajectory planning software.

A laser measurement device was used to record the tip position using an oscilloscope and

then downloaded into a log file. Next, data was collected using an LQR control approach

from work done by Mashner on the same system [13]. Laser measurement data was also

taken with the variable structure control and compared with the other control methods, as

shown in Figure 15.

31

Page 41: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Method Error2

PID 9.7750e-7LQR 1.8366e-5VSC 1.3620e-6

Table 6: Tracking Error Comparison of Control Methods

From Figure 15, it appears that neither state feedback methods track the desired tip

position better than the current RASID PD controller. To verify this, the mean of the

squared error was calculated for each method and the results are listed in Table 6. The

state feedback methods have a squared error that is lager than that of the current PD

controller. However, the variable structure control method has a smaller mean squared

error than the LQR method. Thus, the method developed in this thesis performs better

than the LQR feedback method when using the same state estimator. The poor performance

of the state feedback methods when compared to the PD controller may be a result of poor

estimates from the Kalman filter. There are several factors that may contribute to these

bad estimates, such as model inaccuracies, measurement errors, slow vision sampling, and

programming errors. Also, the time delay due to the RASID’s communication through the

USB cable is not accounted for in the control algorithm.

32

Page 42: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

0 0.2 0.4 0.60

0.01

0.02

0.03

0.04

0.05

0.06Robustness Testing: Increase of Tip Mass

Time (s)

Posi

tion

(m)

10%16%0%

Figure 16: Experimental Results of Robustness Testing

5.4 Robustness Testing

The final experiment that was conducted was to verify the robustness of this control strategy.

Since there were numerous slender rectangular pieces of aluminum readily available, these

were added to the bottom of the steel block to increase the tip mass. Two trials were run,

one with a 10.5% increase in mass and the other with a 15.8% increase, using the same

gains as in Section 5.2, resulting in the response shown in Figure 16. It can be seen that

the system remains stable with the addition of the masses. Furthermore, the mean squared

error remains on the same order of magnitude as listed in Table 6 for VSC.

33

Page 43: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

CHAPTER VI

CONCLUSIONS

A new tracking control method has been developed and proven to achieve acceptable track-

ing results. As discussed in Chapter 4, the maximum error could be as small as 10−5 meters

for a perfect model and perfect state feedback. Experimentally, the root mean squared error

was 1.167e-3 meters due to such factors as model inaccuracies, the use of estimated states,

and signal noises. However, this method achieves better tracking results than LQR control

for the same system, as shown by the experimental results in Chapter 5.

6.1 Contributions

The control algorithm has been proven to be less sensitive to changes in the actual sys-

tem, resulting in increased robustness with acceptable tracking results. The robustness of

this control method is one of the major contributions of this work because flexible system

models usually contain uncertainties due to truncation of flexible modes, small angle ap-

proximations, etc. Also, variations in parameters occur due to picking up parts, lowering or

raising a load, etc. Therefore, a control algorithm that is robust to these changes is desired.

The increased robust nature of this method is due to the fact that the algorithm forces

the system towards a specific surface in the state-space by examining the location of the

current states relative to the surface. Thus, as long as the control signal remains within the

saturation limits of the motor, the system remains stable and is guided towards the surface.

This can be achieved by finding a balance between tip position error and control effort in

the cost function as discussed in Section 4.5. Furthermore, the system response remains

satisfactory, as demonstrated through simulation, for large variations in system parameters.

The robustness to tip mass variations was also verified through experimentation.

Section 3.2 discusses the generalization of the control method so that it can be applied

to any controllable, linear, state-space system, which is another contribution of this thesis.

34

Page 44: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Previous work normally develops a variable structure control algorithm for a particular

system. In addition, there are various methods that can be used to design a variable

structure controller. The method of equivalent control helps generalize the design process

by decomposing the control into two parts, one part that handles the system dynamics on

the surface and one that drives the system to the surface. However, the equations for the first

part involve partial derivatives that need to be evaluated for each system. Therefore, the

process is difficult to execute generically in a computer program. The method developed

in this thesis has been generalized for linear systems, allowing a generic program to be

written. Although the generic algorithm developed assumes a switched feedback form of

variable structure control, this is the method that is most often used.

The last major contribution is the application of variable structure control to a pendulum

model. Although the development of such a model is not new, its use with variable structure

has not been widely investigated. Usually, an assumed mode method or a lumped mass-

spring-damper approach is used to model a flexible arm. However, the use of a pendulum

model instead is favorable because it results in a more intuitive model that is easier to

explain to non-specialists and is adequate for the experimental system of interest, where

most compliance is concentrated at a weak spot along the beam.

6.2 Further Work

Although the control method presented has been proven to be an acceptable tracking control

strategy, there are some ways in which the results could be improved. For example, perfect

tracking is not achievable since the desired trajectory is designed for a rigid system, i.e.

the base motion. The design is based on a jerk-limited motion, however, if the motion is

designed to be continuous to the fourth derivative, an achievable tip trajectory may result.

Thus, if a better trajectory is planned that is achievable for the tip mass, tracking results

could be greatly improved.

Furthermore, since the selection of the sliding surface directly affects the response of the

system, other design methods could be explored. For example, different cost functions could

be used to obtain more desirable time responses since the penalties on different combinations

35

Page 45: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

of states significantly alters the sliding surface. Also, the use of LQR to select the sliding

surface gains could be replaced by another feedback control method, such as pole placement.

Also, an optimization routine for choosing the value of ε could also improve the time response

of the system.

Finally, the application of adaptive learning control or input shaping in conjunction

with variable structure control is another issue that needs to be explored. Since CAMotion

software currently has the option of using either of these methods with their PID control

loop, it would be desirable to do the same with the method presented in this thesis. Adaptive

learning control could be used to update the sliding surface in order to obtain a better system

response. It could also update the switched feedback control gains, improving the system’s

time response. Input shaping could also be applied to the control input calculated from

the variable structure controller in order to reduce any induced vibrations. This reduction

in vibration would help keep the system on the sliding surface, resulting in less control

effort. Therefore, the application of input shaping and adaptive learning control would help

improve the overall performance of the system.

36

Page 46: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

APPENDIX A

MATLAB CODE

A.1 Verification of γ Calculation%%%%%%%%%%%%%%%%%%%%%

%% System Parameters

%%%%%%%%%%%%%%%%%%%%%

m1 = 8; % kg;

m2 = 2; % kg;

k = 7928.3; % N/m;

b = 1.258; % Ns/m;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% State-Space Model (continuous, regular form)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A = [0 0 0 1; 0 0 1 0; k/m2 -k/m2 -b/m2 b/m2; -k/m1 k/m1 b/m1 -b/m1];

B = [0; 0; 0; 1/m1];

C1 = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 0 0 0]; % meas w/o vision

C2 = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 1 0 0]; % meas w/ vision

D = 0;

sysc1 = ss(A,B,C1,D);

sysc2 = ss(A,B,C2,D);

%%%%%%%%%%%%%%%%%%

% Sliding Surface

%%%%%%%%%%%%%%%%%%

Q = [0 0 0; 0 100 0; 0 0 0];

r = .001;

s4 = 1;

diff = 5;

p = are(A(1:3,1:3),A(1:3,4)*(1/r)*A(1:3,4)’,Q);

K = -(1/r)*A(1:3,4)’*p;

S = [-K*s4 s4];

limit1(1,1) = k - (S(1,3)*k*m1)/(S(1,4)*m2);

limit1(2,1) = -k + (S(1,3)*k*m1)/(S(1,4)*m2);

limit1(3,1) = m1/S(1,4)*((S(1,3)*b)/m2 - S(1,2))-b;

limit1(4,1) = -m1/S(1,4)*((S(1,3)*b)/m2 + S(1,1))+b;

limit2 = -((S*A)./(S*B))’;

A.2 System Models%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% 2 Mass Model |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%

%% System Model

37

Page 47: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

%%%%%%%%%%%%%%%%%%%%%

m1 = 8; % kg;

m2 = 1.8; % kg;

k = 7928.3; % N/m;

b = 1.258; % Ns/m;

Kp = 3000;

Kd = 12000;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% State-Space Model (continuous, regular form)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A = [0 0 0 1; 0 0 1 0; k/m2 -k/m2 -b/m2 b/m2; -k/m1 k/m1 b/m1 -b/m1];

B = [0; 0; 0; 1/m1];

C1 = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 0 0 0]; % meas w/o vision

C2 = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 1 0 0]; % meas w/ vision

D = 0;

%%%%%%%%%%%%%%%%%%%%%%%

%% "Actual" System

%%%%%%%%%%%%%%%%%%%%%%%

m1 = 1*m1;

m2 = 1*m2;

k = 1*k;

b = 1*b;

Av = [0 0 0 1; 0 0 1 0; k/m2 -k/m2 -b/m2 b/m2; -k/m1 k/m1 b/m1 -b/m1];

Bv = [0; 0; 0; 1/m1];

C1v = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 0 0 0]; % meas w/o vision

C2v = [1 0 0 0; k/m2 -k/m2 -b/m2 b/m2; 0 1 0 0]; % meas w/ vision

Dv = 0;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Pendulum Model |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%

%% System Model

%%%%%%%%%%%%%%%%%%%%%

m1 = 8;

m2 = 2.5513;

k = 815.6178;

b = 1.5734;

cg = 0.3771;

len = 0.5260;

I = 0.4364;

Krasid = 10/2^12/2047; %V/m

Kamp = 2; %A/V

Kmotor = 9.9; %N/A

Kp = 3000*Krasid*Kamp*Kmotor;

Kd = 120000*Krasid*Kamp*Kmotor;

den = -m1*len*(I+m2*cg^2)-m2*I*len;

A = [0 0 1 0; 0 0 0 1; k*m2*cg/den -k*m2*cg/den b*m2*cg/den -b*m2*cg/den; -k/den*(len*m1+m2*(len-cg))

k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg)) b/den*(len*m1+m2*(len-cg))];

B = [0; 0; -len/den*(I+m2*cg^2); len/den*(m2*cg*(len-cg)-I)];

C1 = [1 0 0 0; -k/den*(len*m1+m2*(len-cg)) k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg))

b/den*(len*m1+m2*(len-cg)); 0 0 0 0];

38

Page 48: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

C2 = [1 0 0 0; -k/den*(len*m1+m2*(len-cg)) k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg))

b/den*(len*m1+m2*(len-cg)); 0 1 0 0];

D = [0; len/den*(m2*cg*(len-cg)-I); 0];

%%%%%%%%%%%%%%%%%%%%%%%

%% "Actual" System

%%%%%%%%%%%%%%%%%%%%%%%

m1 = 1*m1;

m2 = 1*m2;

k = 1*k;

b = 1*b;

cg = 1*cg;

len = 1*len;

I = 1*I;

den = -m1*len*(I+m2*cg^2)-m2*I*len;

Av = [0 0 1 0; 0 0 0 1; k*m2*cg/den -k*m2*cg/den b*m2*cg/den -b*m2*cg/den; -k/den*(len*m1+m2*(len-cg))

k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg)) b/den*(len*m1+m2*(len-cg))];

Bv = [0; 0; -len/den*(I+m2*cg^2); len/den*(m2*cg*(len-cg)-I)];

C1v = [1 0 0 0; -k/den*(len*m1+m2*(len-cg)) k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg))

b/den*(len*m1+m2*(len-cg)); 0 0 0 0];

C2v = [1 0 0 0; -k/den*(len*m1+m2*(len-cg)) k/den*(len*m1+m2*(len-cg)) -b/den*(len*m1+m2*(len-cg))

b/den*(len*m1+m2*(len-cg)); 0 1 0 0];

Dv = [0; len/den*(m2*cg*(len-cg)-I); 0];

A.3 VSC Control Functions%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% SM Control Function: |

%% Calculates control gains based on A,B |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [S,alpha,beta] = smcntrl(A,B,Q)

n = size(A,1);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Transformation into Regular Form

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Trans = eye(n);

for i = 1:n-1;

Trans(i,n) = -B(i)/B(n);

end

Ahat = Trans*A*inv(Trans);

Bhat = Trans*B

%%%%%%%%%%%%%%%%%%%%%%%%

% Sliding Surface (LQR)

%%%%%%%%%%%%%%%%%%%%%%%%

r = .0001;

p = dare(Ahat(1:n-1,1:n-1),Ahat(1:n-1,n),Q,r);

K = -(1/r)*Ahat(1:n-1,n)’*inv(Ahat(1:n-1,1:n-1)’)*(p-Q);

%S = [-K*1/B(n) 1/B(n)];

S = [-K 1];

S = S*Trans;

SB = S*B

39

Page 49: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

limit = -((S*A)./(S*B))’;

alpha = limit - 5;

beta = limit + 5;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Control Signal Function: |

%% Calculates control signal, u |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function u = cntrlcalc(x,S,alpha,beta)

%delta = 0.0001;

delta = 0;

n = size(S,2);

sigma = S*x;

for i = 1:n;

if x(i)*sigma > delta;

K(i) = alpha(i);

elseif x(i)*sigma < -delta;

K(i) = beta(i);

else

K(i) = 0;

end

end

u = K*x;

A.4 Perfect Feedback Simulation%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Main Program |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear

clc

%%%%%%%%%%%%%%%%%

%% Preprocessing

%%%%%%%%%%%%%%%%%

% get system model

model1a

% Discrete System Model

T1 = 0.0001; % RASID sampling time

T2 = 0.001; % Computer sampling time

sys = ss(A,B,C1,D);

dsys = c2d(sys,T2,’foh’);

[Ad,Bd,Cd,Dd] = ssdata(dsys);

sysc1v = ss(Av,Bv,C1v,Dv);

sysc2v = ss(Av,Bv,C2v,Dv);

sysd1v = c2d(sysc1v,T1,’zoh’);

40

Page 50: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

[Adv,Bdv,Cd1v,Ddv] = ssdata(sysd1v);

sysd2v = c2d(sysc2v,T1,’zoh’);

[Adv,Bdv,Cd2v,Ddv] = ssdata(sysd2v);

% calculate control gains

Q = diag([0 1e3 0]);

[S,alpha,beta] = smcntrl(Ad,Bd,Q);

% desired trajectory

load xd.txt;

xd = xd(550:size(xd,1))’-0.4;

n = size(xd,2)-1; % number of time steps for the simulation

%%%%%%%%%%%%%%%%%%%%%%%

%% Control Simulation

%%%%%%%%%%%%%%%%%%%%%%%

% initial conditions

x = [0 0; 0 0; 0 0; 0 0]; % actual states

time = 0;

u = 0; % control calculated from VSC gains

r = 0; % reference signal given to RASID

for i = 2:n;

time(i) = T2*(i-1);

des = [xd(i); xd(i); (xd(i+1)-xd(i-1))/(2*T2); (xd(i+1)-xd(i-1))/(2*T2)];

e(:,i) = [x(:,i)-des];

u(i) = cntrlcalc(e(:,i),S,alpha,beta);

udot = (u(i)-u(i-1))/T2;

if udot == 0;

ubar = u(i)*ones(1,10);

else

ubar = u(i-1)+udot*T1:udot*T1:u(i)+udot*T1;

end

rdot = udot/Kp;

r = (ubar-Kd*rdot)/Kp;

xr = x(:,i);

for j = 1:10;

xr = Adv*xr + Bdv*[Kp Kd]*[r(j); rdot];

end

x(:,i+1) = xr;

% x(:,i+1) = Ad*x(:,i) + u(i);

end

A.5 Estimated State Feedback Simulation%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Main Program (w/ Kalman) |

%% Thesis Simulation |

%% Aimee Beargie |

%% September 16, 2002 |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear

clc

%%%%%%%%%%%%%%%%%

%% Preprocessing

%%%%%%%%%%%%%%%%%

41

Page 51: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

% get system model

model1a

% Discrete System Model

T1 = 0.0001; % RASID sampling time

T2 = 0.001; % Computer sampling time

sys = ss(A,B,C2,D);

dsys = c2d(sys,T2,’foh’);

[Ad,Bd,Cd,Dd] = ssdata(dsys);

sysc1v = ss(Av,Bv,C1v,Dv);

sysc2v = ss(Av,Bv,C2v,Dv);

sysd1v = c2d(sysc1v,T1,’zoh’);

[Adv,Bdv,Cd1v,Ddv] = ssdata(sysd1v);

sysd2vs = c2d(sysc2v,T2,’foh’);

[Advs,Bdvs,Cd2vs,Dd2vs] = ssdata(sysd2vs);

% Kalman Filter Gains

m = 35;

d = 25;

v1 = .01; % std dev of input

V = v1*B*B’*v1;%diag([0 0 v1^2 0]);

w1 = 5e-6; % amp of encoder meas (m/enc. count)

w2 = .005*9.81; % std dev of accel

w3 = .1/640; % amp of vision meas (m/pixel)

W = [w1^2/12 0 0; 0 w2^2 0; 0 0 w3^2/12];

[Amik,Bmik,Cmik,Ddmik,Lfast,Ldel,amd,bmd,emd] = dmrfunc(sys,T2,2,V,W,m,d)

% calculate control gains

Q = diag([0 10 0.0001]);

[S,alpha,beta] = smcntrl(Ad,Bd,Q);

% %Step at time = 0.1

% n = 1000;

% for i = 1:n+1;

% if i*T2 < 0.1

% xd(i)=0;

% else

% xd(i)=0.055;

% end

% end

% desired trajectory

load xd.txt;

%xd = xd2’/1e6;

xd = xd(550:size(xd,1))’-0.4;

n = size(xd,2)-1; % number of time steps for the simulation

%%%%%%%%%%%%%%%%%%%%%%%

%% Control Simulation

%%%%%%%%%%%%%%%%%%%%%%%

% initial conditions

x = [0 0; 0 0; 0 0; 0 0]; % actual states

time = 0;

u = 0; % control calculated from VSC gains

r = 0; % reference signal given to RASID

sat = 100; % saturation limit on motor

% initial for Kalman Filter

xh = [0 0; 0 0; 0 0; 0 0]; % estimated states

add = 0;

xvis = 0;

42

Page 52: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

Ca = Cd2vs(1:2,:);

Da = Dd2vs(1:2,:);

Cvis = Cd2vs(3,:);

Dvis = Dd2vs(3,:);

for i = 2:n;

time(i) = T2*(i-1);

des = [xd(i); xd(i); (xd(i+1)-xd(i-1))/(2*T2); (xd(i+1)-xd(i-1))/(2*T2)];

e(:,i) = [xh(:,i)-des];

u(i) = cntrlcalc(e(:,i),S,alpha,beta);

if u(i) > sat;

u(i) = sat;

elseif u(i) < -sat;

u(i) = -sat;

end

udot = (u(i)-u(i-1))/T2;

if udot == 0;

ubar = u(i)*ones(1,10);

else

ubar = u(i-1)+udot*T1:udot*T1:u(i)+udot*T1;

end

rdot = udot/Kp;

r = (ubar-Kd*rdot)/Kp;

xr = x(:,i);

for j = 1:10;

xr = Adv*xr + Bdv*[Kp Kd]*[r(j); rdot];

end

R(i) = r(10);

x(:,i+1) = xr;

y(:,i) = Ca*x(:,i)+Da*u(i);

yv(i) = Cvis*x(:,i)+Dvis*u(i);

% Kalman Filter:

rr = mod(i,m);

if rr == 0,

xvis(i) = amd*xh(:,i-d+1) + add;

xh(:,i+1) = Advs*xh(:,i) + Bdvs*u(i) + Ldel*([y(:,i);yv(i)]-[Ca*xh(:,i);xvis(i)]);

add = 0;

else

xh(:,i+1) = Advs*xh(:,i) + Bdvs*u(i) + Lfast(:,:,rr)*(y(:,i)-Ca*xh(:,i)-Da*u(i));

if rr > m-d,

add = add + bmd(:,(rr-m+d))*u(i) + emd(:,2*(rr-m+d)-1:2*(rr-m+d))*y(:,i);

end

end

% x(:,i+1) = Ad*x(:,i) + Bd*u(i);

end

43

Page 53: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

APPENDIX B

EQUIPMENT DATA SHEETS

Anorad LW-10 Linear Stage Diagram

44

Page 54: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

45

Page 55: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

46

Page 56: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

47

Page 57: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

48

Page 58: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

REFERENCES

[1] John S. Bay. Fundamentals of Linear State Space Systems. McGraw-Hill, 1999.

[2] Ferdinand P. Beer and E. Russell Johnston Jr. Vector Mechanics for Engineers. TheMcGraw-Hill Companies, Inc., 6 edition, 1996. front cover.

[3] Wen-Jun Cao and Jian-Xin Xu. Oscillation elimination of tip regulation for a single-linkflexible manipulator. International Journal of Robust and Nonlinear Control, 11:267–285, 2001.

[4] Jeang-Lin Chang and Yon-Ping Chen. Force control of a single-link flexible arm usingsliding-mode theory. Journal of Vibration and Control, 4:187–200, 1998.

[5] Xinkai Chen and Guisheng Zhai. Sliding mode method based vibration control offlexible arms. In American Control Conference, pages 2374–2379, May 2002.

[6] R.A. DeCarlo, S.H. Zak, and S.V. Drakunov. The Control Handbook, chapter 57.5Variable Structure, Sliding-Mode Controller Design, pages 941–951. CRC Press, 1996.

[7] Raymond A. DeCarlo, Stanislaw H. Zak, and Gregory P. Matthews. Variable structurecontrol of nonlinear multivariable systems: A tutorial. In Proceedings of the IEEE,volume 76, pages 212–232, March 1988.

[8] J. Enriquez-Zarate, G. Silva-Navarro, and H. Sira-Ramirez. Sliding mode control ofa differentially flat vibrational mechanical system: Experimental results. In IEEEConference on Decision and Control, pages 1679–1684, December 2000.

[9] Paul M. Fishbane, Stephen Gasiorowicz, and Stephen T. Thornton. Physice for Sci-entists and Engineers. Prentice Hall, 2 edition, 1996.

[10] Dadi Hisseine and Boris Lohmann. Nonlinear tracking control for a lightweight flexiblerobot. In IEEE International Conference on Systems, Man, and Cybernetics, volume 5,pages 3360–3365, October 2000.

[11] Harry N. Iordanou and Brian W. Surgenor. Experimental evaluation of the robustnessof discrete sliding mode control versus linear quadratic control. IEEE Transactions onControl Systems Technology, 5(2):254–260, March 1997.

[12] Jianchun Li, Bijan Samali, and Guang Ha. Fuzzy sliding mode control of a five storeybenchmark model equipped with active mass driver (amd). In The 6th InternationalConference on Motion and Vibration Control, August 2002.

[13] Michael Mashner. Multirate machine vision based kalman filtering and state feedbackcontrol. Master’s thesis, Georgia Institute of Technology, November 2002.

[14] W.T. Quian and C.C.H. Ma. Experiments on a flexible one-link manipulator. In IEEEPacific Rim Conference on Communications, Computers and Signal Processing, pages262–265, May 1991.

49

Page 59: Sliding Mode Control of a Non-Collocated Flexible System · control became a strategy of interest due to its seemingly robust nature. The application of variable structure control

[15] W.T. Quian and C.C.H. Ma. Weighted sliding mode control of a flexible one-linkarm. In IEEE Pacific Rim Conference on Communications, Computers and SignalProcessing, pages 162–165, May 1991.

[16] W.T. Quian and C.C.H. Ma. A new controller design for a flexible one-link manipulator.IEEE Transactions on Automatic Control, 37(1):132–137, January 1992.

[17] Marcello Romano, Brij N. Agrawal, and Franco Bernelli-Zazzera. Experiments oncommand shaping control of a manipulator with flexible links. Journal of Guidance,Control, and Dynamics, 25(2):232–239, March-April 2002.

[18] Nader Sadegh, Ai-Ping Hu, and Courtney James. Synthesis, stability analysis, and ex-perimental implementation of a multirate repetitive learning controller. ASME Journalof Dynamic Systems, Measurement, and Control, December 2002.

[19] Hebertt Sira-Ramirez. A dynamical variable structure control strategy in asymptoticoutput tracking problems. IEEE Transactions on Automatic Control, 38(4):615–620,April 1993.

[20] Jean-Jacques E. Slotine and Weiping Li. Applied Nonlinear Control. Prentice Hall,1991.

[21] Susy Thomas and B. Bandyopadhyay. Comments on ”a new controller design for aflexible one-link manipulator”. IEEE Transactions on Automatic Control, 42(3):425–429, March 1997.

[22] K. David Young and Umit Ozguner. A control engineer’s guide to sliding mode control.IEEE Transactions on Control Systems Technology, 7(3):328–342, May 1999.

[23] Ismail Yuksek, Nurkan Yagiz, Rahmi Guclu, Yoshihiro Kikushima, and Nobuo Tnaka.Active control of viaduct road vibrations using sliding modes. In The 6th InternationalConference on Motion and Vibration Control, August 2002.

50