Servers by jDrones

Sailboat Support


(Peter Hall) #99

Videos are finally uploaded to YouTube. This is the mission in real time:

This is it speed up 8x in case you don’t have 40mins to spare :wink: .

Over all I am very pleased with how it went. The wind was quite shifty and gusty but essentially it dealt with it and manged to complete the mission. It sailed almost exactly 1 mile completely autonomously. I did a quick test of all the modes, they are labeled in the real time version. Again everything worked as expected. It got a bit confused about the wind direction when it got very light, this could be improved if I had set a suitable wind vane cut of wind speed, it just ignores the vane at wind speeds less than the cut off. Also it did some odd stuff sometimes when the wind shifted and it swapped back on to L1 controller, it would be tacking then the wind would shift so it would switch back to the L1 controller because the desired heading was no longer upwind. This would result in it turning round and sailing almost back where it came from to get back on the line between way-points. It would be more logical just to carry on towards the next way-point. This could be fixed by a bit of a rejig of how the heading controller works and a parameter to define at what wind angles the L1 controller is used, from a sailing point of view heading control would probably be better 100% of the time. I guess if your mapping or have a motor too you may prefer to try and keep on the line.

Anyway I think that can wait for another pull request, better that I do some documentation before I forget how it all works. Unfortunately I have to go back to my proper job on Monday after messing about with boats for three weeks. Hopefully I can find a nice spot to do some testing somewhere and keep doing some development. I have some other stuff to build too, a boosted tri-copter to rebuild and a TVBS to play with, then I have been thinking about maybe a land yacht. Would be quite a challenge for the code I think since they can quite easily go faster than the wind but if we can get it working for that it should be fine for boats. Would also be good to do some work on motor sailing, I think we might get more interest if we can just add a small sail to a existing boat and get twice the battery life, but still use the motors to remove all the difficulty associated with being 100% wind powered.


(Saijin_Naib) #100

I have nothing to add other than this blows my mind that something I viewed as so hands-on can be successfully managed by ArduPilot.

This has been so cool to watch develop this far this fast.


(David Boulanger) #101

Very Nice Peter. I loaded the latest code and may give it a go tomorrow. I think I have everything sorted out and everything looked good with extensive bench testing.


(David Boulanger) #102

I finally got the boat set up properly. It was great in Acro and not bad in Auto. I’m still a bit confused about SAIL_ANGLE_ MIN, MAX, and IDEAL and exactly how it effects my PWM out to my sail winch. Not much wind and variable from different directions. Here is a super boring 10 minute video of the day.

Once I can get wind consistent at 5 - 10 MPH I will look into tuning. Is there any place I can find what all the parameters mean without guessing? And, any schematic on how the wind speed sensor wires into the Pixhawk. I get that I need to supply 12 volts to it and I think it goes in to the 3.3 ADC but the exact pins I have no idea about. Thanks for all this work.


(Peter Hall) #103

Great to see it working on another boat! Looks like its working well, it got to all the way points!

The only place to look at params currently is the descriptions in the code:
here https://github.com/ArduPilot/ardupilot/pull/9384/files#diff-72ecf87968148cc2cfc029eca4001ba6
and here https://github.com/ArduPilot/ardupilot/pull/9384/files#diff-26e91b7389bee95b8cd2bcc9d044bfe6

Have you ‘de-greased’ the pot? makes a huge difference and will allow it to work in lighter winds. Quite fiddly to maunaly remove the grease but a chemical might do it without having to open it.

For the wind speed sensor you just wire the speed output and temp output pins to the adc. You can configure the pins with the wndvn_SPEED_PIN1 and SPEED_PIN2. 1 is for the speed 2 is for the temp.

The sail angle min and max params are to allow the code to work out what angle the sails are at from the servo output. ie a servo output 1/3rd of the way between SERVOx_MIN and SERVOx_MAX should result in a boom angle 1/3rd of the way between SAIL_ANGLE_MIN and SAIL_ANGLE_MAX. The ideal parameter then sets the angle the boom should be to the wind. So a ideal angle of zero would result in the boom directly inline with the wind vane. Then increasing the number sheets it in more relative to the vane. This limited by reaching either full in or fully out.

I haven’t done much tuning of the L1 stuff probably you know more about it than me as this is my first rover, as you say it needs a nice consistent wind.


(David Boulanger) #104

I have not de greased the pot. Thanks for the help. I will need to wait for a day with some more consistent wind or do it in the afternoon heat. We almost always have wind in the afternoons but it is hot.


(Peter Hall) #105

I have made a start on the documentation, its only a first draft and I have not checked it over yet.

I guess this would go under a new heading ‘Sailing’
Sailing Vehicles Wiki draft.pdf (253.7 KB)

I will do a bit for optional hardware on the wind vane setup. Once the code is merged i will finalise the docmentaiton and do a pr for the wiki.

@rmackay9 Should I do a ‘refrence frame’ on my boat?

@David_Boulanger can i use the picture of your windvane as a example? also I would be great if you could take a picture of the boat with it fitted, thanks.


(David Boulanger) #106

I’ll take a better picture of the vane and also a picture of it mounted on the boat. Probably tomorrow. So to be clear on the wind speed indicator wiring the only two pins used on the pixhawk are the two inputs on the 3.3 ADC? I have not looked at the pins on the pixhawk docs yet to see which is which but the wind speed indicator gets powered by my 3S battery and only the indicators outputs get wired into the Pixhawk?


(David Boulanger) #107

I’m not real good on this hardware stuff or firmware stuff to be honest. I am a good sailor.:grinning:


(Peter Hall) #108

Thank you, no huge rush,

yeah just two pins to the 3.3v ADC, and ground to somewhere. Not sure about powering it straight off a 3s i think it says 9v to 12v on mine, might be ok i guess a fully charged lipo is only 12.6, the battery voltage drop might make the offset voltage change abit, not sure how they work exactly. I refitted my 405wing just to use as a bec, it has a 9v output for fpv stuff.


(David Boulanger) #109

I thought the speed indicator said 10 - 12 volts on the spec sheet. I don’t know if 12.6 would be a problem. Maybe it would be best to add another BEC set at 10. Now that’s 3 BEC’s (LOL). One at 5 for a RFD900 and Gopro’s, one at 5.7 for the servo rail, and now 10 for the Wind speed indicator.


(rmackay9) #110

Really great to have these docs!


(David Boulanger) #111

Thanks for the Wiki Draft. It helped me a bit. Here is a picture of the wind vane, and wind vane on the boat. let me know if you need anything else.
https://1drv.ms/u/s!AgqdUNhfFlnDgbN0kc4kfvm19A7yqg

https://1drv.ms/u/s!AgqdUNhfFlnDgbN1Nu9HuDTi7vwNjw


(Peter Hall) #112

I have finished the draft of the documentation for both the sailing and windvane Sailing Vehicles Wiki draft.pdf (545.5 KB)

Once the code is merged I will make any changes and add it to the wiki.

Thanks for the pics @David_Boulanger


(David Boulanger) #113

I tried to calibrate the wind vane voltage with Mission Planner and it never seemed to respond to tell me it was done. I’m still just using 0 - 5 volts in my parameters. It’s working O.K…


(Peter Hall) #114

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


(David Boulanger) #115

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.


(David Boulanger) #116

@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.


(Peter Hall) #117

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.


(David Boulanger) #118

@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.