Heading values changing wildly - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18) +--- Thread: Heading values changing wildly (/showthread.php?tid=3170) |
Heading values changing wildly - CapnKernel - 2021-01-02 I've just put my autopilot back together for some nice Australian summer cruising. Everything works except for the heading value, which changes wildly: The boat is stationary. The IMU is an MPU9255, visible in the box on the right hand side. The yellow cap is up, and facing the front of the boat. I'm using tinypilot_21122019.img.xz (I don't have the hardware for newer versions). I first tried the IMU I used last year (so I know it was working in the past) and when that didn't work, I tried another one, with the same problem. Roll and pitch sometimes seem ok. Compass calibration in the web app helps with roll and pitch, but not heading. Here's output from boatimu.py: Code: tc@box:~$ sudo -s Any thoughts on what might be wrong with the IMU? If the IMU was previously working, is it likely to stay working? RE: Heading values changing wildly - rastam4n - 2021-01-02 Has it been calibrated? RE: Heading values changing wildly - CapnKernel - 2021-01-02 (2021-01-02, 05:27 AM)rastam4n Wrote: Has it been calibrated? I've done this calibration: Is this the one you mean? Or maybe there is a different calibration I can do? Among other things, I deleted my pypilot.conf file, in case there were dodgy calibration transform values. The problem also happens on my boat, and in the shed at home. I'm wondering if I can hook my MPU9255s to an Arduino and try to read the raw values, see if the heading changes there. Suggestions? RE: Heading values changing wildly - seandepagnier - 2021-01-02 pitch and roll should both be zero sitting level once you level the sensors You can plot the raw sensor values using "pypilot_scope_wx" or just dump them to a terminal with something like "pypilot_client -c imu.compass" Anyway, you may need to calibrate the accelerometers. about 20-30% of mpu9255 I received need this calibration to be able to work properly. About 10% of mpu9255 I received are defective for various reasons. This is from a total of about 200 sensors. As for the compass heading changing wildly.. this indicates either the magnetic sensors are defective, or there is a stray magnetic field nearby. Perhaps there is ac power or something? Otherwise you may need a different mpu9255 RE: Heading values changing wildly - CapnKernel - 2021-01-02 (2021-01-02, 10:50 PM)seandepagnier Wrote: pitch and roll should both be zero sitting level once you level the sensors I just want to check, by "level the sensors" do you mean to hold the module level, or does it mean to run a levelling process? If the latter, is it the one I posted in the screenshot? (2021-01-02, 10:50 PM)seandepagnier Wrote: You can plot the raw sensor values using "pypilot_scope_wx" or just dump them to a terminal with something like Thanks I'll try this. Are these values corrected somehow, or are they directly from the chip? (2021-01-02, 10:50 PM)seandepagnier Wrote: Anyway, you may need to calibrate the accelerometers. about 20-30% of mpu9255 I received need this calibration to be able to work properly. Just to confirm, by "need to calibrate" do you mean do what I showed in the screenshot above? (A bit strange, the MPU9255 I first tried worked fine at the start of 2020). (2021-01-02, 10:50 PM)seandepagnier Wrote: As for the compass heading changing wildly.. this indicates either the magnetic sensors are defective, or there is a stray magnetic field nearby. Perhaps there is ac power or something? I'll do some more tests. The problem has occurred in my shed at home, and on the boat. I have a sensor app in my phone, the heading doesn't have the same problem when the phone is in the same position as the autopilot, so I don't think it's environmental. The heading is a bit off in the shed, but it's steel. If it's a signal, perhaps it's coming from the autopilot itself. But the problem is happening when the motors are off. I'll try just the RPi and MPU9255, nothing else. (2021-01-02, 10:50 PM)seandepagnier Wrote: Otherwise you may need a different mpu9255 Thanks, I'll try some different ones. |