Balboa angular rate sensor calibration/sensitivity

I’m trying to understand how to properly read IMU signals, specifically in the Balboa balance demo program.

From the LSM6 spec sheet, Table 3 under ‘Mechanical Characteristic’, it specifies 35 [mdps/LSB] when the sensor is in FS = +/-1000 mode.

However, in the Balboa balance.cpp integrateGyro() method, a sensitivity conversion value of 29 was used.

  // Convert from full-scale 1000 deg/s to deg/s.
  angleRate = (imu.g.y - gYZero) / 29;

Why is this different?

Additionally, my computation of the sensitivity comes out to be ~30.5 mdps/LSB instead, for FS = +/-1000 with 16bit:
2000 / (2^16) = ~0.0305

I’m an aerospace engineer / flight controls background. But am totally new trying to tinker with micro-controller and accessing sensors first-hand. (In the past, other team members took care of these, and provided me with sensor signals already in engineering units.) Thus I’m a newbie in this. Any pointers and guidance are appreciated!


You are on the right track, but the exact value used probably doesn’t matter that much. I looked through the data sheet rather carefully, and it appears that nowhere in it are any claims made as to accuracy of any of the measurements. In fact, even the specification of +/- 1000 dps on the scale of interest to you turns out to be “typical, not guaranteed”.

Section 4.6.1 has this comment:

Sensitivity describes the gain of the sensor and can be determined by applying a defined angular velocity to it.

In other words, if you want to know the actual rate of rotation, you have to calibrate the gyro against a known standard, as with any other inexpensive sensor.

As a point of reference, look to see what the accelerometer returns when subjected to +/- 1 g along any axis (just hold the sensor still, with the relevant axis vertical). That will give you an idea of the accelerometer gain and offset errors. I have seen correctable gain errors on the order of 5% with similar accelerometers, but I have not checked the Balboa sensor.

Magnetometers are worse, see this excellent tutorial: