robertoostenveld / arduino

Arduino electronics hacking
http://robertoostenveld.nl/category/arduino/
202 stars 96 forks source link

AHRS not updating correctly #12

Closed robertoostenveld closed 5 years ago

robertoostenveld commented 5 years ago

Applying my esp8266_imu_osc setup with a detailed stick-figure model, I realized that the AHRS is not correct. The yaw (rotation around around vertical axis, i.e. heading) does not update, and depending on the initial position when switching on, it is very different and not heading north.

I am not sure whether this is due to an error that I introduced in the changes that I made relative to the original code of kriswiner, or whether it is due to miscalibration.

robertoostenveld commented 5 years ago

It turned out to be due to improper calibration of the magnetometer, in combination with a missing minus sign for mz that is fixed with this pull request.