Académique Documents
Professionnel Documents
Culture Documents
1 of 7 6/8/17, 12:51 PM
Design, build, and test of an autonomous myRIO based Segbot (PDF Dow... https://www.researchgate.net/publication/283819798_Design_build_and_...
displacements are measured in the right hand sense about the used to create a detailed drawing of the Segbot. Part masses
y-axis. The system parameters used to describe the Segbot were measured using a laboratory balance. By finding the
geometry and other physical quantities are listed in Table 1. part volume from the CAD software, the density of the part
Z could be estimated. This allowed for the estimation of
inertial values and the mass center location. The Table 1
inertial quantities I1, I2, and I3 together with the length
z were found in this way. The procedure of mass, volume, and
z
density determination was performed for all Segbot parts.
-Axel center The Table 1 parameters Km, Kt, Ra, and J were found
-Pendulum COM through identification. The brushed DC motor torque is
K t ia
i
j
where is the developed torque in N-m and ia is the armature
y current in amps. The DC motor voltage is
X V i a R a K m
r y Y
l where V is the voltage across the motor in volts and is the
x
motor shaft angular position in radians.
x
V X i Y j
A regulated power supply provided a constant 12.08
volts to the motor driver. The duty cycle of a PWM input to
Figure 1: Segbot Coordinate Systems the motor driver was then varied from 0 to 1. The wheel was
Table 1: System Parameters allowed to spin freely while DC motor voltage and current
Symbol Description Value Units
were measured. Angular position was determined using an
J Mass Moment of Inertia for Wheel, Gearbox, and Motor 0.00157 kg-m
2
optical encoder and a discrete observer, using a fixed time
I1 Mass Moment of Inertia of Body and Wheels about x Axis 0.00153 kg-m2 step of 0.001 sec., estimated the motor angular velocity.
I2 Mass Moment of Inertia of Body about y Axis 0.00111 kg-m2
Mass Moment of Inertia of Body and Wheels about z Axis 0.00089 kg-m2
Motor characteristics were measured for two different
I3
W Distance between Wheel Centers 0.1639 m motor operating configurations. The first configuration
mw Wheel mass 0.0332 kg consisted of the wheel being placed in a locked rotor
R Wheel Radius 0.0508 m situation while various voltages were applied to the DC
mp Mass of Pendulum 1.2398 kg
motor. The corresponding current was measured from the
hc Distance from Axle Center to Pendulum Mass Center 0.0746 m
g Acceleration of Gravity 9.81 m/s2
motor driver. Then the wheel was allowed to spin freely. The
Km Back EMF Constant 0.594 V-s/rad corresponding current, voltage, and wheel speed were
Kt Torque Constant 0.594 N-m/amp measured.
Ra Armature Resistance 12.36 ohms The measurements from each motor configuration were
N Gear ratio 30
inserted into (2) to calculate the best guess for the motor
B. Dynamics parameters via a least squares technique. The resistance
given in ohms, while the back emf constant has the units of
The equations of motion were derived using Lagrangian volt-sec/rad. Table 1 shows the least squares analysis results.
mechanics in terms of two rigid body rotational angles, the
Because one motor model was desired, the least squares
two wheel angles, two X-Y axle center coordinates, and two
was performed together with data taken from both motors.
Lagrangian multipliers associated with the nonholonomic
Because SI units were used to find Km, the torque constant
constraint of the shaft center motion along the trajectory.
is the same value, but with units of N-m/amp.
The next step of the dynamic analysis is to reduce the The remaining unidentified Table 1 quantity is the motor,
number of variables. Note that the angle can be gearbox, and wheel collective mass moment of inertia. The
determined from the difference between the wheel Segbot was positioned so that the wheels were off the
displacements. Through substitution, the equations of ground. There is no translation and each wheel rotates
motion can be reduced to three second order, nonlinear freely. A motor torque balance is written. Eqs.(1) and (2) are
differential equations in time in terms of the tilt angle and applied to this dynamic model providing the relation
the wheel rotational displacements r and l. The derivation
Kt C R
details are contained in [4 ]. While the model development J Cd accel V d a K m
Ra
would be beyond the scope of a second controls class, the Kt
equations could be presented together with an outline of the where Cd is the viscous damping coefficient and J is the
derivation procedure. The end result would be to linearize collective inertia. Note that Ra, Kt, and Km were determined
the equations so that control design could be performed. earlier. Writing (3) in the frequency domain yields
Kt
C. Identification
s Ra J b
The Table 1 parameters W, mw, R, mp, and g can be 2
s s b1
V s C R K tK m
directly measured. The CAD software Solidworks, the s s d a
Ra J
2 of 7 same software used in the undergraduate graphics class, was 6/8/17, 12:51 PM
Design, build, and test of an autonomous myRIO based Segbot (PDF Dow... https://www.researchgate.net/publication/283819798_Design_build_and_...
s Ra J b
The Table 1 parameters W, mw, R, mp, and g can be 2
s s b1
V s C R K tK m
directly measured. The CAD software Solidworks, the s s d a
Ra J
same software used in the undergraduate graphics class, was
2784
where the bi replace the ratios in the numerator and that are not part of the standard package. The IMU is one
denominator. Providing a voltage step and inverting the such device and more will be described later in this section.
resulting Laplace transform yields There are two main loops used in the LabView Virtua
b2 b2 b2 Instrument (VI). These loops are shown in Fig. 2. The first is
t V (5)
b1 t
t e a feedback acquisition loop. This loop runs on available
2 2
b1 b 1
b1
processor time. The main objective of this loop is to obtain
where t is the time in seconds, V is the magnitude of the and parse state measurements. The first loop runs faster than
voltage step input, is the base of the natural logarithms, the second loop. The purpose of the second loop is to realize
Cd Ra Kt Km , and Kt
. (6) the real-time control where feedb ack information is used
b1 b2
Ra J R aJ evaluate the control law and issue the necessary voltages
Again the least squares method is used to determine the through the D/A converters. The second loop also allows for
unknown constants b1 and b2. By knowing these two supervisory control where commands can be issued from the
constants, (6) provides an estimate for J. The estimate of the host computer to turn the controller on or off, change the
wheel position to a voltage step input is given by Equations nature of the control (tracking, stabilization, etc.), and
(5) and (6). Comparing (5) to the measured result is the least change control gains. The second loop executes at 100 Hz.
squares basis. The value of J is listed in Table 1. Software Organization
Untimed loop executes as fast as possible as the idle process
D. Linearized Dynamics
The dynamics of the Segbot were linearized about the Initialize the IMU on start-up
point where the lean angle and lean rate are both zero, and Read gyros and accelerometers
the rate of change of both wheels is equal. Let the state Read motor encoders
Communicate feedback to timed loop using
vector be specified as X r l r l T . The linearized
shared variables
state equations are
X r l r l T
A X Bu
Timed loop executes in real-time 100 Hz.
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 Receive shared
. (7)
0 0 0 0 0 1 0 0 r variable feedback MATL AB
Configure
X information script for
and create
0 0 141 .75 0 0 0 696 . 23 1248 .88 l User option on trajectory
PWM signals
0 0 141 .75 0 0 0 148 .88 696 .23 execution mode generation and
for motors
Read IR and sonar control
0 0 196 .43 0 0 0 372 .72 372 .72
sensors
2785
Q
1 and is the rate of change in heading. Fig. 3 shows
0 0 0 0 0
2
max
actual position of the object as a triangle.
0 1
0 0 0 0
max
2
0 0 0 0 0
1
(xd, yd)
2max
Y
and
1 0 1
(9)
R
4 of 7 0 1 b 2 6/8/17, 12:51 PM
Design, build, and test of an autonomous myRIO based Segbot (PDF Dow... https://www.researchgate.net/publication/283819798_Design_build_and_...
Y
and
1 0 1
(9)
R 2
0 1 b 2
where max = 10, max = 0.05, max = 10, max = 5, b2 is from
(6), and Vmax = 10 were used along with the MATLAB
command K=-lqr(A,B,Q,R) to determine the linear quadratic
regulator feedback gains of (x,y)
0 0 .047 8 .848 0 .035 0 .070 0 .290
K . (10)
0. 047 0 8 .848 0 .070 0 .035 0 .290 X
Figure 3: Navigational Control Posture Error
2786
The actual position of the object is (x, y, ) while the The trajectory tracking control has the same linear
desired position of the object is given by (xd, yd, d). feedback gains as the stabilizing control in (11). However,
The technique of [7] suggests defining the posture error rd = r and rd = r, while rd and ld are determined
as the error between the current coordinates and the desired
by the navigational control. For stabilization all of the
coordinates in the local body fixed coordinate system of the desired states in the navigational control are set to zero.
object being controlled shown in Fig. 3 as The last step is to choose gains for the ki that are used in
e d cos sin 0 x d x the navigational control. In [4 , 7] the gain k3 is set
P e l sin cos 0 y d y . (14) k 3 2 k2. Then appropriate gains must be found for the
other ki. The Segbot was given the figure-8 trajectory of
e 0 0 1 d
cos t cos t sin t
With some trigonometric simplifications the time Xd r and Yd r (
1 sin t 1 sin t
2 2
derivative of the vector in (14) can be written as
as the desired trajectory where is the angular frequency of
ed e l v v d sin e the figure-8 and 2r is the width across the figure-8. The
P el ed vd sin e (15) result in (20) can be differentiated to determine desired
trajectory time derivatives and the desired heading direction
e d
can be found by rearranging the nonholonomic constraint as
where is the position error measured along the local drive
1 Y
direction, is the position error measured in the local lateral tan . (21)
direction, e is the error in the heading direction, is the X
compensational translational speed found by the navigational
control, is the actual translational speed, and the subscript e IV. APPLICATIONS
stands for the desired coordinate minus the actual coordinate.
After the Segbot completes a few figure-8 revolutions to
The navigational control law is developed through a
overcome initial conditions, the trajectory converged to
Lyapunov argument. The candidate Lyapunov function is
steady-state path. The effects of changing and are
chosen as
shown in Figures 4 and 5. The intent of Figures 4 and 5 are
1 2 2 1 cos e to illustrate the influence of the control constants.
V ed el (16)
2 k2 k1=variable,k2=5,k3=2*sqrt(k2),k 4=0,k5=0
1.5
2k2
Y Position (m)
e d e l v vd cos e el e d v d sin e (17) 0
sin e d . -0.5
Desired Path
2 k2 k1=0.1
k1=1.0
-1
The development in [4] proposes the control law of k1=0.3
v v d cos e k1 e d k4 e d el
2 -1.5 -1 -0.5 0 0.5 1 1.5
X Position (m)
5 of 7 6/8/17, 12:51 PM
Design, build, and test of an autonomous myRIO based Segbot (PDF Dow... https://www.researchgate.net/publication/283819798_Design_build_and_...
v v d cos e k1 e d k4 e d el
2 -1.5 -1 -0.5 0 0.5 1 1.5
X Position (m)
and
Figure 4: Effects of Modifying k1
d vd k 2 el k3 sin e k 5 sin e e l
2
(18)
The Segbot tracking can be improved by the proper gain
where the ki are all positive constants used as control choices as shown in Figure 6 which demonstrates that the
parameters. In [7] there are only three control parameters. new tracking control technique produces a better result.
Substituting the proposed control laws into the Lyapunov
time derivative shows V. SEGBOT CONSTRUCTION
k 5 sin e e l
2 2
k3
v d sin e
2
V k1e k 4 e e
2 2 2
(19) In building the Segbot, the aim was to replace
d d l
k2 k2 microcontroller. Use was made of the existing framework
which shows that V is positive definite and V is negative and peripheral parts described in [3]. Although we started
definite. In [7], V was only negative semi-definite. with the Segbot shell, many design changes were introduced
as the construction progressed. Fig. 7 shows the completed
device. Information, such as CAD drawings of the Segbot,
2787
pdf of the CAD drawings, a parts list, the LabVIEW behave similarly to the inverted pendulum cart which may be
controller, pictures, a wiring diagram, and video showing the better suited for an introductory controls class.
Segbot operation, is available at [8]. The LabVIEW environment allows a simplification of
programming and sensor interfacing details, an important
k1=0.3,k2=variable,k3=2*sqrt(k2),k4=0,k5=0
1.5 consideration for students to complete their projects in a
timely fashion. This simplification provides the opportunity
1
to concentrate on control issues. The material presented here
is better suited for a controls class as opposed to
mechatronics class because of the fewer interface details.
0.5
Y Position (m)
-0.5
Desired Path
k2=1.0
-1 k2=15.0
k2=5.0
k1=1.1,k2=50,k3=2*s qrt(k2),k4=500,k5=100
1
Figure 7: Completed Segbot
0.5
VII. ACKNOWLEDGEMENTS
Y Position (m)
X Position (m) Board, 2013 10th IEEE International Conference on Control and
Automation (ICCA), June 12-14, 2013, pp. 634-639.
[2] He Bin, Liu Wen Zhen, an d Lv Hai Feng, The Kinematics Model of
Figure 6: Good Segbot Tracking Performance a Two-wheeled Self-balancing Autonomous Mobile Robot and Its
Simulation, 2010 Second International IEEE C onference
Computer Engineering and Applications, pp. 64-68.
VI. CONCLUSIONS [3] The Segbot Home Page College of Engineering Control Systems
An autonomous Segbot has been built and tested. The Laboratory, http://coecsl.ece.illinois.edu/segbot/segbot.html,
robot was constructed with off-the-shelf parts and the cost accessed 03/15/2015.
[4] Matt Migchelbrink, Sliding Mode Control Trajectory Tracking
was kept to a minimum. The implementation of the NI Implementation on Underactuated Dynamic System, M.S. t hesis
myRIO as a microcontroller allows a convenient means of Mechanical a nd Nuclear Engr. Dept., Kansas State University,
WiFi communication between the robot and host computer. Manhattan, KS August, 2014.
The KSU Segbot resulted from the work of a group of [5] Gyroscopes and Accelerometers on a Chip,
http://www.geekmomprojects.com/gyroscopes-and-accelerometers-
undergraduates and one graduate student. Most of the on-a-chip/ , last accessed 03/15/2 015.
students volunteered their time in this effort. [6] G.F. Franklin, J.D. Powell, and A. Emami-Naeini, Feedback Control
This paper provides the details of model development, of Dyna mic Systems, Upper Saddle River, NJ: Pearson, 6th ed., 2010
identification, stabilizing control, and tracking control. p. 463.
[7] Y. Kanayama, Y. Ki mura, F. Miyazaki, and T. Noguchi, A Stable
The unique dynamics of the Segbot can appeal to a range Tracking Control Method for an Autonomous Mobile Robot, 1990
of students. The Segbot can provide an opportunity for IEEE International Conference on Robotics and Automation, May 1
graduate study in non-linear controls, digital controls, or 18, Cincinnati, OH, pp. 38 4-389.
nonholonomic tracking. If the dynamics are simplified so the [8] The KSU Mechanical and Nuclear En gr. Dept. Segbot Website -
left and right wheel turn together, the Segbot dynamics http://www.mne.ksu.edu/research/laboratories/dynamic-systems-
controls-laboratory-1/segbot, last accessed 03/15/2015.
7 of 7 6/8/17, 12:51 PM