View Single Post
  #10   Spotlight this post!  
Unread 16-01-2012, 03:13
Jeremy Germita's Avatar
Jeremy Germita Jeremy Germita is offline
Co-Advisor/Lead Engineering Mentor
AKA: wood is good. plastic is fantastic.
FRC #5012 (Gryffingear) / (Antelope Valley FIRST Teams)
Team Role: Coach
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Lancaster, CA
Posts: 282
Jeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond repute
Re: Stabilizing robot on bridge with gyro or accelerometer

There are relatively simple ways to do both. The following is how I would do them.

Gyro:
(This assumes the gyro is mounted so that it's measured axis is parallel to the ground and drive base. So it measures pitch)

A simple PD controller should suffice for a single balancing routine. You may or may not want to add I if you plan to run it with multiple robots.

The PID controller's output is fed to the drivetrain's forward/reverse power. Simple as that

Accelerometer:
You would call atan2(accel.getY(), accel.getX()) to get the robot's Pitch angle relative to the ground.

Follow the PD controller advice from the gyro.


Personally, I would go with a 2+ axis gyro. Mounted so that it would measure robot yaw and pitch.
Two PID controllers are running at the same time. One makes sure the robot is parallel with the bridge(don't want to balance if you're > 45 degrees to the bridge ). The other behaves as above, maintaining the pitch.
Sure, it's a little more complex, but it saves the driver the trouble of maintaining heading while on the bridge.
Controls wise, I would make all of that run only while a button is pressed. this allows for quick cancellation just in case something happens on the field.

Then again, you can go completely open loop and put all of this on your drivers. With practice, single robot balancing becomes a cinch. But the real fun happens when you get two or three robots on there . The sensor way to go doesn't care about other robots in the way.

For all of the methods, I would shift into low gear.

Ask away if you have any more questions.
Jeremy G.
__________________
Drive Coach Team 5012 Gryffingear / Antelope Valley FIRST teams / EWCP - (2013 - Current)
Student / Driver / Programmer / CAD - FRC Team 399: Eagle Robotics / FTC Team 72: GarageBots - (2009 - 2013)
Los Angeles Region FTC FTA/CSA/Head Ref
[FF] FIRST Pick
2014 FTC Los Angeles Regional Compass Award Winner.

2017 - Sacramento Regional / Las Vegas Regional
2016 - Los Angeles Regional Creativity + Winners (1197, 987, 5012) / Las Vegas Regional Team Spirit + SF (5012, 5851, 5049) / Galileo Subdivision
2015 - Inland Empire QF (597, 5012, 4413) / Las Vegas Imagery + Winners (148, 987, 5012) / Newton Subdivision and World Champions (118, 1678, 1671, 5012)
2014 - Inland Empire Rookie All Star + Highest Rookie Seed + SF (2339, 1967, 5012) / Las Vegas Rookie All Star / Galileo Division Imagery

Last edited by Jeremy Germita : 16-01-2012 at 03:17. Reason: Open loop