Thread: Using Sensors
View Single Post
  #11   Spotlight this post!  
Unread 16-12-2003, 10:28
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Using Sensors

Quote:
Originally Posted by randomperson
Just my useless two cents...

Last year, trying to get the gyro to work was horrible. I mean, it sorta did what it was supposed to, but there was too much "jitter" in it. If you used the dashboard viewer to look at the gyro output... it was going all over the place, especially when you got hit, hit things, or was going over that wire mesh (especially that).

I know some teams got it to work by using some special stuff to reduce the noise in the output... but I never quite figured that one out. And the usefulness didn't outweigh the difficulties of getting it to work so I never bothered either....
Last year my team sucessfully used the Gyro, but we used an off-board processor (an Atmel AVR). when needing to track a line (going straight) we would read the theta, then, each loop, compare the current theta with the first one and multiplied the difference by some fudge factor and then added/subtracted from the left/right wheel velocity setpoint and make the robot curve back onto the line.

When needing to follow a curved path (e.g. 180) we would just set differential wheel velocity (we used encoders on the motor shaft & controlled velocity rather than power) for a given curve and then loop waiting for the theta to change by 180.

Worked like a charm: straight out from the start, tight 180 to the center of the ramp, straight up and over. Worked every time, even when boxes were stacked in front of the robot. We had four modes: up the ramp left/right, back up as fast as possible (bash the opposition) and do nothing.

The code, attached, is a little state machine task: for the first 5 seconds (5 * SYSCLOCK) it does nothing, letting the robot "settle down", then it reads the gyro value and *assumes* this is the zero point. Then it settles into the -1 case where it just integrates the gyro output and makes various value available to other programs.

What I don't show is that we filtered the gyro on the electronics board (33k resistor feeding a .1uf capacitor) to get the gyro output bandwidth below 100hz.
Attached Files
File Type: txt gyro.txt (1.5 KB, 89 views)