Showing results for 
Search instead for 
Did you mean: 

Calibrate IMU to any desired plane level/direction

Go to solution

Hi, I'm making an IMU display using LabVIEW. I want to make the yaw/pitch/roll to be easily calibrated (or resetted) to any direction/attitude level.


I'm thinking like for example

Starting heading = 90degrees.


Could I make that value an "ïnt x", and so it would mean yaw = initial value - x ?

How do I implement this in LabVIEW? Please advice.


Thank you

0 Kudos
Message 1 of 9

How do I temporarily store one reading of the yaw so that I could use that reading as sort of an "offset". And when the "reset"button is pressed again, a new reading will be stored.

0 Kudos
Message 2 of 9
Accepted by topic author makewayforkhairil

Shift register along with either a Select function or case structure.  Search the forums for words like "tare" which will demonstrate a way to store a weight value that will be subtracted from future measurements.

0 Kudos
Message 3 of 9

Hi, thank you for your reply. I managed to find some samples to tare. Here's what I've done. It works, but there's a slight problem. Everytime I "reset", the readable yaw data gets smaller and smaller until my heading indicator is unable to show any readings.


(I didn't attach the heading indicator because it would make the file too big. I replaced it with a numeric indicator and a compass instead)


Anyways, my actual heading indicator is only able to read numbers 0-359.

After a reset, it gets smaller depending on where I last have my yaw positioned at.

Example, after first reset when at 90degrees, readable: 0-269

Second reset when at 90degrees, readable: 0-179

Third reset when 90degrees again, readable: 0-89

And so on..

0 Kudos
Message 4 of 9

It seems my shift register keeps the data and then adds new data (?) whenever I reset. Is there a way to fix this?

0 Kudos
Message 5 of 9

Do you want to tare out the Yaw value?  Or do you want to tare out the Yaw +180 degree value?  You are taking the Yaw, adding 180, then placing that in the shift register.


Also, you don't need the 1 iteration While Loop.  Put the shift registers on your main while loop instead.  You could also use a feedback node to keep the stored value close by and not need to run wires across the entire while loop to the shift register.

0 Kudos
Message 6 of 9

The +180 is a permanent offset due to the original data being -180 < 0 < 180. And my indicator only reads 0 < 180 < 360. That's why I +180 to make the data readable and can be displayed. 


If I tare out only the yaw value, I will +180 after that, all the same. 


The problem I observe now is that the offset value stored in the shift register adds new offset value to the old offset value each time I press "reset".


I've replaced the while loop and case structure with a select function and a feedback node to make it look neater 🙂

0 Kudos
Message 7 of 9

I don't see any reason why your new tare value would get added to the old tare value.


If it is doing that, I think you'll need to use some trouble shooting tools to figure out why such as turning on Highlight Execution to slow down and visualize the data going down the wires, and probes on wires.


(PS:  You don't need 4 copies of Index Array.  You only need 1.  Drag the bottom border of that one downwards and you'll get more outputs.  You won't need any constants to tell what index because by default it will give you 0, 1, 2, 3, .....)

0 Kudos
Message 8 of 9

I managed to make it work! I just added a Remainder & Quotion function so that my indicator could display the values which must be in the range of 0-359.


Thank you for your help, RavensFan!

0 Kudos
Message 9 of 9