Servers by jDrones

Sailboat Support

(David Boulanger) #92

Actually I just loaded the flash log on Mission Planner and I’m not really sure what to look at. This is a totally different thing compared to a quad, heli, or powered boat. Could it be my Servo3 output needs to be reversed?

(Peter Hall) #93

If your throttle input is not reversed, in manual throttle down (towards you) Should be sheet fully in. If this is correct then servo3 is also correct. Hard to tell if the vane is working properly from the logs, I end up with SAIL_ANGLE_IDEAL at 25. This is the angle the sail set to the apparent wind. It interpolates the sail angle from the sail min and max angles. So if it should be sheeted in more you can just increase this angle ideal param.

I forgot to add the sail logs to the above code this one has them: ardurover.apj (755.5 KB)

If you flash that hopefully it will work alot better, lots of bug fixes since the one you were running. If you have a look at the new defaults or my parameter set, they are the same, most of the sail and windvane parameters are a much more sensible starting point. The only other thing i could see in the parameters is probably to turn down your acro and pivot (this is used for tacking) max rates, mine are 100 and about 30.

Also the new code lets you swap to reporting apparent wind to the GCS this gives you a much clearer idea if the vane is working correctly on the shore.

(Peter Hall) #94

If you mount to the wind vane you have to sort out the wires rotating somehow, i think the sensor is more or less unidirectional, so it should be OK. I think being stuck behind the mast will have a greater effect in my case.

(Peter Hall) #95

As a bit of a teaser, this is the map from my test today, did a AUTO misiton of about a mile total, in shifty winds. Not as much tacking as I had hoped in the end, cant really do much about that with a river to test on except wait for the wind to come from a different direction. It ran completely auto with tacking on cross track error and no pilot input for the whole thing.

Vid to will be up tomorrow, its taking ages to render.

(David Boulanger) #96

I’ll flash this latest one. I will also bench test acro changing the SAIL_ANGLE_IDEAL. Mine is set to 5 I believe. I looked at my RC_OUT 3 in the logs and unless I was in manual it was never less than like 1700 if not maxed out. Only in manual did it come down to 1300 which is fully sheeted in. I don’t know.

(Peter Hall) #97

I think you said it was working sensibly with the vane set to home heading, if this is still the case the issue is defiantly with the analog vane, I guess try the calibration and redo the offset and make sure it gives sensible apparent wind, if not try swapping the outer pints on the pot. It needs to be increasing voltage for clockwise rotation, although looking at your picture of it i think you have it right (assuming red is + and black is -), its hard to work out from the pic tho.

(rmackay9) #98

Wow, awesome that you did such a long mission! can’t wait to see the video!

(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:
and here

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.!AgqdUNhfFlnDgbN0kc4kfvm19A7yqg!AgqdUNhfFlnDgbN1Nu9HuDTi7vwNjw