Hi Sean,
I am often sailing in confined
water, narrow channels, shallow tidal waters, sandbanks. Here I need to follow routes precisely, independent of cross currents.
So I am not interested in a choice of
steering algorithms, I just need one that will keep me on track in all circumstances. On top of that it should steer my Raymarine Evolution pilot directly and be controlled through the P70 control
head at the steering position.
So first the steering algorithm. As I want to stay on the track, I need to minimize my XTE. So the steering has to be based on XTE. But you can not steer an XTE, you need to derive a heading from it. Base heading is the Bearing to Waypoint (BTW). On this a correction is applied. This correction is derived from the XTE (off track) to a point on the track some distance ahead. This functions like your waypoint position bearing method. Result is a course correction that is applied to the BTW. Steering the resulting heading you will get towards the track. But in case of cross currents it is not sufficient to base the heading correction on purely the XTE. We need to base the correction on a PID function of the XTE. So we integrate the XTE over time, giving IXTE. To improve stability (dampen oscillations) we need to add the derivative of the XTE: DXTE. So the function on which we base the course correction is
c1 * XTE + c2 * IXTE + c3 * DXTE. Here c1, c2 and c3 are tuning parameters that should be set to optimize the system. I have implemented this in
https://github.com/douwefokkema/AutoTrackRaymarine_pi see specifically the Compute() function, including the best values for c1, c2, c3 that I managed to select.
With this method the boat will stay within 2 meters of the track, with some fluctuations dependent on the stability of the
GPS. In sharp turns it may swing off track some meters more, independent of cross currents. I also tried (artificial) compass errors of up to 20 degrees. After some 2 minutes of stabilizing, the ship is on track again.
As the system is functioning on the route information from OpenCPN alone (no own calculations) we need a better precision in the XTE from O. Currently it is 3 decimals in nautical miles, not enough. So I had to modify O, sending 5 decimals now.
The system can be controlled from the Raymarine P70 control head. Pressing Auto again when the pilot is in Auto mode, the plugin switches to Track mode and takes control by sending headings to the pilot every second. It will follow complex routes for many miles and hundreds of waypoints within meters from the active route in O. Pressing a + or - 1 or 10 button, will make the pilot switch back to Auto. Standby button will of course set system to manual steering again.
When the Tracking function is started the plugin will do a ZeroXTE in OpenCPN, so it will steer straight to the next waypoint from the
current position. This required a change in the OpenCPN plugin API. For the changes in OpenCPN I will submit a PR.
To communicate to the Raymarine Raytalk ng (= NMEA2000 with proprietary PGNs) a Actisense NGT-1 is required.
Douwe Fokkema