Log in

View Full Version : Current angle from gyro


Ethan Spitz
06-02-2011, 12:26
Hey, I was wondering if anyone knows how to use the "Gyro Get Angle" block in labview. I wired it up and put an indicator on it, but it seems to just keep increasing in angle infinitely or decreasing in angle infinitely.

Am I doing something wrong with this? Or is the subvi just bad?

Ethan

Alan Anderson
06-02-2011, 13:47
Did you open a gyro reference in Begin and use the same name for its reference in Teleop?

Do you actually have a yaw rate sensor "gyro" connected on Analog Input 1 or 2?

Ethan Spitz
06-02-2011, 14:18
Did you open a gyro reference in Begin and use the same name for its reference in Teleop?

Do you actually have a yaw rate sensor "gyro" connected on Analog Input 1 or 2?

Analog 1 and it is referenced in begin and uses the same name.

Ethan

Alan Anderson
06-02-2011, 14:30
There's nothing wrong with the LabVIEW functions.

If your Get Angle continuously increments or decrements, one of three things is likely. First, you might have a faulty gyro. Second, you might have misconnected to its Temperature output instead of its Rate output. Third, your robot might have been jostled during the brief time the gyro code was being initialized and measuring the sensor's offset.

Check your wiring first.

Joe Ross
06-02-2011, 14:36
Does it work with the gyro example program?

Ethan Spitz
06-02-2011, 14:55
The wiring is good. The angle per second was working fine. So are you saying next time i start it up if it is still it will work?

What is the example gyro code?
Ethan

Joe Ross
06-02-2011, 16:28
From the getting started window in LabVIEW, select the "Find FRC examples" in the lower right hand corner. It will give you examples for many different sensors actuators, and other things. The examples show the required wiring and minimal code to get it working.

Ethan Spitz
06-02-2011, 18:08
I didn't have set gain in there. Could that be it? (I won't be able to test till tomorrow)

Ethan

Ethan Spitz
07-02-2011, 22:01
I figured it out, it was a stupid error. I made a typo in the reference string.

Thanks for your help!
Ethan