Sailboat Support

hum, not sure why that would be, do you get the calibration starting message?

No, but I will try again. Just no wind here. Did some circles around are model sailing pond today in auto. My camera in a waterproof housing over heated. Here is 9 minutes of 1 1/2 hours on the pond. It struggled at times to tack. No wind and faulty vane data from the lack of windI’m sure.

2 Likes

@iampete, @rmackay9, I got out today for my second video test. Wind was somewhat better and the wind vane more reliable. Currently processing video and will post when finished. Since I had some better wind today I noticed a few things. First the boat seemed slow to respond to favorable wind shifts going up wind. SAIL_MAX_ST_RT is set to 5 by default. I want the boat more responsive so I guess I turn this up? What does the number mean? Second is this. I have the max cross track set at 10 because I have been testing in a small lake. When the boat going into the wind hits the 10 meter mark it tacks very nice but then seems to want to get rid of the cross track error before going hard on the wind to make way to the windward waypoint. I thought something was said about this earlier in this discussion. Is this correct that the cross track error is more important than making way to the waypoint. This causes the boat to do a inefficient upwind sailing course to reach the windward waypoint. Not a huge deal I just want to understand if this is how it works. The boat got around the lake without help. As always Thank you.

Great!, I look forward to the vid, SAIL_MAX_ST_RT will alter the rate at the boat steers with the wind shifts, it is in deg/second. Have a play with increasing it, 5 deg/sec was a guess really.

Yeah it may exhibit this funny behavior to try and remove the cross track error completely if it thinks the next way point is no longer upwind. It switches back to the L1 controller which reduces the cross track error as quickly as possible. This happens because the wind vane sticks as it is tacking, so it thinks the wind has shifted such that the next way point is not upwind.

This exposes a flaw in the heading controller, really it should carry on from where it is to get to the next way-point rather than getting back on the proper line. I think we are better to get the current stuff merged before we try and fix it because as you say it still got round the way points.

I have been thinking about SITL, I will see if I can get a land yacht working in realflight, It should handle the wind and sail stuff fine, not sure if it will like funny shaped wing or if the wheel physics is good enough that it wont just go sideways. Gazebo has proper sailing sims that are opensource, but this might be a bit to complex for me to implement.

@iampete, Thanks for the quick reply. The video will be up here in 30 minutes. Same course as the last one just enough wind to make me think the wind vane was giving better more reliable information. Thanks.

Here is the video. If you have time to watch the whole boring thing you will see some of the strange behavior. No complaints as it does get around the lake.

1 Like

Hum, as you say it does seem to do some funny stuff.

Can you post the log, not sure how useful it will be I made a error in the logging code so it might just be rubbish.

You could try the same thing with the constant heading wind-vane type, this would diagnose a sticky vane. It should have perfectly tacking angles as the wind direction wont change. The other thing to do would be to try and get the vane in the video shot then it would be easy to tell if its reporting bad info.

Looks like you have the heel PIDS working well, you could try adding a range sensor to see if it will stop it hitting the marks :wink: .

I have a feeling it is the vane. I have yet to have a day with the wind consistently blowing. Thought about getting another pot and removing the grease somehow and building another vane for light air. One of these days soon when a front comes through I’ll get some consistent blowing wind. My HEEL_MAX is currently set to 30. I found the boat goes to wind better then with it set to 15 or 20. There are 12 marks in the pond and the boat is very good at finding them somehow. Boat is still in the car but tomorrow I can put up a log. And perhaps next week I will try the constant heading vane type if the wind is light and see how it does. Thanks

@iampete, @rmackay9.
After looking at my Tlog this morning I have figured out what is going on. The video help also. Video’s are a very valuable tool. Scenario is… Wind 0 - 5 and most often probably less than 3 MPH. SAIL_NO_GO_ANGLE 50. Just being conservative to start with. SAIL_MAX_ST_RT at 5. The boat tacks and builds speed to about 2 MPH. The apparent wind goes to 46 - 49 degrees. Boat falls off the wind and off the wind until almost on a beam reach. Wind vane finally moves, boat sheets out and now the boat realizes it needs to head up more into the wind. It sheets in and changes course to a more proper course toward the mark. Now it’s time to tack and the process is repeated. So its the lack of wind for my vane. I also have an old 3DR GPS unit and the best it has been is 10 or 11 Sats and Hdop of .9. I think at times it drifts a bit and on a tight course like this creates a little bit of a problem. I’m going to reduce the NO GO ANGLE and probably increase the ST_RT to 10 although I don’t want the boat to get to busy. As I have said before I am not see any battery voltage or amp draw in any type of log. I don’t know yet if it is my old 3DR power module or the cable or what. See the screenshot below. It tells the story without words.

2 Likes

To help us with the sailboat development I’ve created a simple sailboat simulator (PR here)

I based the physics of it on this wikipedia article which describes the forces on sails. It’s still missing some important bits - for example the vehicle doesn’t heel over but I think it’s still useful and we can of course improve it over time. I’ve got some commits that add a SITL backend for the windvane as well but that’s not included in the above PR.

2 Likes

Great! this looks really usefull!

I had a play at making ground vehicles in realflight but basically there not very good. I think it could possibly work be would be a lot of work. Unlike air vehicles all the ground interaction stuff is dictated by the graphics. So you have to make the correct visual too.

I did find that Xplane10 has some user generated sailing vehicles in it. After some more research it turns they look right but the physics is not correct, they only work on one tack.

So i think that limits us to Gazibo, there is only one that looks OK https://github.com/disaster-robotics-proalertas/usv_sim_lsa. But i think the sailing physics is not much more complex than what you have done so far.

But I think for code development your simulator should work well. I wrote a VPP in Matlab a few years ago I think it did heel angles and sail twist and more complex things too. We might be able to duplicate some of the physics from that. I will upload it if i can find it.

1 Like

a PR with basic sailboat support (without tacking and wind speed sensing) is about to be merged to master. If anyone would like to give it a try, I’ve put a binary here. I don’t think people should notice any significant changes in behaviour except that it doesn’t tack.

One warning is that in ACRO mode, you’ll need to slightly raise the throttle or it won’t try and control the sail.

No pressure, but if anyone has a chance to give it a try…

EDIT: a PR with the full feature set will be coming soon… we just wanted to get this simpler version in first because other wise it’s really tough on the reviewers to give it the thorough review it deserves.

O.K… So if I understand this properly the boat will not tack on its own in AUTO if heading to a windward waypoint? If so I’ll stick with what firmware is currently loaded on the boat.

1 Like

David,

Yes, that’s right it does not include tacking. Still, testing this interim version is an important step towards getting the software available to everyone so any testing people can do, even if it’s a step back from what’s on your vehicle at the moment, will help with the process of getting sailboats officially supported.

1 Like

This is now half in master! Thanks for all the help @rmackay9!

I have been looking to upgrade the RF stuff on my boat so i can carry on testing on some larger bits of water. I have a 3DR telemetry kit to replace the wifi telemetry I had been using. I think I need to also move my rc receiver, its a frsky rx8r so should have plenty of range but I was getting low signal warnings after only 50M or so.

I think this is due to being so close to the water level. So i guess for the telemetry radio I could mount the radio itself in the waterproof box and mount the antenna up the mast with a SMA coax extension. But for the RC receiver I would just have to mount the whole thing on the mast and run the sbus signal back. I guess i could do the same and extend the antennas, and leave the actual receiver where it is, but they are tiny surface mount connectors.

Any ideas?

2 Likes

A couple things here. I use a Spektrum system with satellite receiver. Each receiver is mounted under the deck on opposite sides of the boat. It helps but still no where near the range of an aircraft or land based rover. I use a 1 watt amp on my transmitter which seems to help a lot. I’m removing my 3DR 915MHz telemetry radio and adding a RFD 900 this weekend. The 3DR unit in the hull was having range issues. I plan on trying the RFD unit in the hull, close to deck, first and see how it goes before deciding to put antennas outside the boat. I’m trying to keep everything just below deck so I don’t clutter up the deck and risk equipment getting wet.

Finally had wind for a change. Did a Auto mission around 14 marks on a pond in numeric order. Other than the sheets moving to fast when my max heel was reached, easily fixed, the boat did a great job I thought.

2 Likes

That’s really great. I hope you don’t mind, I blogged it on ArduPilot.org here. I’m happy to make any chances to the blog you’d like of course.

2 Likes

I’ve raised a pull-request to get the 2nd part of @iampete1’s sailboat support into master. This includes the ability to tack but is still missing a couple of less critical features:

  • tacking in Acro can only be done from an auxiliary switch. tacking (in acro) is aborted if the user provides any steering input
  • true wind speed and direction are always reported to the ground station. In iampete’s version the user can select which is sent using a parameter.

On the positive side though I think the calculation of the true windspeed and drection may be better - this is the key thing that I’d like to confirm. Because the true wind direction is so important, it’s possible that the tacking performance may be better. It will only be better though if a windspeed sensor is attached.

If anyone would like to give it a try before it’s in master that would be greatly appreciated, I’ve put a binary for a Pixhawk/Cube autopilot here.

A small word of warning is that the parameters have moved around so if you were using iampete1’s version please double check that the SAIL_ parameters are reasonable.

Here’s a video of it working in the simulator.

1 Like

My boat is being re rigged with heavier wire stays. I’m looking to add the wind speed sensor also in the next few days. I probably would not have time to test this until Sunday. And just to be clear on the wind speed sensor… The OUT and TEMP labelled on the sensor go to pin 13 and 14 on the Pixhawk ADC? I’m not sure what goes to what pin.