Servers by jDrones

Sailboat Support

(Peter Hall) #72

good luck, I guess first the ideal sail angle param, without a vane its probably best to be tighter(higher number) then looser, not that is has to be perfect, so long as it goes. tuning the steering is the same as normal,just is harder to judge because the speeds not constant. You should be able to set up a 2 point reaching mission with a do_jump waypoint to just reach back and forth while you tune the L1 nav controller. This is only used in auto when not going upwind (angles larger than no go angle + 10 deg). Then all modes should work. If its windy enough you could have a look at the sail control PIDs, these kick in at heel angles larger than the max heel, I would just add p gain to start, and keep I D and ff at zero. I think loiter should work too, I only found the LOIT_TYPE param on after i tested it the other day, has to be 1, so it knows to turn round not try and try and reverse.

This is my latest parameter set if its any help.
Pixwawk5.param (12.4 KB)

I lookforward to seeing how it goes.

(David Boulanger) #73

Thanks for the heads up. I thought I would start with Acro to see how the sails sheet in and out for a bit. The reaching Auto mission makes sense. Steering PID are ATC_STR I assume? This boat tracks very well due to its weight and full keel. I’ll play around and ask questions tomorrow afternoon. Thanks for the Param’s.

(Peter Hall) #74

Yep ATC_STR same as normal, Acro is a good place to start, you can also try auto tacking in acro on the aux switch

(David Boulanger) #75

What Aux switch? I have Ch6 for then wind vane type 2 option to adjust. Is it channel 5 or did I miss a parameter where I can set this.

(Peter Hall) #76

you can set RCx_Option to 59 for tacking, works in acro and upwind auto

1 Like
(rmackay9) #77


I’ve created a PR to allow disabling arming and/or disarming via sticks. I hope this will go into master in the next day or so and then I’ll help rebase your branch on this. Coincidentally the tradheli guys wanted this feature in Copter too so this basically moves the feature so it can be used in all vehicles.

1 Like
(Peter Hall) #78

@rmackay9 I have got the airspeed library working, however, The new sensor doesn’t really fit into the preexisting types, it directly reads the airspeed, requires a temp input on a second analog pin and the offset works differently. I don’t want to add too much extra stuff to the airspeed library, basically the new sensor would be a special case. Possibly it would be better to implement the new sensor in the windvane library, but still allow standard airspeed senors to be used?

this is the documentation for the sensor,

I cant see anyone using it for plane so i don’t think it would be a big deal, what do you think?

(Luís Vale Gonçalves) #79

Backported to 3.6 ??

1 Like
(David Boulanger) #80

I got out today for some initial testing on my boat. The wind was very light and shifty changing in direction about 270 degrees. I had to change my SERVO3_REVERSE parameter to get it going in auto in the proper direction. Ran a two waypoint mission four or five times on about a beam reach. It really was more like 70 - 75 degrees windward and 105 - 120 degrees back in for waypoint 2. Boat tracked perfect going slightly to wind heading to waypoint 1 and coming back to waypoint 2, slightly downwind of a beam reach, it hunted around a bit. Really could not do any useful tuning with the wind so light and shifty. My wind speed sensor came today but I am really waiting for the pot to arrive. We may get some more predictable wind here in Southwest Florida later in the week when the Hurricane hits the Carolina’s. Nice work!!AgqdUNhfFlnDgbNxCmXeP0F_L62mIA

1 Like
(Peter Hall) #81

Great you got it working! looks like a nice setup you have there with the seats and shade.

I have been having a play with my pot, not sure if its because it got some water in or something, but it cant really do better then ±20deg repeatably. I think the sooner we implement a magnetic encoder the better. I did add a dead zone parameter maybe by adding a resistor between the wiper and ground to stop the wiper pin floating as it moves from fully + to fully - some better accuracy could be gained. My placement on the bow also results in the flag hitting the water when heeling over. There is auto min and max voltage calibration routine now at least.

I had the opposite problem here today, to much wind was good to do some testing in tho, I think it was about 20knots gusting 25+. I tested loiter and checked that Randy’s radians for the rates fixes the rates issue I was having. Also ran a upwind down wind auto mission. Essentially everything worked well, except bearing away and sometimes tacking. It would just slam the rudder to full but doesn’t know to sheet out, so it would just carry on straight. And for tacking it would just get stopped dead by a wave or something and start drifting backwards. Looking at the speeds, speed scaling seems quite pointless for this as it only gets to 2ish m/s when going full speed, gps is not really accurate enough to do the scaling well in such a small range. Maybe some logic based on heading error over time, i guess this is just steering integrator that lets the sail off might work for bearing away.

Heel control PIDS worked well tho, maybe abit smaller P and larger I would have helped smooth it out abit, due to the load the winch lets out fast then takes longer to sheet in, maybe a nicer winch would remove the need to tune up the gains as much.

1 Like
(David Boulanger) #82

My pot has arrived. I’ll work on mounting it to the mast head and getting it wired up tomorrow. Then another day to build the pointer I guess. Can you put up a regular speed video of the boat running in auto up and down wind? I’d like to watch what it is doing closer.

(David Boulanger) #83

Is this when going windward in the heavy air?

(Peter Hall) #84

In real time, not very a good vid, I forgot to increase the field of view after the loiter bit and the auto stabilization is makeing it to look like its mounted on a piece of spaghetti.

when trying to bear away, @9:20 in the vid you can hear the water going round the rudder but nothing happens because its too powered up.

1 Like
(rmackay9) #85


Could I get the design files for the windvane? The Bourns Potentiometer has arrived so I’m planning on replicating your windvane. I’ll be asking one of the guys at to modify and print it for me so that I can hopefully attach it to the top of my Thunder Tiger sailboat mast.

EDIT: also I guess the pot was connected to the flight controller’s ADC port. There are two available on a Pixhawk (6.6V and 3.3V) but just one on the Cube (3.3V). I’m wondering which did you use?

(Peter Hall) #86

The designs for the vane are here, , I used the 6.6v ADC but only because of the convenience of having 5v to connect the pot to, if you use 3.3v you need to get 3.3v on the pot using a resistor I guess because i don’t think there are any 3.3v outputs on the cube. A 5.6K resistor will drop the max voltage on the pot to 3.2V if you connect it to 5v. I also think it may be worth trying a pull down on the pot wiper, but much larger about 100k maybe.

You will also need to un-grease the pot to get it spin more freely, maybe some chemical, acetone? (this might also dissolve the plastic) or IPA? would remove it with out having to take it apart.

1 Like
(David Boulanger) #87

@iampete, @rmackay9.

Thanks for the video Pete. I built a wind vane yesterday. Takes about three mph of wind to get it to move. the mount just drops down inside my mast. It may be bigger than necessary. Only a set screw holds it to the pot so it is easy to replace if I try a smaller one. I’ll be giving it a try out in a few hours.!AgqdUNhfFlnDgbNyLoH5IkSDKvmq0Q

1 Like
(David Boulanger) #88

Turned out today my model sailing club had 15 Soling 1 Meters sailing at the pond so I choose to not sail. I did take the wind vane out in the air and it worked surprisingly well. I think it will be good for my boat even at 12 inches long and 70 grams.
I noticed something on your video on the heavy air day. It looked like at some times your booms were coming in to far. With these smaller boats, even the 8 foot 100 pound J boats, the jib boom should point to the shroud and the main boom should point to the corner of the transom when fully sheeted in. In heavy air it is common to set the jib the same but adjust the main so it is hanging out a little more and use the vang to induce more twist in the main sail. This allows air to dump out of the top part of the main, and the jib also backwinds the main a bit causing the main to be far less powerful and giving a well balanced boat without all the weather helm and rudder input to travel straight. This makes me think about something a little. Chances are a boat designed to carry out some type of work will be the size of my EC12 or most likely larger. Larger boats have separate winches for the jib and the main. At some point a separate jib winch may want to be defined in the code. Its common in the larger RC boats with two winches to ease the main in heavy air at times but keep the jib set as it is. The boat continues to move along nicely under power from the jib and the main helps out just a little. This results in a very well balanced helm. So if the wind speed or heel angle reached some defined point, initially just the main would be eased. Just a thought for the future.

(Peter Hall) #89

Hi all,

Wind speed sensor is now working! I have rebased on master I think the code is complete enough to start looking to merge. I fairly happy it all works, only untested thing is automatic tacking on geo-fence. Apart from that I think everything works as intended. I guess the best thing to do is to merge and do some documentation then hopefully a few people will have a go and then we can fix things as we find them.

I have mounted the sensor on the mast under the back stay to protect it while in transit.

@David_Boulanger This is the lasted code and my parameter set
ardurover.apj (755.2 KB)
Pixwawk6.param (12.8 KB)

Due to the rebase you will find some of your parameters are reset. There is now a calibration code for the wind vane, set the WNDVN_CAL param to one and reboot, after 30 seconds or so you will get a message on your gcs saying calibration started, then you just rotate the vane slowly for 30 seconds until it says complete. This populates the min and max voltage params. It will still have to be rotating clockwise for increasing voltage. Then you can set SAIL_GCS_TRU_WND param to 1 to report the apparent wind to the gcs instead of the true wind. This will allow you to set the vane to head to wind and set negative the current wind direction into the ANA_OF_HD param. The vane should now read zero. Oh and tacking on aux is now function 60 not 59.

(rmackay9) #90

Great stuff.

My wind sensor arrived yesterday as I also have all the bits to make a windvane now. I’ve tested the potentiometer and it seemed to work (i.e. by turning the potentiometer I could see the reported wind direction was changing).

So you’ve decided to mount the wind speed sensor separately from the windvane. I was thinking that it would all be part of the same unit so that the wind speed sensor rotates into the wind. I see from the shape of the wind speed sensor that this could be a little difficult because the flat side would face into the wind so it could potentially fight against the vane.

(David Boulanger) #91

@iampete, @rmackay9.

I tested with the wind vane today and it did not go real well. I was using Peters code from about 10 days ago . The wind vane was accurate on the lake bank to within 5 degrees or so of the boats heading. The sheeting action in auto and acro was horrible though. on the lake bank in acro while I moved the wind vane around some times the sheets responded and some times they didn’t. The rudder was also moving around on the bank. In acro and auto on the water the sheets didn’t seem to behave properly. I don’t know if this is the wind vane or the older code that had the sail no go and sail hold parameter problem. It was light wind and it was hard to tell where the vane was pointing. I have a log at the end of this attached to look at. I have not looked at it yet but will do so in a few hours while eating dinner. Steering was O.K. considering the lack of drive the sails were providing. One question. Is there anyway to scale how much the sheets go out as the boat head from close hauled to a beam reach? Sail position is very critical in this range until going off the wind. once off the wind its not as critical . Different boats are going to have different sheeting geometries depend what type of winch or sail arm servos they use. It seemed that my sheets moved a lot more than I thought they should. I have just now changed to peters latest code he provided on this thread. This is the last log of the day after numerous reboots and troubleshooting. Thanks as always for everything.!AgqdUNhfFlnDgbNzMIs23L2_VBGsEA

1 Like