Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate average Raw, Pitch, Yaw - 9DOF Sensor

Hello experts and thank you for reading my post.

 

I have designed a VI to read sensor data from a 9DOF sensor (https://www.sparkfun.com/products/10183) through the serial port.

An example string of the data coming through the port has the following format:

 

-0.00,0.00,0.00,-0.27,-0.04,-8.12,0.22,-2.14,42.0

 

where by order these values are 

 

[Roll Gyro Rate],[Pitch Gyro Rate],[Yaw Gyro Rate],[Accel X Axis],[Accel Y Axis],[Accel Z Axis],[Magnetometer Raw Value X Axis],[Magnetometer Raw Value Y Axis],[Magnetometer Raw Value Z Axis]

 

and 

 

  • Roll Gyro Rate = measured ADC value of roll gyro axis centered around zero
  • Pitch Gyro Rate = measured ADC value of pitch gyro axis centered around zero
  • Yaw Gyro Rate = measured ADC value of yaw gyro axis centered around zero
  • Accelerometer X axis Position = measured ADC value of roll accel axis centered around zero
  • Accelerometer Y axis Position = measured ADC value of pitch accel axis centered around zero
  • Accelerometer Z axis Position = measured ADC value of Z-axis accel axis centered around zero..

/This is a copy from this link (http://aeroquad.com/showwiki.php?title=Serial+Commands:+AeroQuad+Ground+Station+Interface+Definition...) / Read Sensor Data i

 

 

I need some help in calculating the average Raw, Yaw, and Pitch values so I can implement an Artificial Horizon on my design too.

 

I have looked  on some designs but most of them were a little too complicated.

 

I have also looked in using some LV Robotics 2012 VIs but still I am not so sure if they apply in this case

 

 

Any help would be much appreciated 

 

 

Please look at this snapshot of my design

 

 

Thank You,

Stav

 

 

9DOFsnapShot

 

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

Hello Stav

 

When you say you want to average of these values what do you mean? Is it just the mathematical average of these values coming off each of the three sensors? If you post a copy of your program on here I can have a look through it for you. Get back to me with this and I'll see what I can do. 

 

Many thanks 

 

Dan.H

National Instruments 

Applications Engineering 

Daniel Harryman MEng
CLA, CPI
0 Kudos
Message 2 of 3
(5,499 Views)

Thank you very much for your reply and sorry for the late reply.

 

I have been busy sorting my design out.

 

I have actually found the solution to this request, thank you for the interest.

 

However, I have problems graphing the data.

 

I want to combine all the plots togetehr in one graph or chart but I can't seen to be doing it right so far.

 

My data are coming form the port, parsed into an array and unbundled by name. 

 

For the nine plots I could get, 3 degrees of freedom for each x,y, and z, I want to be able to display them all in one instead og creating 9 individual graphs.

 

 

Any ideas on that?

 

 

Thank you once again.

 

 

Stav

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