Sailboat Support

Thanks for the fix! Does it need a call to an angle unwrapping function like wrap_PI?
My SD card worked in the most recent test, I will remember the slowdown option though, I did not know about that.

I did some more bench testing of the windvane-rework, and fixed two things:

  • a couple of fixes on your fix so that true wind direction is calculated if there is no wind speed sensor.

  • the filters weren’t filtering. I changed the format for the filter update back to the original (with a dt) strictly following the documentation in LowPassFilter.h. I updated all filter calls but can’t test the speed variable since I don’t have a speed sensor. The direction log tested fine, I could see different filtering in apparent_raw, apparent, and true as expected.

I can’t seem to do a proper pull request on your fork since I have a fork of the original in my github, or maybe I just don’t know how. The changes are all in AP_WindVane.cpp which I’ve attached.

AP_WindVane.cpp (17.0 KB)

Hoping to test on the water next!

1 Like

Thanks!, I have pushed a fix (hopefully)

I am hoping it should be possible to set the new true wind filter slow enough that it will filter the apparent wind over a couple of tacks and get a reasonable estimate. Not as good as having a speed sensor, but hopefully better than nothing.

My direct-rotation mast code sailing last weekend (PR is here: https://github.com/ArduPilot/ardupilot/pull/17066/):

2 Likes

I tested the latest and I’m not convinced the filters are working yet in the updated windvane-rework branch. I bench tested and wiggled the vane, then compared data with my other version (above) that uses different filter function call syntax. You can hardly see any filtering in the windvane-rework version even with a filter pole of 0.1, while in the version I fixed there is a lot of smoothing and lag as I would expect.

Here are the graphs:
Latest IamPete windvane-rework:
image

My fix of filter call with a lot of filtering shown:
image

@iampete Can you run a similar test and see what you get? There is a chance I messed up with github but I did check the files against the online viewer.

The datalogging and telemetry of windvane data is really good, I’m looking forward to sailing it soon.
-Mike

Yeah there is something funny going on, they seem to be filtering but not at the correct cutoff. I might just put it back to how it was before, as you did in your test.

Some testing of the Mini40, unfortunately with the motor not the sails.

2 Likes

Hi Pete … a lot of pages in this thread. May I cut a corner and understand what you are testing for ? Note - am a Brisbane based multihull and IOM builder/sailor who has recently embarked on “Buoybot” project that we are seeking assistance with.

I’ve been watching Mike Holdens YouTube clip with his tacking issues. This reply has nothing to do with Mikes issue but I wonder how the sheeting is working. It seams like the sheet servo is controlled by the position of the wind vane even in upwind. I’m I right? Check at 5:33, the boom is so far out that the sail is loosing laminate flow and the boat stops. If so, I think it would be better to use an upwind mode where the sheet is set to a fixed position and the apparent wind is controlling the rudder so a pre set angle to the apparent wind is achieved. By upwind mode I mean when the boat is not able to reach the way point straight ahead. The point of tack would be either 1. reaching lay line, 2.the angle between relative bearing an heading is greater than closed hauled 3. hitting the defined boundary.

Hint, if you pause a YouTube video with the space bar you can jump frame by frame by pressing comma (,) or dot (.).

I can answer some of the questions I think. First, my boat could go upwind better with some work. Because of the double-tacks it would get stuck in irons sometimes (light wind mostly) so I have the sail trim settings very loose. This makes it easier to bear away but isn’t trimming the sail in very tight when sailing to weather. I think most of what you are seeing is the result of these settings.

I also think you are correct about the algorithm. Upwind the boat steers to a compass heading relative to the true wind as calculated by the autopilot. The sail is always trimmed to the vane. If everything is exact, this would be the same as directly steering to the vane and the sail would be trimmed in, but there are lags from filters, feedback response, and wind shifts so at times the sail can be eased out a little upwind while the boat adjusts its heading.

I’ve been spending a lot of time reading the code and it seems like we could use the _steer_angle_p.get_p function with the vane error as its input to steer directly to the vane apparent wind. But this would be a major change to the code. It is how most people sail upwind (sheet tight and steer to telltales) but I don’t know that it would actually perform much better than the other way which works well.

There are a few reasons, the first is that it is currently implemented in least intrusive way.

I think in the future we should be looking to use dedicated navigation controller. Currently we just override the target heading when upwind and use the standard L1 controller upwind. When using the L1 controller we can currently get stuck if we get blown off course. This is because we decide based on heading to the target waypoint, but if we get blown downwind trying to get back on track will be further upwind.

For sailboats we probably just want to point at the target location all the time.

In the near future rovers will be moving to S-Curves rather than L1, so that might hurry this up a little. Of course we might want sailboats with motors to be able to choose depending on the wind ect.

A second reason is that on slow boats, where the code started, its quicker to sheet the sail that to turn the boat. Such boats are also quite hard to tune the steering, so they get on a little better if we keep a constant target heading rather than moving it about.

Apparent wind sailing is something that I would certainly like to improve, especially with faster stuff being attempted now.

1 Like

Thanks for the explanations. You do a great work. I will hook up my Pixhawk to one of my RC-boats when the temperature allows. It´s been a terrible cold spring here in the Baltics this year.

Of numerous sail drone videos i seen on the net I like this guys boat best. He briefly explains the concept of steering different regarding upwind or downwind. The boat seams to have a very stable manner. To bad he don´t show more videos like light wind performance etc.

Pete - im a newbie to this forum, having joined to learn more about drones (how to establish “buoybots” specific to RC sailing courses in particular :slight_smile: ) … and pleasantly surprised to see lots of interest in sailing, being a very long time (50+ years) sailor of all manner of racing vessels.

Can you educate me on your objectives of this thread please ? What are you trying to develop ?

I ask because in my experience their are only two end games to sailing (on auto pilot). One is to set a defined course, and trim sails constantly to suit the changing conditions (wind direction) to get the boat along that course (striaght line between two points ?) as efficiently (fast) as possible, the other is to sheet the sails (and balance the boat on that course) then steer the boat so that that balance (wind direction relative to sail setting) is maintained as conditions (wind direction) change.

0r is your objective to automate the decision making process so that say, from a starting point, with a known wind direction, choose which tack and what sheeting angle to get to the finish point as efficiently as possibly, computing when to tack and/or when to trim (dodging hazards along the way ?) as conditions (wind direction and strength) change as the boat travels the course ?

You presume too much forethought, the goal is simply to do the best job of sailing we can. For different vehicles in different conditions that takes different forms.

This is the closest I think. We can already get round a course with no assistance, dogging geo-fences and taking in to account wind shifts. The hard bit is the efficiently as possibly were not there yet, but I think some vehicles in ideal conditions get quite close.

You are all quite brilliant and inspiring !

Hello Pete @iampete

What is the status of this filter thing in the Rover master currently available?

The weather seems pretty good to bring the boat out again :slight_smile: Would like to put on the standard rig for a change (not the Wing sail).

Should be good to on master, hopefully some nice improvements.

1 Like

I switched back to master from your branch. My bench test showed 0 for true wind direction, and I found there was an old bug with the true wind calculation if there is no wind speed sensor. I think you had fixed this in the past. I fixed it, tested it, and submitted a pull request. This is my first pull request so please educate me if I didn’t do it right!

2 Likes

Is there a good guide on troubleshooting the “Unhealthy AHRS” message? My boat seems to work fine but I would like to be sure there is no issue with my setup. My google searches mostly find people having trouble setting up hardware for a wide variety of reasons.

image

Here is a link to the dataflash bin file. Thanks for any help.

Looks OK in the log, nothing to be too concerned about. GPS looks like its having abit of a hard time, I have found they don’t really get on that well at ‘water’ level.