Sailboat Support

Thanks - I recall reading that somewhere but couldn’t locate it.

Happy to share the log - what’s the procedure? I assume it’s just the .bin file, is there a place to drop them? (or prob. no need now you’ve answered the question)

You should be able to upload the .bin straight here if its not too big, or drive/dropbox/whatever and share the link.

So long as the EKF seemed happy and there were no warnings there is not a huge amount to be learned from manual mode. Next step is acro mode. This will auto trim the sail, you just have to bump the throttle for go!, sail boats have no concept of speed control its flat out or stop, not really a issue for the boats so far, might be exciting for you tho. You also get steering rate control, you will probably need to get into a little tuning in order to get this working well.

1 Like

Here’s the log. As you deduced the vehicle disarmed in manual mode - this would have been when it was head to wind and I held full left lock to back the yacht out of the no-sail area. I’ll disable rudder disarming as you suggest.

looks good, no nasty errors, EKF is resonbly happy.

I dare say you have claimed the ArduPilot sailing vehicles speed record on your first outing!

6.5m/s! My keel boat has never been anywhere near that speed. Hopefully the Mini40 will be in contention for such speeds once I finally get round to trying it out properly.

Although I guess manual mode doesn’t really count!

1 Like

It’s a shame the log didn’t record the whole session - there was another 5 minutes or so before the mast step gave way when the wind got up to around 9 - 10 m/s. The land yacht accelerates so quickly in gusts and continues to power up as the apparent wind builds - tuning will require less wind / more space as I kept running out of room.

What might be interesting to look into is controlling the steering as well as the sail trim to manage the power / heel angle for faster sailing vehicles as you would on a fast skiff or multi-hull:

  • Luffing when close hauled to reduce heel
  • Bearing away when on a reach or down wind in response to gusts

With my current sail winch I suspect the mechanics won’t respond fast enough to fully compensate for the changes in power you’ll see in a fast yacht - I could get a bigger / faster winch and put a 1:2 or higher purchase on the main but I think active steering to de-power is probably the better solution longer term. The alternative is a sail drone style wing sail with trim tab - I read an article by Richard Jenkins where he said this was the reason he developed his wing control system - he could not trim the sail fast enough at speed on Greenbird.

I’d be quite keen to help you on this Peter, but need to get up to speed on the code base first. Also a simulation might help, so perhaps I could try to get my Gazebo land yacht sim working better / more realistically.

2 Likes

Hi @rhys, could you please point me to the place in your simulator repos code responsible for communication with SITL. I guess you’re not using standard Ardupilot gazebo plugin, are you? Thanks,

Hi @soldierofhell. It’s in this fork https://github.com/srmainwaring/ardupilot_gazebo/tree/feature/gazebo_sailboat_poc of the ardupilot_gazebo project. The main change is to the file ArduPilotPlugin.cc where I’ve added a controller for the sail trim.

There are also a couple of changes to the ardupilot SITL / Gazebo code here: https://github.com/srmainwaring/ardupilot/tree/feature/gazebo_sailboat_poc, mainly to do with setting the wind speed.

I need to revisit this: add support for anemometers then submit a PR, but have been side tracked on the getting up to speed on practical side of things for the last month or two. If there’s anything I can help with let me know.

Thank you, I didn’t noticed this repo

The docker file:

https://github.com/srmainwaring/sail_sim_docker/blob/feature/ardupilot_sailboat_poc/Dockerfile

lists all the repos and branches used in the example simulation if you’d like to replicate in a local build.

This is certainly something I would like to look into. We could sail to apparent wind angle rather than true wind as we do currently, or just change heading at some rate proportional to the heel controller.

The current code sails to true wind angle when going up wind and tacking. Other points of sail are done using the standard L1 controller, this means it trys to keep on line between two points. A first step in this direction is probability just to use heading control the whole time. This frees us to mess with the heading more. With the L1 control it will quite aggressively try and get back on the line so you would end up fighting against it the whole time.

A switch that changes the acro control from being ‘constant heading’ as it is now to ‘constant true wind angle’ or ‘constant apparent wind angle’ might be a nice first step to get a feel for how it would work.

2 Likes

Short update. Had a chance to try the new smaller control wing for the little D wing sail.
Wind was over 5 and mostly just under 6 m/s. It works fine, steering is neutral now.
The OSD with apparent wind really helps to sail it. It’s much more gusty than it appears from shore. Just trying to learn to sail it in manual mode.
I had magnetometer issues and need to check all settings and recalibrate before next try.

2 Likes

Here’s a short clip of the land yacht on sand. Unfortunately I had issues with the ground control station which meant I couldn’t get the steering tuned in the field today so no good performance in acro mode, but that will come.

Mean wind speed approx 3 m/s gusting to 9 m/s.

2 Likes

@iampete I’m trying to set up the motor sailing config on the Rover latest from 18 October but am not getting the results I’d expect. Some pointers would be much appreciated.

Here are the results of a parameter comparison between the standard set up and changes for motor-sailing:

Command Value New Value Comment
RC10_OPTION 41 74 Assigned to 3 pos switch for motor (S4, S5 on mz-12)
RC6_DZ 0 30 Assigned to control (DV on mz-12)
RC6_OPTION 0 207 As above
RC7_OPTION 0 31 Assigned to 2 pos switch for E-stop (S1 on mz-12)
SERVO3_FUNCTION 0 70
SERVO3_MAX 1900 2000
SERVO3_MIN 1100 1000
SERVO3_TRIM 1500 1000

The mainsail is assigned to servo 4.

Hold / Disarmed / Motor-sail=Low

  • main sheet fully out
  • steering disabled

Manual / Disarmed / Motor-sail=Low

  • main sheet fully in
  • steering enabled
  • no response to throttle
  • no response to DV control (assigned to main sail (207))

Manual / Armed / Motor-sail=Low

  • main sheet fully in
  • steering enabled
  • motor responds to throttle
  • no response to DV control (sail fully sheeted)

I can see the response to toggling the sailboat motoring 3pos switch in the MP messages tab (i.e. SailboatMotor LOW). I’m not sure why the motor is active in sail only mode and why I’m not getting any sailing control on the aux control?

Just had a practice in SITL ./Tools/autotest/sim_vehicle.py -v Rover -f sailboat-motor if you want to try it, the motor enable/disable is set to RC7.

I think the issue is simply that it doesn’t do anything in manual, manual mode is all manual. It works to select the form of propulsion in speed control modes, ie acro and above.

The hack for manual so you can still control everything with one stick is to use e-stop to disable the motor when you want to sail. Or you can setup option 207 as you have and have them on different channels. When in auto throttle modes it is all done one the throttle stick as set with RC_MAP (channel 3 unless you have changed it).

1 Like

Thanks Peter, I think I’ve got my head round how the sailboat motor mode operates now. It didn’t help that I’d not set up the min, max and trim settings for the aux RC channel assigned to 207 sensibly - which is why I wasn’t seeing any response there.

If I understand correctly setting RCX_OPTION 207 will override whatever you have in the servo output mapping. If I don’t set an aux channel, then the throttle simultaneously controls both the throttle and main sail in manual (which is what I see).

The sailboat motor 3pos switch is behaving correctly as far as I can tell in acro, the motor comes on in the HIGH position, goes off in LOW as expected. The other mode can’t really be tested inside. I assume the motor should be tuned using the method for Rovers (setting cruise speed etc)? The motor I’m running is a bit underpowered - ok for tarmac but no good for sand, so that will have to wait until a more powerful unit arrives.

Outside of tuning the steering, what I was hoping to use the motor for is recovery if the vehicle gets stuck in sand. I’d be happy to put the motor power on the aux channel instead of the throttle but can’t see any guidance on doing that. I did read something advising not to mess about with the primary RC channel mappings and assume that is for good reason!

On the hardware side I’m in the process of fitting some 200mm PU scooter wheels for the beach / hard. They may be a bit on the heavy side, but if they work should make the land yacht good for both terrains.

Correct

Yes, if its working reasonably well and its just a get you out of trouble motor there is no need to spend ages tuning, better to spend time on the steering.

This currently not possible, basically because on all other rovers the throttle that controls the motor is then used to control the desired speed in auto throttle modes and must be zero for arming ect. Basically if we move the throttle control away from ‘throttle’ stick we break some of rovers assumptions about safety.

You could probability work around with a fancy mixer in the transmitter, but that is a bit of a pita, sorry.

1 Like

Peter, I’m not sure if this is an issue with hardware or with the AP software from the sailboat branch, but on a couple of occasions now I’ve had the FCU lock and not respond to any external communication (no RC, USB or telemetry radio). The FCU runs through its boot sequence and gives the start tone, then spins. It happens after rebooting when the initial connection to Mission Planner glitches / locks. Once it locks there is no recovery (rebooting does not help). The only solution I’ve found that works is erasing the FCU memory with STM32CubeProgrammer and re-flashing.

Have you any experience of this happening and any advice on how to diagnose?

That sounds bad. Make sure your boot loader is up to date. You should be able to still upload firmware in the normal way. The watchdog timer should be rebooting you and giving a ‘wdog’ messages in the messages tab and the log. This gives more info such as the line number the lockup happened on. This lower level stuff is a little outside my expertise, the dev team are always keen to get to the bottom of such issues tho, as ever discord is the place to ask.

Yes - it’s very strange. There is no log on the SD card for the session that failed or subsequent to that until the FCU was reprogrammed, so I can’t see what was going on internally. The audio tone suggests the FCU progresses through the boot stage but the lack of logging suggests otherwise.

I’ve found the STM32CubeProgrammer quite good for completely erasing the flash memory and uploading firmware so I’ll stick with that, but check the boot loader is current as you suggest, and check the watchdog is enabled in future.

I’ve been struggling to get my land yacht’s steering controller tuned properly so I thought I’d set up a simulation to try and get some insight into where things are going wrong. Here’s a demo of the model in Gazebo with the simulation running in auto mode. It’s running with the default SITL sailboat params with the wind at 6 m/s and SAIL_HEEL_MAX=20 as a limit test. Peter’s heel controller is working well but the centripetal force of a sharp turn around a way point is too much so we have a capsize at the end.

2 Likes