![]() |
Gyro angle will not work with robot code
3 Attachment(s)
I am trying to get an angle from the gyro and I am able to get the sample code to work. But when I try to use the sample code on the robot code it just outputs a constantly increasing number from 0-360. I attached the code below. Can anyone tell me why this is happening?
|
Re: Gyro angle will not work with robot code
You didn't set the gyro gain. Try this:
![]() |
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
The spec sheet for the gyro you are using should list a value for "voltage per degree of rotation per second", use the value they list for the gain.
When the cRIO is first booted, you know you must not touch the robot while the gyro initializes? That's how it decides what zero is. |
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
I just saw on another thread that you are intending to use the gyro for your shooter altitude angle. I think you want a potentiometer or encoder instead. |
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
Quote:
|
Re: Gyro angle will not work with robot code
We have seen the constantly increasing gyro behavior which seems to be due to bad connections. Check that the connection to the analog board and the gyro itself are solid and don't have any wire "hairs" shorting. Also, as mentioned, check the datasheet for the gain. Our gyro (I think this year or last year KOP) has a gain of 0.007 instead of the 0.0125 of the examples.
|
Re: Gyro angle will not work with robot code
http://www.chiefdelphi.com/forums/sh...42#post1239642
Please see this post, and see if this explains the issue. |
| All times are GMT -5. The time now is 12:02. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi