LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interface a Gyroscope for Attitude

Hi.

I am having trouble determining attitude from a Gyroscope. I wish to determine when a Platform is Level using a Gyroscope. Similar principle to a Artificial Horizon in a naircraft. I can read the voltage rate change from the Gyro but how do I convert this to Angular Displacement. Integrating once should give velocity and again for displacement. Has anyone got some sample code that will do this for me. I am not worried abour drift at this stage. Any help would be much appriciated.

 

Regards

Creg

 

0 Kudos
Message 1 of 8
(4,106 Views)

Hi Creg

This is not something That I have done before but it does look interesting. What kind of a voltage signal are you reading in? What is the relationship between the voltage and the angle/speed etc. of your Gyroscope.

If you can describe the system in a little more detail I will try and advise best i can with the LabVIEW bit.

I look forward to hearing from you

best regards

Graham Green
Software Product Marketing
NI | Emerson
0 Kudos
Message 2 of 8
(4,076 Views)

 

HI,

I’m Using a Melexis MEL90609 Gyro. It has a SPI and an Analogue output. At rest the analogue output is at 2.5V. This voltage varies up and down depending on the direction and the rate of turn. When the gyro stops turning the voltage settles back to 2.5V. Being used is the analogue input of a NI USB-6008. (Not using SPI).  Picture a tray/platform being held by a mechanical arm. For the moment one axis of rotation needs to be level. (Then copied for the other). When the plate is being moved the joystick of the mechanical arm, the operator can observe the attitude with reference to gravity. An accelerometer will probably have to be used to determine downward direction and to eliminate gyro drift.

 

Pitch and roll of the platform should be displayed similar to that in an Artificial Horizon of an aircraft.

 

Any suggestions of how to approach this problem would be appreciated.

 

Creg
0 Kudos
Message 3 of 8
(4,059 Views)
Hi Creg
 
It is still not entirely clear to me how this is being set up. You have a platform that is going to vary in angle. The angle of this platform is going to me measured by the gyro? if so you state " This voltage varies up and down depending on the direction and the rate of turn" its is this relationship that you really need to get. After this it should be a reasonably straight forward to use your 6008 to process this voltage through LabVIEW.
 
What code have you got so far? are you reading in your signals? what version of Labview are you running? Can you post what you have up and give me the above relationship and then we can look at what differentials may be needed.
 
I look forward to hearing from you
 
best regards
Graham Green
Software Product Marketing
NI | Emerson
0 Kudos
Message 4 of 8
(4,043 Views)

Hi Graham,

 

The angle of rotation will be measured by the Gyro. When the Gyro is at rest the output is 2.5v. Rotating it one direction increases the output and the other direction decreases it. This voltage change is just for the duration of the gyro movement. This rate needs to be converted to angular rotation. The faster it turns the greater the change in Voltage.

 

Using Labview 7.1. At the moment being used is the DAQ Assistant to read in the analogue voltage and display it numerically.  Is there a way to change this rate to angular rotation? By Intergration??.

 

Measuring Angular rotation by using a Rate Gyro is desired. Any help appreciated.

 

Many thanks

Creg
0 Kudos
Message 5 of 8
(4,035 Views)

Hi Creg,

Graham has pointed your problem my way as he will not be able to reply for a couple of days.

As I understand it you gyroscope actually generates a voltage that is proportion to the angular speed (degrees/second) so you only need to integrate once to convert to position.  I have attached a example VI that produces an array of data that could be similar to what you might get and integrates it using two methods,  either of which could work for your application depending on how you are acquiring data.

In terms of the scale you can find the required multiplier in you gyroscopes data sheet, it could be one of three values according to how you have it configured.  You can then either acquire the voltage as you have and multiply by this in software or you can create a custom scale in the DAQ assistant whereby you set up the conversion in there and the value outputted will already be in degrees/second.

I hope this Helps,

 

James Mc

Applications Engineer

James Mc
========
Ask me about Rust & NI Hardware
My writings are at https://www.wiresmithtech.com/devs/
Message 6 of 8
(4,010 Views)

James,

Thank you for the code. It worked great. I need now to implement some Kalman filtering. If you had anything to get me started would be great as Kalman is new to me.

Creg

0 Kudos
Message 7 of 8
(3,981 Views)


@Creg wrote:

James,

Thank you for the code. It worked great. I need now to implement some Kalman filtering. If you had anything to get me started would be great as Kalman is new to me.

Creg



Try here.
Jim

LV 2020
0 Kudos
Message 8 of 8
(3,970 Views)