Академический Документы
Профессиональный Документы
Культура Документы
Abdullah Al-Refai
Kevin Bowman
John Eisenbraun
April 2011
Abstract
The inverted pendulum represents an entire class of control problems known as balance systems. The
properties of balance systems and all manner of solutions to controlling such systems (i.e. balancing a
pendulum in the upright position) are fundamental concepts covered in numerous control systems and
control theory textbooks. The inverted pendulum problem is often presented as a cart pendulum
problem, in which a pendulum is attached to a moving cart by means of a frictionless pivot. Other
mechanisms, such as the rotary control we investigate here, are less common. A closely related problem
is the controlled movement, or anti-sway, of a hanging pendulum (e.g. cranes lifting and moving heavy
objects).
In this report, we present our implementation of a system to balance an inverted pendulum by means of
a rotary actuator (i.e. a motor). This system is often called a Pendubot. Of primary interest are:
a) the derivation of a mathematical model that encompasses the entire system (motor and
pendulum arms),
b) the computer modeling and simulation we constructed for experimentation prior to the
availability of a physical system, and
c) the challenges we faced in making the transition to the real world physical system.
Much has been written about deriving equations of motion for a forced dual pendulum but our survey
of the literature regarding Pendubots and other motor-based balancing systems failed to produce a
single description or example that includes the actuator (motor) in the analysis of the system. This is
perplexing because the universally accepted method of derivation results in equations of motion that
declare torque to be the controlling force; yet, motors are typically controlled by an applied voltage,
which has a non-linear relationship to torque. In this report, we explain how we extend the
mathematical model to include the motor in the system dynamics.
Accurately modeling even the simplest of non-linear dynamic systems is difficult. If the model does not
closely represent conditions and relationships found in the real world, it is of little practical use. Yet, the
use of computer models in designing control systems has advantages not the least of which is the
ability to experiment with various aspects of the system when no physical system is immediately
available. In this report, we show the incremental and iterative development of a simulation model that
aided us in the design of the Pendubot control.
Finally, we discuss some of the practical matters we encountered while making the transition from an
ideal simulation environment to a physical electro-mechanical prototype. In particular, we discuss issues
with the mechanical design, fabrication, and construction of the pendulum arms and the limitations and
constraints imposed by a high level model-based and inherently non-real-time computing platform.
Page 2 of 68
Table of Contents
Acknowledgments......................................................................................................................................... 5
Introduction .................................................................................................................................................. 6
Objectives ..................................................................................................................................................... 7
Summary of Results ...................................................................................................................................... 8
Significant Milestones ............................................................................................................................... 8
Conclusions ................................................................................................................................................. 12
Recommendations ...................................................................................................................................... 13
Discussions .................................................................................................................................................. 14
Dual pendulum visualization ................................................................................................................... 14
Modeling and simulation of the (non-linear) unforced pendulum system ............................................ 15
The Math Model ................................................................................................................................. 15
Simulink model of the dual pendulum system ................................................................................... 16
Linearization about balance points ..................................................................................................... 16
Modeling a DC motor in Simulink ........................................................................................................... 17
Modeling and simulation of the pendulum system under direct torque control................................... 19
Modeling and simulation of the entire plant (pendulums plus motor) .................................................. 19
Design of the feedback control ............................................................................................................... 19
Simulating the system under control...................................................................................................... 21
Implement the physical system .............................................................................................................. 23
Interfacing the motor and encoders with MATLAB ................................................................................ 24
The physical system under control ......................................................................................................... 25
References .................................................................................................................................................. 26
Bibliography ................................................................................................................................................ 26
Appendix A Derivation of non-linear equations of motion...................................................................... 27
Appendix B Derivation of the seventh order state space model ............................................................. 34
Appendix C Program Listings.................................................................................................................... 39
Appendix D Data Sheets ........................................................................................................................... 48
List of Figures
Figure 1 - System schematic ......................................................................................................................... 7
Page 3 of 68
List of Tables
Table 1 Project Goals ................................................................................................................................. 8
Page 4 of 68
Acknowledgments
The beam-balancing concept that is the main focus of this project was chosen from a list of suggestions
provided by Dr. Cheok. In place of the machine vision method for determining beam angles, we chose to
use rotary encoders. Other components of the system were employed as suggested.
Dr. Cheok and Sami Oweis selected and ordered the motor (with integrated encoder), H-bridge, and
DAQ hardware. Pete Wilson, the engineering department machinist, fabricated the pendulum arms.
John Eisenbraun assembled and tested the H-Bridge kit.
We would like to thank Dr. Cheok for his many suggestions and for his help in formulating a
comprehensive state space model. We also recognize Sami Oweis, who spent many hours in the lab with
us and other groups.
Magna Electronics generously loaned us the TMS320 Piccolo development kit.
MATLAB and Simulink are registered trademarks of The Mathworks, Inc.
Page 5 of 68
Introduction
Examples of inverted pendulums exist everywhere. The last decade has seen the introduction of several
self-balancing personal vehicles like the Segway Personal Transporter. Using technology developed for
the ASIMO robot, Honda has created a self-balancing unicycle[1] . Every human being is himself an
example of an inverted pendulum, balancing the torso on two legs consisting of several joints having
several degrees of freedom.
The inverted pendulum is inherently unstable; to keep the pendulum upright the forces at the bottom of
the pendulum must be constantly adjusted. The failure of a Trident 2 missile launched from a submarine
during a test in 1989 is a testament to the susceptibility of such systems to external disturbances. The
missile had been successful in several land-based launches but spiraled out of control after breaking
through the surface of the water from an underwater launch[2]. This really is rocket science!
Complex systems are naturally non-linear. The academic study of inverted pendulums and solutions for
their controlled balancing leads to an understanding of concepts common to non-linear systems in
general. These concepts include linearization about equilibrium points; control strategies, including
strategies for guiding a system between discontinuous equilibrium points; and systems involving
multiple disciplines (e.g. mechanical, electrical, software), to name a few. In this project, we investigate
modeling a complete system consisting of a double pendulum and a motor, the design of a control
system to balance the pendulum in different configurations (including anti-sway), and a swing-up
strategy for moving the pendulum from rest to a balanced position.
Page 6 of 68
Objectives
The overall objective of this project is to apply control systems theory and the microcomputer-based
tools presented in class to demonstrate the controlled balancing of a beam. We place heavy emphasis
on the use of modeling and simulation and the challenge of real-time control in an inherently non-realtime development environment.
24 V DC
H-Bridge Amplifier
Motor Direction
to H-Bridge
Motor Voltage
to H-Bridge
Motor Current
from H-Bridge
Encoder Inputs
Digital Inputs/Outputs
Analog Input/Output
USB
National
Instruments DAQ
Encoder 2
The following table lists the goals we wished to achieve and the criteria for their success:
#
1
Goal
Dual pendulum visualization
Success Criteria
Demonstrate the visualization in all possible angle
combinations using a test clock pattern.
Observe that the movement of the pendulum arms
released from various non-static positions behaves
in a reasonable manner (does it look right?).
Motor responds to voltage and load torque inputs,
produces torque and speed outputs.
Visualized pendulum responds to applied torque.
Page 7 of 68
#
6
Goal
Design of the feedback control
8
9
10
Success Criteria
Analysis of the systems reaction to initial conditions
and pulse inputs shows convergence within reasonable
response times.
Visualize the simulated anti-sway control and
balancing of the inverted pendulum
Summary of Results
We were successful in applying control theory to design a beam-balancing control system. Simulated
models were built in Simulink. Simulations of an LQR full state feedback control system showed that it
was effective at balancing an inverted pendulum. Practicalities and limitations of the physical prototype
prevented us from achieving the balance of a real inverted pendulum. We were, however, able to
demonstrate the use of the control in an anti-sway application.
Significant Milestones
Pendulum Visualization
The ability to see the pendulums in action was indispensible during simulation. While scope plots and
other collected data provided more detail for close analysis, visualization is a quick and intuitive
indication of the systems behavior.
Page 8 of 68
Motor Model
We developed a Simulink model of a DC motor and assigned the various parameters according to the
physical motors datasheet. The output variable for our system in torque (speed or angle are more
common outputs).
Page 9 of 68