Transcript Balancing Robot Thingy - Rochester Institute of Technology
Roberto - Balancing Robot
RIT Computer Engineering Senior Design Project
Group Members
Jeff Mahmood Paul Krausman Dave Froman
Project Description
Two-wheel balancing robot – Balances on any angled surface – Remains balances indefinitely Remote controlled “Inverted Pendulum” PID Controller
Physical Layout
Tilt & Rate Sensors HC12 18.0" RF Receiver H-Bridge Battery 10.0"
PID Algorithm
Means to control some output from a combination of different factors Differential equations solved in the frequency domain We will solve experimentally
PID Algorithm (cont.)
PID is “Proportional Integral Derivative” Output based on the aggravate of 3 factors – Error – Error Derivative – Error Integral PID algorithm combines these 3 factors to determine appropriate output
Error Definition
Actual Error Set Point Error: Difference between set point and actual Error can be positive or negative
PID Equation
Proportional Integral Derivative Output = P* Θ + I*Θ + D*Θ’ – – – P is the Proportional constant Current error I is Integral constant Sum of past errors D is Derivative constant Rate of change of error
Proportional
40° Θ 0° Torque applied to motors is proportional to amount of error
Integral
Sum of all errors over time Biases output so all errors cancel over time
Derivative
300°/sec 0° Torque applied to motors proportional to derivative of error Velocity of error
Tuning PID Controllers
Goal: – – Find coefficients for P, I, and D terms Robot should “snap” back to set point after any disturbances – Prevent any oscillations – Robot should remain at set point indefinitely
Finding P Term
Set I and D terms to 0 Set P term to 1 Increase P term until strong oscillations occur Some references recommend setting P to 60% of this value
Finding D Term
Slowly increase D until oscillations begin to slow Fine-tune D – – – Robot will oscillate if D is too high Robot will fall over is D is too low Robot should “snap” back to set point after any disturbances
Finding I Term
More difficult than P and D Generally inverse of D Limit sum to prevent saturation Sliding window
Increase Performance
Robot may seem sluggish – If either P or D is set too low, robot will be slow to respond Robot may oscillate – If either P or D is set too high, robot will oscillate before settling on set point Tweak P and D terms until optimal performance is achieved
Sensors
Accelerometer – Measures tilt (proportional error) – – Slow response, but accurate Gives sense of “up” Gyro – Measures velocity (derivative error) – – Fast response, but inaccurate Suffers from drift over time
User Interface - Remote Control
Two axis control – left and right motors 2 commands for each side – move forward, back Uses 4 bit encoding/decoding(8 values used) Each switch press has unique encode value, which is transmitted and received
Remote Control
Momentary rocker switches are used for intuitive remote controlled car feel Robot moves by pressing both switches in the same direction, turns by alternating directions
The End
Questions???