Transcription of THE INVERTED PENDULUM - Electrical and Computer …
1 THE INVERTED PENDULUM A Design Project Report Presented to the engineering Division of the Graduate School of Cornell University in Partial Fulfillment of the Requirements for the Degree of Master of engineering ( Electrical ) By John Stang Project Advisor: Dr. Bruce Land Degree Date: May, 2005 IIAbstract Master of Electrical engineering Program Cornell University Design Project Report Project Title: The INVERTED PENDULUM Author: John Stang Abstract: The INVERTED PENDULUM is a classical control problem, which involves developing a system to balance a PENDULUM .
2 For visualization purposes, this is similar to trying to balance a broomstick on a finger. To study this problem, this project incorporated a full system design including all of the mechanical, hardware, and software design at minimal cost. There are three main subsystems that compose this design: (1) the mechanical system, (2) the feedback network which includes sensors and a method to read them, and (3) a controller and its interface to the mechanical system. After determining sets of requirements between the subsystems, each one can be designed independent of the other two, simplifying the design process.
3 The mechanical design involved building a track, cart, PENDULUM , and drive mechanism. The track, cart, and PENDULUM were developed out of primarily aluminum and wood. The drive mechanism is a DC motor with a sprocket mounted onto its shaft to pull a chain, which the cart connects to. The feedback network consisted of rotational potentiometers, which were sampled by an analog-to-digital converter, to measure the angle of the PENDULUM and the displacement of the cart. The controller was implemented by an Atmel Mega32 which varies the speed of motor by using pulse width modulation.
4 The final system results in a cart that could balance a PENDULUM for a limited amount of time. This was due to many imperfections in the mechanical system and the inability to model the dynamics of these imperfections along with the calculation limitations of the Atmel Meg32. Report Approved by Project Advisor: _____Date:_____ IIIE xecutive Summary The classic control problem of the INVERTED PENDULUM is interesting in that it can be solved using a wide variety of systems and solutions . This problem is similar to trying to balance a broomstick on a finger.
5 The flexibility of this problem invites those interested in system design, control theory, and just plain problem solving to try and develop a working system. For this project, the motivation was to translate the mathematical models developed in control theory classes into a real-time system. This design is a full system design including all of the mechanical, hardware, and software aspects at minimal cost. The design process for this project required a great deal of planning and testing before deciding on a final design since there were so many alternatives to choose from.
6 The design problem can be broken down into subsystems which are extremely dependent on each other. The actual design of each subsystem was an iterative process of testing components and implementing simple solutions until the optimal solution could be found. The optimal solution can be defined as the solution that can be developed at minimal cost (meeting budget constraints) which balances the PENDULUM the best. During the design process, many setbacks were encountered. The most important and time consuming setbacks all related to broken motors.
7 When the first motor broke, a faster and higher torque motor was obtained because the original one was not able to react fast enough in order to balance the PENDULUM . Since the new motor had different dimensions than the first, the whole mechanical system needed to be redesigned. The next two motors broke when the control effort was too high and changing direction rapidly, putting too much stress on the internal gears. To fix this, the controller was redesigned with a tighter constraint on the control effort. In the end, a system and controller were designed to balance the PENDULUM for about 3-5 seconds before reaching the edge of the track.
8 Applying small taps to the PENDULUM in the opposite direction would allow for much longer control. The final result of this design process can be deemed a success since a working mechanical system was developed with an optimal controller designed by minimizing the Linear Quadratic Regulator cost equation, given the maximum desired angle, displacement, and control effort. IVTable of Contents INVERTED PENDULUM IABSTRACT IIEXECUTIVE SUMMARY III1. INTRODUCTION 1 MOTIVATION 1 BACKGROUND 12. DESIGN PROBLEM AND REQUIREMENTS 3 THE PROBLEM 3 THE CONSTRAINTS 3 THE REQUIREMENTS 33.
9 THE RANGE OF POSSIBLE solutions 5 MECHANICAL SYSTEM 5 TRACK, CART, AND PENDULUM 6 THE MOTOR AND THE CONTROL CIRCUIT 8 FEEDBACK NETWORK 9 DISPLACEMENT SENSORS 10 ANGLE SENSORS 12 CONTROLLER solutions 12 MODELING THE SYSTEM DYNAMICS 13 MODELING ASSUMPTIONS 13 LINEARITY 13 COMPLEXITY 13 CONTROLLER DESIGN 14 CLASSICAL CONTROL 14 MODERN CONTROL 14 ROBUST CONTROL 16 MODEL PREDICTIVE CONTROL 17 CONTROLLER
10 IMPLEMENTATION 18 THE FINAL DESIGN CHOICES AND REASONING 19 THE FINAL DESIGN CHOICES 19 THE REASONING BEHIND THE CHOICES 194. DESIGN PROCESS AND IT S IMPLEMENTATION 21 MECHANICAL SYSTEM 21 FEEDBACK NETWORK 26 CONTROL CIRCUIT 27 SYSTEM MODEL AND CONTROLLER IMPLEMENTATION 27 THE SYSTEM DYNAMICS 28 THE STATE SPACE MODEL 32 LQR CONTROLLER DESIGN 35 USING THE MEGA32 TO APPLY THE CONTROL LAW 39 PARAMETERIZING THE MOTOR 39 IMPLEMENTING THE CONTROL LAW 41 EVOLUTION OF THE REQUIREMENTS 425.