540 likes | 662 Views
Introduction. The Team Goals Design Parameters. Introduction. The Pendubot is a two-link inverted pendulum actuated by a single electric motor. Our task is to design and build the Pendubot Culmination of the Electrical and Computer Engineering program for our team
E N D
Introduction The Team Goals Design Parameters
Introduction • The Pendubot is a two-link inverted pendulum actuated by a single electric motor. • Our task is to design and build the Pendubot • Culmination of the Electrical and Computer Engineering program for our team • ECE496 teams are in competition
Team Goals • Efficiently build a working Pendubot • Have working Pendubot by Bonus Day • Have the fastest, best performing Pendubot during Competition Day • Build a complete, aesthetically pleasing website • Present our work in a manner that is interesting and complete
Theory Mathematics Physical
SWING-UP CONTROL • Energy Balance Approach:
Problems with Energy Balance Approach • Motor torque not sufficient to swing the robotic arm up in one swing • Back-swing implemented • Torque signal maxed out through most of the swing up routine • Result: Theoretical equations/calculations will not work under non-ideal conditions
Swing-up Control Solution • Solution: Experimentation with PD gains to find numbers that result in correct orientation for balance control • Taking into account the orientation of second link during swing up • Results:
Stability Analysis • PD Controller • not stable • PID Controller • not stable • Therefore, resort to pole movement technique
Balance Control • Based on the physical properties of our robot: • matrix Algebraic Riccatti Equation: • Linear Quadratic (LQ) Optimal Control • Performance index is quadratic and the control system is (approximately) linear • Move all pole to the negative half plane
lqr results: Thus, the control law is as follows: where, Note: actual k values differed significantly from calculated values.
Problems with Theoretical Gains • They just plain did not work! • Theories as to why: • Physical construction of the pendubot • Low mass and cross-sectional areas of the links • Conclusions: • Resort to trial and error testing for balance control • Results:
Equipment Research The following were areas of the project that were researched before construction. Each was vital in implementation of the Pendubot. • Motor types • Encoders • Circuit Boards • Links
Motors Group set forth to determine the optimal type of motor to use. The following three DC motor types were researched further: 1)Permanent magnet 2)Stepper motor 3)Servo
Types of Motors Permanent magnet: These motors are the most common type of DC motor on the market. Uses polarity switches to start and continue the spinning of the rotor. Advantages: common, least expensive, simple to use Disadvantages: least control, power hungry, physical dimensions, gradual acceleration and deceleration curves
Types of Motors Cont. Stepper Motors Stepper motors use a magnetic field to move a rotor. Voltage is applied to poles around the rotor. Stepping can be done in full step, half step or other fractional step increments. Advantages: position control, large low end torque Disadvantages: expensive, complicated computer control
Types of Motors Cont. Servo A servo is a dc motor combined with a position sensing device (e.g. a digital decoder). An attached potentiometer allows the control circuitry to monitor the current angle of the servo motor. Advantages: excellent position control, simple implementation Disadvantages: cost
Encoders • Encoders are devices that measure position changes. • Industry standard is the optical encoder • Important specifications: • Shaft load bearing ability (durability in general) • Resolution • Cost • Weight
Boards Breakout board “Intelligent” board used by computer that allows Qmotor to communicate with hardware Servo-to-go board Computer feed board that alters data into a form that the terminal board can use and vice versa Terminal Board ISA MultiQ terminal board by Quanser. Essentially acts as a relay for all incoming signals to their respective destinations. Sends incoming encoders signals to computer and outgoing motor pulses to the amplifier
Implementation Links Motor Encoders Software
Links The following slides illustrate the gradual evolution of links for the project. Shown is the first proposed idea; hollow aluminum tubing with ball bearings separating the links.
Links Cont. Second idea was to use aluminum arrows to constitute the link arrows. Links were strong and lightweight.
Links Cont. Shown below are the machined aluminum inserts necessary to attach the arrow shafts to the encoder and motor shaft.
Links Cont. Due to complications, it was necessary to re-evaluate the “arrow links” and choose new design. Solid aluminum links that utilize same inserts were chosen.
Links Cont. Finally, after realizing weight limitations of the motor, it was decided that thinner solid aluminum links would be used. No inserts were needed for these links.
Motor Pittman 14207S008 brush-commutated DC motor chosen
Encoders US Digital's S2-1000-B encoders chosen 5 V – 1000 Point
Acquisition After making many calls, looking through catalogs, and searching the web, we obtained the following products: • Model 14207S008 brush servo motor from Click Automation • Model S1-1000-NT optical encoders from US Digital • Boards provided by project administrators
Software Implementation • Use QMotor to implement control programs in C++ without DSP boards • QMotor has the ability to log data in various formats • Allows for ease of testing
Pseudo Code • enterControl() • Register relevant LogVariables • Link Angles, Link Velocities, Position Errors, Output, and System State • Register ControlParameters • Kp, Kd, Kf, Switching Angle, SwingBack Angle • clearAllControlParameters();
Pseudo Code (continued) • startControl() • clearAllLogVariables() • Check for IO Board errors • Enable velocity filters • Set desired link positions • Read current encoder values • Set system state
Pseudo Code (continued) • control() • Read Link angles • Calculate Link Velocities • Calculate Position Errors • Input into P Matrix • [PE1 PE2 LV1 LV2]T • Check System State • If state == 0 • Swingback until link1Angle = swingBackAngle • If state == 1 • Enter swing up • If state == 2 • Enter balance control • ControlOutput = MatrixP x MatrixK • If state == 3 • Link 1 has gone too far • enter safety control • If state == 4 • Link 1 has not reached balance control • Enter safety control
Testing Code Balance Swing up
Listed below are the steps involved in evaluating the performance of the Pendubot Equipment Check Tested Code Tested k values for balance control Tested swing up Time Spent Problems Encountered Testing
The following are tests performed on equipment before testing could begin Tested Motor and Linear Amp using 1.5V battery Tested voltage output of I/O board for 5V Checked outputs of encoders Equipment Check
After assembling and checking the necessary hardware, the next tasks involved the operating code: Compiled code Checked for correct readings and responses Tested code on Pendubot and made updates Testing Code
As Math Theory section above states, k gains were found using two different approaches; Generated values using LQR function in Matlab Correct k values found by trial and error K Values for Balance Control
Swing up from bottom failed Added Backswing for momentum Adjusted switching angle for best results Adjusted kp, kf, kd Testing started two weeks before bonus day competition Approximately 60+ hours spent testing Testing Swing Up
Finding correct k values for balance control Pulled thread insert out of 1st set of links because of high gain on motor Broke connection piece Broke encoder shaft when computer froze Problems Encountered
Results Bonus Day Final Competition Conclusion
Bonus Day On Bonus Day, the project had to meet the following criteria; • Demonstrate indefinite stability when undesturbed • Be able to recover stability when bumped • Swing up not necessary, but bonus points awarded if capable of
Bonus Day Performance After a night of arduous tweaking and adjusting, Bonus Day arrived. The group performed as follows; • Accomplished stability for 20 seconds • Unable to complete swing up • Received 7 out of the maximum 10 points
Competition Day Competition Day was the culmination of all the months of hard work. Competition and grading criteria was as follows; • Groups are to initiate swing up from rest and have link end at a fully stable position • Timing is initiated after program is initiated and stopped when links enter forks • Golf ball is not to exit the measuring forks once it enters them • Stability must be achieved, but quality of stability is not judged
Competition Day Results On competition day, groups were allowed 10 minutes to achieve the fastest possible swing up and stability for their machines. Our group performed as follows; • Swing up accomplished in 1.62 seconds • Maximum stability achieved • Performance time good enough for 5th place