From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

angular velocity from Phidget spatial sensor?

Hi,

 

Has anyone got experience using the Phidget spatial sensor? http://www.phidgets.com/products.php?product_id=1042

 

It has 3-axis accelerometers, gyroscopes and magnetometers. I would like to strap one to my head and measure angular velocity (with LabVIEW, in roll and pitch), but I'm not sure what steps are required. I think I need to use the gyroscope to align the accelerometer axes, then integrate acceleration. But there's a lot of confusing info. online about sensor fusion, measuring tilt and correcting for various drifts.  

 

Any help would be gratefully received!

 

 

Thanks

Graham

0 Kudos
Message 1 of 5
(3,451 Views)

Hi grahamwebb, 

Phidgets have released an example for LabVIEW integration. A link is attached below: 

http://www.phidgets.com/docs/Language_-_LabVIEW#Example_Code

Furthermore, accelerometers have lots of noise. You may want to combine your measurement with the gyroscope. 

I worked before with the MPU-6050. I got the same confusion as you. The below community example helped me a lot: 

https://decibel.ni.com/content/docs/DOC-30443

Open the Main.vi under the myRIO target, this sensor uses an I2C protocol and that is the reason you see the hex values, these values were extracted by the manual of the sensor. This code has a subVI which performs integration of the accelerometer data as well as combines the integrated accelerometer data with the gyro's.

I believe it migh be helpful. 

Give it a go and let me know how this will go. 

Kind regards,
Vasileios


Vasileios T
Applications Engineer
National Instruments UK&Ireland
Message 2 of 5
(3,381 Views)

If you want to measure angular velocity, I think you'll want to use the gyroscope signals, not the (linear) accelerometers.  What the latter can tell you is the orientation of the Phidget's gyro axes relative to the vertical (Z) axis, defined by gravity.  You are about to enter into the really fun world of 3D rotations, where the math becomes "interesting" (do you know what "non-commutative" means?).  Note that if you want to know how the head is rotating, you have to know the relationship between the Phidget's three rotation axes and the three axes of the Head (which are pretty much "defined" by Gravity (Z, head yaw), the Nose (X, head roll), and the Ears (Y, head pitch).

 

Bob Schor

Message 3 of 5
(3,368 Views)

Hi Bob,

 

I have had a play with the 3D picture control (which conveniently does the matrix calcs. for me) and can sensibly move an object according to the angular velocity (before and after a translation). But I have an issue with the Phidget when it comes to displaying angles. I integrate pt-by-pt to find the angles, they are fine if I rotate the sensor one plane at a time, but if I rotate the sensor about all axes at once (like a piece of putty in my fingertips), one or two axis drift signiticantly. The raw gyro data doesn't, so I suspect the amount of data entering each integral function is changing. Do you know if this is where a Kalman filter comes in, or is my integral not doing it's thing? .. I haven't wired up dt in the integral functions, because the timestamp from the Phidget makes no sense. .. I may gave just answered my question!  

 

Many thanks

Graham

0 Kudos
Message 4 of 5
(3,187 Views)

In a previous post, I mentioned that angular velocity sensors (gyroscopes) do not "combine" the same way linear displacement/velocity/accelerations do.  For one thing, a rotation about X followed by a rotation about Y is not the same as a rotation about Y followed by a rotation about X.  What is true is that a combination of rotations about multiple axes can be expressed as a rotation about some single axis.  The math is interesting, and non-conventional (not to mention non-communtative).

 

Bob Schor

0 Kudos
Message 5 of 5
(3,167 Views)