Sailboat Support

sorry, had bad weather here for ages and I have been very busy. Hopefully will get back to the boat as the weather is improving.

Virus is not bad here yet, but the dev conference is coming up in Australia in a couple of weeks hopefully I can still make it to that.

The world robotic sailing championship is in the UK this year. So goal is to get the mini40 working well by then. Altough I suspect it will be on the sea, I don’t think the mini40 will like waves very much even once its working well, might take the IOM as a backup.

https://www.roboticsailing.org/

Ah I see.
International Robotic Sailing Regatta (IRSR) SailBot, is not the same event/organisation but similar? Also in U.K. this year. https://www.sailbot.org

Be safe, that is a long flight for many hours with hundreds of people in a confined space.

Hi all!

I’m considering building an AP sailboat and maybe contributing to the code!

  • I have some experience with Arducopter, implementing CV precision landing
  • I would love to contribute to ArduBoat as my first open source project
  • I’m a people-boat sailor and instructor who recently built my first model sailboat from scratch
  • I would be particularly interested in developing the project’s robotic state estimation capabilities, for instance by tackling spaciotemporal wind mapping. I’m in a robotic state estimation class with a friend and that could be a great final project for us.

Before I learned about ArduBoat I went out and bought a Raspberry Pi Zero W and assorted goodies such as GPS, IMU, PWM drivers, NRF24L01+, PiCam, and a magnetic rotary encoder with the intention of designing an autonomous sailboat from scratch. I don’t actually have an AP-compatible autopilot, since I intended to use the Pi for everything and didn’t foresee needing fast control loops.

Would I be welcome to join the project? What would be a good way for me to start if I am interested – do I just fork the Github, make any changes I want, and submit a pull request, or is there a more formal process for requesting, developing, testing, and approving new features? Should I buy all new hardware so I’m using the same kit as you are? (Compared to what I already bought, AP rigs sound pricier)

Thank you for you response! Please let me know if this is the wrong place to post this – it seems like this is the thread for sailboat stuff.

Hi Tim,

Welcome, you have certainly come to the right place.

Of course start developing and submit PR’s. There is a Dev Wiki to help you get started building the code, we also have a sailboat SITL simulator.

https://ardupilot.org/dev/index.html

You would probably be better of with a compatible board, of course you can use the Pi as a companion computer. I think you GPS and NRF24 would be compatible already. We have loads of small flight controllers that are quite cheap, you could certainly get one for less than $50.

https://ardupilot.org/rover/docs/common-autopilots.html

Thanks, Pete! I’ll check out the docs and see where I can start. Since I’m cheap (and the economy is shut down) I’ll try to compile APM on the Raspberry Pi itself running as a realtime OS until I can purchase a dedicated autopilot board.

By the way, I’ve used my quarantine to design a 3D-printed wind vane based on the AS5048 I2C magnetic rotary encoder. I haven’t tested it on the water, but once I do that and work all the bugs out it could be a good way to get quality sub-degree wind data – it looks like various people have struggled with potentiometer-based wind vane solutions. Hopefully this can help fill a niche for folks who don’t want to shell out for a commercial wind vane or design their own!

1 Like

Hello again!

I’ve been looking through the documentation for APM (generated with Doxygen – is this the best way to view the docs?) and I think I might have found a small bug in AP_WindVane::update_true_wind_speed_and_direction(). It looks like the code identifies true wind angle by

  1. Identifying the sideways and forward components the wind velocity from the windvane and anemometer,
  2. Subtracting the boat’s velocity vector from the measured wind velocity vector to get the true wind velocity vector, then
  3. Using the atan2 function on the true wind vector to calculate the true wind angle.

This is a solid way to calculate true wind angle, but it breaks down at high angles of heel. If the boat were heeling so far as to be nearly horizontal, then the measured sideways component of the wind would be very small since the windvane axis is parallel to the mast and a large component of the true wind velocity is aligned with this axis. In fact, the sideways component of measured wind decreases with the cosine of the heel angle, as explained on page 88 of Joddy Chapman’s PhD thesis. The apparent wind angle requires a correction to step 1 of the form

tan(AWA_true) = tan(AWA_indicated) / cos(heel).

I might have just missed this correction being applied at another spot in the code. In any case, at low heel angles the cosine effect is small. Chapman quotes Tanner (1968) in saying that at 30 degrees heel, a simple wind vane would under-read by 3 degrees at a 25 degree actual apparent wind angle. Because the effect is small and the current setup provides a decent angle of attack to steer the boat, I doubt this bug causes any difference in sailing performance. However, the the bug might result in inconsistent estimates of the true wind angle from tack to tack, and could impede future developers who want to map the wind’s vector field.

If it’s alright, I’d like to look into true wind estimation in a bit more depth to examine the performance of the current set-up. It could be interesting to pursue wind estimation as a final project in a class with my friend Alex, and it would be ideal if we could provide the Ardupilot community with an improved wind estimator. Do you have any full-state trial run data from sailboat deployments (ideally with synchronized ground-truth from a nearby stationary weather station) that we could analyze before implementing our system in hardware?

Thanks,
Tim

2 Likes

I think bug is a a little harsh, but as you say we do not currently take heel angle into account in the wind calculation. That equation makes me somewhat nervous there will be a issue when AWA = 90 or heel = 90. Maybe the original derivation of it is in the other paper?

As far as I know no one has any runs including ground truth wind speed. It would be interesting if you could do some testing, maybe with two of the same sensors and test one at different angles and keep the other stationary to compare.

One issue I have noticed with our implementation is that rocking and rolling of the boat results in errors in the wind speed and resulting true wind calculations. This is somewhat mitigated by the filtering but it would be nice to do it properly. You could add a parameter for the height above waterline/cg (not sure which is correct but it won’t make a huge difference) then calculate the resultant velocity vector form roll and pitch rates and subtract this from the velocity sum before the atan2.

Any new wind-vane back-ends would be great!

1 Like

Thank you, that’s an excellent point about the numerical stability of the arctangent function. I agree that calling this a “bug” seems a bit alarmist – corrections for masthead instruments are not consistently applied even in leading academic papers, and it doesn’t stop their sailboats from working.

Unfortunately, I haven’t been able to find a good source for a derivation because this work was done back in the 60s and 70s in print books. It looks like current researchers take calibration data to subtract the steady-state effects of leeway, sail upwash, mast twist, and unmodeled effects and they handle the effects of boat motion separately.

Going forward, I’ll prioritize getting a boat up and running with the goal of collecting good data. This will help determine whether mathematical correction or empirical calibration is effective for all edge cases, and it’ll be totally fun.

1 Like

Hi all,

As you may know the ArduPilot dev conference took place last weekend. All the talks were excellent and are now available on youtube. There were two talks in particular about Sailboats. Firstly a excellent talk from Matthew McGill from Ocius who are using ArduPilot on some very impressive long endurance ocean going sailboats.

Secondly I did a bit of a update on where we are now I what i’m planning to work on in the future.

4 Likes

when using the motor, Is that aux RC option to control the sail in manual mode using RC(X)_OPTION = 207 MAIN SAIL ?

1 Like

Yeah 207 lets you control the sail independently of the throttle in manual mode. The throttle stick is the only nice one to do this really, on my transmitter all the other sticks are sprung so instead i tend to leave the sail on the throttle stick and setup E-stop (31) on a switch. Then you can E-stop the motor to control just sail. Option 74 is the motoring 3 position state switch.

1 Like

Thanks Pete, I think I got it.

These are the 4 servo output and functions:

And the RC options in use are:

RC4_(31) E-stop
RC6_(63) Tack
RC7_(207) Main sail
RC8_(41) Arm/Disarm
RC9_(74) Motor 3 pos

I can not test all functions inside without gps and good compass, but what seems to work:
. if arming, in manual mode, the motor can be controlled nicely with the throttle stick.
. if not armed, then the motor will not start (as expected).
. if hitting the Emergency stop switch, motor do shut down.
. in manual mode, the main sail and the wing sail will both follow the 207 function nob on TX.
. in acro mode (not armed) the sail and wing do not follow the nob, as expected, but the throttle.
. the rudder is moving in expected direction both in manual and acro (armed and disarmed).

I have good hopes to control the boat in manual mode if needed now with motor and the wing sail control tab. Thats good since I dont know if anything above manual mode will work :slight_smile:

Next step for me, stick out the lock down period and then get to the park and do mag calibration and then try sailing manual, loiter etc.

You see anything wrong or worrying in the configuration?

1 Like

all looks OK to me.

Were in lockdown here too, cant see us getting let out for at least another 3 or 4 weeks. Wasnt so bad when we first started but now we have changed to summer time and the weather would be ideal for testing.

Thanks Pete

If setting the SAIL_WNDSPD_MIN = 0 m/s

(0 5 Sailboat minimum wind speed to continue sail in, at lower wind speeds the sailboat will motor if one is fitted)

Does that mean its disabled and the motor will never kick in?
Setting it to anything else like 0.01 will that enable the motor if the 3 pos switch is set to Allow motor?

And if it does kick in, will the throttle be automatically adjusted to keep the settings in RTB speed etc?

Yeah, its really annoying with lockdowns but we do it for the greater good (that’s what I am thinking).

If its disabled the motor will never kick in due to low wind speed, it will still kick in if it thinks it has failed to tack and you can still use it via the force motoring switch position.

As soon as the throttle is working it will speed up to the ‘normal’ speed set for rovers depending on various params and the mode. It will never use the motor in reverse to slow down if its going too fast due to wind in the sail.

1 Like

I am trying to prepare for a possible sail tomorrow or day after.
Not terribly important but …
I have some experience with waypoint missions but no experience so far with geo fencing.
I was just thinking to put a fence around my missions and tried to use mission planner to do it.
But the menus do not look like the ones in the Wiki - there it looks so simple.

But when I make a fence polygon and try to write it to the autopilot it always complains about an unexpected error
so I must be doing something wrong…

I haven’t done a huge amount with fences recently, have you set fence_enable param to 1?

I put it to 2
Like fence and sensor kinda…

hum, i just had a go in MP (without a vehicle) and its the same pink with blue points. Not sure.

Dont worry about it Pete, I have enough to test the coming week(s) :slight_smile: