Taking A Beating
In accordance with a new task sharing initiave between myself and one of the engineering students who is working on the control systems of the boat, I am now going to tackle one of the simplest, and yet most infuriating problems that needs a solution before we can take on a pond, let alone the Atlantic. The issue is beating, and not your wife.
Beating is the action carried out in order to sail upwind. That’s my definition, and I’m sticking to it. It’s simple, very simple. Here’s the problem:

This is a graphic displaying the simplest type of beat to compute, where the desired heading is directly into the wind.
You’re at point A, and you want to sail to point B. Unfortunately, the vector BA is parralel to wind direction, and you can’t sail upwind! Luckily, you can sail right up to 45 degrees to the wind direction, so the solution is to set waypoints (which are marked in red in the above graphic) and beat or zig-zag, towards your destination.
I call this the Simple Beating Algorithm:
- Turn 45 degrees to port
- Sail 10 meters
- Turn 90 degrees in the opposite direction to the previous turn
- Sail 10 meters
- If arrived at desired location, break
- Goto line 3
This is quite simple to implement: the boat already has a compass and a wind direction meter, and it will soon have a paddle wheel to determine relative speed to the water. That’s enough information, with the aid of an accurate timer, to sail a five or ten meter leg 45 degrees either side of the desired heading, before tacking ninety degrees and continuing the beat. Simple, as I said.
Unfortunately, that ain’t all there is to it, folks.
The complex part comes when the desired heading isn’t directly upwind, but is still within the dead zone. That is to say, the desired heading is greater than 315 degrees and less than 45, assuming the dead zone is 45 degrees either side of the wind direction. In this scenario, a simple equal length leg zig-zag approach is not suitable, as for every second leg, the bow would be pointing into the dead zone.

In this graphic, it can be seen why it is ineffective to follow a simple beating algorithm when the desired heading is inside the dead zone but not parralel to the wind direction.
The above graphic is an example of a heading inside the dead zone, but not parralel to the wind direction. For clarity, the desired heading is just inside the 45 degree dead zone, although the principle holds for all headings not parralel to wind direction. (I do feel I’m using the phrase parralel to wind direction an awful lot, but it’s necessary for clarity.) In the above graphic, the simple beating algorithm is used, however, it can be seen that the legs where the boat should be in a starboard tack, it is in fact in irons, or stuck in the dead zone. This displays why the simple beating algorithm is insufficient. It’s a shame, too, because the simple beating algorithm is damn simple!
This leads me into what I’ll imaginatively call the Complex Beating Algorithm. It’s clear that the angle to the wind must be taken into account to avoid deliberately tacking into the dead zone.

In this graphic, the desired heading is inside the dead zone. Theta is the angle between the desired heading and the wind direction Theta is positive if the desired heading is starboard of wind direction.
The above graphic shows the angles of the port and starboard tacks when beating. By using these angles, which are always at the edge of the dead zone (handy, that!), we can be sure that the boat never gets stuck in irons while while beating. So, we have fixed angles, which are the same as the simple beating algorithm, so what’s different?
Variable length legs while beating, that’s what. Using some good old fashioned trigonometry, the correct lengths can be ascertained.

This graphic show the course dictated by the Complex Beating Algorithm.
If the angle Theta is positive, the port tack leg can be the lengthened. To keep the boat on it’s overall course, the algorithm then also shortens the starboard tack. The situation is simply reserved is Theta is negative. Pseudocode time:
if (Theta <= 0) {
port_tack = 10/Cos(Theta);
starboard_ tack = 10 * Cos (Theta);
}
else {
port_tack = 10 * Cos(-Theta);
starboard_tack = 10/Cos(Theta):
}
The above algorithm falls down when Theta isĀ +/- 45 degrees, as there is a divide-by-zero error. However, when the boat is at +/- 45 degrees, the boat should be out of the dead zone, and so the complex beating algorithm would not be invoked.
I apologise if the above post is overly simple. I have tried to explain my logic clearly. - D.N.T. (01/11/08)
Sounds like a good plan. Let’s get enough sensors, a couple of servos and a handyboard from the engineers to test these algorithms on a desk setting (or just use the boat directly in the engineering building). We could even order duplicate servos to the ones on the model boat. I’d like to see working algorithms coded and ready to go on the boat before the project management report is finished. I’d like to see photos (and a short video?) here on the blog at around this time too.
My father has something to say about this project on the subject of Ocean Currents