Log in

View Full Version : Help with Gyro for Field-centric Mecanum Drive


ShadowBot
16-02-2015, 18:30
So we have been trying to implement the gyro for field centric mecanum drive. So far, when the gyro code is hooked up to the holonomic drive, the robot spins out of control. I think I managed to fix that problem (its value used to read INF), but now the gyro angle constantly counts up at roughly 0.0001 per second and does not change when the robot rotates.

Gain is set to 0.0125 on front panel and have a button on my controller to reset the gyro.

Could our gyro be faulty or something wrong with the code?

Begin
http://i.imgur.com/0mYX8xE.png

Teleop
http://i.imgur.com/BSFXNSD.png

Alan Anderson
16-02-2015, 18:35
What gyro are you using? What connections on it are you using?

The Yaw Rate Sensor "gyro" board from the Kit of Parts a few years ago has a temperature output as well as a turn rate output. Accidentally connecting the temperature to a gyro accumulator can have the effect you described.

ShadowBot
17-02-2015, 16:14
Yes, we are using the am-2067. It's connected with a pwm cable to DIO 1 with the signal wire on the rate pin, power wire to the next pin, and ground wire to the corner pin.

Alan Anderson
17-02-2015, 16:56
DIO 1

Well, there's your problem. Gyros of that type provide an analog output and must be connected to Analog Input 0 or 1. If you don't have anything connected to the Analog Input signal pin, it will do what you're describing.

ShadowBot
17-02-2015, 17:55
....... Thank you! getting my brain checked