mod eling and control of dual motor ball & beam...
TRANSCRIPT
MODELING AND CONTROL OF DUAL MOTOR
BALL & BEAM SYSTEM
HAO PENG YU
UNIVERSITI TEKNOLOGI MALAYSIA
MODELING AND CONTROL OF DUAL MATOR
BALL & BEAM SYSTEM
HAO PENG YU
A project report submitted in partial fulfilment of the requirements
for the award of the degree of Master of Engineering
(Electrical-Mechatronics and Automatic Control)
Faculty of Electrical Engineering
Unverisit Teknologi Malaysia
MAY 2011
iii
DEDICATION
To my beloved mother, father and family
谨此献给我所爱的父母,家人
iv
ACKNOWLEDGEMENT
First of all, I would like to express my sincere appreciation to my supervisor,
Assoc. Prof. Dr. Hj Mohd Fua’ad bin Haji Rahmat for his encouragement and
guidance as well as suggestions from the beginning to the end of this project.
I am grateful to all of the lecturers in CIED department FKE UTM, who have
opened my mind seeing the wonderful world of Control System and Instrumentation.
Also I would like to say thank you to all of my friends and colleagues that had help
me to complete this project.
Furthermore, I am also grateful to Universiti Teknologi Malaysia for
providing me the facilities to carry out this project.
Last but not least, I would like to express my heartiest appreciation to my
parents and my family for their support through my academic years.
v
ABSTRACT
Ball and beam balancer system is very popular and widely used in control
system engineering due to its simple modeling and easy understanding. The
conventional ball and beam balancer system is with a single motor (SMBB) and
recently a new variant of ball and beam balancer system with dual motors (DMBB)
has come up. The purpose of DMBB is similar to SMBB, which is to control the
position of the ball on the beam. Compared with SMBB, DMBB use two motors to
work together in order to achieve a satisfied control of the ball position. Before the
controller design, the mathematical model of the system needs to be derived. PD
controller and lead compensator are designed to perform the simulation with
MATLAB/Simulink. Two DC motors integrated with reduction gearbox is used as
the actuator in the prototype design and two incremental encoders work to form the
motor feedbacks. Interfaced with the computer through DAQ card, the designed
prototype is verified by LabVIEW. This prototype can be used to test certain control
strategies that SMBB cannot.
vi
ABSTRAK
Sistem bola dan pelantar seimbang sangat popular dan sering digunakan
dalam kejuruteraan sistem kawalan kerana rekabentuknya yang mudah.
Konvensional sistem bola dan pelantar seimbang adalah motor tunggal (SMBB) dan
baru-baru ini, sistem bola dan pelantar seimbang dengan dua motor (DMBB) telah
dibentuk. Tujuan DMBB lebih kurang sama dengan SMBB, iaitu untuk mengawal
kedudukan bola di atas pelantar. Berbanding dengan SMBB, DMBB mengguna dua
motor untuk mengimbang kedudukan bola dan mencapai kawalan yang memuaskan.
Sebelum pengawal direka, model matematik sistem harus diperoleh terlebih dahulu.
Kawalan PD dan kompensator direka untuk menjalankan simulasi dengan
MATLAB/Simulink. Dua DC motor integrasi dengan gearbox sebagai penggerak
dalam rekabentuk prototaip dan dua pengekod tambahan dijalankan untuk
membentuk tindakbalas motor. Rekabentuk prototaip disahkan melalui LabVIEW
dan hubung kait prototaip dengan komputer adalah melalui kad DAQ. Prototaip ini
boleh digunakan untuk menguji strategi kawalan tertentu yang SMBB tidak boleh
laksanakan.
vii
TABLE OF CONTENTS
1 INTRODUCTION 1
1.1 Background
1.2 Statement of the Problem
1.3 Objectives of the Study
1.4 Scope of the Study
1.5 Research Methodology
1.6 Thesis Outline
1
3
4
4
5
6
CHAPTER TITLE PAGE
DECLARATION
DEDICATION
ACKNOWLEDGEMENT
ABSTRACT
ABSTRAK
TABLE OF CONTENTS
LIST OF TABLES
LIST OF FIGURES
LIST OF ABBREVIATIONS
LIST OF SYMBOLS
ii
iii
iv
v
vi
vii
x
xi
xiv
xvi
viii
2 LITERATURE REVIEW 8
2.1 Introduction
2.2 Previous Designs of Ball and Beam Balancer System
2.3 Synchronization
2.4 Cooperative Control
8
8
13
14
3 MODELING & SIMULATION 15
3.1 Introduction
3.2 Theoretical Analysis of DMBB Model
3.2.1 Assumptions
3.2.2 Model of DC Motor
3.2.3 Model of the Ball Moving on the Beam
3.2.4 Model of the Transmission Part
3.2.5 DMBB Model for Simulation
3.3 Simulation
3.3.1 Model Parameters
3.3.2 Controller Design of DMBB Model
3.3.2.1 Controller for DC Motors
3.3.2.2 Controller for Ball Position
3.3.3 Simulation by MATLAB / Simulink
15
15
16
18
22
24
26
27
27
29
30
34
38
4 PROTOTYPE DESIGN 41
4.1 Introduction
4.2 Components to Construct the Prototype
4.2.1 Actuator (DC Motor)
4.2.2 Motor Driver
41
42
42
44
ix
4.2.3 Sensors to Form the Feedback
4.2.3.1 Position Sensor
4.2.3.2 Rotary Displacement Sensor
4.2.4 Mechanical Parts
50
50
51
55
5 EXPERIMENT 57
5.1 Introduction
5.2 PCI-1711 DAQ Board
5.2.1 Introduction of PCI-1711 DAQ
5.2.2 Installation of the DAQ Board
5.2.3 Connections of the Prototype with PC through
5.3 LabVIEW Application
5.3.1 Introduction of LabVIEW
5.3.2 Program by LabVIEW
57
57
57
59
60
62
62
63
6 CONCLUSIONS AND RECOMMENDATIONS 67
6.1 Conclusion
6.2 Recommendation
67
68
REFERENCES 69
PCI-1711
x
LIST OF TABLES
TABLE NO TITLE PAGE
3.1 Parameters of the Ball & Beam Model 28
3.3 The Effect of Increasing Each of the PID Controller
Parameters
30
4.1 Parameters of Selected DC Motors 44
4.2 Logic Truth Table for LMD18200 47
4.3 Selected ICs to Make the Driver Circuit 49
5.1 Signals of the Prototype 60
xi
LIST OF FIGURES
FIGURE NO TITLE PAGE
1.1 Designed DMBB Prototype 2
1.2 Flow Chart of Research Methodology 6
2.1 ‘Ball on balancing beam’ built by Berkeley Robotics
Laboratory (Arroyo 2005)
9
2.2 ‘Ball and Beam Balancer’ built by The University of
Lakehead (Ambalavanar , Moinuddin & Malyshev
2006)
10
2.3 Ball and Beam module presented by ‘Quanser’ (Quanser
2006)
11
2.4 Ball and Beam System; a) Single Motor System, b) Dual
Motor System
11
2.5 Configuration of Dual Motor System 12
2.6 Dual-motor Ball and Beam System (Manavaalan
Gunasekaran and Ramprasad Potluri 2008)
12
3.1 Sketch Diagram of DMBB Initial State 17
3.2 Sketch Diagram of DMBB Dynamic 17
3.3 Sketch Diagram of DC Motor 18
3.4 Block Diagram of DC Motor Model 21
3.5 Sketch Diagram of Ball on Beam 22
3.6 Sketch Diagram of Force Analyze for Ball on Beam 22
3.7 Diagram of System Geometric Relationship of DMBB 25
xii
3.8 Geometric Relationship of Ball & Beam part and Motor
part
25
3.9 Derived DMBB Model 27
3.10 Block Diagram of the DMBB 29
3.11 Open-Loop Step Response of Motor Angle Output 32
3.12 Performance of PD Controller for DC Motor with Step
Input
33
3.13 Performance of PD Controller for DC Motor with Sine
Input
33
3.14 Block Diagram of Uncompensated Inner Loop System 35
3.15 Step Response of Uncompensated Inner Loop System 36
3.16 Bode Plot of Uncompensated Inner Loop System 36
3.17 Bode Plot of Open Loop System with Designed
Compensator
37
3.18 Simulation Block Diagram for the System 38
3.19 Simulation Result for the Ball Position 39
3.20 Simulation Result with Sine Wave Input 40
3.21 Simulation Result with Square Wave Input 40
4.1 Dimension of the Selected DC-Motor (from datasheet) 43
4.2 Illustration of Planetary-Gear System 43
4.3 Schematic of H Bridge 45
4.4 Operation of H-bridge; a) Left to Right Current Flow, b)
Right to Left Current Flow
45
4.5 Functional Block Diagram of LMD18200 46
4.6 Schematic of PWM Waveform; a) PWM with Duty
Cycle of 75%, b) PWM with Duty Cycle of 50%, c)
PWM with Duty Cycle of 75%
47
4.7 Circuit Diagram of Motor Driver 48
4.8 PCB of Motor Driver 49
xiii
4.9 Sketch Diagram of Position Sensor 51
4.10 Encoder Circuit Diagram 52
4.11 Quadrature Encoding of the Incremental Optical
Encoder; a) Forward (Clockwise) Encoding, b) Reverse
(Counter clockwise) Encoding
53
4.12 Encoder Feedback Signals Monitored by Oscilloscope 54
4.13 Mechanical Parts Details of DMBB Prototype 56
4.14 Overview of the Designed Prototype 56
5.1 PCI-1711 DAS Set 58
5.2 Installation Flow Chart of DAQ Card 59
5.3 Connections of the Prototype 61
5.4 LabVIEW 8.6 Program 62
5.5 Elements for LabVIEW from Advantech 64
5.6 Block Diagram of Main Program 65
5.7 Block Diagram of Sub Program for Motor1 65
xiv
LIST OF ABBREVIATIONS
SMBB - Single Motor Ball & Beam Balancer System
DMBB - Dual Motor Ball & Beam Balancer System
DC - Direct Current
PC - Personal Computer
SISO - Single Input, Single Output
MIMO - Multiple Input, Multiple Output
P - Proportional
PD - Proportional-Derivative
PID - Proportional-Integral-Derivative
LQR - Linear Quadratic Regulator
MATLAB - Matrix Laboratory
LabVIEW - Laboratory Virtual Instrumentation Engineering Workbench
KVL - Kirchhoff’s Voltage Law
EMF - Electromotive Force
PM - Phase Margin
GM - Gain Margin
DIY - Do It Yourself
IC - Integrated Circuit
CMOS - Complementary Metal Oxide Semiconductor
DMOS - Double Diffused MOSFET
PWM - Pulse Width Modulation
Ch - Channel
xv
Ref - Reference
CCP - Capture/Compare/PWM
ECCP - Enhanced CCP
A/D - Analog to Digital
DAQ - Data Acquisition
AO - Analog Output
AI - Analog Input
DO - Digital Output
DI - Digital Input
DAS - Data Acquisition System
PCI - Peripheral Component Interconnect
SCSI - Small Computer System Interface
CD - Compact Disc
DLL - Dynamic Link Library
VI - Virtual Instrument
MOT - Motor
xvi
LIST OF SYMBOLS
- Input voltage to DC motor
- Armature resistance of DC motor
- Armature inductance of DC motor
- Armature voltage of DC motor
- Armature current of DC motor
- Torque constant of DC motor
- Back EMF constant of DC motor
- Torque at the motor shaft
- Torque from load
- Gear ratio of reduction gearbox
- Effective moment of inertia
- Viscous friction coefficient
- Motor shaft angle speed output
- Motor shaft angle acceleration
- Gain constant of DC motor model
- Time constant of DC motor model
- Force on ball
m - Mass of the ball
r - Distance of the ball on the beam
g - Acceleration of gravity
- Beam’s tilt angle from the horizontal position
- Friction force
xvii
- Rotational angle of the ball
R - Radius of the ball
- Rotational radius of the ball
- Torque on the ball
- Inertia of the ball
- Angular acceleration of the ball
- Rotary angle of motor1
- Rotary angle of motor2
- Rotary angle of motor1 gear shaft
- Rotary angle of motor2 gear shaft
- Sum of the rotary angle of motor1 and motor2
L - length of the beam
l - Length of the arm
- Gain constant of ball beam model refer to the tilt angle of
beam
- Transfer function of DC motor integrated with gearbox
- Transfer function of the ball position refer to gear shaft
output
- New gain constant of DC motor after reduction.
- New Gain constant of ball beam model refer to the gearbox
shaft angle
- DC motor speed transfer function
u - Output of PID controller
e - Error signal
- Proportional gain
- Integral gain
- Derivative gain
- Transfer function of PID controller
- Integral time constant
- Derivative time constant
- Transfer function of motor controller
xviii
- Open loop transfer function for DC motor
- Transfer function of lead compensator
K - Gain constant of lead compensator
z - Zero of lead compensator
p - Pole of lead compensator
α - The specific value of p and z
- Necessary additional phase is required to give the desired
phase margin
- The inner loop transfer function
- Desired phase margin
- Makeup value of the phase margin
OS% - Overshoot
- Settling time
- Peak value
- Final value
- Output voltage from position sensor
- Voltage applied to position sensor
- Frequency of the PWM feedback signal from encoder
n - Rotary speed of the code disk
- Resolution of encoder
1
CHAPTER 1
1 INTRODUCTION
INTRODUCTION
1.1 Background
The ball and beam balancer system is a typical control system. It is also
called ‘balancing a ball on a beam’. This system can usually be found in most
university control labs. With the associated control design, it is an excellent platform
for testing and evaluating different control techniques (Rosales, R. A. 2004).
It is related to real control problems such as horizontally stabilizing an
airplane during landing or in turbulent airflow. The fundamental principles within
this control system can also be found in many industrial applications, such as precise
position control in production line (Wei Wang 2006).
The ball and beam balancer system has been built previously by many
organizations. Normally the system is with a single motor, also can be named as
single motor ball & beam system (SMBB). This application has been studied for
years and methods of control techniques have been discussed in many literatures.
There are two different basic models of SMBB dependent on the position of the
motor used to regular the beam position. For the first kind, the motor was amounted
2
in the middle of the beam; for the second kind, the motor was amounted in one of the
end of the beam.
Recent years, a new variant of this system has come up: system with dual
motors, dual motors ball & beam system (DMBB). This topic first appeared in
Aalborg University Esbjerg (2005). They have built the first DMBB prototype.
DMBB is a ball-beam system regulated by dual motors. In contrast to the SMBB,
each end of the beam in DMBB is driven by a motor. The two motors cooperatively
work to regular the beam angular which can control the ball position.
Figure 1.1 Designed DMBB Prototype
As shown in Figure 1.1, each end of the beam hangs from a level beam. The
level beam hangs from an arm. The arm is fixed with the shaft of the planetary gear.
Each planetary gear is amounted on the shaft of each of the two DC motors.
3
Such a setup can serve as a learning stage, for example, for the more difficult
dual-manipulator cooperative control task (Hisashi Osumi ans Tamio Arai 1994), and
for the more general multi-agent cooperative control (Daniel Cruz, James Mcclintock
2007).
1.2 Statement of the Problem
Same as SMBB, the aim of DMBB is to control the position of the ball to a
desired reference point. The control signal can be derived by feeding back the
position information of the ball. The angle signal from compensator goes to the two
DC motor controllers then generate voltage signal to go to the DC motors. At last the
torques generated from the two motors cooperatively drive the beam to rotate to the
desired angle. Thus, the ball can be located at the desired position. In contrast to the
SMBB, the difference is the two motors need to work cooperatively to achieve the
aim.
It is important to point out that the open loop of the system is unstable and
nonlinear. The problem of ‘instability’ can be overcome by closing the open loop
with a feedback controller. The nonlinear property is not significant when the beam
only deflects a small angle from the horizontal position. In this case, it is possible to
liberalize the system. However, the non-linearity becomes significant when the angle
of the beam from the horizontal is larger than 30 degrees, or smaller than -30 degrees.
In this case, a simple linear approximation is not accurate.
4
1.3 Objectives of the Project
The major job of the project is to model DMBB and design controller for the
DMBB model. Then build the prototype and verify it. Specifically, the aims are listed
in the following:
To derive the mathematical model of DMBB and build a simulation
model for this system.
To design controller for the DMBB model and see the simulation results.
To design the prototype of the DMBB.
1.4 Scope of project
Two DC motors of the DMBB system will control the ball position. It’s a
cooperative problem between both DC motors. In this project, the cooperative
control is without information exchange between the two motors and is accomplished
through predefined workload sharing.
Some assumptions are made when deriving the mathematic model of the
DMBB. And linear model is used. PD controller and lead compensator are used to
apply control to the DMBB model in simulation.
The DMBB prototype is built in this project and interfaced with PC by
PCI-1711 from Advantech.
5
1.5 Research Methodology
1. Literature review to understand the concept of a ball and beam balancer system is
conducted.
2. Search out previous and current projects of a ball and beam balancer system and
get ideas for designing the DMBB.
3. Derive mathematical model for DMBB and define mathematical model of the
controllers.
4. Perform simulation using MATLAB/SIMULINK.
5. Design the prototype and test it with labVIEW program.
6. Future work to test different kinds of control strategies.
All the methodology above can be summarized as shown Figure 1.2.
6
Figure 1.2 Flow Chart of Research Methodology
1.6 Thesis Outline
This project consists of six chapters including this chapter. The scope of each
chapter is explained as stated below:
Chapter 1
This chapter gives an introduction to the project report, objectives, problem
statement, scope of work and methodology adopted.
Literature
Review
Derive Mathematic
Model of DMBB
Prototype
Design
LabVIEW
Program
Design
Design
Requirement
Controller
Design
Perform
Simulation
Verified the
Prototype by
Experiment
Testing Different Control
Strategies (Future Work)
Future Work
7
Chapter 2
This chapter discusses the previous design of ball and beam system and also
the concept of synchronization and cooperative control.
Chapter 3
This chapter gives the analysis and modeling of the DMBB. With the
designed controller, simulation is performed.
Chapter 4
This chapter presents the design of DMBB prototype including the
mechanical parts and the electrical parts. The key components to construct the
prototype are given here.
Chapter 5
This chapter the connections between PC and prototype are given. And also
the designed DMBB prototype is verified by developing a program with LabVIEW.
Chapter 6
This last chapter presents the overall discussion and conclusion of this project.
Some recommendations and suggestions have been included for future works.
69
REFERENCES
Ambalavanar, S., Moinuddin, H. M. & Malyshev, A. (2006), Ball and Beam
Balancer, BA Thesis, Lakehead University.
Arroyo, S. (2005), Ball on Balancing Beam,
http://bleex.me.berkeley.edu/ME102/proj_archive/F03/Proj9/contactinfo.htm
Aalborg University Esbjerg (2005), Dual-Motor Ball–Beam System,
http://www.aaue.dk/~akbar/projects/Ball%20and%20Beam%20System.htm
Advantech, PCI-1711/1731 User’s Manual, www.advantech.com
Advantech, Device Driver User Manual for PCI-1711/L, www.advantech.com
Advantech LabVIEW Driver User’ s Guide, www.advantech.com
Advantech Device Driver Example Manual, attached in CD
Blekhman, P. S. Landa, and M. G. Rosenblum, Synchronization and chaotization in
interacting dynamical systems, ASME Appl Mech. Rev., vol. 48, pp. 733-752, 1995.
Daniel Cruz, James Mcclintock, Brent Perteet, Omar A.A Orqueda, Yuan Cao, and
Rafael Fierro., Decentralized cooperative control, IEEE Control Systems Magazine,
27(3), pp. 58-78, 2007.
70
Hisashi Osumi ans Tamio Arai, Cooperative control between two position-controlled
manipulators, In proceedings of the IEEE International Conference on Robotics and
Automation, volume 2, pp. 1509-1514, 1994.
Jimenez S and Wen Yu, Stable synchronization control for two ball and beam
systems, In International Conference on Electrical and Electronics Engineering, pp.
290-293, 2007.
Li-Qun Chen, A general formalism for synchronization in finite dimensional
dynamical systems, Chaos, Solitons and Fractals 19, pp. 1239–1242, 2004.
M. Gunasekaran and R. Potluri. Cooperative control of a dual-motor ball and beam
system. In India Conference, 2008. INDICON 2008. Annual IEEE, pp. 525–530,
volume 2, 2008.
M. Tomizuha, J. S. Hu, and T. C. Chiu, Synchronization of two motion control axes
under adaptive feedforward control, ASME J. Dynam. Syst., Meas. Control, vol. 114,
no. 6, pp. 196-203, 1992.
Microchip (2004), PICmicro® DC Motor Control Tips ‘n Tricks,
ww1.microchip.com/downloads/en/devicedoc/41233a.pdf
Quanser (2006), The ball and beam module,
http://www.quanser.com/english/downloads/products/Rotary/Quanser_SRV02_BallB
eam_PIS.pdf
Rosales, R. A. (2004), A ball-on-beam project kit, BA Thesis, Massachusetts Institute
of Technology.
71
Wei Wang (2007), Control of a Ball and Beam System, MS Thesis, The University of
Adelaide.
Wei Ren abd Beard R.W. and Atkins E.M., Information consensus in multivehicle
cooperative control, IEEE Control Systems Magazine, 27(2), pp. 71-82, 2007.