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.
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.
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 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.
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.
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.
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?
I’m not real good on this hardware stuff or firmware stuff to be honest. I am a good sailor.
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.
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.
Really great to have these docs!
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.
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
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…
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.
@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.
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 .