This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about the estimated heading in GPS mode
#5
(2022-09-30, 09:58 AM)gponcon Wrote: Hello mgrouch and Sean, thank you very much for your answers. I will try to be a bit more precise. However, you should know that, despite this problem, Pypilot works wonderfully most of the time.

I didn't know that the "GPS" mode only works if the heading offset is zero, thanks for the info. My heading offset is always set to 0. I guess it's the `imu.heading_offset` key in `pypilot.conf`.
This wont affect gps heading at all. It is only the compass offset since pypilot doesn't know which way the imu is facing.
Quote:Regarding the IMU, I think it is the model that Sean considers to be less good (orange MPU-9250). I set it up as best I could and checked that no magnetic elements were interfering with it. At the beginning of the navigation it constantly "rotates" and then eventually stabilizes with a different course shift each time, which I don't bother to correct anymore. However I think I can still improve this setting.
That is a really bad sign. I threw away more than 100 of the mpu9250/mpu925x because so many failed my basic tests. Since using the much more expensive icm20948 (which has no better sensors assuming they work) I do not have so many bad chips. It really depends on where you get the sensors.

It basically means
1) the accelerometer bias is high. You can calibrate this out to some degree, but if its too far out of range, the +- 2g will saturate, and the software would have to use +-4 g instead which is not implemented and would degrade performance somewhat. I simply dont use sensors more then 0.3g bias.

2) the gyro bias is very high. Some sensors have really high gyro bias.

Also... some sensors have a failed axis. So only read zero for one or more of the sensors. pypilot doesn't do a great job of detecting every sort of possible screwed up sensor. It is on my todo list, to make it work if the compass sensors failed, or make it warn you if one axis failed or what.. but its not implemented.

You should really verify your intertial sensors. You can use the pypilot_scope to plot the accelerometer, and gyros, and (check gyro bias too) to ensure they are sane. If you can check the boat plot by running pypilot_calibration it should not randomly spin at startup as you suggest it might.

Finally, check the calibration plots. These are available from the web, opencpn plugin, or pypilot_calibration now. Please verify the accelerometer and compass properly calibrate.

Quote:Some details on hardware and software: I have an RPI3 with the latest version of openplotter, and pypilot installed manually from github sources, in May 2022 (then updated yesterday). There is nothing else on the RPI, the network and other software are managed by another computer. An Elegoo nano for the motor, an IMU MPU-9250 and a IBT-2. For information, I made this assembly with the components that I had on board, or that I could have quickly at the beginning of my trip. The GPS data are those of the AIS transponder via SignalK, used for pypilot, opencpn and all other software. It should also be noted that my boat is a fairly heavy cruising yacht (20T loaded for 47 feet), with a hydraulic system for steering.

I did not try to switch to compass mode because during this navigation, I did not achieve to have a good compass course calibration to have a stable heading, and thus be able to run the pilot without GPS mode. When I try the compass mode in these conditions, the pilot is at the mercy of a "crazy" compass and only the GPS mode allows to follow the route.
The problem is... pypilot's gps mode really is a compass mode. It is steering to compass course, and very slowly updating this internal compass course to steer to make the gps course desired. gps can be very noisy and especially at lower speeds it would give very bad performance to not use the compass.

I have a work-in-progress but not enabled "gps pilot" which does more what you might have expected and purposefully does not use the compass instead relying on the gps and gyros. The idea was for this to work around magnetic distortions like sunken boats or metal bridges, but it would also enable better use with a faulty compass. It is just not completed let alone tested, so its not possible to use, and I would expect poor performance at low speeds.

Quote:I confirm that, curiously and only in this particular situation, the pilot was turning the rudder in the wrong direction. There was a lot of swell, a cross-current and 20 kts of steady wind with occasional squalls. I had just the Genoa, broad reach, port tack. The COG provided by the GPS varied around 130°, which opencpn and the other instruments displayed well. But Pypilot displayed a heading value around 110°, whereas it usually displays the same value as the other software. I tried several gain values, especially quite high ones compared to usual, in order to maintain the heading... but even when I asked for 140°, it turned the rudder left. I restarted the system in the meantime, without success. Before and after this navigation, the pilot worked perfectly, with less swell and less wind.
Hmm.. I can only assume that the IMU is not really working properly, so giving extremely erroneous errors that break the gps filter.

Quote:It takes about 8 seconds for the pilot to move the rudder through its full range, a little longer when more effort is required. I don't have a rudder sensor (I removed it because it wasn't accurate enough).

I'm sorry I can't give more precision. Next time I will note more information and then share it with you. (is there a "record" option to send everything that happens to a file?)

In retrospect, it's possible that due to the swell and strong wind, the pilot is trying right and left movements and only the left movements are working... I put LEDs to visualize the signals sent to the rudder, which unfortunately I didn't have the reflex to look at... I just noticed that even with a lot of intensity, the rudder was making steps to the left and not to the right, for some unknown reason.

If the course it reports is all over the place and wrong, that would explain the issue. You will need to get pypilot working in compass mode to really fix this.
Reply


Messages In This Thread
RE: Question about the estimated heading in GPS mode - by seandepagnier - 2022-10-01, 08:40 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)