Sailboat Support

Welcome,

Your looking for ‘WindDirApp’ this is the apparent wind direction relative to the boat, 0 deg would be head to wind

‘WindDirAbs’ is the absolute/true wind, 0 deg is wind from the north

edit: I notice that I have used absolute and true wind interchangeable, its ‘WindDirAbs’ but ‘WindSpdTrue’ this is makes it more confusing than it should to be, I will fix

Awesome thank you so much!

Back in BJ with the boat.
Some development here.
I have been doing a lot of soldering to get the swop from Revolution mini to Kakute F7 AIO autopilot.

This will enable some simplification to the wiring in the Laser boat.
. The board has its own BEC so the current BEC is recommissioned to have only responsibility to power up the RFD900 unit with 5volts. That is good since they draw lots energy.

. The SD card for logging onboard is working.
. The LiPo sensor of volt and current is working.
. The GPS unit is working
. The Compass I2C connected is working.
. I got the Telemetry and the PPM control to work with RFD900 unit.
. The NMEA calypso wind instrument is working.
. I think I found a good way to attach the unit to the deck - remains to be tested.
. Hopefully future rigs that have a fixed mast can allow a mast top mounting.

Things still to do
. the servo outputs are different from documentation (Pete mentioned this early on), not big problem but time consuming soldering.
. Find a way to connect all the cables over deck, decided to try the 8 wire standard LAN cables and connectors. Must learn how to connect these small wires, buy some tools to do it.
. I would like to get a motor mounted and working up on the wing sail to be able to get home if things turn bad. think its a great idea.
. mount the NMEA unit properly.

Hope to do some sailing this upcoming weekend - probably too ambitious expectation :slight_smile:
K

3 Likes

Hi everyone!

Im new to ardupilot and i recently bought a pixhawk 1 (2.4.8) and im trying to make it work on a sailboat moonsoon 1900mm with the Ardurover Sailboat. I had some problems with the compass calibration and command of the servos but its working now.

Now im trying to add wind information in the mix. I have this windvane here but i couldn’t find code to read this windvane in AP_WindVane so im trying to add the code.

the steps to read the windvane are simple:

  • read the A/D port (0-1023)
  • map the A/D value (0-1023) to the direction

can someone here help me debug the code?
AP_WindVane_SEN08942.cpp (2.7 KB)
AP_WindVane_SEN08942.h (1.1 KB)

the idea is to use the ADC 6.6v slot for the windvane.

i plan to develop more code in the future, so some important questions are:
what are the good practices to develop code for ardurover?
how can i build a firmware for testing?

another problem is that the only wind parameter that is shown in Mission Planner is WNDVN_TYPE. does anyone know why that happen? i have the latest firmware uploaded in the board

Thanks in advance!

welcome!

The anemometer should already supported using the RPM windvane backed. The problem with that type of wind vane however is the resolution, 22.5 deg is not really enough resolution to do a good job of sailing. Although your welcome to try it.

Your code look OK except your returned angle needs to be in radians, this should do the trick

direction_update_frontend(wrap_PI(radians(_direction) + AP::ahrs().yaw));

The developer wiki is the best place to start leaning the code. http://ardupilot.org/dev/index.html

and you can ask dev advice over on the gitter channel https://gitter.im/ArduPilot/ardupilot

You will have to set WNDVN_TYPE to something other than zero and reboot before the rest of the params will show up

1 Like

No sailing last weekend but some progress :slight_smile:
. made the LAN cable over deck solution, got a 3 input box on deck now (ugly but efficient)
. NMEA connected over LAN cable and feels very accurate for the 1h testing on land.
. Moving the Compass on deck is great. Using separate LAN input connector, calibrated okay.
. All is prepared for Motor, ESC and servo for the Control Tab on deck.

This is the first time I hade the Autopilot not complaining about BAD AHRS and MAG and GPS health :slight_smile: Encouraging.

Plan is to sail with standard Laser Rig upcoming weekend with the new NMEA instrument but will new Autopilot. There seems still be some configuration to be sorted about the radio input and servo outputs. Probably post a question later.
Then need to order some more stuff to arrive next weekend, install it and then sail with Wing Sail the following weekend. Probably too ambitious again, lets see :slight_smile:

One thing slowing me down is the need to do all installations in a way so they can be mounted and dismounted and transported in a box.

1 Like

At this time I feel I need a confirmation that the Radio input configuration in mission planner can be ROLL for controlling the rudder of the boat?
(more intuitive would be to use YAW?)

When setting up the Servo output, the position #1 will ONLY accept input from the ROLL from the RC input. Rather, the only way to get the servo to move on the boat is to use position #1 regardless if using channel # 6 7 8 9 or whatever.
At least in my set up :expressionless:

@iampete

K

yeah roll is the steering input on rover, the labels are for flying things. The servo output maybe the kakute f7 motor ordering stuff. Channel 5 and 6 are in the correct order, the servo numbers match the silkscreen on the PCB. 1,2,3 and 4 do not match the silkscreen. Also if rover does not find a ground steering out on another channel it will assign in to servo 1 on boot.

Good to have the Roll confirmed.
Yes, I ran in to the servo number miss match :slight_smile: under control I think.

However, I have some unexpected behaviors here.
The ground steering is set to servo 1 and the main sail sheeting to servo 3.
Both servo responds as expected when armed and in manual mode.
When in acro mode, and unarmed, the rudder behaves as expected, the autopilot make correct corrections to the rudder when twisting the boat around.

To test the sheeting, the boat needs to be armed while in Acro mode (I don’t have gps signal indoors so it complains and needs to be forced to arm). Also have no wind so it might get confused like we discussed some month ago with the other controller.
Anyway, when this is done I would expect the rudder to be controlled by the roll stick via rate stabilization and the sheeting should move around according to the code without regarding any input from the throttle stick. But that is not what happens.
The sheeting servo is moving a bit, think that’s a good sign. However the rudder is turning without stick input. Sometimes a lot, like it was trying to tack but mostly it seems random movements. When I move the roll stick the rudder responds in the correct direction at first and is then overtaken by the autopilot. After a while the rudder have responded in the opposite direction to stick control :upside_down_face: something is not ok.
I think at one time the sheeting took input from the stick and moved as well.
I could just ignore this and try it outside with gps fix and some wind (but standing still).
Just feel that will not fix it. It should not tamper with the rudder at all in Acro.
What do you think?

Hum, if the stick moves the same way as the green roll bar on the radio page and the rudder is correct in manual you should be good to go and try it out on the water

Yes it does.
Okay, will do. There are several thunderstorm coming this weekend where I am but maybe get a chance in between them.

Maybe I’m dense, but I don’t think I can display WindDirApp in my quick view. I’m only seeing “wind_dir” and this appears to be the true wind angle. I have the latest firmware and mission planner.

WindDirApp and WindDirAbs are in the SAIL data-flash log on the SD card, you only get the true wind direction in real-time via mavlink i’m afraid.

Bummer. Live apparent wind info in the quick view would be really helpful for manual steering to the apparent wind angle. Is it terribly difficult to expose that data to MavLink?

-P

its quite easy to expose sort of, that is it is very easy to write apparent wind rather than true using the wind message. However we are then using the wind message out of spec, this can potentially cause confusion between vehicles and ground stations ect.

The correct way to do it would be to add a new sailing mavlink message, but then it is quite a lot of work to get it into all the various ground-stations ect.

maybe we could use the airspeed message or something, I will have a think. as you say it would be nice to have, helps when setting up windvanes also.

In the mean time I can show you where to change the code or I could build you a code than reports apparent instead of true.

RE: Custom Build or Where to Change Code
-Definitely, both!

I think I understand there are two issues, sending the message (currently not supported) and then preparing the ground station software to receive the message. I would be interested in learning more on the ground station end because I want to modify the HUD some day. Way outside of my skillset but that’s what hobbies are for.

the code change would be to change this

to wrap_360(degrees(get_apparent_wind_direction_rad()))

and I guess you would want the apparent wind speed also so you can change get_true_wind_speed() to get_apparent_wind_speed()

bit of a pita having to change the code tho, as I say I will see if we can add a better way to do it.

Excellent, so in this situation we aren’t changing the communication spec, just swawpping apparent wind dir and speed for the absolute values. So all the navigation code running on the board will still function properly if trying to autopilit, but the mavlink telemetry is reporting apparent instead of true until we get a proper system for reporting both.

-P

1 Like

First attempt at building was a fail, the Cygwin method did not work. I’m on Windpws 10, so I went with WSL. That was successful and I’ve built vanilla rover! But because the source now exists on the WSL ubuntu file system, I have no freakin idea how I’m supposed to go edit the source code or even access the firmware that I jst built to load it onto the board. Frustrating but a worthwhile exercise since I’d like to be able to tinker with this stuff eventually.

I work with WSL alot. My typical work flow is to edit the source code with programs in windows, and do all of my compiling and git commands in Ubuntu. You can access all of your Ubuntu folders in a path similar to this:

C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs
1 Like