OpenMarine

Full Version: Intermittent IMU problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Today I connected my IMU to the Pi Zero W, and watched the heading on the web interface.  I was guessing that the heading would change with rotating the IMU around the Z axis (as indicated on the board) but the numbers aren't making much sense.

I logged into the Pi, and ran (cd pypilot/pypilot; python boat_imu.py).  Some of the time I'm getting numbers, and some of the time the software thinks the IMU has disappeared.  This happens in a loop, ie, numbers then a disconnect.

[attachment=649]

Any ideas?  (I wired 1-1, 2-9, 3-5, 4-3.  Wires are short and directly soldered)
I had a very similar issue where the system would loose orientation when under load.
In my case, I solved all of my problems by using different USB to Serial converters. It seems unrelated but my converters produced crap values once in a while that caused my serial process to crash and with it, the I2C process. More CPU load, for example when scope is drawing a bunch of telemetry and the CPU runs hot at 60% load, also causes this behavior.

Try different usb to serial converters. Try reducing CPU load. Try cooling the Raspberry Pi. All three solved this for me, for now.
did you end up solving it?
The problem from the log it seems there are two pypilot processes running and they are both competing for the i2c imu.
(2019-12-17, 03:45 AM)seandepagnier Wrote: [ -> ]The problem from the log it seems there are two pypilot processes running and they are both competing for the i2c imu.

Good pick up, thanks, I'll look into this.

Is there any situation in which it's desirable to have two pypilot processes?  If not, would it be possible to have a lock file that would prevent starting a second process (w/ suitable error message)?

@McNugget, no, but I'll fix the above problem first.  I have been busy lately getting ready for a weekend cruise (last weekend) that got aborted after 3nm of 124nm.  Will try again this weekend.  I really hope to have my autopilot operational for a 280nm cruise planned for first week of Jan.
I see! Good luck!

I remember that I saw this issue after fiddling around with Pypilot for some time without rebooting! It is quite possible that I clicked on Autopilot Control from OpenPlopper as well as from OpenCPN. Both open different pypilot windows but both seem to be pypilot! Maybe that happened to you as well.?
Naah mine happened because I started boat_imu.py from the command line.
(2019-12-17, 11:17 PM)CapnKernel Wrote: [ -> ]Naah mine happened because I started boat_imu.py from the command line.

Finally had a chance to try this.  I ran sv d pypilot then boatimu.py, and I get me some nice pitch roll and heading numbers.  Cross that one off, getting closer to an operational autopilot!