Reading Futaba 401 gyro information
patterson7019
Posts: 25
Anyone know how to read the Futaba 401 gyro positional information? Would it be safe to read it like a servo? Would the parallax servo controller read it's info correctly?
Thanks,
Lee
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://perfectaperture.com/robb
Thanks,
Lee
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://perfectaperture.com/robb
Comments
Just like PULSOUT to a servo (in reverse).
~1500us (1.5ms) pulsewidth should be "level".
I *would* put a 220 or 470 ohm resistor between the signal out of the gyro and your Stamp pin, however. This way if you accidentally make the pin an output, you won't short out and release smoke from your Stamp.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
J-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
So.... the trick to using these inexpensive gyros is generating a 1500us servo pulse (dead center) into the gryo so that the output can be read as "tilt" or deviation from dead center.
On an SX this is easy -- one pin to the gyro (in the ISR) generates a constant neutral pulsewidth, another pin reads the pulsewidth generated (like pulsin).
On the Stamp I do not think this is possible without a peripheral that is generating constant servo pulses for the input. With a PSC (Servo Controller), then it would be easy -- set one servo channel to 1500us (750) and leave it there. That's the input to the servo; then read the output signal with PULSIN.
One advantage here is that one could generate an input that is not dead center -- to tune the gyro if it's not mounted exactly straight or whatever -- since the output is the deviation from whatever the input is.
I'm going to order one of these to play with -- I really want to build a balancing bot (that'll be an SX, though, not a Stamp).
e.g.
www3.towerhobbies.com/cgi-bin/wti0001p?I=LXMSF8
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
patterson7019 -- The Futaba 401 you refer to is *much nicer* -- and pricier :-) -- more stable and allows for what's called "heading-hold" which means that it will report more accurate axis rotational info.
The PG-03 works as follows (the 401 is similar but will prob. give you better results without having to integrate the readings to get tilt/rotation):
- servo signal goes into servo cable (I set up a PSC to output a 1500us reference pulse, but a 556 timer or an SX or just about anything that can be configured to output a servo pulse will work)
- adjust setup pot on gyro so·LED·shows "red/green" simultaneously
- gyro servo socket is tied to an input pin for use with PULSIN
- gyro is read via pulsin
- I did not need to adjust the gain pot at all
Now, since the gyro is meant to "stabilize" a connected servo, it reports just the "change" in rotation about it's measureable axis, then returns to "center". So you don't get what I would think of as "absolute" tilt without integrating the error.
My attached test program works fantastically well -- very stable and consistent readings as I tilt the gyro back and forth. Can't wait to build a balancing bot this winter....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 9/9/2008 3:06:41 PM GMT
Excellent! Keep us posted with your results!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
My own future project will be an SX-based 'bot, which will be more than capable of handling a number of servo pulse outs, measurements, ir modulation (sensors), and pwm out to h-bridge motor drivers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php