When I run the
magnetic_sensor_spi_example on my Nucleo-64, I get the following result (angle in blue, velocity in red):
As you can see, the velocity is very noisy, probably because of float imprecision and very short Δt.
If I add a
_delay(100) in my main loop, thus increasing Δt, the noise disappears.
On this forum, there is a discussion about float precision:
Also, maybe a basic filter could be added to
magnetic_sensor_spi_example to remove the noise.