## Monday, October 31, 2011

### New wind vane calibration

In the second post of this blog, I described a rather complicated method to calibrate the Raymarine ST60+ wind vane transducer. I have now identified a simplified and more robust way to do the same.

The following figure illustrates the interface between the Raymarine transducer and the microcontroller.  With the regulated supply voltage now reduced from 8 to 7.25 V, the wind vane produces 2 analog signals (the green and blue wires), varying between 2.4 and 4.8 volts.

The analog signals are fed directly to two ADC (analog-to-digital) pins of the microcontroller. The microcontroller uses a 5 V volt reference to convert the signals to a number ranging from 0 to 1023.

This is the form of the signals produced when the vane is rotated through a complete turn from 0 (wind from the front of the boat) to 360 degrees, clockwise from above.

When the mast was down (instead of climbing up there), I manually rotated the vane and recorded the blue and green ADC signals at several angles around a full turn, first clockwise and then counterclockwise.

Then the green/blue pairs are graphed as X,Y points in Excel.

This may look like a circle, but it is in fact a slightly eccentric ellipse, with its axis tilted, and its center slightly off the main diagonal. The next step is to find the equation of the ellipse that best fits these points. For this step, we use the NLREG software which has a convenient example of fitting an ellipse to data points.

Using the NLREG software, we obtain the following characteristics for the fitted ellipse:

Parameter        Final estimate
------------------  ------------------
Xcenter           741.363842
Ycenter           744.69208
Xdim               243.159241
Ydim               249.288046

The calibration technique consists in mapping the ellipse to a circle centered at the origin (0,0). For each green/blue measurement pair (x_green, y_blue), the apparent wind angle can then be calculated by the following procedure.

The equation reduces to:

And the measured apparent wind angle can be calculated as:

1. On a French forum, the exact inner construction of the Raymarine wind vane has been revealed. On this link:

http://www.hisse-et-oh.com/forums/equipements/messages/1262538-ca-sort-quoi-comme-signal-une-girouette-anemometre-raymarine

see the messages by LaJoliette and their attachments.

1. I just realized that the link above refers to the old-style ST60 masthead unit. For the new-style ST60+ unit, see:
http://www.videoacustic.com/sat/NO%20DATA/AZIMUT/service_manuals/service_man/Transducer/New%20Windvane%20ser%20man.pdf
for a complete description including electronic diagrams.

2. Here is an updated link for the ST60+ masthead unit service manual:

http://www.olajedatos.com/documentos/New%20Windvane%20ser%20man.pdf

2. Great post and interesting project in general. Specifically with the wind vane, how would you deal with a wind vane transducer that had 3 'phase' output.

Some units have 3 signals offset by approximately 120 degrees. I love the simplicity of the approach above but cannot quite decide two things.

1 - Does the phase offset being 120 degrees and not 90 throw everything out of the window with regard to this approach.

2 - It not, how best to deal with the 3 signals.

3. I suppose that you refers to the B&G wind vane, with the 3 voltages (S1, S2 and S3) described in the following link:
http://www.ockam.com/docs/TroubleshootingWind.pdf

I have already given some thought on how to adapt the calibration procedure to this arrangement, and here is where I am on this.
When considering the 3 voltages as points in a 3-D space, and visualizing the result in SketchUp, we see a circle slanted by 45 degrees vs the 3 axes, with his center somewhere on a line starting from the origin and extending at 45 degrees from each axis (using perfect sines as signals). One way to retrieve the corresponding angle is to slide the circle along this line until its center coincides with the origin, and then rotate the circle by 45 deg along either the x or y axis so as to get the circle in the x-y plane, with its center at the origin. Then we can calculate the angle from the x and y coordinates (the z coordinate being always zero by now).

In reality, the measured points would likely represent an ellipse (instead of a perfect circle), with the perpendicular axis not pointing directly at the origin, but having some offset. Thus we need to map the fitted ellipse to a circle looking to the origin. The math is likely more involved, but would represent an interesting exercise.

4. Do you have an idea of the voltages (and phase shifts) needed by a preST autohelm 6000