Tachometer Design and Development

For many years I struggled to make a tachometer work with this system.  The problem was not the electronic devices themselves, but actually the quality of the AC being produced by the wind turbine.  I was very surprised by the simplicity and effectiveness of the solution I finally came up with.  I was even more surprised to learn that this does not seem to have been done before, even though the ideas I used have been applied many other places for a long time.  I’ll try to explain what I did.

The Polyphase Tachometer

The tachometer uses features of a microcontroller and its programming together.  The microcontroller shown in the diagram is a PICAXE, but any microcontroller will do.  Three input pins monitor the 3 phases of the AC output of the wind turbine (a, b, c).  At the same time, the program in the microcontroller monitors these inputs with interrupts (not pulse counters).

The microcontroller is programmed with 3 interrupts, one for each phase, triggered when each phase of the AC is positive.  The program responds to each interrupt in its turn.  Once the interrupt for phase A has been triggered, the program ignores A and only monitors the pin for phase B.  The same goes when the signal is received on the pin from phase B, and it begins to monitor phase C. When a full cycle of interrupts is complete, it matches the complete rotation of the generator.  The time required to complete this cycle is the period of rotation and the speed is now easy to calculate.

This is the basic idea behind the polyphase tachometer. 

Note that the functions described above do not rely on the waveform of the AC on any of the phases.  As long as there is a signal to trigger the interrupt, the microcontroller proceeds through the program.  As long as all 3 phases continue to send signals, the program detects the rotation and computes the speed of rotation.

It borrows a similar function from some types of differential encoder, and uses them for measuring speed like the encoder, but doesn’t rely on an actual encoder device to work.  

This summary leaves many things not explained.  For those who haven’t experimented with microcontroller IC’s this may not mean very much at all.  For now, it’s enough to show that a microcontroller is a “computer on a chip” and an easy way to automate many mechanical and electronic things. 

Here is a brief summary of the kind of program needed to make the polyphase tachometer work.

Initialize:
1. Enable Input 1 to interrupt the program if signal rises through zero, and go to Interrupt 1
2. Enable Input 2 to interrupt the program if signal rises through zero, and go to Interrupt 2
3. Enable Input 3 to interrupt the program if signal rises through zero, and go to Interrupt 3

Interrupt 1:
4. If Input 1 is triggered, test whether Interrupt 3 is complete. Exit if not.
5. Measure the time since Interrupt 1 last ran & compute period & speed.
6. Set conditions allowing only Interrupt 2 to execute next.

Interrupt 2:
7. If Input 2 is triggered, test whether Interrupt 1 is complete. Exit if not.
8. Set conditions allowing only Interrupt 3 to execute next.

Interrupt 3:
9. If Input 3 is triggered, test whether Interrupt 2 is complete. Exit if not.
10. Set conditions allowing only Interrupt 1 to execute next.

This example doesn’t use the programming language of any specific microcontroller.  The logic works for any kind you prefer to use.

If you prefer, it can be expressed as a flowchart.  The thing with flowcharts is that they do not deal with events that happen at random times.  To compromise, if have laid out the underlying “tachometer” program as a generic series of operations that typically happen in any program.  The inputs happen at arbitrary times during the operation of the program’s other business.  They are not “called” by the program.  The inputs happen when the external input is received, and the program suspends all other activity to respond.

The flowchart also doesn’t illustrate that with a lot of noise on any input, the interrupt could be triggered multiple times.  Hopefully it is also seen that even when an interrupt is repeatedly started, it only counts as one, to the logic operators that are keeping track.

Here is my version of the Polyphase Tachometer program for Arduino.

I could develop a version for a PICAXE fairly easily.

The polyphase tachometer is almost completely insensitive to noise.  See below for some examples of the messy sine-waves that it can be fed, and still make sense of the rotation.  As long as there are two or more phases to monitor, it can distinguish rotation from noise.

 

Noise and Harmonics

A large part of the AC noise is harmonics.  If you are more familiar with resonance in vibration, it’s a good analogy.  Another part is the “Clamping” of the voltage by the battery voltage.  There is also a part of the distortion that comes from the current switching On and Off through rectifiers, which pulses the current in each phase.

 

Harmonics

Most motors and generators are designed to have very smooth AC sine waves, but inside each of these machines are windings of wire which are wrapped around iron slots.  I have come along and mounted rectangular magnets to the rotor.  Each slot is a point of magnetic attraction for these magnets.  Despite me efforts to “decog” the generator I built, each magnet is attracted to each tooth and it is easily felt when turning the shaft.  When turning it can be imperceptible but that attraction causes the shaft to slightly speed up and slow down.  The resulting ripple in speed causes a ripple in torque and a ripple in the voltage being generated.  With enough inertia most of the ripple can be damped out mechanically, but the blades of my wind turbine are nowhere near heavy enough to do that.  So there is a ripple easily seen in the oscilloscope traces.  The harmonic has a frequency about 18 times the shaft frequency, which corresponds exactly to the number of iron slots in the stator.

Voltage Clamping

The wind turbine’s output is rectified and used to charge a battery.  The result is that the AC side of the system can have the potential go generate much higher voltage, but the system voltage remains limited.  In my system, battery charging voltage is about 27 to 28 volts, usually.  On the AC side, this appears to be approximately 21 V-RMS on a multimeter or 28 Volts peak-to peak if seen on an oscilloscope.

Switching

Part of the connection to the battery is a rectifier, which is a semi-conductor switch that turns off against reverse current (negative AC) and on to allow positive current to flow.  This is what allows the AC generator to charge a DC battery.  When it switches off the current drops to zero, and there is an effect in the generator’s wiring due to this change.  The coils of wiring in the generator have inductance, and they respond to rapid changes of current load with “ringing”.  Again, the vibration analogy is apt, like a diving board flapping just after the diver has jumped off.

Tachometers (other kinds)

There are two categories of tachometers.  

  • Sensors: using external devices to generate a signal
  • Sensorless: detecting raw electrical signal

 

Either kind will infer the speed of a machine by the rate that pulses are received from the source to the electronic device that converts them into a speed.

Often, tachometers are based on devices like encoders, that deliver a clean, regularly pulsed signal that is easy for electronic circuits to detect and measure. On a wind turbine such as this, adding an encoder is difficult, and so would magnetic pickups or Hall-effect sensors.  Each requires a small power supply that is very stable.  Their signal must be delivered to the recorder without picking up interference.  This is often done with thin wires with noise shields.  Such wires installed in a wind turbine would be exposed to the wind, sun, ice and rain.  They would also need protection from abrasion, stretching, kinking, and picking up EM interference in a tower with high-current power wires beside them.  This is not a trivial problem.

Without a believable turbine speed, I gave up on data logging for a long time. The essence of my problem was that my wind turbine is an unregulated, unruly, wild AC generator. Worse, the current it produces is rectified to charge my batteries. When AC is rectified, the “switching” spike adds a pulse that ruins the perfect waveform, and the “clamping” to the battery voltage means that any similarity to a sinewave is lost when the peak is flattened off abruptly. Inevitably there is a lot of noise and harmonics in such an AC system.

I once again considered encoders, and even went so far as installing a pair of Hall-effect sensors inside the generator, but never got farther than that.  Either Hall-effect sensor or encoder would need extra wires coming down the tower, powered by the data logging system. Skinny little wires, subject to twisting as the turbine pivots, the weight of gravity as 50 feet of it hangs from the top, and noise injected from the power cables.

Looking at the wind turbine itself, which has a bundle of very heavy cables transmitting power to the ground, adding a few skinny little wires is not such a simple idea any more.

One might casually mention slip rings, but on a wind turbine that currently works just fine without them, no thanks!

The solution had to involve making a reliable RPM calculation out of the messy AC coming out at the bottom of the tower, but for a long time the noise filters that I tried did not work.

At the time I was unaware of the shape of the noise and harmonics that I can easily see on my oscilloscope now.  Even without it, I made many low-pass filters as they should be made, and by the numbers they should have helped.  I later discovered that the wide-range of speeds that these wind turbines operate (50 RPM to 600 RPM) makes any one specific low-pass filter useless.  Any LPF that works at low speed will suppress the DESIRED signal at high speed!

When AC is well regulated, or fits nicely into certain design conditions, there are plenty of tachometer solutions out there. The LM2907 tachometer chip is one, and I certainly gave that a try, but it also failed. My isolated system has no regulation at all, just the power of the wind to drive it, and the speed varies by an order of magnitude. 

The solution never really crystallized until I discovered that microcontrollers have INTERRUPTS, which activate a special function and stop all other processing when an event happens. After learning what interrupts do and how they work, it suddenly occurred to me that 3 interrupts, that proceed in sequence, could be used to identify one complete cycle of a 3-phase alternator.

I had hit upon the solution that the SEQUENCE of 3 phase power could be my RPM reference, rather than any single voltage waveform. I finally had a way to prevent the spurious spikes and wiggles from interfering with the count of turbine rotations. I was so excited to try out my idea that I promptly fried my pocket digital oscilloscope! Oh well, I’ve always wanted a REAL oscilloscope, and picked up a Tektronix 422 (older than I am!) from a surplus auction for 70$.

The Arduino interrupt tachometer did not care what the waveform looked like in my oscilloscope. I confirmed I had a working circuit, and after that, it was just a matter of boxing up the rest of the pieces.
I had my tachometer at last!

The truth-table above illustrates my way to control the program flow. As each phase passes from negative to positive, the rising edge is identified but any later changes to the waveform are ignored. The rising edge only causes the program flow to respond once, then move to the next phase. The program flow waits for the next phase’s rising edge, and repeats. Once it has passed through these steps it identifies a full cycle.  The time elapsed since the last cycle was complete is the period of rotation.  From there it is simple math, because frequency = 1/period. 

The sequence described above assumes that there is a single rotation of the electrical phases when the generator turns on complete rotation.  That is true for 2-pole electrical machines.  The cycle is completed twice per revolution in a 4-pole generator, 3 times in a 6-pole generator, and so on.  To have an accurate speed, the polyphase tachometer needs to be programmed with the correct number of magnetic poles.

Note that the program can only flow correctly when the phases occur in the right order. If the generator turns in the opposite direction, the sequence of phases doesn’t match.  There are ways to adjust the program that is summarized above to allow it to detect reversed rotation, and continue to measure speed.

Additional development of the polyphase tachometer’s program can include fault-detection, if desired.  Many possibilities can be suggested, although I haven’t explored them at this time.  Consider the case where a phase is continuously missed, but the other phases continue to proceed normally.  This would indicate an open-circuit on one phase – a potentially disastrous problem.  The polyphase tachometer can alert the user to this problem.