Sailboat Support

Nice! Great work!

I’m a little surprised to see the sail ‘wagging’ so much. Hard to tell the cause, there are wind speed and direction filters you could lower the frequency of.

For a land yacht who’s expected angle of lean is basically 0 you might have better luck with a lower SAIL_HEEL_MAX and less aggressive PIDs, I think it should be possible to get it to cruise along on two wheels.

For my mini-40 I also turned up the loop rate to 400hz, that is what is used on copter. (SCHED_LOOP_RATE) By default Rover is 50. There probably won’t be any huge in increase in performance but it should make the PIDs easier to tune.

1 Like

Thanks for the suggestions Peter.

I think the sail wagging may be caused by the PID controllers used in the Gazebo plugin, not AP settings. Gazebo joints are force or position controlled and you have to tune the PIDs for them so they behave like servos - AP then sets the servo PWM values. It’s either that or I have the centre of pressure for the sail in the wrong place which is introducing instabilities. I still have to add the anemometer to the simulation so SITL gets the apparent wind - that could also explain some of the behaviour. In short there’s still some work to do there!

It’s a much lighter simulation than the ocean one, so quicker to iterate through and test. I plan to keep adding the sailing simulation functionality to it then port it across to the water vehicle version.

What is good is that I can see some of the recovery behaviour working in the AP when the vehicle oversteers round a waypoint and gets into irons (because of tuning issues on my part I might add) - it rolls back, counter steers, and heads off - not sure if that’s all planned but its working!.

really nice! We should get this documented in the wiki. Looks like fun!

Perfect conditions for testing today - wind 4 - 5 m/s gusting 8 - 9 m/s.

  • Main sail sheeting in Acro mode is working well.
  • Ran a short Auto mission where the main track looks good in the logs, but I cut it short because I was concerned the steering was not responding well and the far WP was set a little to close to a pool for comfort.
  • I am not having much success getting the steering controller to respond well. From the video you can see in manual the vehicle can turn quite sharply even under full power - so it’s not a mechanical issue with the steering geometry or servo sizing.
  • The gains are turned right up on the ATC_STR_RAT_* params:
    • ATC_STR_RAT_FF = 10.0
    • ATC_STR_RAT_P = 2.0
    • ATC_STR_RAT_I = 0.5
  • I am wondering whether it is something else? One non-standard setting is the ground steering servo outputs are set with wide limits:
    • SERVO1_MIN = 800
    • SERVO1_MAX = 2200
      to get the full range of motion of the front wheel.

In SITL I noticed that the simulation constrains the steering servo output for Rover to [1000, 2000]. If this constraint was also applied to the servo output for a physical rover in Acro / Auto that might explain why I am not seeing a more aggressive response?

Appreciate any thoughts.

1 Like

First thing I notice is the target is a much larger magnitude the turn actual ever manages. Here i’m plotting GyrZ so you can also see the max rate in manual.

Setting ACRO_TURN_RATE to about half its current value should help, this would be about 50. Once the tune is working you can always look at increasing it again.

Currently the tune is hugely feed forward based. You can see where the feed forward ‘runs out’.

The actual changes with the feed forward but the high of the peeks is about 1/2 of the height it needs to be. The would probably leave you with a feed forward term of about 25. That is much higher than we would typically see, I guess that is just a factor of the steering setup. The steering is along way ahead of the vehicle and I guess with a relatively small range of motion and high castor angle.

Once the feed forward is in the ball park, some P and D should help smooth it all out, again you will need big values.

You can see the servo is often hitting the limits of travel in all modes.

1 Like

Thanks for the analysis Peter. Having the PID params an order of magnitude larger than standard settings was leading me to think that there was something else incorrectly set up. As you suggest it’s probably a feature of the crafts steering geometry. I can see that I over set the ACRO_TURN_RATE - I took the larger values from the GyrZ history and went a little under that. In reality those values are probably coming from slide turns at high speed.

I’ve tried a lower turn rate and higher PID gains in the Gazebo sim - the settings are too aggressive but there are still big differences in the simulated and real physics so it’s probably too much to expect the simulation to reflect real life PID values at this stage.

Quick update on the land yacht steering tuning.

It turns out the critical parameter is MOT_SPD_SCA_BASE which defaults to 1 m/s. In test conditions the land yacht’s average speed is around 4 - 5 m/s. This was causing the steering controller to constrain the max turn rate which made it look like the feed forward was too low. With motor speed scaling disabled the FF and PID values for the steering controller take on more typical values (under 0.5). Thanks to @iampete for suggesting investigating the speed scaling.

Acro steering is now working well, next stage is tuning the sail position. At present the sail is under sheeted which suggests a combination of the travel limits and desired angle of attack are not quite right.

1 Like

@iampete how would I go about accessing the SAIL.* information in MAVProxy? I can see the apparent wind speed and direction in the beta version of Mission Planner, but they don’t seem to appear in MAVProxy when I use:

status MAV*

Happy to pitch in with dev work if that’s needed - just need pointing in the right direction.

The SAIL message is in the onboard log only. Some of the same info is sent back over MAVLINK. True wind speed and direction are sent using the wind message, apparent speed and direction are sent using the named_value_float message. With the names AppWndSpd and AppWndDir. I have never tested the named value message on MAVProxy, but it is used in a couple of places in the code. Most notably the second airspeed senor reading on plane.

1 Like

I see them in MAVProxy with SITL now. I needed to rebase my local branch of ardupilot on master to pick up the new messages. We now have:

MANUAL> status NAMED*
MANUAL> 1086: NAMED_VALUE_FLOAT {time_boot_ms : 273819, name : AppWndDir, value : -168.2600555419922}
1334: NAMED_VALUE_FLOAT {time_boot_ms : 335819, name : AppWndSpd, value : 2.995225429534912}

@iampete I’d be interested in your thoughts on nav tuning with the sailboat code. The land yacht is behaving well once it’s on track, but can get confused when exiting a way point.

2 wp course

At wp 2 the vehicle may either tack or gybe

  1. tack: the tack completes and the vehicle comes back on course but then starts to round up again before bearing off.
  2. gybe: the gybe completes but the vehicle oversteers out of the corner and then initiates a tack and stalls rather than bearing off.

4 wp course

This is similar but wp 4 was placed to reduce the turning radius and remove the gybe from the course adjustment. The turn at 4 is too sharp and the vehicle oversteers and may stall.

1 Like

Looking good!

Not done a huge amount of high speed rover nav tuning, doesn’t make a any as much difference when your going slow.

The tack vs gybe is just that it is a 180 deg turn so depending on if you happen to be a little onside or the other of the target heading results in a tack or gybe.

SITL with a normal rover is probably quite good for getting a feel for what the params do, I don’t really have much more advise over what is on the forum in other places.

Hi
This is existing! Some years ago me and some friends build two experimental robotsailboats. At one point I tested an APM as a controller for steering with an extra arduino for sail control and wind vane interface. By that time there were no sailboat support in mission planner. We gave up that idea and continued with just the arduino. Our goal was to join the Microtransat event but school, work and family got in our way.
I will definitely try to get hold of one of our boat and equip it with a Pixhawk I got laying around to try it out. Hopefully the water will continue to stay free of ice. Otherwise I’ll have to go with the simulator until the spring.
I am a competitive sailor since the mid seventies. Work as an automation programmer.

3 Likes

Great to see guys trying to get a Sailboat to run missions. I have spent some time sailing RC IOM sailboat. Trying to get the sails tuned and dealing with waves, wind shift would be interesting. Very cool thread. great work guys.

@iampete After reading through this thread and watching all the videos. I was thinking about loitering. I was wondering if this is a problem the controller might be able provide a solution that would be too difficult for a sailor to accomplish. Would it be possible to steer into the water current then trim the sails to match the water current speed. While not possible in all conditions it might work in some. A bit like hovering a quad. A cheap microcontroller can hover a quad but I have yet to see someone fly a drone without a FC.

Yes, this certainty would be possible, the current loiter is a bit of a bodge tbh.

Now we have some land yachts we should add some other options, land yachts can stop on the spot like a normal rover without drifting off like a boat will.

I looked up the project I was a bit involved in in 2014. They seem to have continued the project since I left it. Maybe it does’t have so much to do with ArduBoat but there might be some interesting readings in the documents.

sailingrobots.ax

…happy new year!

Is it possible to implement so that you can choose different SAIL_XTRACK_MAX for every new WP in a mission? The reason is that if I plan a long mission in our archipelago I some time need to pass quite narrow passages between islands. Activate and using a fence would be an option but only works less than 10 km from home.
I also would like to have the option to set a “no go angle” for downwind sailing. Some boats, and special land based vessels, gain more speed if not sailing dead flat downwind.

I think your better off just using a fence, I don’t think the 10km thing is a hard limit. Exclusion fences should also work (although I have not tested personally). So you might just be able to do exclusion zones on each island.

There is also a fix coming for the 10km thing coming soon anyway I think.

Yeah gybing angles for downwind is on the todo list.

For the issue when the land yacht jibes, if it’s going fast enough when it turns downwind the windvane will show wind from the nose (most land yachts luff sails through the jibe). If the controller thinks it’s in irons it might bear away giving the 2nd turn. Eventually the vehicle will slow down enough that the vane will show wind from a sailable angle and go on with the course. I don’t know the code well enough to know if this is really what happens but it does look like that from the track.

In full-scale sailboats a similar thing happens surfing down a wave under autopilot-- if sailing to apparent wind setting to keep the spinnaker full the boat will steer the wrong way when it surfs fast downwind because the apparent wind moves forward. The usual fix for this is for the autopilot to steer to true wind angle, this would probably work for the land yacht too.

1 Like