@David_Boulanger Great! I think that is everything, you don’t need the wind vane if the rest of its ready to go, It should do a reasonable job with constant true wind direction so long its not too shifty. I guess we could calculate the effect of pitch and roll rate in waves on the windvane if we have its height as a parameter, might be some tricky maths tho.
More testing today but no vid. I have added the cross track error parameter and tested it, it works well to tack up my testing river. I have fixed and tested acro tacking, this allows tacking on the aux switch in acro mode, the boat just matches the current angle to the true wind on the new tack.
I thought I had reduced the maximum allowed rate when sailing in a straight line in auto but it seems to not work, will have to have another look at it.
I have added but not yet tested reducing the rudder output scaling when going slowly, I found it will get stuck head to wind because it will just use full rudder to tack even if its going very slowly. Maybe this would be better controled by reducing the target turn rate?
I have been thinking about the best way to filter the wind vane outputs, I think a fast-ish moving average over a second or so, I can’t decide if we should do a slower filter of true wind angle to use just for tacking, but then we would loose out on how quickly it follows the shifts currently, I think the reduced straight line rate, if i can get it working and a faster filter would be better. And if we can detect a stuck vane we could use a faster filter, I was thinking maybe if the apparent wind angle hasn’t changed by some small amount just don’t up date the true wind angle, and use the last one. But then we might lose information where apparent wind is the same because a change in true wind angle or speed had been masked by a change in boat heading or speed. Maybe with the addition of the wind speed sensor we could weight the vane results with wind speed, ie strong wind - vane is defiantly right, light wind - vane is probably close, no wind - vane is useless. Duno i keep changing my mind, any ideas?
Any thoughts on the best way to do loiter mode? I guess we should just define a circle and sail within it. There a couple if ways we could do it, we could go into a hold style head to wind and keep reseting to the upwind side, i think this might result in getting stuck head to wind from some boats, maybe hold mode should not be dead into the wind but more of a tacking angle but the the sails still loose, I think I will add a parameter for this. We could just sail back and forth on a reach at 90deg to the wind, we could sail back and forth upwind and down wind, or we could do a plane style loiter and sail as close as we can to the perimeter of the circle.
Once loiter is done all useful modes should be supported. I don’t think guided should do any automatic heading stuff, I don’t see much point in steering mode for a sailboat and smartRTL would be abit pointless as it wouldn’t necessarily avoid anything if it has to tack up to the next RTL waypoint, duno we could impose the cross track error on it I suppose but I cant see it working that well.
I suspect I keep having issues that would be far less important in a bit of a stronger and steadier wind, there has not been much here recently, If it was windy I would be doing the heel control code.