Project Report On Personal Transport Vehichle

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

PROJECT AA 447 CONTROL IN AEROSPACE SYSTEMS

December 09
th
, 2011


SEGWAY CONTROL SYSTEM DESIGN

Andrew Banner Chris Ciampi, Declan Pray Mallamo, Van Nguyen
University of Washington, Seattle, WA 98195-2250




The project is to design a control system for a Segway. The objective of this project is to design an
autonomous Segway control program by creating a model of the Segways environment and
monitoring sensor inputs from the physical parameters and using them to govern the outputs of
specified actuators. A linearized model of an inverted pendulum will be chosen to compare the inputs
to the actuators outputs and will provide a transfer function describing the Segways time response
and stability characteristics. A compensator block will be designed to interact with the systems
transfer function to provide internal stability for the Segway over an expected range of operational
parameters. The exact configuration of the sensors and actuators in reference to the Segways upright
orientation will also be analyzed to see their effects on the overall stability of the vehicle. This will
eventually lead to a dynamic system with a stable time-response for all combinations of likely values of
the expected physical parameters, therein creating a functional Segway control system. A simulation of
the environments will then be created to test our control program. A prototype, based off the results of
the analysis will be attempted, using motors, a gyroscopic sensor and a combination of integrated
circuits.



Nomenclature

J
B
= (kg.m
2
) the moment of inertia of the pendulum body
J
M
= (kg.m
2
) moment of inertia of motors rotor
J
W
= (kg.m
2
) the moment of inertia of the wheel
l
C
= (m) distance from the pivot to mass center
M
W
= (kg) mass of the wheel
M
B
= (kg) mass of the pendulum body
n = the gear ratio of the motor drive
r = (m) radius of the wheel
t = (N.m) the torque the motor applies to the wheels
u = (rad) angle from the vertical upward direction


Introduction

The objective of this project is to design an autonomous control system for the Segway, a small vehicle that runs on
electricity with a simple design consisting of two wheels mounted under a vertical platform. This ingenuous device
works with a simple series of gyroscopes to provide the movements and balancing characteristics that separate it
from similar looking machines such as motorized scooters. When the rider of a Segway leans forward on the
handlebars of the machine, the motor will spin the wheels forward. Likewise, if the rider shifts backward, the
Segway will react in unison. This prevents the Segway, which would appear to be top-heavy with the addition of a
rider, from tipping over. The compensator control system will keeps the Segway upright. This system allows one to
transport themselves across vast distances safely and with minimal effort and skill on the part of the rider. For this
project, a model of an actual Segway system will be built, tested, and designed. As a result, the values of the
parameters given in this project reflect the design specifications for the model only.

Design Specifications

The assumption is that, because the vehicle does not move very fast and is normally handled in city and outdoor
environments, it is more important that the system react efficiently than quickly. The goal of the analysis is to
revisit each of requirements (stability, tracking, regulation and sensitivity) in a linear dynamic setting and to
develop equations that will expose constraints placed on the controller and identify elementary objectives. As a
result, the control design considerations will reflect the case with minimal overshoot and settling time
characteristics. Naturally, a low steady state error is desired as well. The control system is needed to satisfy the
constraints of overshoot M
p
< 10 %, setting time t
S
< 1 second, and steady state error e
SS
= 0.1. With these
conditions, the response will track with the desired input closely within an allowable offset; also, the controller
must not amplify disturbance and sensor noise.

Franklin, Powell, and Emami-Naeini detail the equations to conform to the parameters given above. Specifications
for a control system design often involve certain requirements associated with the time response of the system. The
requirements for a step response are expressed in term of the standard quantities (settling time, rise time and
overshoot)
[A]



4.6
S
n
t
e
~

1.8
n
r
t
e >

( )
p
M >

2
2
(ln( ))
2 (ln( ))
p
p
M
M

t
=
+

100
PM
~
1.8
R
n
t
e
~
Analysis

For our design, we will first look at the free body diagram as shown in Fig. 2 of the system to obtain the equations
of motion. The system will be modeled as an inverted pendulum that is free to translate. An application of
Newtons Second Law with respect to rotation and translation will be applied such that M = I* and F = m*a (M is
the sum of all moments about the fixed point, is the angular acceleration of the body, and I is the moment of
inertia about the pivot, I =

+ M
p
*l
C
2
). The results will then be coupled into two second-order nonlinear differential
equations in u and x with the input being the torque acquired from the trolley accelerations, (t). The forcing term
arises from the angular acceleration of the pendulum, and the instability system is modeled as a characteristic of the
inverted pendulum. From this information, a SIMULINK model will be used to determine the time history u for
the inverted pendulum.

Theoretical Modeling

Equations of Motion

The model of Segway is simplified as displayed in the free body diagram as shown in Figure 2.


Figure 2: Free Body diagram for mounted Segway
[B]

After Newtons Laws are applied for the translational motion of the trolley and the rotational motion of pendulum,
it will be found that the reaction forces between the two bodies can be eliminated, and the only unknowns will be u
and x. Given below are the non-linear equations of motion ignoring friction assuming both wheels apply the same
torque.

(
(

+
+
=
(

(
(
(
(

+ + + +
+ + +
) sin(
) sin(
) cos(
2
2
2 2
2 ) cos(
2
2 2
2
2
2
2 2
2
u u
t
u t
u
u
u
c B
c B
c B
M
B W
M W
c B M B c B
M
l M
r
gl M
x
l M
r
n J
M M
r
n J
r
J
l M n J J l M
r
n J





Linearizing the system with the small angle approximation sin(u) ~ u, cos(u) ~ 1, and

~ 0 results in the ordinary


differential equations.

(
(

+
=
(

(
(
(
(

+ + + +
+ + +
r
gl M
x
l M
r
n J
M M
r
n J
r
J
l M n J J l M
r
n J
c B
c B
M
B W
M W
c B M B c B
M
t
u t
u


2
2
2
2
2 2
2
2
2
2 2
2
2


Using Cramers Rule, which gives an expression for the solution of a system of coupled linear equations with as
many equations as unknowns, is valid in this case where there is a unique solution of angle to applied torque as
expressed in Eq. 1.


A B C u u t = + (1)

Where A, B, C are defined as

2 2 2 2 2 2 2
2 2 2 2 2 2 2
2 2 4 2 2 2
2 4 2 4
B W B M M W W B c B B B W M B c
M B M W B W c M B c
A J J J J n J J n J M l J M r J M r J M l n
J M n r J M n r M M l r J M l n r
= + + + + + + +
+ + +


2 2 2 2
2 2 2
B c W B c M B c B W c
B M gl r J M gl J M gl n M M gl r = + + +

2 2 2
2 4 2
W M B W B c
C J J n M r M r M l r = + + +


Plant Transfer Function

The tested Segway device will be a miniature model of the actual vehicle. The specific values are exclusively
designed to fit the model apparatus as expressed in the Appendix B. Performing a Laplace transform of Eq. 1, the
second-order function of angle u with respect to the torque of the motor applied is obtained with specific values of
the model such that:


2 6 2
( ) 0.003366
( )
( ) 9.989*10 0.002488
s C
G s
s As B s
u
t

= = =

(2)



Sensors & Actuators

The sensor chosen for the Segway model is the Tonkin CG-L35 rate gyro. The output of the rate gyro is
proportional to the angular velocity of the inverted pendulum. For the Tonkin CG-L35 is:

H(s) =0.00066s + 1.3 (3)

The sensor used in the system adds an element of derivative control. However, the pure derivative control from the
sensor function normally amplifies sensor noise implied by the differentiation, which must be approximated. If the
pole of the lead compensation is placed well outside the range of the design
n
, then the dynamic response of the
design would not be upset. When the pole is too far to the left, the magnification of sensor noise appearing at the
output of D(s) is too great and the motor or other actuator of the process can be overheated by noise energy in the
control signal. With a large value of the compensator pole, the lead compensation approaches pure PD control.

For the model Segway the actuators chosen are two Hitec HS 225MG servos modified for continuous rotation.
These servos have an operating voltage between 4.8 and 6 volts and a maximum operational torque of 67oz-in. The
main advantage of using a R.C. hobby servo is that they are designed to supply any torque up to their maximum
value no matter what their operational rpm is. This is accomplished by the electronics inside them and the use of
pulse width modulation. This property of R.C. servos allows us to ignore the transfer function of the electric motor
inside them.

System Transfer Function

A negative feedback is used, so the output of the system acts to oppose changes to the input of the system, with the
result that the changes are attenuated. Since the overall feedback is negative, the system will tend to function in a
relatively stable manner. With the plant in Eq. 2 and the function of sensor in Eq. 3, the closed loop transfer
function runs as:


( )
1 ( ) ( )
KG s
KG s H s +
(4)


The system characteristic equation of the closed loop system is thus defined

1 ( ) ( ) ( ) 1 ( ) 0 KD s G s H s KL s + = + =
(5)


*******************************************
A lead compensation generally causes the locus to bend toward the LHP, moving the dominant roots to a place of
higher damping.


Before adding the lead, it is necessary to determine the gain value at which the system will remain stable. The
steady state requirement must fit such that:

1
0.1
1
ss
p
e
K
= =
+


From which:

0
(0.224*1970)
lim ( ) ( ) 1.7587
249.1
p
s
K
K KG s H s K

= = = =



The steady-state error follows that:

1 1.7587 10 K + =

And therefore, for the steady state error requirement to be filled:

K=5.2

However, the damping achieved from this value is too low ( =0.0128) to satisfy our overshoot requirement. The
lead compensator will enable a design such that the other requirements are met with the steady state error condition
at the given gain.

From trial and error, setting a pole at -950 and zero at -27 enables our overshoot and settling time requirements to
be met such that:

M
p
= 9.78%
t
s
=0.11 s
t
r
=0.0191 s

Which can be clarified from the step response shown from Figure 3:



Figure 3: Step response and disturbance rejection

The system requirements for the Segway are clearly shown from this data. Efficient reaction performance is
displayed as the system has minimal overshoot and stabilizes in a quick and efficient manner with minimal steady
state error. Likewise, the Segway settles steadily in a swift yet controlled manner as the rejection disturbance
balances at the approximate settling time for the system.

The block diagram for this full system is set as shown in Figure 4:


Figure 4: Complete Block Diagram for Segway




The root locus and bode plots for the system are given as shown in Figure 5:


Figure 5: Root Locus and Bode plots for given system


From the root locus, this design is shown to be stable while also meeting the settling time and overshoot
requirements. From the Bode plot, it is shown that the crossover frequency is 85.2 rad/s. Additionally, it is shown
that the gain margin is -19.2 dB. While in most cases that would immediately represent instability, it should be
noted that this particular case involves a pole in the left hand plane, as shown in the root locus. For extra
clarification, the Nyquist plot for this function is given as shown in Figure 6:


Figure 6: Nyquist plot for Segway

The argument principle states that the number of unstable closed loop roots (Z) must be equivalent to the sum of the
number of right hand poles(P=1) and the number of clockwise encirclements of -1 on the Nyquist plot. Considering
the encirclement is counterclockwise (N= -1) and that there is one right hand pole on the root locus (P=1), there are
therefore no unstable closed loop roots in (Z=0) the system, proving that our system is effectively stable.
Observing the Nyquist plot, it becomes apparent why the gain margin is negative; the gain for the system cannot be
decreased by a factor of 19.2 dB else the plot would no longer encircle -1. Because of the presence of the right
hand pole, the system would naturally become unstable.

Design Critique:

The actual functions and calibrations shown from the Root Locus and Nyquist plots above suggest that, in theory,
the system would function in a relatively stable manner. Trying to make the system work in reality, however, met
with mostly questionable results. This is most likely due to the fact that there are more dynamics going on with
Segway motion than just from the simple free body diagram shown when forming the equations of motion. Should
this project be continued in the future, combining parameters such as the thickness of the wheels and their effects
on the CG of the Segway as it moves would prove most eventful in creating more favorable results.













Appendices

Appendix A References

A
Franklin, Gene F., J. David Powell, and Abbas Emami-Naeini. Feedback Control of Dynamic Systems. Upper
Saddle River [N.J.: Pearson, 2010.

Appendix B Specific Constants for the Segway model

J
B
=1.563*10
-3
[kg-m
2
]
J
M
= 10
-8
[kg-m
2
]
J
W
= 6.25*10
-5
[kg-m
2
]
M
W
=0.05 [kg]
M
B
= 0.75[kg]
n = 15
r = 0.05 [m]

You might also like