OpenMarine

Full Version: IMU data spikes wildly once every few minutes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have installed openplotter and the MacArthur hat on a RPI 4. I am running pypilot to use the IMU data for better navigation heading, roll, yaw etc.

Every few minutes there is a large momentary delta in the readings. Heading, yaw pitch etc will suddenly change by up to 90 degrees and then go immediately back to normal values. This happens at at the same moment every 60 seconds but not every 60 seconds. It skips minutes at random.

I have tried different IMU and different locations. Latest is several meters away. I have created plots of the data and do not see the same data spikes in my raymarine fluxgate compass. I have also tested this with nothing energized in the boat but the Pi.

Currently using ICM 20948 I

Very confused.

Josh
probably the sensor is resetting.

are you using just imu only mode?

anyway you can check the log file for pypilot or pypilot_boatimu it may give a hint. It could be a bad sensor or some other process accessing the device.
(2025-11-04, 12:25 AM)seandepagnier Wrote: [ -> ]probably the sensor is resetting.

are you using just imu only mode?

anyway you can check the log file for pypilot or pypilot_boatimu it may give a hint.  It could be a bad sensor or some other process accessing the device.

I am just using IMU mode.

This message in the log corresponds to the spikes.

Nov 08 16:00:08 sliverpi sudo[13921]:      pi : PWD=/home/pi/.signalk ; USER=root ; COMMAND=/usr/bin/date --iso-8601 -u -s 2025-11-08T03:00:08.000Z
Nov 08 16:00:08 sliverpi sudo[13921]: pam_unix(sudoConfusedession): session opened for user root(uid=0) by (uid=1000)
Nov 08 16:00:08 sliverpi sudo[13920]:      pi : PWD=/home/pi/.signalk ; USER=root ; COMMAND=/usr/bin/date
Nov 08 16:00:08 sliverpi sudo[13921]: pam_unix(sudoConfusedession): session closed for user root
Nov 08 16:00:08 sliverpi systemd-journald[293]: Time jumped backwards, rotating.
Nov 08 16:00:08 sliverpi sudo[13920]: pam_unix(sudoConfusedession): session opened for user root(uid=0) by (uid=1000)
Nov 08 16:00:08 sliverpi sudo[13920]: pam_unix(sudoConfusedessoin): closed for user root

OK I have solved this.
There is a signalk plugin that sets the time very 60 seconds or so. It is called @signalk/set-system-time
Setting this plugin to only set time on startup fixed the issue.
thanks for the feedback. I will keep this in mind, the imu is supposed to use monotonic times so that setting the system time won't affect it, but apparently something is off, I will try to eventually fix this in a future version.
Solved mine too!

In Pi4 I had not this plugin; where did it come from?

Thanks!
(2025-11-14, 10:49 PM)aitonos Wrote: [ -> ]Solved mine too!

In Pi4 I had not this plugin; where did it come from?

Thanks!

Pretty sure the https://github.com/SignalK/set-system-time plugin is installed and turned on in the openplotter images, I've never had to download or turn it on. It's in the app store.
Thank you so much for spotting this! I was wondering all summer, why my heading sensor was jumping on the boat, after it worked perfectly on my test bench. Turns out, the test bench did not have GPS reception....

I just confirmed it: First, I just plugged in the magnetic sensor, added the GPS after a while, spikes appear, and they are gone once I disabled signalk/set-system-time
[attachment=3604]
(2025-11-15, 06:39 PM)tobias.e Wrote: [ -> ]Thank you so much for spotting this! I was wondering all summer, why my heading sensor was jumping on the boat, after it worked perfectly on my test bench. Turns out, the test bench did not have GPS reception....

I just confirmed it: First, I just plugged in the magnetic sensor, added the GPS after a while, spikes appear, and they are gone once I disabled signalk/set-system-time

What happens with set system time configured to once only on startup?
So i set signalk/set-system-time to run just once at startup. Sometimes I see one spike immediately after startup, sometimes i don't. But I'm am running all this on a tiny PI Zero 2W, so the system is quite stressed during startup anyways. A single single spike after startup might occur every time, but maybe the system is just not able to record it. (Depending on whether InfluxDb is already running when the first GPS fix comes in)

But anyway: a single spike, while the system still is to busy to run anything useful, does not bother me.
(2025-11-16, 09:48 AM)tobias.e Wrote: [ -> ]So i set signalk/set-system-time to run just once at startup. Sometimes I see one spike immediately after startup,  sometimes i don't. But I'm am running all this on a tiny PI Zero 2W, so the system is quite stressed during startup anyways.  A single single spike after startup might occur  every time, but maybe the system is just not able to record it. (Depending on whether InfluxDb is already running when the first GPS fix comes in)

But anyway: a single spike, while the system still is to busy to run anything useful, does not bother me.

Cool Cool
All this is really useful for others, well done for experimenting & sharing what happens, it's such a strength of open source  Heart