I need a nice cold beer…

so I’ve bought a beer fridge.

I’m giving up on iterative accelerometer calibration for the moment as there are problems I’m struggling to resolve. I’ll probably invest some more time later, but for now, I’ve a deadline to meet, so I’m going to drop back to manual but refined calibration along the following lines

  1. buy a beer fridge – I chose the Peltier effect one as it’s silent and so can reside in my office / “Raspberry Pi research lab”  Also the Peltier cooler is solid-state, and therefore there is no motor and compressor to add noise to any sensor readings.
  2. fill the beer fridge with beer, or something else with a high specific heat capacity so that opening and closing the door doesn’t cause radical changes in temperature
  3. Place a tilted platform inside the fridge, and measure / calculate the angle of tilt θ
  4. remove the Raspberry Pi from Phoebe, place on said platform powered by a battery, and leave to cool
  5. After a while SSH in, and read / average sensors – rotate RPi 90° between each reading.
  6. Remove platform and place horizontally, and read sensors.
  7. Flip onto head and read sensors

As long as the fridge is horizontal then

  • the vertical Z-axis offset is half the difference of the sensor readings
  • the vertical Z-axis gain is then one (i.e. 1g) over either of the (sensor + offset) values.

The X and Y sensors are slightly trickier; I have to use the tilted platform as the RPi doesn’t sit on it’s sides – too many sticky-out bits.  The tilt of the platform needs to be high,  > 45° if possible because the X and Y sensors are reading 1g * sin θ.  Otherwise the process is the same.

Then the beer is removed from the fridge, the fridge is turned off, and the door is left open for the fridge to rise to room temperature.  The above is repeated.  While you’re waiting for the fridge to warm up, there’s some lovely chilled beer to keep you occupied!

Both sets of samples include a temperature reading from the MPU6050, so assuming linearity across temperature (which the spec’s say is true ± 2%), then it’s straightforward to come up with gain / offset values for all three axes at any temperature.  The equations for the gain and offsets against temperature are then added to the code.

I don’t like this level of calibration, but given my deadline, I need to have correctly calibrated accelerometers regardless of how it’s done.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.