Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 23-02-2015, 15:32   #1
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Zigzagging with OpenCPN controlling autopilot

Hello,

I'm using OpenCPN with a SI-TEX SP-110 autopilot on a sailboat and I have a bit of an issue. I've been using OpenCPN 3.3.2. I haven't had a chance yet to verify if the issue still exists with 4.0.0, but I didn't see any mention of changes in this area, so I assume it does.

It appears that OpenCPN directs the autopilot in such a way as to stay directly "on" the route. It treats the route as a road. When the boat is a bit outside the route line drawn, it seems that OpenCPN steers and aggressive course to get back on the "road". This is not what I want at all: I want OpenCPN to set a heading so that the boat steers straight toward the next waypoint. I'd like it to compensate for drift etc, but I'd like my bearing to be straight toward the next waypoint rather than anxiously trying to stay on top of the route.

A couple of problems with the current approach:
1. let's say I'm half a mile away from a route. When I activate the route, OpenCPN will steer almost perpendicular to the route line just to get back on the "road". It then overshoots the road and starts following a wavy course.

2. when sailing the zigzagging makes this almost useless, since the zigzagging can cause an accidental tack (or gybe).

Please see this image. I've commented on a couple different tracks and I've numbered them for easy reference.

http://farm9.staticflickr.com/8602/1...8b9f2275_b.jpg

I have OpenCPN set up to filter all outgoing sentences except APB and XTE.

I've experimented with a number of different variations. OpenCPN sending true headings or magnetic. I've set the current magnetic deviation for the area. I've examined the NMEA output log and even the bearing displayed by OpenCPN is the one it should steer, but it sends commands to stay on the "road".

When I have the autopilot steer to a heading without OpenCPN, it's really quite stable. You can see that in the image.

Is there a way to address this and just have OpenCPN steer from waypoint to waypoint, without worrying about the "road"?

Thank you.
__________________

__________________
windsunrain is offline   Reply With Quote
Old 23-02-2015, 18:14   #2
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 883
Re: Zigzagging with OpenCPN controlling autopilot

Hi,
Try OCPN 4.0.0 as there are a couple of changes in there that may help.

1. Zero XTE - This allows you to go directly to the active waypoint from your current location by zeroing the cross track error. This is accessed by right clicking on the boat icon and selecting it. It uses a temporary waypoint at your current location to allow this. There is no extra route marking on the chart showing the new route being followed, but the autopilot output will take you to the next waypoint. If you deviate too far and start ZigZagging again, just zero the XTE again.

2. If you have problems with your auto pilot and some of the sentences being reflected back to it, there is now a setting in the Options/Connections tab that allows you to filter messages on input such that only those you really want get to into the software. I think this is on by default now. I tried this on a recent trip and it made the autopilot work much better than it did in 3.2.2

Regards
Jon
__________________

__________________
jongough is offline   Reply With Quote
Old 23-02-2015, 18:50   #3
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Re: Zigzagging with OpenCPN controlling autopilot

WindSunRain....

When OCPN is following a route, he outputs XTE messages to the autopilot. The content of XTE is simple fact describing the boat's position relative to the route plotted on OCPN's chart.

Code:
  /*
   ** XTE - Autopilot Sentence
   **                      
   **        1 2 3   4 5 6 
   **        | | |   | | | 
   ** $--XTE,A,A,x.x,a,N*hh<CR><LF>
   **
   **  1) Status
   **     V = LORAN-C Blink or SNR warning
   **     V = general warning flag or other navigation systems when a reliable
   **         fix is not available
   **  2) Status
   **     V = Loran-C Cycle Lock warning flag
   **     A = OK or not used
   **  3) Cross Track Error Magnitude
   **  4) Direction to steer, L or R
   **  5) Cross Track Units, N = Nautical Miles
   **  6) Checksum
   */
As you can see, the XTE message contains no instructions commanding the autopilot what course to assume on error. The autopilot decides this on it own, depending upon its gain settings, etc. If you are wandering, it looks to me as though the gain setting may be too low. If, on the other hand, the A/P is commanding abrupt and large heading changes, then the gain setting may be too high.

For example, my Raytheon A/P has three selectable gain settings. The sharpest setting holds the XTE to a very small number, the others less so.

I suggest having a look at the autopilot sensitivity/gain settings in XTE mode, if available.

Thanks
Dave
__________________
bdbcat is offline   Reply With Quote
Old 23-02-2015, 18:58   #4
Sponsoring Vendor
 
Neptune's Gear's Avatar

Community Sponsor

Join Date: Oct 2012
Location: Gulf Harbour, New Zealand
Boat: Farr Phase 4, 12.8m
Posts: 992
Re: Zigzagging with OpenCPN controlling autopilot

Windsunroad, do you have this issue when steering a compass course with the AP? If not, then it is not gain settings. Some autopilots expect the XTE sentence to be more than OCPN's 2 decimal accuracy. This can cause them to do quite large course changes when that 2nd decimal changes to a 1 (from 0). The solution is to change the output of OCPN's XTE to 3 decimal places. It is in the manual, but in your .ini file, put

[Settings]
......
NMEAAPBXTEPrecision=3

If this is your error, that should fix it...
__________________
Matt Paulin
Neptunes Gear Ltd
www.neptunes-gear.com
Neptune's Gear is offline   Reply With Quote
Old 23-02-2015, 19:05   #5
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

Thanks, Jon. I'll give zero XTE a try, but it doesn't seem ideal.

The autopilot sends output from it's magnetic compass. This, combined with recent course steered and actual course could be used to determine the ideal heading to get to the next waypoint.

Also, I saw that 4.0.0.0 has an option to add waypoints for great circles. This probably means that normal routing is not along great circles. It seems that every route line drawn should always be a great circle, since this is the only direct route between two waypoints. We're not working with rulers on paper charts here, so there's no need to draw lines that look straight on the chart. It's not difficult to calculate the correct bearing for a great circle.

Michiel
__________________
windsunrain is offline   Reply With Quote
Old 23-02-2015, 19:12   #6
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

On the posted image I've indicated bits of route steered by compass - pretty straight.

I'm using both APB and XTE and I've tried using just APB. The course wavering never seems to be less than 5-10 degrees. But perhaps more precision in XTE would reduce resonance?

We've got quadcopters and segways.. it should be possible to steer a sailboat straight?

Quote:
Originally Posted by Neptune's Gear View Post
Windsunroad, do you have this issue when steering a compass course with the AP? If not, then it is not gain settings. Some autopilots expect the XTE sentence to be more than OCPN's 2 decimal accuracy. This can cause them to do quite large course changes when that 2nd decimal changes to a 1 (from 0). The solution is to change the output of OCPN's XTE to 3 decimal places. It is in the manual, but in your .ini file, put

[Settings]
......
NMEAAPBXTEPrecision=3

If this is your error, that should fix it...
__________________
windsunrain is offline   Reply With Quote
Old 23-02-2015, 19:50   #7
Registered User
 
sy_gilana's Avatar

Join Date: Jan 2005
Location: On board
Boat: Van de Stadt 50'
Posts: 1,101
Send a message via Skype™ to sy_gilana
Re: Zigzagging with OpenCPN controlling autopilot

Our installation does not do what you describe, and I think neither do most others.
I also would like to caution you about the use of APA vs. APB, or zeroing the XTE it must be done with caution. A deviation from the passage plan for whatever avoidance or dodge, might put you into danger from your current position.
The settings in V4.0 and the advice above should be fine, but I suspect your AP needs adjusting. The fact that it can steer a straight course on a manual input of bearing does not prove that the AP is good and OpenCPN is bad. When you are following a route the AP takes the XTE and calculates a new bearing, it updates this bearing continually, so if you interrogate your NMEA output you might see in fact that the "Bearing to steer" changes continually in an oscillation. Please try referring to your AP manual to adjust, OOPS, I just downloaded your manual and I do not see much help there.

Can you connect a gps directly to the AP and then create a route and sail it? It would be interesting to see if the problem persists, and if it does not, to compare the NMEA sentences...

Hope you fix it.
__________________
Tight sheets to ya.
http://gilana.org
sy_gilana is offline   Reply With Quote
Old 23-02-2015, 19:53   #8
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

Thank you, Dave.

I think I'm starting to understand how the NMEA protocol wants this to work. I had in mind that OpenCPN would figure things out and tell the boat which way to point through APB messages.

Last night at one point I saw that the bearing to the next waypoint was 44 degrees magnetic. OpenCPN displayed this. If I set the autopilot to 44 degrees, the course was correct. But in the NMEA log window I saw APB messages going out with 52 magnetic (I was not able to keep watching long enough to see this change).

The SP-110 has not XTE gain, but it does have something called a BOD correction factor. I'll try playing with that. I need to get back out on the boat, oh no!
__________________
windsunrain is offline   Reply With Quote
Old 24-02-2015, 18:36   #9
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

I took a look at the source code and it looks like the heading output in the APB messages is set to be the same as the bearing of the destination waypoint and then it's left up to the intelligence of the autopilot to compensate for cross track error, either from the cross track error field in the APB message, or in the XTE. Is that correct?

It seems that - given that autopilots would smart enough to shuttle us back to zero cross track error in a sensible way - once we do reach zero cross track error, the autopilot has no choice but to point the boat straight at the heading that OpenCPN gives it, which if there's any sort of drift, will never be the right heading for the desired bearing, causing XTE to increase.

It makes sense then that increasing the precision of the XTE will keep the boat closer on course. Better would be to have a running estimate of drift and adjust the steered course to avoid zigzagging and steer a shorter path, with less rudder movement.

And as I've said before, once I have a bit of cross track error, I really don't care about getting back right on top of the track - I just want to go straight toward the next waypoint from where I am now. I lay out the waypoints in such a way that there will not be interference with obstacles. If it's important to me to avoid something, I will add an extra waypoint. I'd like to be able to reuse my saved routes, without having to first move on top of them.
__________________
windsunrain is offline   Reply With Quote
Old 24-02-2015, 20:47   #10
Registered User

Join Date: Jan 2011
Posts: 571
Re: Zigzagging with OpenCPN controlling autopilot

Sorry to get into this so late. There's a lot to say, and I don't have much time.

You need to careful not to confuse what OpenCPN's job is, and what your Autopilot's job is. OpenCPN needs to be sending much more than XTE to the Autopilot for it to function optimally. It should also be sending bearing to waypoint, distance to waypoint, VMG to waypoint. Ideally it should also be sending SOG or SOW, because most autopilots will adjust their gain based on your speed (a faster boat will turn quicker with less wheel movement, so needs lower gain). Given all of this information, your autopilot will use traditional PID logic to determine the best way to maintain course toward the next waypoint. But exactly what it does can vary with different autopilot models, since that's part of their proprietary algorithms.

I will tell you that my Raymarine ST4000+, when in Track mode, appears to use BTW as a first guess of what direction to steer, and if it sees XTE increasing, it tweaks the heading to compensate. I've never seen it try to turn sideways to immediately zero out XTE. But if it wasn't getting BTW and DTW, it might just do that.

So be sure that OpenCPN is set to send VTG, ECRMB, as well as ECAPB to your autopilot. Those extra sentences will give it the information it needs to function optimally.

Note that OpenCPN does not tell the autopilot to steer directly toward zero XTE. All OpenCPN does is tell the autopilot how your boat is progressing. After that, it's the autopilot's logic that determines how to turn the wheel.

One other thing that could be wrong is the conversion from true to magenetic headings. I've seen two cases where it went the wrong direction. One was an earlier version of OpenCPN (there are some messages on this). Another is a particular brand of Seatalk-to-NMEA converter where the programmer did it wrong. I'm still waiting for a fix for that, because it's screwing up things for me right now.
__________________
RhythmDoctor is offline   Reply With Quote
Old 24-02-2015, 20:59   #11
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

Thank you for your input. I had actually disabled XTE altogether and only allowed APB and ECAPB out. With XTE enabled I had some very strange results where the heading displayed on the autopilot would sometimes flutter back and forth severely (presumably as APB and XTE messages came in) and the boat sometimes would go in circles.

I just discovered the VDR plugin and I'll try to make some recordings next time I get a chance to go out.
__________________
windsunrain is offline   Reply With Quote
Old 01-03-2015, 15:00   #12
Registered User

Join Date: Dec 2014
Location: Point Roberts, WA, USA
Boat: Cooper 316
Posts: 23
Re: Zigzagging with OpenCPN controlling autopilot

Hello again.

I want to thank the people that have replied for sharing their insights. I got a better understanding how the system is supposed to work.

I did some experimenting and it appears the autopilot has some trouble using the cross track error to get the boat steady on course. OpenCPN's output appeared to be correct.

I did increase the precision of the XTE as recommended and I also allowed RMB and RMC out.

The unit has a setting called BOD correction factor. Default value 15. When setting this to 1, the autopilot steers extremely bad. At a cross track error of less then .1 mile, and a distance of over a mile to the destination, it steered at an angle 90 degrees to the route, then overshot it and did not start to turn toward the destination until the cross track error was around .2 mile. At that point it again turned 90 degrees to the course and so on. Setting BOD correction to the maximum value, 30, did help to reduce the zizagging, but it's not entirely gone. I wish the course could be as steady as when steering a compass heading.

After this (with the new setting), I selected a route with the second waypoint about 10 miles away and the cross track error about 2 miles. I activated the second waypoint. The autopilot again steered a course about 90 degrees to the line from the first waypoint to the second. The course that the autopilot steered would actually put me in a place before the first waypoint, on land!

The Zero XTE command will stop this from happening.
__________________

__________________
windsunrain is offline   Reply With Quote
Reply

Tags
autopilot, enc, opencpn

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Siemens Logo for controlling the generator etc? avazquez Electrical: Batteries, Generators & Solar 20 07-11-2015 06:11
EPA approves product for controlling invasive mussels Soundbounder General Sailing Forum 0 13-03-2012 08:56
Charge Controlling for Wind and Solar svh2obo Electrical: Batteries, Generators & Solar 20 29-01-2012 16:54
controlling IC-M802 by JVComm32 broach Marine Electronics 0 09-01-2012 13:08
Bimini controlling depth Robert Entwistle Marinas 0 12-05-2006 19:57



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:11.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.