Sie sind auf Seite 1von 99

ANTI-SWING CONTROL OF A SUSPENDED VARYING

LOAD WITH A ROBOTIC CRANE

A thesis presented to

the faculty of

Fritz J. and Dolores Russ

College of Engineering and Technology of Ohio University

In partial fulfillment

of the requirements for the degree

Master of Science

Bibhrajit Halder

August 2002
This thesis entitled

ANTI-SWING CONTROL OF A SUSPENDED VARYING

LOAD WITH A ROBOTIC CRANE

BY

Bibhrajit Halder

has been approved for

the School of Mechanical Engineering

and the Russ College of Engineering and Technology by

Jae Lew

Assistant Professor of Mechanical Engineering

Dennis Irwin

Dean, Russ College of Engineering and Technology


HALDER, BIBHRAJIT, MS. August 2002. Mechanical Engineering

Anti-swing Control of a Suspended Varying Load with a Robotic Crane (99pp.)

Director of Thesis: Jae Lew

This thesis presents feedback control algorithm for a robotic crane carrying a suspended

varying load. A controller based on swing angle feedback method is proposed and its

performance is compared with Proportional and Derivative (PD) and full state feedback

controllers. The proposed controller suppresses the swing motion of the load while the

crane carries the load to a desired position. The analysis includes the nonlinear dynamics

of the crane and two-dimensional swing motion of the load. A simulation study is

performed under various load condition to show the effectiveness of the swing angle

feedback controller. The proposed controller is successfully implemented on the test bed

at Mechanical Engineering Control Laboratory, Ohio University.

Approved: Jae Lew

Assistant Professor of Mechanical Engineering Department


4
TABLE OF CONTENTS

Page
TITLE .................................................................................................................................1

APPROVAL .......................................................................................................................2

ABSTRACT........................................................................................................................3

LIST OF TABLES .............................................................................................................7

LIST OF FIGURES ...........................................................................................................8

LIST OF SYMBOLS .......................................................................................................11

CHAPTER 1. INTRODUCTION ....................................................................................13

1.1 MOTIVATION .....................................................................................................13

1.2 LITERATURE REVIEW .....................................................................................14

1.3 SUMMARY..........................................................................................................16

CHAPTER 2. CONCEPTUAL STUDY WITH OVERHEAD CRANE SYSTEM ...18

2.1 SYSTEM DESCRIPTION....................................................................................19

2.2 OPEN LOOP RESPONSE....................................................................................22

2.3 PERFORMANCE SPECIFICATION ..................................................................23

2.4 DESIGN OF FEEDBACK CONTROLLERS ......................................................23

2.4.1 PD CONTROLLER ...................................................................................24

2.4.2 FSF CONTROLLER (POLE PLACEMENT METHOD).........................30

2.4.3 FSF CONTROLLER (LQR METHOD)....................................................33

2.4.4 SWING ANGLE FEEDBACK CONTROLLER ......................................35


5

CHAPTER 3. MODELING OF TWO-LINK ROBOTIC CRANE ............................38

3.1 DYNAMIC MODELING ......................................................................................38

3.2 SIMPLIFICATION OF THE MODEL..................................................................44

3.3 STATE SPACE MODEL ......................................................................................46

CHAPTER 4. ANTI-SWING CONTROL DESIGN ....................................................49

4.1 PROBLEM STATEMENT....................................................................................50

4.2 DESIGN OF ANTI-SWING CONTROLLER ......................................................51

4.2.1 PD CONTROLLER ...................................................................................51

4.2.2 FSF CONTROLLER (POLE PLACEMENT METHOD).........................53

4.2.3 FSF CONTROLLER (LQR METHOD)....................................................55

4.2.4 SWING ANGLE FEEDBACK CONTROLLER ......................................56

4.3 SIMULATION RESULTS ....................................................................................59

CHAPTER 5. EXPERIMENTS WITH TEST BED.....................................................69

5.1 TEST BED DESCRIPTION ..................................................................................69

5.1.1 HARDWARE ............................................................................................69

5.1.2 SOFTWARE ..............................................................................................70

5.1.3 OVERALL SYSTEM ................................................................................71

5.2 MODEL VERIFICATION ....................................................................................74

5.3 EXPERIMENTAL RESULTS...............................................................................77


6

CHAPTER 6. CONCLUSION........................................................................................85

6.1 CONCLUSION......................................................................................................85

6.2 CONTRIBUTION..................................................................................................87

6.3 FUTURE WORK...................................................................................................88

REFERENCES.................................................................................................................89

APPENDIX A: MATLAB FILE FOR DYNAMIC MODEL ..........................................91

APPENDIX B: MATLAB FILE FOR CONTROLLER ..................................................96


7

LIST OF TABLES

Table 3.1: system Parameter for Computer Simulation………………………………….47


8

LIST OF FIGURES

Figure 1.1: Test bed at Ohio University.............................................................................17

Figure 2.1: Simple overhead crane system ........................................................................18

Figure 2.2: Impulse response of the system.......................................................................22

Figure 2.3: Step response of the system.............................................................................22

Figure 2.4(a): Poles for low kp/kd .......................................................................................25

Figure 2.4(b): Poles for medium kp/kd................................................................................25

Figure 2.4(c): Poles for high kp/kd ......................................................................................25

Figure 2.5: Simulink diagram of the system with PD controller .......................................26

Figure 2.6: Simulink results of the system with PD controller..........................................27

Figure 2.7: Simulation results of the system with FSF controller .....................................32

Figure 2.8: Simulation results of the system with FSF controller (LQR method).............34

Figure 2.9: Simulink diagram of the system with swing angle feedback control..............36

Figure 2.10: Simulation results of the system with swing angle feedback controller .......37

Figure 3.1: Line diagram of two-link robotic arm .............................................................38

Figure 4.1: Simulink diagram of the system with PD controller .......................................52

Figure 4.2: Simulink diagram of the system with FSF controller......................................54

Figure 4.3: Simulink diagram of the system with swing angle feedback controller..........59

Figure 4.4: X-axis oscillation under various payloads using PD controller ......................61

Figure 4.5: Y-axis oscillation under various payloads using PD controller ......................61

Figure 4.6: First joint angle q1 under various payloads using PD controller.....................62
9

Figure 4.7: Second joint angle q2 under various payloads using PD controller ................62

Figure 4.8: X-axis oscillation under various payloads using FSF control (PPM) .............63

Figure 4.9: Y-axis oscillation under various payloads using FSF control (PPM) .............63

Figure 4.10: Joint angle q1 under various payloads using FSF control (PPM)..................64

Figure 4.11: Joint angle q2 under various payloads using FSF control (PPM)..................64

Figure 4.12: X-axis oscillation under various payloads using FSF control (LQR) ...........65

Figure 4.13: Y-axis oscillation under various payloads using FSF control (LQR) ...........65

Figure 4.14: Joint angle q1 under various payloads using FSF control (LQR)..................66

Figure 4.15: Joint angle q2 under various payloads using FSF control (LQR)..................66

Figure 4.16: X-axis oscillation under various payloads using SAF controller ..................67

Figure 4.17: Y-axis oscillation under various payloads using SAF controller ..................67

Figure 4.18: Joint angle q1 under various payloads using SAF control.............................68

Figure 4.19: Joint angle q2 under various payloads using SAF control.............................68

Figure 5.1: Test bed ...........................................................................................................70

Figure 5.2: Data signal flow...............................................................................................73

Figure 5.3: Simulink diagram for the model verification ..................................................75

Figure 5.4(a): First joint angle comparison........................................................................76

Figure 5.4(b): Second joint angle comparison...................................................................76

Figure 5.5: The Simulink diagram of the system with SAF ..............................................77

Figure 5.6(a): X-axis oscillation for payload 1kg with SAF and PD controller ................79

Figure 5.6(b): Y-axis oscillation for payload 1kg with SAF and PD controller................79

Figure 5.7: Comparison of joint angle q1 with PD control for payload 1kg......................80
10

Figure 5.8: Comparison of joint angle q1 with SAF controller for payload 1kg ...............80

Figure 5.9: Comparison of joint angle q2 with PD control for payload 1kg......................81

Figure 5.10: Comparison of joint angle q2 with SAF controller for payload 1kg .............81

Figure 5.11(a): X-axis oscillation for payload 2.3 kg with SAF and PD controller ..........82

Figure 5.11(b): Y-axis oscillation for payload 2.3 kg with SAF and PD controller..........82

Figure 5.12: Comparison of joint angle q1 with PD control for payload 2.3 kg................83

Figure 5.13: Comparison of joint angle q1 with SAF controller for payload 2.3 kg .........83

Figure 5.14: Comparison of joint angle q2 with PD control for payload 2.3 kg................84

Figure 5.15: Comparison of joint angle q2 with SAF controller for payload 2.3 kg .........84
11

LIST OF SYMBOLS

θ : Swing angle for simple overhead crane system

M : Mass of the cart in overhead carne system

m : Mass of payload in overhead crane system

x : Distance of the cart position from it’s initial position in X coordinate

&x& : Acceleration of the cart

θ& : Velocity of swing angle

θ&& : Acceleration of swing angle

F : Applied force to the cart

g : Acceleration due to gravitation

l : Length of the pendulum

kp : Proportional constant of PD controller

kd : Derivative constant of PD controller

ζ, : Damping ratio

K : Gain matrix

m1 : Mass of first link

m2 : Mass of second link

m3 : Mass of payload

l1 : Length of first link

l2 : Length of second link


12

l g1 : Length of mass center of link l1 from joint A

lg2 : Length of mass center of link l2 from joint B

I1 : Moment of inertia of first link with respect to the mass center of link 1

I2 : Moment of inertia of second link w.r.t the mass center of link 2

g : Gravitational constant

T : Kinetic energy

V : Potential energy

θx : Swing angle in X-axis

θy : Swing angle in Y-axis

Ts : Settling time

ς1 : Torque from first motor

ς2` : Torque from second motor

ωn : Swing frequency
13

CHAPTER 1: INTRODUCTION

1.1 Motivation

Cranes are widely used in industry to transport heavy loads. For example, on the

construction site, harbor, or warehouse, it is often found that a crane carries a suspended

load to the point of interest. However, the swing motion of the load often limits its

operational efficiency and safety. To reduce the swing motion of the load, the crane

requires a special control scheme.

This problem is popularly known as anti-swing control of the crane system and it

has drawn the interest of control engineers for a long time. The controller should be able

to handle a wide range of payloads without prior knowledge, which is the typical scenario

of an industrial crane.

A controller based on swing angle feedback method is proposed, after comparing it

with three other different linear controllers, to handle a wide range of payloads. The three

other controllers are, Proportional and Derivative (PD) controller based on root locus

method and full state feedback controller based on pole placement method and Linear

Quadratic Regulator (LQR) method. The results of all four controllers are compared

under various payload conditions; namely, 1 kg (nominal), 10 kg and 0.1 kg.


14

The swing angle feedback controller has advantages over the other controllers under

various payload conditions. First, the proposed controller adds an extra feedback loop to

damp out the swing. This extra feedback loop is independent of the payloads. Thus it is

more robust under various payloads. Second, it can be easily implemented to an existing

industrial system.

1.2 Literature Review

Modeling and control of an overhead crane is a long-time research interest. Many

researchers have worked on this issue of anti-swing control of the crane system. Their

work can be divided into largely two groups: open loop and closed loop control.

The open loop methods, such as low pass filter, symmetric acceleration profile [1],

and input shaping [2] [3], are intended not to excite the swing motion. They are simple to

implement but cannot suppress swing motion caused by external disturbances. They also

do not perform satisfactorily for a wide range of payloads.

On the other hand, the closed loop method of swing motion provides the ability to

eliminate existing swing motion and rejects disturbances at the cost of an extra sensor.

Ho-Hoon Lee et al. [4] have developed a closed-loop controller based on root locus

and loop-shaping. He also derived a near dynamic model of a three-dimensional overhead

crane based on two degree of freedom swing angle. But he linearized his dynamic
15
equation to find the decoupled control law. The new decoupled control law can’t work

for varying payloads, as it requires exact knowledge of the payload beforehand.

Wen. B et al. [5] developed the closed-loop controller based on the LQR method.

This approach also requires knowledge of the payloads beforehand.

Chi-Chen Cheng and Cheng-Yi Chen et al. [6] derived a control law using the

feedback linearization technique. This method addresses the issue of varying payloads.

J.A. Mendez et al. [7] have proposed a more complex neural network based self-tuning

controller. Both M. Mahfouf et al. [8] and A. Benhidjep et al. [9] developed a fuzzy logic

based controller. The analysis and implementation of all the above controllers are limited

to one-directional linear overhead crane systems.

Ji sup Yoon et al [10] designed several anti-swing controllers using both open-loop

and closed-loop approaches. In order to develop more effective and robust controller he

developed a pre-programmed feedback controller and a fuzzy controller. He implemented

all the controllers on a one-directional linear pilot crane system.

In general, the analysis is often limited to only one-directional or two degree of

freedom linear overhead crane. Also, the crane dynamics is often ignored and considered

only as a controlled velocity source, which may not hold under heavy load. In addition, it

often requires an exact model of the overall system and cannot maintain swing control

under a wide range of payloads.


16

1.3 Summary

Cranes are popularly used in industry to carry heavy loads. It is found that the swing

in the suspended load limits the operational efficiency. To reduce the swing motion,

swing angle feedback controller is proposed.

Different control methods are applied to design a controller to suppress the swing

motion of a load suspended from a two link robotic arm. A simple one-directional

overhead crane system is considered to illustrate the dynamic behavior of the system.

Four different controllers, namely, PD controller based on graphical root locus method,

pole placement controller, LQR controller and swing angle feedback controller, are

designed for the simple overhead crane system. First, the simulation results for each

controller are obtained. The simulation study demonstrated that the significant damping

effect was obtained using angle feedback controller. The swing angle feedback controller

also performs better under various payloads. The analysis on a simple one-directional

overhead crane helps to better understand the dynamic behavior of the system under

different controllers.

The modeling of the overall system of a four-degree-of-freedom robotic crane is

derived using Lagrange’s Equation. With few assumptions, the actual dynamic model is

simplified and expressed in a state space form.


17

To demonstrate the proposed swing angle feedback controller and compare it with

others, experiments were performed on a test bed at the Mechanical Engineering Control

Laboratory, Ohio University. Figure 1.1 shows the actual test bed. Two motors are

mounted at each active joint. An aluminum rod is attached at the end of two link robotic

arm, which swings as the links moves. The experimental results match closely with the

simulation results.

Figure 1.1: Test bed at Ohio University


18

CHAPTER 2: CONCEPTUAL STUDY WITH OVERHEAD CRANE SYSTEM

A simple two-degree-of-freedom overhead crane system can be thought of as

representing a four-degree-of-freedom robotic manipulator system with a pendulum. A

simple overhead crane system, shown in Figure 2.1, consists of a cart of M, and a

pendulum with payload, m. The cart represents the tip position of the robotic arm. The

control objective is to move the cart from position ‘1’ to position ‘2’, with minimum or

possibly zero swing angle, θ. This simple overhead crane is used in the following

analysis to illustrate the dynamic behavior of the system under various controllers,

namely, PD controller, full state feedback controller and finally swing angle feedback

controller.

1 2

M M

m
m

Figure 2.1: Simple overhead crane system


19

2.1 System Description

The dynamic model of the simple overhead crane system has been derived using

Newtonian mechanics. The pendulum l is considered as a rigid link and its length is

assumed to be constant. x denotes the distance of the cart from it’s initial position, in X

coordinate. The system dynamics of Figure 2.1 are shown in Equations (2.1) and (2.2).

([11] Page 782-784)

( M + m) &x& + mlθ&& cos θ − mlθ& 2 sin θ = F (2.1)

ml 2θ&& + ml&x& cos θ + mgl sin θ = 0 (2.2)

where M denotes the mass of the cart in Kg , m denotes the mass of payload at the end of

the pendulum, in Kg, &x& denotes the acceleration of the cart, θ denotes the swing angle,

θ& denotes the velocity of the swing angle, θ&& denotes the acceleration of the swing angle,

F denotes the applied force in Newton, g stands for acceleration due to gravity, and l

denotes the length of the pendulum.

With an assumption that the swing angle remains small so that

sin θ ≅ θ and cos θ ≅ 1 , the system Equations (2.1) and (2.2) may be linearized as

follows:

( M + m) &x& + mlθ&& = F (2.3)

lθ&& + &x& + gθ = 0 (2.4)


20

Equations (2.3) and (2.4) are used as the dynamic model of the cart and pendulum

system for rest of this section.

To represent Equations (2.3) and (2.4) in a state space form, four states have been

chosen as follows: X 1 = x, X 2 = x& , X 3 = θ , X 4 = θ& . Representing them in a matrix form,

X& = AX + BU and Y = CX + DU , where A is the system dynamics matrix, U is the

input, Y is the output, B, C and D are coefficient matrix.

The matrix, A, B, C and D are as follows:

 X& 1  0 1 0 0  X 1   0 
&      
 X 2  = 0 0 mg / M 0 X2 1/ M 
  +  [F ] ( 2.5)
 X&  0 0 0 1  X 3   0 
 3     
 X& 4  0 0 − g ( M + m) / Ml 0  X 4   − 1 / Ml 

And the output equations are as follows:

X 
 1
 x  1 0 0 0   X 2   0 
 =
θ 0 0 1 0
  + 0 [F ] (2.6)
    3   
X
X 
 4
21

For simulation purposes, the parameters are assigned as follows:

M=2 kg, m=1 kg, l =1 m, to get the A, B and C matrixes in numerical values.

The A, B and C matrix are given as

0 1 0 0 0 
0 0 0.5 
0 4.9 1 0 0 0 
A=  , B= , C= 
0 0 0 1 0   0 0 1 0
   
0 0 − 14.7 0  − 0.5

The D matrix is a (2x1) zero matrix; it physically represents the part of input, which

produces the output, bypassing the system dynamics.

The system described by Equation (2.5) and Equation (2.6) has only one control

input, but has two states, x andθ, to be controlled. In the following sections, open-loop

response of the system will be discussed and controllers will be designed for the system.
22

2.2 Open loop System Response

To get the open-loop response of the system, a unit step input and an impulse input

have been applied to the system. Figure 2.2 shows the impulse response of the system,

and Figure 2.3 shows the step response of the system. It is observed that the cart

displacement keeps on increasing, since there is no friction in the simulated system. It is

also observed that there is no damping in the swing motion of the pendulum. Its natural

frequency is observed at 0.6 Hz.

Figure 2.2: Impulse response of the system

Figure 2.3: Step response of the system


23

2.3 Performance specification

The control objective is to determine the control inputs, F, such that the oscillation

in the pendulum damps out as quickly as possible while the cart moves from position ‘1’

to ‘2’. More precisely, the desired objectives are as follows:

• Settling time<6 sec,

• % Overshoot< 10% and

• Damping ratio>.6 for the swing motion.

2.4 Design of Feedback Controllers

In this section, four different controllers will be designed. The first controller is a

PD control based on root locus method. Root locus method is a graphical method to

design the closed loop pole locations. The second controller is a full-state feedback

control based on pole placement method. In this method, poles of closed-loop system are

placed at desired locations by means of choosing the appropriate state feedback gain

matrix. The third controller is another full-state feedback control based on Linear

Quadratic Regulator (LQR) method. Finally, a swing angle feedback controller is

proposed. In this method, an extra angle feedback loop has been added to the existing PD

controlled system to damp out the swing motion of the pendulum.


24

2.4.1 PD controller

An iterative root locus analysis is used to find a unique set of values for proportional

constant, kp, and derivative constant, kd, to maximize the damping of the system. The root

locus method is a graphical method for determining the location of all closed-loop poles

as the parameter is changed from zero to infinity. This method yields the closed loop pole

location for which the system satisfies the desired specification.

In the following, three different cases have been considered, first a low kp/kd ratio,

second medium kp/kd ratio and finally high kp/kd ratio. To change the kp/kd ratio, the kd

value keeps constant and the kp value has been changed. For low kp/kd ratio, a low kp

value has been chosen. A medium kp value has been chosen to get a medium kp/kd ratio.

Finally, a high value of kp has been chosen to get high kp/kd ratio. The root-locus plots for

the three different cases are shown in Figure 2.4(a), (b) and (c). It can be observed in the

root locus plot that the maximum damping for low kp value is restricted below .15. As the

kp value increases, kp/kd value increases and the poles moves to the left hand side. That

increases the maximum damping to .37. As kp/kd ratio increases, the two poles move

towards the imaginary axis, which in turn decreases the damping ratio. From this

graphical method, the kp and kd value are chosen for medium kp/kd value.
25

Figure 2.4(a): Poles for low kp/kd Figure 2.4(b): Poles for medium kp/kd

Figure 2.4(c): Poles for high kp/kd


26
Simulink diagram of the overall system with the PD controller has been shown in Figure

2.5.

Figure 2.5: Simulink diagram of the system with PD controller

It can be observed from Figure 2.5 that only the cart position, x, has been used for

the feedback loop. The PD controller only controls the position of the cart and has no

control over the swing motion of the pendulum. This can be observed in the Simulink

results of the system with the PD controller.


27
The simulation results are shown in Figure 2.6 for kp=21 and kd= 6. The simulation

was performed for payloads 1 kg (nominal), 10 kg and 0.1 kg. The same controller has

been applied for all the payloads.

C o m p a r i s o n o f c a rt p o si ti o n f o r th r e e d if f e r e n t p a y lo a d s
1.4

1.2

1
Position of cart in meter

0.8
P o s i ti o n o f c a rt w i th p a y lo a d 1 k g
P o s i ti o n o f c a rt w i th p a y lo a d . 1 k g
0.6
P o s i ti o n o f c a r t w i th p a y lo a d 1 0 k g

0.4

0.2

0
0 5 10 15 20
T im e in s e c

S w i n g a n g le f o r d i ff e r e n t p a y loa d s
0.6
S w i n g a n gle f or p ay lo ad 1 0 k g

0.4

0.2
Swing angle in radian

-0 .2

-0 .4

-0 .6
S wi n g a n g le f o r p a y lo a d 1 k g S w i n g a n g le f o r p ay lo ad 0 .1 k g

-0 .8
0 5 10 15 20
T I m e i n s ec

Figure 2.6: Simulink results of the system with PD controller


28
It has been observed that to damp out the oscillation more damping has to be added to

the system. But as discussed earlier and is shown in Figures 2.4(a), (b) and (c), there is a

limitation in increasing damping by the position feedback only.

It is observed from Figure 2.6 that the overhead crane system with PD control

remains stable under various payload conditions. To find the stability criterion of the

system with PD control, Routh-Horiwitz criterions have been used. The linear dynamic

model of the system is given in Equations (2.3) and (2.4). Laplace transformation has

been used to write the equations in S-plane.

Equations (2.7) and (2.8) describe the dynamic equations in S-plane.

( M + m) s 2 X ( s ) + mls 2θ ( s ) = F ( s ) (2.7)

ls 2θ ( s ) + s 2 X ( s ) + gθ ( s ) = 0 (2.8)

The characteristic equation of the system, with PD controller, in S-plane is given in

Equation (2.9)

( Ms 2 + k d s + k p )(ls 2 + g ) + mgs 2 = 0 (2.9)

In order to use Routh-Horiwitz criterion, Equation (2.9) has been written by taking the

coefficient of s term together. It is shown in Equation (2.10)

Mls 4 + k d ls 3 + {( M + m ) g + k p l}s 2 + k d gs + k p g = 0 (2.10)


29
The first column of the Routh-Horiwitz table has been calculated and the four terms of

the column are given as follows:

mgk d g
a1 = Ml , a 2 = k d l , a 3 = mg + k d l , and a 4 =
k p l + mg

It is observed that all the four terms are positive, regardless of the weight of payload,

for positive kp and kd value. It proves that the system with PD controller remains stable

for positive kp and kd values under any payload condition.

In the next section, full state feedback control using pole placement method has been

discussed where the closed loop poles can be placed anywhere in the S-plane to achieve

the desired performance.


30
2.4.2 FSF Controller (Pole Placement Method)

It has been observed that the open loop system is marginally stable as open loop

system poles are on the imaginary axis of the S-plane. In this section a full state feedback

(FSF) control using pole placement method, will be presented. It is shown in Section 2.2

that the system is completely controllable. As the open loop system is fully controllable,

the poles of closed loop system are placed at desired location by full state feedback gain

matrix. The control law with the gain matrix K given as: U=r-KX, r represent the

reference input. A settling time of 5 sec and percent overshoot of 5% are chosen to decide

the desired dominant closed-loop pole location. The other two poles are selected 10 times

of the dominant pole (ME 601). The desired closed-loop pole locations in S-plane are

given as follows:

P1 = −2.0 + 3.46i
P2 = −2.0 − 3.46i
P3 = −20.0
P4 = −21.0

Ackerman’s formula ([11] Page 782-784) has been used to get the appropriate state

feedback gain matrix based on the desired closed loop pole locations. The value for the

gain matrix, K, is given as follows:

K = [1363 475.9 192.6 385.9]


31
In order to get the observer, desired pole locations are selected as 10 times the

controller desired poles. Ten times has been taken, to ensure that observer should have

faster work rate then controller, so that the observed values of the states are

approximately the same as the true state values.

The values for observer gain matrix, L, are given as follows:

 160 1650 
11030 295250
L= 
 0 140 
 
 30 6270 

The simulation results for pole placement controller are shown in Figure 2.7. The

state feedback gain matrix is designed based on payload 1 kg. But the same gain matrix is

used for payload 0.1 kg and 10 kg also. It can be observed in Figure 2.7 that the system

becomes unstable for payload 10 kg.

It can be observed that the values of the gain matrix are very high. The gain matrix

controls the input force to the system. A very high value of the gain matrix requires a

large force input into the system. Implementing such a controller for practical purposes

needs a lot of energy and sometime it is not possible to generate a large force. To avoid

this problem, in the next section, full state feedback control will be designed using LQR

method.
32

Res ults for P ole plac eme nt c ontro ller


5

P os ition of c art with pay load 1 k g:So lid line


4
P os ition of c art w ith pay load 0.1 kg:D ash ed line
3 P os ition of c art with pay load 10 kg:D otte d lin e
Position of cart in meter

-1

-2

-3
0 2 4 6 8 10
Time in s ec

Res ults F or P ole pla c ement m eth od


0. 3

S wing angle w ith p ay load 1 kg : S o lid line


0. 2

0. 1
Swing angle in radian

-0.1

-0.2
S wi ng a ngle with pay loa d 0. 1 kg : da shed line
-0.3
S wing angle with pay load 10 kg: D otted line

-0.4
0 5 10 15 20
Time in s ec

Figure 2.7: Simulation results of the system with FSF controller


33

2.4.3 FSF Controller (LQR Method)

In this section, an optimal control method known as Linear Quadratic Regulator

(LQR) ([11] Page 841-844, [12]) has been considered to design the full state feedback

controller. In pole placement method, the state feedback gain matrix has been calculated

purely based on desired closed loop pole location, without any physical insight of the

system. In LQR method, the state feedback gain matrix is calculated by minimizing the

performance index, J, as given in Equation (2.11):


J = ∫(X QX + U T RU ) dt
T
(2.11)
0

where Q is a positive-definite Hermitian or real symmetric matrix and R is a positive-

definite Hermitian or real symmetric matrix. The matrices Q and R determine the relative

importance of the error and the expenditure of the input energy. The choice of Q and R

allows the relative weighting of individual state variables, inputs as well the control

outputs. Both Q and R are taken as a unit matrix to give equal importance to all the states.

By taking Q and R as unit matrix the values of feedback gain matrix, K, are given as

KLQR =[1 2.66 -0.521 -0.177]


34

In Figure 2.8, the simulation results for FSF controller using LQR method are

shown. It has been observed that LQR controller works satisfactory for payload 1 kg. For

payloads of 10 kg and 0.1 kg the performance is not satisfactory.

R e s u lts f o r L Q R c o n tr o lle r
1.4

1.2

1
Position of cart in meter

0.8

P o s i ti o n o f c a r t w i th p a y lo a d 1 k g : S o li d lin e
0.6
P o s i ti o n o f c a rt w i th p ay lo a d 0 . 1 k g : D a s h e d li n e

0.4 P o s i ti o n o f c a r t w i th p a y lo a d 1 0 k g :D o t te d lin e

0.2

0
0 5 10 15 20
Tim e in s e c

R e s u lt s f o r L Q R m eth o d
0. 2

S wi n g a n gle w ith p a y loa d 1 k g : S o lid line


0 .1 5
S w in g a n gle w it h p a y loa d 0 . 1 kg : da s h e d lin e
0. 1 S w in g a n gle w it h p a y lo a d 1 0 k g : D o tte d lin e
Swing Angle in radian

0 .0 5

- 0 .0 5

-0 .1

- 0 .1 5

-0 .2
0 5 10 15 20
Tim e in s e c

Figure 2.8: Simulation results of the system with FSF controller (LQR method)
35
2.4.4 Swing Angle Feedback Controller

In this section, the controller has been designed based on swing angle feedback

method. To damp out the swing motion of the pendulum an extra angle feedback loop is

added to the PD controlled system. The controller is designed by implementing a

feedback of swing velocity into the acceleration of the cart as given in Equation (2.12)

[10] .

&x& = k sθ& and k s = 2lζω n (2.12)

where ks is the feedback gain for swing angle and ζ is a desired damping ratio and

g
, ω n (= ) ,is the swing frequency of the suspended loads. In Figure 2.9 a Simulink
l

diagram of the system with swing-angle feedback controller has been shown. Substituting

Equation (2.12) into Equation (2.4) gives the controlled dynamic system as follows:

θ&& + 2ζω nθ& + ω n 2θ = 0 (2.13)

Equation (2.13) is a damped second order system and by choosing the value of k s the

damping ratio can be assigned to rapidly damp out swing to zero. The value for k s has

been calculated using the system parameter values. The value of k s is shown in Equation

(2.14).

k s = 2 × 1 × 0.707 × 9.8 = 5.001 (2.14)


36
After integrating both sides of Equation (2.12) twice, it gives Equation (2.15).

x = k s ∫ θ dt (2.15)

This new x is added with the reference x and the result goes to the PD block. The

Simulink diagram of the system with angle feedback control is shown in Figure 2.9.

Figure 2.9: Simulink diagram of the system with swing angle feedback control

In Figure 2.10, the simulation results have been shown. It can be observed that the

system performs satisfactory for all the payloads.


37

Figure 2.10: Simulation results of the system with swing angle feedback controller
38

CHAPTER 3: MODELING OF TWO-LINK ROBOTIC CRANE

In the previous chapter, a simple two-degree-of-freedom overhead crane system is

considered. In the following section, a four-degree-of-freedom, two-link robotic crane is

considered and a dynamic model of the system is derived. The non-linear dynamic model

is linearized after a few assumptions and expressed in state space form.

3.1 Dynamic Modeling

A line diagram of the four-degree of freedom robotic crane system given in figure

1.1 is shown in Figure 3.1.

Figure 3.1: Line diagram of two-link robotic arm


39
There are two active links, l1 and l2. The rotation of the two links, q1 and q2, are

measured in radian. The angle q1 is the rotation of the first link with respect to the fixed

axis. The angle q2 is the rotation of the second link with respect to the first link. Another

link, l, is attached at the end of the second link and it swings both in X and Y directions.

The swing-angle of link l in X and Y directions, θx and θy, are straight from sensor

(Euler’s angle) measured in radian. There are two active joints, A and B and one passive

joints C. A payload has been attached at the end of the link l. The payload swings along

with the link l.

The dynamic model of this system is derived based on a newly defined two-

degree-of-freedom swing angle. The dynamics of the system is obtained using

Lagrange’s Equation.

In deriving the dynamic model of the system the following assumptions have been made:

(1) The elastic deformation of the system is being ignored.

(2) The link, l, is considered rigid and constant and has very small mass compared to

payload.

(3) The moment of inertia of payload is being neglected and is treated as a point mass.

For this four-degree of freedom system four generalized coordinates are chosen as

follows:

q1 , q2 , θ x andθ y , where q1, q2, θx and θy are defined as the first and second joint angles and

two swing-angles respectively.


40
The various terms used in deriving Lagrange’s Equation are given in the list of

symbols. The general form of Lagrange’s Equation is given in Equation (3.1).

d  ∂T  ∂T ∂V
 − + =τ (3.1)
dt  ∂q&  ∂q ∂q

T and V, the kinetic and potential energy of the system as defined above, and q

represents the generalized coordinate system. τ , represents the input torque. In order to

use Lagrange’s Equation, the various terms of the system are represented in terms of the

general coordinate systems.

Tip position of the robot is described as

x = l1 cos( q1 ) + l 2 cos( q1 + q2 ) (3.2)

y = l1 sin( q1 ) + l2 sin( q1 + q2 ) (3.3)

The coordinates of center of the two links are

x g1 = l g1 cos( q1 ) (3.4)

y g1 = l g1 sin( q1 ) (3.5)

x g 2 = l1 cos( q1 ) + l g 2 cos( q1 + q 2 ) (3.6)

y g 2 = l1 sin( q1 ) + l g 2 sin( q1 + q2 ) (3.7)


41
The position of payload in the fixed coordinates system is

x m = x + l sin(θ x ) cos(θ y ) (3.8)

y m = y + l sin(θ y ) (3.9)

z m = −l cos(θ x ) cos(θ y ) (3.10)

The kinetic energy of the system is given in Equation (3.11),

2 2 2 2
T = .5(l g1 q&1 + m1 v g1 + l g 2 ( q&1 + q& 2 ) 2 + m 2 v g 2 + m 3 v m ) (3.11)

2 2
The terms v g1 and v g 2 represents the velocity square of the mass center of the

2
first and second link, respectively. The term v m represents the velocity square of the

payload mass.

The velocities of the mass center of the first link in X and Y-axis have been

calculated. The square of the velocities in X and Y-axis has been added to get the

velocity square of the mass center of the first link. The steps are shown in the following

equations.

x& g1 = − q&1 l g1 sin( q1 ) (3.12)

y& g1 = − q&1 l g1 cos( q1 ) (3.13)

2 2 2
v g1 = l g1 q&1 (3.14)
42
The same steps have been performed for second link, l2, to calculate the velocity

square of the mass center of the second link. It is given in the following equations:

x& g 2 = − q&1l1 sin( q1 ) − ( q&1 + q& 2 )l g 2 sin( q1 + q 2 ) (3.15)

y& g 2 = − q&1l1 cos( q1 ) − ( q&1 + q& 2 )l g 2 cos( q1 + q 2 ) (3.16)

2 2 2
v g 2 = l1 q&12 + l g 2 ( q&1 + q& 2 ) 2 + 2l g 2 l1q&1 ( q&1 + q& 2 ) cos( q2 ) (3.17)

The velocity of the payload mass has been calculated in the same way and it is

given as follows:

x& m = x& + lθ&x cos(θ x ) cos(θ y ) − lθ& y sin(θ x ) sin(θ y ) (3.18)

y& m = y& + θ& y cos(θ y ) (3.19)

vm = l1 q&112 + l2 (q&1 + q&2 )2 + 2q&1 (q&1 + q&2 )l1l2 cos(q2 ) + l 2θ&x cos2 θ y
2 2 2 2

− 2ll1q&1θ&x sin(q1 ) cosθ x cosθ y + 2ll1q&1θ&y sin(q1 ) sinθ x sinθ y


− 2ll2 (q&1 + q&2 )θ&x sin(q1 + q2 ) cosθ x cosθ y + 2l3l2 (q&1 + q&2 )θ&y sin(q1 + q2 ) sinθ x sinθ y
+ 2ll1q&1θ&y cos(q1 ) cosθ y + 2ll2 (q&1 + q&2 )θ&y cos(q1 + q2 ) cosθ y

(3.20)

The three velocity square terms are substituted into the kinetic energy equation,

Equation (3.11), to get the kinetic energy of the system.


43
The potential energy of the system is given in Equation (3.21),

V = m 3 gl (1 − cos θ x cos θ y ) (3.21)

The kinetic and potential energy terms from Equations (3.20) and (3.21) substitute

into Lagrange’s Equation, Equation (3.1). Symbolic MATLAB have been used to

compute the dynamic model of the system after computing kinetic and potential energy

terms in the Lagrange’s Equation. The nonlinear dynamic model of the system is

represented in the matrix notation. The matrix notation of the model is shown in Equation

(3.22),

M ( q) q&& + C ( q& , q) q& + g ( q) = τ (3.22)

where

q = [q1 q2 θ x θ y ]
T

τ = [τ 1 τ 2 0 0]T

and

M (q) = [F1; F2; F3; F4]

C ( q& , q) = [C1; C2; C3; C4]

g(q)=[0 ;0 ; mgl sin θ x cos θ y ; mgl cos θ x sin θ y ]

The details of, F1, F2, F3, F3, F4, C1, C2, C3 and C4 are described in the MATLAB

program given in the Appendix A.


44
3.2 Simplification of the Model

The nonlinear dynamic model of the robotic system, given in Equation (3.22) has

been simplified by using the following assumptions:

1) The swing motion of the payload is considerably small.

2) The payload is a point mass.

The simplified dynamic model is given in Equation (3.23),

M ( q ) + M (q ) M ( q)  q&& C ( q , q& ) + C ( q , q& ) 0  q&  0 0   q  τ 


 r 2 l/r 2 rl    r 2 l/r 2       
   +   +  = 
 T
M (q) M  θ&&  C ( q , q& ) 0 θ&  0 K  θ  0 
 rl l   rl 2     l     

(3.23)

where q is the joint coorinates [q1T,q2T]T; θ is the swing angle coordinates [θxT,θyT]Τ;

τ is the joint torque; Mr is the inertia matrix of the robot itself; Cr is the nonlinear matrix

due to centrifugal and Coriolis force without the load; M rl and M l / r are the coupling inertia

matrices; C rl and C l / r are the coupling nonlinear terms due to carrying a load; and Kl is

the swing stiffness matrix due to the gravity. Detailed description of each term can be

expressed as

α +α + 2α3c2 α2 +α3c2  β +β +2β c β +β c 


Mr (q2 ) =  1 2 Ml / r (q2) = 1 2 3 2 2 3 2
 α2 +α3c2 α2   β2 +β3c2 β2 

 − β s − β 5 s12 β 4 c1 + β 5 c12  β 0 
M rl ( q ) =  4 1 Ml =  6
 − β 5 s12 β 5 c12   0 β 6 
45

−α s q& −α3 s2 (q&1 + q&2 ) − β s q& − β3 s2 (q&1 + q& 2 )


Cr (q2 , q&) =  3 2 2  C p / r (q2 , q&) =  3 2 2 
−α3 s2 q&1 0  − β3 s2 q&1 0 

− β c q& − β c (q& + q& ) − β5c12(q&1 + q&2 ) mp gl 0 


Crl (q2 , q&) =  4 1 1 5 12 1 2  Kl =  
− β4s1q&1 − β5s12(q&1 + q&2 ) − β5s12(q&1 + q&2 )  0 mp gl

Where
ci = cos(qi), si = sin(qi)

c12 = cos(q1+q2), s12 = sin(q1+q2)

α1 = I 1 +m1 l g1 2+m2l12 α2 = I 2 + m2 l g 2 2

α3 = m2 l g 2 l1,

β1 = m 3 l 1 2 , β2 = m 3 l 2 2

β3 = m 3 l 1 l2 , β4 = m 3 l 1 l

β5 = m3 l2l, β6 = m 3 l 2 .

Term αi is defined to represent the dynamic parameters of the robot in a simpler form and

βi is to represent the coupling dynamic parameters from the load.

By rewriting the nonlinear term in a vector form, Equation (3.23) becomes

Mr (q) + Mp/ r (q) Mrl (q)q&& Cr (q, q&) 0 0 q τ 
  +  +  =  (3.24)
 MTrl (q) Ml θ&& Cl (q, q&) 0 Kl θ  0
46

3.3 State Space Model

In the next section, Equation (3.24) will be used as the dynamic model of the

system to design the various controllers. To design the pole placement and LQR

controller, a linear state space dynamic model of the system is needed. The nonlinear

C ( q, q& ) 
term in Equation (3.24),  r  , has been neglected by assuming a very slow motion
Cl ( q, q& ) 

of the system. The velocity and acceleration of first and second link and the payload

becomes negligible for slow motion of the system. After neglecting the nonlinear term of

Equation (3.24), it becomes

Mr (q) + Mp/ r (q) Mrl (q)q&& 0 0 q τ 


  +  =  (3.25)
 MTrl (q) Ml θ&& 0 Kl θ 0

The constant coefficients of the four second-order differential equations have been

obtained for the nominal position of the system. The nominal position of the system is

described as follows:

First joint angle, q1 = 45 degree.

Second joint angle, q2 = 45 degree.

Payload = 1 kg.
47
To expresses the four second-order differential equations given in Equation (3.25)

in state-space form, eight states have been chosen as follows:

X 1 = q1 , X 2 = q2 , X 3 = q x , X 4 = q y , X 5 = q&1 , X 6 = q& 2 , X 7 = q& x and X 8 = q& y

The standard form of the state space representation is given as follows:

X& = AX + BU and Y = CX + DU (3.26)

where U and Y are input and output matrices respectively.

To get the numeric values of matrixes, A, B, C and D the system parameters used in

Equation (3.25) are given in Table 3.1.

Mass of 1st link 2.115 kg


nd
Mass of 2 link 0.765 kg
st
Inertia of 1 link w.r.t. 0.022 kg ⋅ m 2
mass center
Inertia of 2nd link w.r.t. 0.005 kg ⋅ m 2
mass center
Length of 1st link 0.285 m
nd
Length of 2 link 0.285 m
Length to mass center 0.207 m
st
of 1 link
Length to mass center 0.133 m
nd
of 2 link
Mass of load 1kg
Length of link l 1.2 m

Table 3.1: System Parameters for Computer Simulation


48
After substituting the system parameter values, the A, B, C and D matrixes have

been calculated and are given below.

0 0 0 0 1 0 0 0  0 0 
0 0 0 0 0 1 0 0  0 0 
   
0 0 0 0 0 0 1 0  0 0 
   
0 0 0 0 0 0 0 1 0 0 
A=  B= 
0 0 −2.75 2.75 0 0 0 0  4.19 −5.10
   
0 0 −6.49 6.49 0 0 0 0 −5.10 17.95 
0 0 −9.02 0.85 0 0 0 0  0.23 0.552
   
0 0 0.85 −9.02 0 0 0 0  −.23 −0.552

1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
C= 
and
D= 
0 0 1 0 0 0 0 0 0 0
   
0 0 0 1 0 0 0 0 0 0

The state-space form of linear dynamic model of the two link robotic crane with

four- degree-of-freedom suspended load system will be used in the next section to design

the full-state feedback controller.


49

CHAPTER 4: ANTI-SWING CONTROL DESIGN

In the last section, the dynamic model of a two-link robotic crane with a two-

dimensional suspended load has been derived. The derived nonlinear dynamic model has

been linearized with a few assumptions and expressed in a state-space form. Equations

(3.25) and (3.26) in the last section show the linear and state space form of the system. In

Chapter 2, different controllers, namely PD based on the graphical root locus method, full

state feedback based on the pole placement and LQR methods and angle feedback have

been designed for anti-swing control of a simple two-degree-of-freedom overhead crane

system. In this section, design of the same four controllers for a two-link robotic crane

with two-dimensional suspended load will be discussed. The performance of each

controller under three different payload conditions, as 1 kg, 0.1 kg and 10 kg, will be

shown in simulation results. The simulation is done under the nonlinear model, although

the controllers are based on the linear model. For simulation, a third order trajectory for

tip position of the robot is applied as a desired trajectory.

In this Chapter, first, design of the above-mentioned four controllers will be

discussed. Second, a third-order trajectory will be applied as a desired trajectory for the

robot. Third, computer simulation results using MATLAB/Simulink will be shown.

Finally, the conclusion of the results will be discussed.


50

4.1 Problem Statement

The control objective is to determine the control inputs, such that the oscillation in

pendulum damps out as quickly as possible while joint angles q1 and q2 follow the

desired path. To control such a system is difficult. First, the number of inputs to the

system is less than the number of outputs. The system has two inputs, and four outputs,

q1, q2, qx, and qy, which must be controlled. Second, the system is nonlinear. The inertia

matrix and the nonlinear term vary as time and configuration change.

The desired control objectives are as follows:

1) Settling time for the joint angles, Ts, has to be less than 8 sec.

2) Percent overshoot, P.O for the joint angles, has to be less than 10%.

3) Damping ratio for the swing angles, ζ, has to be more than 0.5.

4) Payloads of 1 kg (nominal), 10 kg and 0.1 kg.


51
4.2 Design of Anti-Swing Controller

In this section, the design of the four controllers for the dynamic system derived in

the last Chapter will be discussed.

4.2.1 PD Controller

A PD controller has been designed using the graphical root locus method [14]. This

design methodology allows choosing the unique set of values of proportional and

derivative constants (Kp and Kd) to maximize the performance of the single input single

output (SISO) system. As mentioned in Section (4.1), the two-link robotic crane system

has two inputs and four outputs. Considering the system is decoupled, a separate PD

controller has been designed for each link. The torque ς1 has been controlled for the first

link, l1, and torque ς2 has been controlled for the second link, l2.

An iterative root locus method has been used for each link to get the value of the

constants. The values of constants for the first link are given as follows:

Kp1= 21

Kd1=1.8
52

The values of constants for the second link are given as follows:

Kp2= 15

Kd2=1

Figure (4.1) shows the simulation diagram of the system with PD control.

Figure 4.1: Simulink diagram of the system with PD controller


53

4.2.2 FSF Controller (Pole Placement Method)

In this section, the design of the full state feedback controller using the pole

placement method will be presented. It is observed that the open-loop two-link robotic

crane system is marginally stable. It can also been observed that the open loop system is

fully controllable. To choose the desired pole location, the ITAE method has been used.

A 6th order polynomial has been used to choose the desired pole position. The polynomial

has been given in Equation (4.1)

S6+3.25 ωn. S5+6.6 ωn2. S4+8.6 ωn3. S3+7.45 ωn4. S2+3.95 ωn5. S+ ωn6 =0 (4.1)

The value, ωn, has been selected as .415 to satisfy the desired control objective as given

in section (4.1).

The desired pole locations are given as follows:


Poles = [ −21 ,−16 ,−4 + 1.3i ,−4 − 1.3i ,−6 + 1.7i ,−6 − 1.7i ,−1 − 2.85i ,−1 + 2.85i ]

Using Ackerman’s formula, the state feedback gain matrix (APPENDIX B) has been

calculated as follows:

 − 5.7 − 3.98 23.7 39.7 11.64 5.05 49.8 49.8 


K Pole Placement =  
183.8 89.87 102.3 102.3 99.48 49.99 225.94 225.94
54

The simulation diagram of the system with full state feedback controller is shown in

Figure 4.2.

Figure 4.2: Simulink diagram of the system with FSF controller


55

4.2.3 FSF Controller (LQR Method)

In this section, a full-state feedback controller has been designed using an optimal

Linear Quadratic Regulator (LQR) method ([11] Page 841-844, [12]). In LQR method,

the state feedback matrix is calculated by minimizing the performance index, J, as given

in Equation (4.2).


J = ∫(X QX + U T RU ) dt
T
(4.2)
0

The matrix Q and R are the weighting matrices. The choice of Q and R allows the relative

weighting of individual state variables. No standard method has been followed to choose

the Q and R matrix for this system. Instead, the simulation has been performed using

different values of Q and R matrix, and the values of Q and R matrix are chosen based on

the simulation performances. The Q and R matrix that have been used finally are given as

follows:

15 0 0 0 0 0 0 0
 
 0 12 0 0 0 0 0 0
 0 0 10 0 0 0 0 0
 
 0 0 0 10 0 0 0 0
Q = 1 0
0 0 0 0 5 0 0 0 R=
  
 0 0 0 0 0 5 0 0 0 1
 0 0 0 0 0 0 5 0
 
 0 0 0 0 0 0 0 5
56

The feedback gain matrix, K, have been calculated using the above Q and R matrix. The

MATLAB function “are” has been used to solve the Algebraic Riccati Equation and the

calculated value of K is given as follows (APPENDIX B):

 1 − .02 .7 − .7 1.3 .1 .03 − .03


K LQR = 
.01 1 .55 − .55 .13 1 − .01 .01 

The simulation diagram of the system with the full-state feedback control has been given

in Figure (4.2). While using the LQR method, the same diagram has been used with the

above K values.

4.2.4 Swing Angle Feedback Controller

A swing-angle feedback controller has been described in this section. In this method

additional feedbacks loop being used with a PD controller. The PD controller controls the

motion of tip position of the two-arm manipulator. The desired tip position movement is

to move from a specific point ‘1’ to point ‘2’in X-Y plane. The desired tip position of the

two-arm manipulator is translated in to desired joint angles using forward kinematics.

Controlling the torque of the motors at each joint controls the two-joint angles.

In the swing-angle feedback method, an additional loop has been added to the PD

controller to take care of the load oscillation. The additional loop is designed by
57
implementing a feedback of load oscillation velocity into the acceleration of the tip

position, as given in Equation (4.3)

 X&&   K 1 0  θ&x 
 &&  =  0  
K 2  θ& y 
(4.3)
Y  

where X and Y axis of the tip position of the robot and K1 = K 2 =2lζωn , l is the length of

the pendulum, ζ is the damping ratio, and ωn is the swing frequency.

In order to implement Equation (4.3), the dynamics relation between tip position,

namely X- axis and Y-axis position, and the load oscillation, namely θx and θy, is derived.

Lagrange’s equation is used to derive the coupling dynamics. Considering the small

swing angles the linear system dynamics has been given as follows:

 m3 0 m3l − m3l   X&&   0  0


 0 m    
0 m 3 cos(θ y )  Y&&   0  0
 3  + =  (4.4)
m 3 l 0 m3l 2 0  θ&&x   m 3 glθ x  0
      
 0 m3 0 m 3 l 2  θ&&y  m 3 glθ y  0

The last two equations of Equation (4.4) are two decoupled equations separately

representing the relationship between the X coordinate of the tip position and the load

oscillation in X direction and Y coordinate of the tip position and load oscillation in Y
58
direction. Substituting Equation (4.3) in those equations gives the controlled dynamic

system as follows:

g
θ&&x + 2ζwnθ&x + θ =0 (4.5)
l

θ&&y l + 2ζwnθ&x + gθ = 0 (4.6)

Equations (4.5) and (4.6) are damped second order system and by adequately

choosing the value of K1 and K2, the damping ratio, ζ, can be assigned to rapidly damp out

the load oscillation to zero.

Equations (4.5) and (4.6) are independent of the payload. This makes the swing

angle feedback control robust under various payload conditions. In this method, by

adding an additional loop a decision has been made using the feedback of payload

oscillation.
59
Figure (4.3) shows the Simulink diagram of the system with the swing angle feedback

controller.

Figure 4.3: Simulink diagram of the system with the swing angle feedback controller

4.3 Simulation Results

In this section, a third-order polynomial trajectory has been calculated and used as

the desired trajectory of the system to perform the simulation. The simulation results

using each controller under various payload conditions have been shown.

The desired path in the X-Y plane for the tip position of the two-link robot is

given below:

Initial X= 0.3 Initial Y= 0.1

Final X = 0.1 Final Y= 0.3.


60

The desired tip position has been converted to desired joint angles using inverse

kinematics [13]. The simulation results have been performed under various payloads

conditions and for each designed controllers.

Figures (4.4), (4.5), (4.6) and (4.7) represent the simulation results using PD

controller. It can be observed that although the tip position has been controlled

satisfactorily using PD controller but the swing angle of the payload doesn’t damp out

satisfactorily.

Figure (4.8), (4.9), (4.10) and (4.11) represent the simulation results for full state

feedback control using pole placement method. In this case only two payload conditions

have been performed as it is observed that the system becomes unstable for payload 10

kg.

Figures (4.12), (4.13), (4.14) and (4.15) represent the simulation results for full state

feedback control using LQR method. Figures (4.16), (4.17), (4.18) and (4.19) represent

the simulation results using swing-angle feedback controller.


61

Figure 4.4: X-axis oscillation under various payloads using PD controller

Figure 4.5: Y-axis oscillation under various payloads using PD controller


62

Figure 4.6: First joint angle q1 under various payloads using PD controller

Figure 4.7: Second joint angle q2 under various payloads using PD controller
63

Figure 4.8: X-axis oscillation under various payloads using FSF control (PPM)

Figure 4.9: Y-axis oscillation under various payloads using FSF control (PPM)
64

Figure 4.10: Joint angle q1 under various payloads using FSF control (PPM)

Figure 4.11: Joint angle q2 under various payloads using FSF control (PPM)
65

Figure 4.12: X-axis oscillation under various payloads using FSF control (LQR)

Figure 4.13:Y-axis oscillation under various payloads using FSF control (LQR)
66

Figure 4.14: Joint angle q1 under various payloads using FSF control (LQR)

Figure 4.15: Joint angle q2 under various payloads using FSF control (LQR)
67

Figure 4.16: X-axis oscillation under various payloads using SAF controller

Figure 4.17: Y-axis oscillation under various payloads using SAF controller
68

Figure 4.18: Joint angle q1 under various payloads using SAF control

Figure 4.19 Joint angle q2 under various payloads using SAF control
69

CHAPTER 5: EXPERIMENTS WITH TEST BED

An experimental study was performed with the test bed located in the Mechanical

Engineering Laboratory 015, Stocker Center, Ohio University. The system is a two-

degree-of-freedom robotic arm with a two-degree-of-freedom pendulum attached to it.

This chapter describes the test bed setup, model verification, and experimental results

with the test bed.

5.1 Test Bed Description

5.1.1 Hardware

The test bed is shown in Figure 5.1. It consists of one fixed rigid link, two moving

rigid links and a pendulum at the end of the second moving link. The first and second

moving links connect with the fixed link and first moving link respectively. Both joints

are rotational joints powered by DC motors. These joints are called active joints. The

pendulum attaches at the end of the second link by two pin joints. It allows the pendulum

to swing both in the X and Y directions. Two encoders are attached at each pin joint to

measure the swing angle.

The manipulator consists of two 0.285m- long metal links and two DC motors.

Each DC motor is s PITTMAN GM9000 Series with 19.7:1 gear ratio and equipped with

an optical encoder at the motor side to measure absolute joint angles. The encoder is an

Integrated Hewlett-Packard® optical encoder with 500 CPR (cycle/rev).


70

Figure 5.1: Test bed

5.1.2 Software

A MultiQ board with a Pentium 233 Computer controls the test bed. The sampling

rate is chosen at 500 Hz. The D/A converter of MultiQ board converts the digital to

analog (D/A) by a 12-bit unsigned binary. An input of –5 volts maps zero and +5 volts

maps to 212-1=4095. The encoder data is decoded in the MultiQ board in quadrature and

used in 24-bit counter, With 24 bits, 224-1=16,777,215 counts can be obtained.


71
The input torque to the robot arm system is calculated by the computer from the

joint displacements and sent through a D/A board to the amplifiers, which drive the

motors of the joints. MATLAB/Simulink are used to write the program, and WinCon ver

3.2 is used for conversion to C language and communication with the MultiQ board.

5.1.3 Overall System

The data flow in the system is shown in the block diagram in Figure 5.2. The

computer, using different controllers calculates the input torques, τ1 and τ2. The inputs to

the computer are the encoder values of the joint angles q1 and q2 and swing angles of the

payload, θx and θy. A D/A converter converts the input torques. The converted torques,

τ1D/A and τ2D/A are proportional to the input torques by the following relation:

τ1D/A= KD/A. τ1D/A and τ2D/A= KD/A. τ2D/A

The conversion factor KD/A has been calculated as follows:

(5volts ) − (−5volts )
KD / A = = 0.00244volts
212
72
The actual torques applied to the motors, τ1m and τ2m are proportional to the

converted torque, τ1D/A and τ2D/A respectively. The proportional factor for this case is Kt

which is the torque constant of the motor. The DC motor in the experiment has a torque

constant, Kt= .04585 N. m; hence, the relationship between the input torques and the

actual torques, are given as :

τ1m= KD/A.Kt τ1D/A=1.12 x 10-4 τ1D/A

The encoder data from the encoder has been converted. The encoders attached on

the motor with a 19.7:1 gear ratio, have 500 CPR and the encoder data is decoded in

quadrature. Hence, the conversion factor for the encoder of the motor has been calculated

as:

1 1
K encodermotor = .(2πrad ). = 1.595 × 10− 4
4 (500CRV ).19.7

The conversion factor of the encoders for the swing motion of the payload has been

calculated as

1 1
K encodermotor = .(2πrad ). = 3.1415 × 10−3
4 (500CRV )
73
The conversion factors are needed for a comparison between the simulation results

and experimental results.

Figure 5.2: Data signal flow


74
5.2 Model verification

Before applying the various controllers on the test bed, model verification has been

performed. Model verification has been performed in order to validate the derived

dynamic model of the system. For the same input to the system, the outputs from the

dynamic model and from the test bed are compared.

First, a third-order polynomial trajectory ([13]) is applied as the desired trajectory

for the tip position of the robotic arm. The trajectory is defined in terms of the X and Y-

axis positions taking the first joints as (0, 0) position. The trajectory starts at (0.57, 0)

goes to position (0 .45, -0.33) in 5 seconds, waits in that position for 5 seconds and then

goes to the final position (0.45, 0.33) in 7 seconds. A forward kinematics ([13]) block is

used to calculate the desired joint angles, q1, q2, in order to follow the desired trajectory.

This desired trajectory has been used as the reference path for both the dynamic model

and the test bed. Second, separate PD controllers are used for each joint. The Kp and Kd

value chosen for first PD controller are Kp= 12, Kd= 1.2 and for the second PD controller

are Kp=7, Kd= 0.8. The same PD controller is used for dynamic model and the test bed.

Figure 5.3 shows the Simulink diagram for the model verification. It can be observed

from Figure 5.3 that the two joint angles are compared.
75

Figure 5.3: Simulink diagram for the model verification

Figure 5.4 (a) shows the comparison of first joint angle from the dynamic model

and the test bed. Figure 5.4 (b) shows the comparison of the second joint angle from the

dynamic model and the test bed. It can observe from the two figures that the dynamic

model outputs are reasonably close to the actual test bed output. This validates the

derived dynamic model of the system. In the next section, the experimental results with

the PD and the swing angle feedback controller will be discussed.


76

Figure 5.4(a): First joint angle comparison

Figure 5.4(b): Second joint angle comparison


77

5.3 Experimental Results

In this section the experimental results are shown. The following results are

shown:

1) PD control for 1 kg payload.

2) Angle feedback control for 1 kg payload.

3) PD control for 2.3 kg payload.

4) Angle feedback control for 2.3 kg payload.

The same desired trajectory has been used in the experiments as used for the model

verification. The values of Kp, Kd are also kept the same. The Simulink diagram is shown

in Figure 5.5.

Figure 5.5: The Simulink diagram of the system with SAF


78

It can be observed from Figure 5.5 that the integrator block for the angle feedback

loop has been removed. During the experiments it has been found that the system

performs better without the integrator block. This makes the angle feedback loop a simple

gain feedback loop.

The experimental results with a payload of 1 kg are shown in Figures 5.6, 5.7, 5.8,

5.9 and 5.10. In Figures 5.6(a) and (b) it can be observed that the swing motion of the

payload damp out better with angle feedback than with the PD controller. Figures 5.7 and

5.8 compare the actual and desired first joint-angle position with PD controller and angle

feedback controller respectively. It is observed that the actual first joint angle follows the

desired path satisfactorily with both controllers. Figure 5.9 and Figure 5.10 compares the

actual and desired second joint-angle position with the PD controller and angle feedback

controller, respectively.

Figures 5.11, 5.12, 5.13, 5.14 and 5.15 show the experimental results for a payload

of 2.3kg. To increase the payload, an extra load of 1.3 kg has been attached at the end on

the pendulum link. The experimental results show that the angle feedback controller

works satisfactorily under different payloads as well. In Figures 5.11(a) and (b), the

comparisons of swing angle with the PD and with angle feedback controller have been

shown. Figures 5.12 and 5.13 compare the desired and actual first joint-angle with two

controllers. Figures 5.14 and 5.15 compare the desired and actual second joint-angle with

two controllers.
79

Figure 5.6(a): X-axis oscillation for payload 1kg with SAF and PD controller

Figure 5.6(b): Y-axis oscillation for payload 1kg with SAF and PD controller
80

Figure 5.7: Comparison of joint angle q1 with PD control for payload 1kg

Figure 5.8: Comparison of joint angle q1 with SAF controller for payload 1 kg
81

Figure 5.9: Comparison of joint angle q2 with PD control for payload 1kg

Figure 5.10: Comparison of joint angle q2 with SAF controller for payload 1kg
82

Figure 5.11 (a): X-axis oscillation for payload 2.3 kg with SAF and PD controller

Figure 5.11 (b): Y-axis oscillation for payload 2.3 kg with SAF and PD controller
83

Figure 5.12: Comparison of joint angle q1 with PD control for payload 2.3 kg

Figure 5.13: Comparison of joint angle q1 with SAF controller for payload 2.3 kg
84

Figure 5.14: Comparison of joint angle q2 with PD control for payload 2.3 kg

Figure 5.15: Comparison of joint angle q2 with SAF controller for payload 2.3 kg
85

CHAPTER 6: CONCLUSION

6.1 Conclusion

To reduce the anti-swing motion of the crane system under various payloads, four

different controllers have been designed and simulated. The four controllers are as

follows:

1) PD controller based on root-locus method.

2) Pole placement controller.

3) An optimal controller based on LQR method.

4) Angle feedback controller.

A mathematical model of two-link robotic crane with two-dimensional swing load

has been derived using Lagrange’s Equation. Simulation results using all the four

controllers under various payloads have been performed. Their results have been

compared with each other.

The PD control of the tip position of the two-link robotic crane has limitations in

reducing the swing motion of the payloads. The maximum damping by the PD control

has been determined using an iterative graphical root locus analysis. The maximum

damping by the PD control is not sufficient enough to get a desired system response.

Also, the PD control is not robust under different payloads.


86

The full state feedback controller can be designed only for the linear model. The

dynamic model derived for the system has been linearized and then pole placement and

the LQR controller have been derived. The simulation results show that with the pole

placement controller the system becomes unstable for payload 10kg. The LQR controller

also fails to perform satisfactorily under different payloads. This implies poor robustness.

The swing-angle feedback controller with the PD controller is able to damp out the

swing motion in the payloads. It also performs satisfactorily under different payloads.

The PD and angle feedback controller have been implemented experimentally and the

experiment results resemble the simulation results (Figure 5.4 (a) and (b)). The

experimental results demonstrate the advantages of the angle feedback method.


87

6.2 Contribution

1) The overall dynamic model of the two link robotic crane with a two-degree-of-

freedom swing system has been derived. The derived dynamic model has been

linearized and expressed in state-space form.

2) Four different control methods have been analyzed.

3) The swing angle feedback controller has been proposed after analyzing the other

controllers.

4) The proposed control method has been implemented on the Ohio University test

bed under various payload conditions.


88

6.3 Future Work

The following topics are suggested for future research:

1) Experiments were performed with a PD and swing angle feedback controller. The

results of the two controllers have been presented. Experiments with the advanced

controllers should be considered.

2) The encoder was used to measure the swing motion of the payload. It was not

accurate enough to get high resolution. A more accurate sensor or other sensor

should be considered for better results.

3) Mechanical improvement of the robot is suggested for better results. Due to the

slip in the active joints accurate results couldn’t be obtained. The controller might

have produced better results with a more mechanically sound robot.

4) To handle the different payloads, a robust controller can be designed using the H∞

method.
89

Reference

[1] Yoon,J.S.,el, Various Control Schemes for Implementation of the Anti-Swing Crane.

In ANS 6th Topical Meeting on Robotics and Remote systems.1994.

[2] Noakes, M. W., R.L. Kress, and G.T. Appleton. Implementation of Damped-

Oscillation Crane Control for Existing AC induction Motor-Driven Cranes. in ANS Fifth

Topical Meeting on Robotics and Remote System. 1993. Knoxville, TN.

[3] Parker, G.G.,et al. Experimental Verification of a Command Shaping Boom Crane

Control System. In American Control Conference. 1999. San Diego, CA.

[4] Lee,H.H., Modeling and control of a Three-Dimensional Overhead Crane. Journal of

Dynamic Systems, Measurement and Control.1998.

[5] John T. Wen, Dan O. Popa, Gustavo Montemyor and Perter L. Liu, Human Assisted

Impedance Control of Overhead Cranes.

[6] Chi-Cheng Cheng and Cheng-Yi-Chen, Controller Design for an Overhead Crane

system with Uncertainty, Control Eng. Practice , vol .4,no. 5, pp. 645-653, 1996

[7] J.A.Mendez, L. Acosta, L. Moreno, S. Torres and G. N. Marichal, An Application of a

Neural Self-Tuning Controller to an Overhead Crane, Neural Comput & Applic 1999.

[8] M. Mahfouf, C. H. Kee, M. .F. Abbod and D. A Linkens, Fuzzy Logic-Based Anti-

swing Control Design for Overhead cranes, Neural Comput & Applic 2000.

[9] A. Benhidjep and G.L. Gissinger, Fuzzy Control of an Overhead Crane Performance

Comparison with Classic Control, Pergamon, Control Eng. Practice, vol. 3. No. 12, pp.

1687-1696, 1995
90

[10] Ji Sup Yoon, Byung Suk, Various Control Schemes for Implementation of the Anti-

swing Crane. Korea Atomic Energy Research Institute.

[11] Katsuhiko Ogata. Modern Control Engineering, second edition.

[12] Bernard Friedland. Control System Design - An Introduction to state-space methods.

[13] John J. Craig. Introduction to Robotics Mechanics and Control, second edition.

[14] Richard C. Dorf and Robert H. Bishop. Modern Control Systems, eighth edition.
91

APPENDIX A: MATLAB file for dynamic model

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FILENAME: Dynamic model
% WRITTEN BY: Bibhrajit Halder
% Ohio university
%
% COMMENTS ON CODE STRUCTURE: This derive the dynamic model of the four
degree of freedom robotic crane
% sytem in sybolic and numeric output.
%
%
%
% ORIGINAL DATE WRITTEN: 17 JULY 2001 - Ohio University
% DATE OF LAST MODIFICATION: 26 JULY 2001
%
%
%
%
%%%%%%%%%%%%%%%%% START OF CODE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clc;
clear;
syms l1 l2 l3 m1 m2 m3 lg1 lg2 g1 g2 q1 q2 qx qy dq1 dq2 dqx dqy g ddq1 ddq2 ddqx
ddqy x1 x2 x3 x4 x5 x6 x7 x8 T11 o1 o2

% velocity square terms


vg1_s=(lg1*lg1)*(dq1*dq1);

vg2_s=(l1*l1)*(dq1*dq1)+(lg2*lg2)*(dq1+dq2).^2+2*lg2*l1*dq1*(dq1+dq2)*cos(q2);

v3_s=l1.^2*dq1.^2+l2.^2*(dq1+dq2).^2+2*dq1*(dq1+dq2)*l1*l2*cos(q2)+l3.^2*dqy.^2
+l3.^2*dqx.^2*(cos(qy)).^2
-2*l3*l1*dq1*dqx*sin(q1)*cos(qx)*cos(qy)+ 2*l3*l1*dq1*dqy*sin(q1)*sin(qx)*sin(qy)
-
2*l3*l2*(dq1+dq2)*dqx*sin(q1+q2)*cos(qx)*cos(qy)+2*l3*l2*(dq1+dq2)*dqy*sin(q1+
q2)*sin(qx)*sin(qy)
+2*l3*l1*dq1*dqy*cos(q1)*cos(qy)+2*l3*l2*(dq1+dq2)*dqy*cos(q1+q2)*cos(qy);
92
%Potential Energy%
V=m3*g*l3*(1-cos(qx)*cos(qy));
%Kinetic Energy%
T=.5*(g1*(dq1.^2)+m1*vg1_s+g2*(dq1+dq2)^2+m2*vg2_s+m3*v3_s);

t1=diff(T,q1);
t2=diff(T,q2);
t3=diff(T,qx);
t4=diff(T,qy);
v1=diff(V,q1);
v2=diff(V,q2);
v3=diff(V,qx);
v4=diff(V,qy);
L=T-V;
%For q1%
a1=diff(T,dq1);
a11=diff(a1,dq1);
a12=diff(a1,dq2);
a13=diff(a1,dqx);
a14=diff(a1,dqy);
f11=simple(a11);
f12=simple(a12);
f13=simple(a13);
f14=simple(a14);
b11=diff(a1,q1);
b12=diff(a1,q2);
b13=diff(a1,qx);
b14=diff(a1,qy);
g11=simple(b11);
g12=simple(b12);
g13=simple(b13);
g14=simple(b14);

% for q2%
a2=diff(T,dq2);
a21=diff(a2,dq1);
a22=diff(a2,dq2);
a23=diff(a2,dqx);
a24=diff(a2,dqy);
f21=simple(a21);
f22=simple(a22);
f23=simple(a23);
f24=simple(a24);

b21=diff(a2,q1);
93
b22=diff(a2,q2);
b23=diff(a2,qx);
b24=diff(a2,qy);

g21=simple(b21);
g22=simple(b22);
g23=simple(b23);
g24=simple(b24);

% for qx

a3=diff(T,dqx);
a31=diff(a3,dq1);
a32=diff(a3,dq2);
a33=diff(a3,dqx);
a34=diff(a3,dqy);
f31=simple(a31);
f32=simple(a32);
f33=simple(a33);
f34=simple(a34);

b31=diff(a3,q1);
b32=diff(a3,q2);
b33=diff(a3,qx);
b34=diff(a3,qy);

g31=simple(b31);
g32=simple(b32);
g33=simple(b33);
g34=simple(b34);

%for qy

a4=diff(T,dqy);
a41=diff(a4,dq1);
a42=diff(a4,dq2);
a43=diff(a4,dqx);
a44=diff(a4,dqy);
f41=simple(a41);
f42=simple(a42);
f43=simple(a43);
f44=simple(a44);
b41=diff(a4,q1);
b42=diff(a4,q2);
b43=diff(a4,qx);
94
b44=diff(a4,qy);
g41=simple(b41);
g42=simple(b42);
g43=simple(b43);
g44=simple(b44);

% The M matrix is

F1=[f11 f12 f13 f14];


F2=[f21 f22 f23 f24];
F3=[f31 f32 f33 f34];
F4=[f41 f42 f43 f44];
M=[F1;F2;F3;F4];

%The C matrix%

C=[C1;C2;C3;C4];

% The G matrix

G=[v1;v2;v3;v4];

% The numarical values of different variable%


l1=.3;
l2=.3;
l3=1;
m1=1.5;
m2=1.5;
m3=1;
lg1=.15;
lg2=.15;
g1=.0028;
g2=.0028;
T11=[o1;o2;0;0]
o1=sym('u(1)');o2=sym('u(2)');
T11=subs(T11);

% Substituting the values in the equation%

Ms = subs(M) % M matrix with numeric value


Cs = subs(C) % C matrix with numeric value
Gs = subs(G) % G matrix with numeric value
csl=Cs*[dq1;dq2;dqx;dqy];
95

ms1=-inv(Ms);
fn=ms1*(csl+Gs);
fn1=inv(Ms)*T11;

q1=sym('x(1)');q2=sym('x(2)');qx=sym('x(3)');qy=sym('x(4)');dq1=sym('x(5)');dq2=sym('
x(6)');dqx=sym('x(7)');dqy=sym('x(8)');

fn4=subs(fn1)
96
APPENDIX B: MATLAB file for controller

% FILENAME: Robotic crane

% WRITTEN BY: Bibhrajit Halder

% Ohio university

% COMMENTS ON CODE STRUCTURE: This performs Pole placement and LQR

controller design for the four degree of freedom

% robotic crane system, with two torque as the control inputs. The four outputs are two

motor angle

% q1 and q2 and two swing angles in X-axis and Y-axis direction.

% ORIGINAL DATE WRITTEN: 15 JULY 2001 - Ohio University

% DATE OF LAST MODIFICATION: 24 JULY 2001

% MODIFICATION HISTORY:

%%%%%%%%%%%%%%%%% START OF CODE

% Description of the system in state space%

a=[0 0 0 0 1 0 0 0;0 0 0 0 0 1 0 0;0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 1;0 0 -2.7535 2.7535 0 0 0

0;0 0 -6.4917 6.4917 0 0 0 0;0 0 -9.0216 .8549 0 0 0 0;0 0 .8549 -9.0216 0 0 0 0];

b=[0 0;0 0;0 0;0 0;5.5957 -7.7444;-7.7444 5.04126;0.2456 2.4883;-0.2456 -2.4883];

c=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0;0 0 1 0 0 0 0 0;0 0 0 1 0 0 0 0];


97
d=[0 0;0 0;0 0;0 0];

%Check for controllability and observabillity%

p=ctrb(a,b);

rankp=rank(p);

q=obsv(a,c);

rankq=rank(q);

%Checking the stability%

poles=eig(a)

disp('As all the poles are non-negative, but there are two zero poles so the system are

merginaly stable')

% Designing pole placement controller%

wn=3.2;

num=wn^6;

den=[1 3.25*wn 6.6*wn^2 8.6*wn^3 7.45*wn^4 3.95*wn^5 wn^6];

g=tf(num,den);

des9=pole(g)

des1=[des9' -4 -4.3]
98
k1=place(a,b,des1)

%Finding the new matrix%

a1=a-b*k1;

poles=eig(a1)

t=[0:.1:20];

u= [ones(size(t))'];

%open loop simulation%

step(a,b,c,d);

[y,x]=lsim(a,b,c,d,u,t);

figure;

%input correction%

r1=-pinv(b)*a1*[.8;1.6;0;0;0;0;0;0]*u';

r2=-pinv(b)*a1

[Y,X]=lsim(a1,b,c,d,r1,t);

plot(t,Y)
99
%Finding K matrix using LQR method%

bb=b*b';

Q=diag([400 400 50 50 100 100 100 100]);

R= diag([1 1]);%Weighting matrix%

[k2,s2,e2] =lqr(a,b,Q,R)

%v=[10 0 0 0;0 0 0 0;0 0 1 0;0 0 0 1];%Weighting matrix%

%q=are(a,bb,eye(8,8));

%k2=b'*q%new K from LQR%

a2=a-b*k2;% New A with new K%

r5=-pinv(b)*a2*[.8;1.6;0;0;0;0;0;0]*u';% input correction%

% LQR simulation%

[y1,x1]=lsim(a2,b,c,d,r5,t);

hold on;

plot(t,y1)

zoom;

Das könnte Ihnen auch gefallen