Another idea for wind speed and direction sensing - evaluation please!

MFB

Senior Member
Not many details on the Elektor web site but get the impression they will be cover a number of techniques in next months article.
 

PaulRB

Senior Member
Using 4 ultrasonic sensors I presume.
Why 4? I would have thought only 2 were needed (meaning 2 emitters and 2 detectors). Is it to compensate for the variation in the speed of sound due to pressure/temp/humidity?

Paul
 

AllyCat

Senior Member
Hi,

Perhaps he should have used the term "transducers" and then 2 + 2 = 4 :)

Actually 3 transducers is "sufficient", typically mounted at the cormers of an equilateral or a right-angled triangle.

Ultrasonic transducers are/were often supplied in either "transmit" or "receive" versions (the transmitters having a narrower bandwidth). But for a short-range time-of-flight windspeed system which I developed many years ago, I used only "receivers". Then the time-of-flight could be measured both "forwards" and "backwards" to compensate for variables such as the speed of sound. Receivers made satisfactory transmitters but transmitters didn't seem to make good receivers.

But we're going OT. I hope this thread will stay with the OP idea of converting the Maplin / Fine Offset anemometer, as there's still much to try and discuss. ;)

Cheers, Alan.
 

g6ejd

Senior Member
I've just received my anemometer from Maplin, I can hear the reed switch on/off as it rotates, the next job is to fit either another reed switch or some Hall effect sensors, in the latter case 4 but as has already been mentioned, the magnet may not give enou isolation between switches if its too strong, so some experimentation required.

I also have an offset cup anemometer head (for a rotavecta, it cost me £17 delivered) but I won't fit that until I have solved the sensor aspect.

I'm looking forward to all of the experience and experimentation this project will give me, can't wait to really get going.
 
Last edited:

g6ejd

Senior Member
OK, the maths for this are as follows:

1. The rotor speed varies up/down over a complete revolution, not confirmed, but probably sinusoidal. That's in the time domain.
2. Convert the rate of change into degrees.
3. Differentiate the rate of change and when this reaches zero is the wind direction derived from the degrees scale of stage 2.

There is little to measure, other than determine rate of change over a number of fixed samples, three in this case. So measure time between pulses.

You need a reference position, hence the e.g. North hole in the disk. Measure the time between the reference and the first hole at 120-degrees, then measure between that and the next at 240-degrees and finally that and the north reference.

Much as Hippy has outlined in his analysis.
 

g6ejd

Senior Member
Why 4? I would have thought only 2 were needed (meaning 2 emitters and 2 detectors). Is it to compensate for the variation in the speed of sound due to pressure/temp/humidity?

Paul
Yes 4 or 2 emitters and 2 detectors. I'm going to try out 2 sr04 units as the work is done.
 

AllyCat

Senior Member
Hi,

A month since the last post, so has anybody else made any progress with this project, or is the thread destined to die like so many others? Personally, I have a PICaxe version running "on the bench" (with a stable artificial wind), much as I proposed above. So I can now answer some of the questions raised earlier in the thread, at least from the perspective of my own "requirements specification": that the functionality should be "comparable with, but better" than the present Fine Offset sensors. To put some numbers on that, the FO wind vane costs £10 (as a spare part from Maplin) and is accurate to about +/- 30 degrees "out-of-the-box". But that can be improved to ~20% by modifying the magnet, and probably to around 10% simply by numerical averaging. The Power Supply is 3 volts, with the anemometer averaging ~50 uW and the vane <1 uW (yes, micro-watts) drain from the two AA cells.

Adding a "tag" to the Fine Offset anemometer rotor was easy, requiring only scissors, a junior hacksaw blade, glue and perhaps a small file. FO appear to have used ping-pong balls as their "cup template", since they have identical dimensions to Derek Weston's original design. Therefore, I followed his instructions exactly, cutting the tag (it's about 4 square cms) out of an empty margarine/spread tub. FO don't seem to have compensated for the weight of their magnet, so mounting the tag on the opposite cup actually improved the gravitational balance. Then, sticking fingernail-sized pieces of adhesive PVC tape into the appropriate cup(s) optimised the balance.

For now, I have continued to use the original magnetic reed switch, for ease of modification and its "zero power" consumption. No need to even pull off the rotor, I just removed the screws underneath, drilled a new mounting hole in the PCB and reassembled with the reed a few millimetres off-axis. Now, for each revolution, the anemometer sensor generates one pulse about 50 degrees wide (active low), with a second pulse and two "spaces" each about 100 degrees (still usable with the original FO transmitter and station). The three larger arcs are not identical (which has actually proved quite useful for initial evaluations) but a "definitive" assembly might incorporate some form of three-axis (or "degrees of freedom") "vernier" mounting adjustment (e.g. using screw-threads / nuts) to optimise the arc angles.

Of course the magnetic reed switch has some limitations, particularly its hysteresis and questionable long-term magnetic stability, but I doubt if they're significantly worse than of a Hall device. For a "precision" measurement, optical sensing (as used by Derek) could be significantly more accurate. Probably a practical modification for the FO sensor, but requiring considerably more mechanical adaptation. Also, the sensor must work in direct sunlight, but the plastic is white and rather translucent, so some optical screening may be needed. Using (PWM) modulated light might be wise (also to reduce power consumption) but that does rather stray from the "single-pin / cable-pair" concept.

Since the software must measure both "pulse" and "space" for consecutive arcs, I used simple polling of the pin for a time of nominally two seconds. "Hits" (counts) are accumulated into four "bins" (variables) with a total timeout (to complete the last revolution) of three seconds, which accommodates windspeeds down to ~2 mph. Approximately 1000 hits are recorded, which are then scaled to give four arcs, totalling 360 degrees for convenience. Resolving the angles to only integer degrees, and the limitations of PICaxe's 16-bit division, are "bottlenecks" in the computation, but the resulting "quantising noise" (i.e. line-width in the resulting graphs) is useful in showing the "sensitivity" of the result to measurement discrepancies.

My initial "spot measurements" at various wind angles were tedious and produced rather inconclusive results. So I mounted the anemometer on a geared stepper motor, which the PICaxe advances automatically by one degree after each measurement, for a total of one revolution. Each block of data (i.e. measured angles, completed revolutions and elapsed time) is stored in an I2C EEPROM for later anlaysis, initially downloaded "raw" into a spreadsheet program for processing, and now via an equivalent algorithm in PICaxe Basic.

The first attached graph shows the four time / angle (cf speed) waveforms and the second is with the bias (average windspeed) subtracted. The peak-peak amplitudes of the directional components are only about 10% of the windpeed, so the directional computation is likely to be very susceptible to wind gusts and to variations in sensing of the magnetic field. But 10% variation should avoid any significant uncalibration of the "anemometer factor", or the need to invert (divide) arc-times to give rotor-speed (just negate the biassed values).

The four waveforms are not perfectly sinusoidal, nor in exact quadrature, but probably "good enough" w.r.t. the other intrinsic errors. It should be easy to compensate for the phase offsets (using sine and cosine), but variation of the pk-pk amplitude versus the magnitude of the sector angle seems more complex. So I simply combined (subtracted) values for opposite sectors, to produce (signed) X and Y components. Then calculated ARCTAN, using eight octants, each divided into just two "piecewise linear" sections (giving ATAN accurate to within a degree). The second set of attached graphs shows the X-Y components with the computed "error" spread (difference of result from expected direction) in yellow behind, and finally the overall response from 0 to 360 degrees.

In conclusion, this method does seem to give viable results, perhaps comparable to FO's separate wind vane. It potentially uses "zero cost" hardware, but calibration if far from easy and I suspect that accuracy may be highly affected by wind gusting and overall stability (long-term repeatability) of the rotation sensor. However, it does offer the potential of measuring wind speed and direction on a single PICaxe pin. So, if anybody can devise a method to measure humidity on a "Touch" input pin, then perhaps a complete "Weather Station on an 08M2" becomes a possibility. :)

Cheers, Alan.
 

Attachments

AllyCat

Senior Member
Thanks Derek,

Welcome to the forum. Would the "W" stand for Weston by any chance? We don't have too many PhDs on the forum. ;)

All that functionality and the program memory is only just over half full! But then I always have been a fan of Assembler.

Now all I've got to do is work out how to make a "chopper" (and find some time for everything else). :)

Thanks again, Alan.
 
Top