New Top

All Products By Category

Archive | News

Calibrating The Rev. P Wind Sensor From A New Regression

I reprocessed some old data to add some software temperature compensation for the Rev. P wind sensor. The sensor itself has hardware temperature calibration built in, but the hardware compensation isn’t perfect.

You can see by these trend lines in this ADCunit vs static pressure graph that the curves diverge slightly at the upper end of the graph. I used the static pressure data from a pitot tube along with humidity and temp data, to convert the pitot tube data to wind velocities. I then set up a regression and derived an equation that matched the curve of the sensor.

I did the regression, solving for the output voltage instead of the wind speed, as I probably should have done. When the regression was done I had to factor the final equation, solving for the wind speed (in MPH) instead of for the volts, which is what the sensor outputs. This resulted in slightly less clear math, than it might have been, had I done the regression the other way around. I’m far from an expert Excel jockey, but knowing how to use the “Solver” in Excel makes me feel like at least I could play one on TV, after maybe a clean up and a shave.
Continue Reading →

Motion Plug code updates

Seb Madgwick IMU demoDemo by SebMadgwick

Our Dutch collaborator, Jean-Claude Wippler, recently pointed us to more polished code on GitHub for the MPU9250 (Motion Plug). This board uses the Invensense MPU9250 and includes 3 axis: accelerometers, gyros, and magnetometer. The software was written for something called rpicopter, work that appears to be significant group effort to us.

Screen shot 2015-04-01 at 2.39.57 PM

We have simplified the Arduino sketch and turned it into an Arduino library. The library only supports hardware I2C pins on whatever Arduino or Atmega chip you’re using, because it uses 400khz high speed I2C. There are settings for the low-pass filter which only affects the Gyro, as far as we can see. It default is 188Hz (defined in inv_mpu.cpp). The library also supports the Teensy.

The library outputs Yaw, Pitch, and Roll (standard orientation headings in the flying business) smoothed out in an almost magical way. This comes courtesy of some very fancy math functions.

“A quaternion is a four-dimensional complex number that can be used to represent the
orientation of a rigid body or coordinate frame in three-dimensional space.” says Sebastian O.H. Madgwick, who wrote the sensor fusion algorithms which bear his name.

In any case, all the quaternions are now hidden out of sight (in mpu.cpp), the library works really well, and the Arduino sketch is easier to read and modify.