APMrover -> APMsail

Some of you might have read my blog posts about ny autonomous sailboat. It is now time to implement my control algorithms on the APM. 

My plan is to start with the APMrover code and replace some parts with my code. There are a few changes that i need to make and i would really appreciate some advice from those of you that have worked with the code:

Add wind sensors (wind angle and wind speed)

These are i2c sensors and it shouldn't be to hard to read the data and store it in a data structure. for tuning reasons i need to store them in the log file and send them over Mavlink as well. 

Calculate sheet angle given windspeed and apparent wind angle (AWA). 

The position of the sail is controlled by a servo output. My thought is to add an update_sail function to the AP_Scheduler since the sail position independent of mode. Or maybe not. Stopping the boat by pointing it to the wind and releasing the sheets might be something i want to do. 

Calculate where to steer

This is where it gets interesting. Pointing the boat to next waypoint or using XTE is fine as long as the AWA is more than something like 35 degrees. Less than that and i need to beat to get to the waypoint. 

where would you suggest i implement this in the code. I would like to reuse as much of the existing code as possible.

My approach is to start as simple as possible. When i it works i can implement it in a more advanced way with libraries and a better following the existing code patterns. 

Any advice would be appreciated. I have working Arduino code, but i would love to integrate it into the APM environment. 

/Magnus

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi.

    Have you had any progress with apm-sailboat.

    I have a onemeter which i have tried to steer with arduino.

    I started with Arduino mega + Adafruit gps shieldm + Minimu and some own programming.

    Now i have a APM board set with Ublox gps-compass and 3dr telemetry.

    Im wondering how far is the day that we could have a apm-sailboat sailing.

    -Timo

  • Hi Magnus

    I'm new to this site, but I joined because this topic got my attention. I'm also interested to implement "sailing"parameters into a APM. 

    I started build my own autonomous sailboat some years ago but due to family life and renovating two houses the time is not on my side to develop my project. 

    My setup is on a electric rover at the moment with no sails. I use a 32 bit Arduino DUE board with wind vane, gps, rudder servo, sheet servo, compass (tilt compensated) connected to it. 

    I have been looking at the APM module to replace the DUE but I thought it might be problem to add code for sensors like wind vane and modify the code for upwind performance ("kryssa" in swedish). 

    How far have you come? It is almost a year ago you posted this topic. 

    /Jeppe

This reply was deleted.

Activity