Noise of a straining transformer

02.09.2010 17:38

My lab power supply is now almost complete. It passes most tests I throw at it with flying colors except for one. When the output is even moderately loaded the toroid mains transformer is giving off a loud 100 Hz hum.

This is usually a sign that the windings are badly overloaded. Another warning sign that pointed in that direction were the thyristors in the preregulation stage that were dissipating more heat than I anticipated. This called for further investigation.

This is how the voltage on transformer secondary (blue trace) and capacitor (yellow) look like when the power supply is in short-circuit with current limit set to maximum. The gray trace shows transformer voltage when the power supply is idle for comparison.

Transformer and capacitor voltage oscillogram

The preregulator is working correctly here - it fires the thyristors in the correct moment so that the sine wave charges the 4700 μF tank capacitor just enough to replace charge lost due to load current during the previous cycle.

But that voltage drop on the transformer looks worrisome. Adjusting my SPICE simulation so it matches these measurements it gives peak transformer current at 17 A and RMS of almost 7 A. This is quite a bit above the 4 A RMS specification of the transformer.

Although I don't trust these simulation results completely they do confirm that components are getting overloaded. This is much more current than I accounted for in the design - I was counting on the stray inductance of the transformer and capacitor ESR to dampen the response a bit. With such current spikes it's no surprise thyristors are heating up.

The solution I'm looking into right now is to put a couple of power inductors between thyristors and the tank capacitor. They should provide enough reactance to smooth out the current.

Unfortunately to lower the RMS current all the way down to 4 A I would need a pretty big inductor. Bigger in fact than I'm willing to invest into right now, considering these things cost and arm and a leg to ship to this end of the world. For a start I'm ordering a pair of cheap bobbin-types from eBay. Although they shouldn't be enough according to SPICE at least I will be able to more accurately estimate the correct value.

Here's the simulation with the 680 μH inductor in place:

Simulated transformer and capacitor voltages

Green - voltage on transformer secondary. Blue - voltage on the tank capacitor.

Simulated transformer current spike

Current through the transformer secondary.

So, a few lessons learned: with a thyristor regulator RMS current can be even 3.5 times higher than the rectified DC current (compare that to the 1.6 derating factor you usually see on transformer datasheets). To get that down to a reasonable level you need expensive inductors, which eliminates one of the advantages over switch-mode regulators.

Posted by Tomaž | Categories: Analog | Comments »

One diode patent

05.08.2010 21:07

Everybody is talking about software patents and how big USA sue-me-sue-you companies are acquiring them in bulk for the most trivial methods and algorithms. Here's something that made me think that perhaps the "One click shopping" problem isn't limited to just the world of software.

Cut-out from Charging Specification for VL Series

This is a cut-out from Panasonic's Charging Specification for VL Series for their rechargeable Vanadium-Lithium batteries:

Notice the little notes below the schematics saying "Patent acquired"?

A couple of things don't make sense here. First, these circuits are so simple that most electronics engineers would probably came up with them given the specifications. There are a few circuits in that document that are actually more complicated than these and aren't marked as patented.

Secondly, why patent these in the first place? Isn't the goal of the manufacturer of batteries to sell as many as possible? Scaring potential costumers with potential for patent infringement in their products seems like bad practice. Is it just to prevent a rival from patenting it first?

Then again, after some searching on Google patent search I was unable to actually find the patent application for these.

Posted by Tomaž | Categories: Analog | Comments »

Leaky thyristors

29.07.2010 19:52

As you might remember, my lab power supply in-the-making utilizes a thyristor pre-regulator stage. When I soldered the circuit together on the final version of the printed circuit board it had an interesting glitch. Occasionally it would get into a mode where the regulation circuitry completely failed to work, pegging the output voltage to the maximum with ill effects to the longevity of the linear regulator down-stream.

The solution, as you will see, was simple, but the exact cause still puzzles me.

This is the critical part of the circuit:

Simplified thyristor regulator diagram

Here you see the transformer with a 30 V secondary and two full rectifier bridges with a common return path. The lower bridge simply produces a pulsating voltage (SYNC) serving as a synchronization signal for the control circuit. The upper bridge creates the regulated voltage over the tank capacitor. It has thyristors instead of diodes on the positive side which are triggered in the right moment with current provided by the control circuit.

Now here's what it looks like on the scope:

Thyristor regulator oscillogram

The regulator is working correctly on the left half of the picture. Set point is 8 V (as shown by the yellow trace) and almost no load. The control fires thyristors when the AC waveform on anode falls a little bit above 8 V (just before the blue or gray trace crosses the yellow trace) to cover for the negligible loss of charge on the tank capacitor.

But what happens at the third cycle? The gray thyristor fires at the correct moment, however the blue thyristor fires as well as soon its anode voltage gets high enough, charging the output capacitor way above the set voltage.

The immediate reason for this fault is because the combined blue and gray lines never fell to 0 V at the same time. Here's a close-up of the oscillogram: you can clearly see that the blue and gray waveforms intersect at 8 V, not 0 V. Since the control circuit depends on the SYNC signal (which basically provides max(Ublue, Ugray) function) falling near zero it never switches off the trigger current and mistakenly triggers the blue thyristor too soon.

Thyristor regulator oscillogram, detail

So the blue thyristor firing is a secondary effect. The problem already shows itself well before that, when the gray voltage gets pegged at 8 V. So what's happening here?

If it weren't for the SYNC bridge the blue and gray voltages would be weakly defined when the voltage over the transformer secondary is less than 8 V because all diodes in the bridge would be closed. However, the SYNC bridge diodes are conducting down to 0.7 V above ground, so the voltages should not be floating at 8 V as the 10 kΩ resistor makes a good connection to the ground.

Take a look at the instant marked with the red line. Here are the voltages at that instant on all the active components:

Thyristor regulator diagram, annotated

Note that the voltage on the SYNC bridge's 10 kΩ load is 7.4 V, meaning 0.7 mA is flowing through it.

Kirchhoff's current law says this current must come from somewhere. Where? At that moment voltages on all elements point away from the bridge, so it can't be a large leakage current because it would point into the wrong direction.

The only exception is the blue thyristor, however it would have to leak pretty badly to account for almost a milliamp of current. These thyristors are rated at 1 mA reverse current at 800 V. And furthermore it appears as if the current starts the moment trigger current starts flowing into the gate.

As I said, the practical discussion ends with the finding that some stray source of current is affecting the circuit. The obvious solution is to decrease the load resistance of the SYNC bridge so far that it is able to sink the additional leakage current. And it worked - after decreasing the resistance to 5 kΩ the problem went away.

However, the underlying cause of this anomaly remains a mystery to me.

Posted by Tomaž | Categories: Analog | Comments »

Light engineering

23.07.2010 18:01

My lab power supply is progressing steadily, with minor setbacks now and then. One trivial task that still needed to be done is putting lights into those nifty analog panel meters.

I ordered two instruments, a voltmeter and an ammeter, from Conrad. They come with fittings for (what I guess are) small incandescent bulbs for backlight, but no actual bulbs. Since I found incandescents a little too retro I decided to fit them with 3mm white LEDs instead. Luckily, they fit in almost perfectly.

I thought clear white LEDs I had would have a too narrow beam and wouldn't lit up the entire scale. So I decided to try my hand at Keith's LED diffusing technique.

It turned out that the single abrasive brush I had was a bit too rough and it ate through the clear plastic LED almost immediately. This was the best I could do, with the bulb still visibly deformed. I would do better to just use fine sandpaper:

Analog voltmeter, lit by one white LED

However, it turned out that when fitted in, the LEDs shine a bit upwards, so the nice bright beam on this photo turns into a single bright spot on the bottom. It actually makes no visual difference if the LED is frosted or not. So I left all subsequent LEDs in their original states.

I did notice though that most of the light was lost through the top of the instrument. So, the solution was straight-forward - put a white cardboard reflector up there.

Result as you can see is pretty good:

Analog voltmeter, lit by two white LEDs

By the way, the left LED is frosted, while the right one is clear.

Here is a close-up of the LED arrangement and the reflector on the top. I removed the metal spring fittings for light bulbs that were too tight and used LED's own leads sa simple spring latches. When the top cover presses down on them they sit pretty securely.

Panel voltmeter without the front cover

Finally, it's interesting to note that the 3 A ammeter has an internal shunt with the moving coil instrument connected directly over it, without any additional series resistance. The instrument itself has an instrument constant of 2.5 mA/A (e.g. 2.5 mA of current must flow through the coil to get 1 A reading).

These meters are advertised as accuracy class 2.5, which is pretty good considering that the shunt is a piece of metal, obviously soldered manually with little precision and gratuitous blobs of solder on both ends. Unfortunately I took the original shunt out before doing any measurements, so I can only speculate whether it actually lived up to its specifications.

Posted by Tomaž | Categories: Analog | Comments »

My Book power supply

13.05.2010 17:17

My external USB disk stopped working a while ago. It turned out the culprit was the little 12 V power brick which appeared completely dead.

Disassembled WD My Book power supply

I took it apart and poked around it with the multimeter. It's a pretty simple 30 W switcher using a PWM chip in a tiny 6-lead SMD package (marked 63813 - I'm guessing it's a 6-lead version of the 3813). Nothing was obviously bad, so the next suspect was the power MOSFET. I desoldered it and did a couple of tests and it worked as expected. I soldered it back and, surprise, everything worked perfectly.

Interesting. I recently see a lot of power supplies that fail because of bad soldered joints. Is the use of RoHS materials (i.e. lead-less solders) to blame? On a high-powered ones this usually have spectacular effects because the heating and arcing will make a big black spot on the board. But in this case the pins of the MOSFET looked perfectly OK.

Posted by Tomaž | Categories: Analog | Comments »

Regulator stability and capacitive load

10.05.2010 21:58

A lab power supply should work reliably under a wide range of loads. Capacitive loads are common - most circuits include at least one blocking capacitor on the power rail and this capacitor often defines the characteristics of the device as seen by the power supply. However capacitive loads are also the most problematic for the final linear regulator stage, because they affect the open-loop transfer function of the feedback.

Here's a simplified schematic diagram of a linear regulator:

Schematic diagram of a voltage regulator.

The differential amplifier block usually includes an op-amp, compensation circuit, driver and power transistors. Only its output resistance is shown here. The feedback comes from a voltage divider R1 R2 which is connected to the negative terminal. To calculate the open-loop transfer function Uout/Uin, the divider has been disconnected from the amplifier.

Amplitude Bode plot of a voltage regulator.

The solid line here shows the amplitude Bode open-loop plot for a typical setup. The op-amp has 100 dB of gain and has been compensated with a dominant pole at 10 Hz resulting in 100 kHz of bandwidth. Divider has 20 dB of attenuation. Say Rout is about 100 mΩ.

What happens when you connect a capacitor to the output terminal of the regulator? Together with Rout it forms a new pole (for instance at fp, shown approximately on the picture for a 4700 μF capacitor).

This creates a stability problem, because the plot passes 0 dB gain at a phase shift greater than 135°. If you look carefully, the loop is stable only if the new pole is created in two regions: at far left (less than 1 mHz) or far right (more than 100 kHz). This translates to capacitances between 1600 F and 16 μF.

The far left region obviously isn't interesting because it would require unrealistically large capacitors. However there is a range of capacitances greater than 16 μF that is occupied by common electrolytic capacitors that will put the feedback loop into instability.

This might appear as a grave problem at first. But it turns out there's nothing like a naked capacitor out there. Electrolytic capacitors actually have quite large effective series resistances. These will create a zero on the amplitude plot at around 1 kHz (for aluminum capacitors, somewhat higher for tantalum). The position of this zero depends solely on the tan δ (dissipation factor).

This changes the picture somewhat. Zero at fz (again shown approximately for a realistic 4700 μF aluminum capacitor) causes the plot to cross 0 dB at 20 dB/decade and makes the loop stable again.

So, such a regulator is actually stable for a much wider range of realistic loads than is apparent at the first glance. Long connection cables will further improve the situation. However, low ESR solid-state tantalum capacitors can still cause problems. These can be solved by increasing the bandwidth or with more complicated compensation networks, but these are left as an exercise for the reader.

Posted by Tomaž | Categories: Analog | Comments »

Magic trace

02.05.2010 12:48

A while ago I wrote about an old SMC barricade wireless router that's been acting up. It's still having weird issues with both wired and wireless interfaces, which magically disappear when I open the box. It's probably time to invest in some new hardware, but I gave it one last shot at finding the problem. It's most likely something trivial, like a bad soldered point somewhere.

Anyway, when closely inspecting the circuit board I found this interesting feature:

Detail of the SMC Barricade G circuit board

What is the purpose of the long U-shaped trace at the bottom of this photograph (click on the image for a larger version)? The via at one end doesn't appear to be connected anywhere (although it is possible I missed a connection on some inner layer).

It looks like an antenna, but is surrounded by the ground fill and doesn't have any obvious connections to the RF front-end above (plus this router uses two external antennas).

My guesses are some test feature for measuring the parameters of the circuit board (unlikely in a production version) or a small capacitance needed by some part of the circuit (provided it's actually connected. But really, why use this instead of one more SMD capacitor? The circuit already has a hundred of them).

Maybe it's just a modern integrated version of the magic/more magic switch.

Posted by Tomaž | Categories: Analog | Comments »

Thyristor regulator AC model

08.04.2010 12:40

It turns out that having a thyristor voltage regulator in a feedback loop isn't as simple as it seems. Actually, it's quite hard to keep the regulation stable over a wide range of load conditions and prevent it from oscillating. At least my previous experiments proved somewhat hard to adapt to work reliably in a pre-regulator regime where the load current can go from 0 to 2 amperes.

The stability problem is usually attacked by studying the circuit from the perspective of various well-known loop stability criteria, like phase and gain margin. However, this circuit is as non-linear as they get. Therefore Bode diagrams and such are out of the question without some major simplifications.

Basic thyristor preregulator diagram

Here's how the output voltage (thick) looks like when the reference voltage (thin) swings around a preset DC value.

Time diagram of input and output voltages versus time

Obviously, the output contains frequencies not found in the input, hence the claim that this is a non-linear circuit. The output looks like this because the output voltage

  • can only increase once every 10 ms (1 over 100 Hz, two times the line frequency), when the thyristors can fire, and
  • can only decrease due to load current discharging the capacitors.

This circuit behaves more like a switch-mode power supply than a linear circuit. Unfortunately, the usual state-space averaging technique doesn't work here.

However, it does seem possible to approximate the gain and phase diagrams for a single input frequency with a simple one-pole transmission function:

A(j\omega) = \frac{1}{1 + j\frac{\omega}{\omega_p}}
\omega_p = \frac{2 \cdot I_{out}}{U_{in} \cdot C}

Where C is the output capacitance, Iout output current and Uin the amplitude of the AC reference voltage component. Of course, this holds only for input frequencies significantly lower than the line frequency (say 10 Hz and lower).

This appears to be a good enough approximation to use in practice when applying phase and gain margin criteria. Of course, it only allows rough approximations (think nearest order-of-magnitude, not nearest third-decimal). But it does show how stability relates to current and capacitance. It also shows that the frequency of the pole depends on the amplitude, so a circuit that's otherwise stable may go into oscillation if it receives a large enough disturbance from its set point - something I've also seen in practice.

In conclusion, here's a couple of simulated gain and phase diagrams compared with the approximation given above. The dots are the result of a time-domain simulation of the circuit while the lines represent the transfer function of the model above.

As you can see, the simulated gain follow the model quite nicely. On the other hand the phase plot is a bit off the mark. However the error is usually on the side of safety, since the simulated phase shift is less than one predicted by the model.

Bode gain plot of a thyristor regulator

Bode phase plot of a thyristor regulator
Posted by Tomaž | Categories: Analog | Comments »

Integrator windup

30.03.2010 21:08

I'm playing with a thyristor regulator proof-of-concept circuit for my lab power supply. Right now I'm using an op-amp integrator in the feedback control loop and I stumbled upon this nice example of how integrator windup can screw up a control system's response.

Simple feedback control loop

Image by en:User:Ap CC BY-SA 3.0

The upper, blue trace shows the output voltage (plant output y in the block diagram above). The lower, orange trace shows the integrator output (u). The orange shaded area shows where the plant is roughly linear - when integrator output is outside those bounds, the thyristor control circuit is in saturation and the output won't change much.

This is the response of the system to a negative step in the setpoint, without any special measures:

Negative step response with ringing due to integrator windup.

And this is the response to the same input with the integrator output limited by a Zener diode:

Negative step response with limited integrator output.

And finally, just to show off, here are both positive and negative step responses on the same picture:

Two step responses of a thyristor regulator.

I'm more interested in optimizing the positive response, since that's what will be important here. The output will be regulated by a linear regulator which can take a moment of excessive power dissipation due to overvoltage, but it can't correct for an input voltage that's too low.

The delay after the step response is 30 ms, while the theoretical minimum would be 10 ms. I doubt I'll be able to get it much lower without compromising stability.

Now I just have to figure out how this model will scale up to the real thing.

Posted by Tomaž | Categories: Analog | Comments »

An electric anomaly

20.03.2010 19:26

Last week I got an email from Lucy Clarke asking me if I could explain how the following machine works and the readings she gets on the multimeter:

Diagram of the Lucy's machine
The coil is bifilar, meaning it has two winds of wire on it, one (heavier gauge) for taking power from DC and one (lighter gauge) going out to the multi-meter.
The coil also has a ferrite rod core so that, when the reed switch is open and there is no power, the magnets are attracted to the iron core, but when the reed-switch is closed and the power flows, it acts like an electromagnet and pushes away the magnet, so there is no 'sticky point'.
The peak reading on the multi-meter is 600V at 10.0A (...) When the rotor spins fast enough the voltage and the amps readings on the multimeter are off it's scale.

First, this is a variant of a brushless direct-current electric motor where the commutation is performed magnetically via the reed relay. A very inefficient one actually. For instance, it's only drawing power half of the time - ordinary two-pole DC motors will invert the direction of the current in the coil while it passes over the opposite magnetic pole, while this one merely switches the current off. There's also a huge air gap between the north and south poles of the permanent magnets reducing the strength of the magnetic field upon which the current in the coil can act.

If we forget about the moving parts for a moment, this device is very similar to an induction coil. Here's what an equivalent circuit looks like:

Model circuit diagram for Lucy's machine

On the primary side is a constant voltage source that gets periodically connected and disconnected to and from the primary side of a transformer. On the secondary side is a resistor that represents a model of the multimeter.

Here's how primary and secondary side voltage and current look like versus time for such a circuit in somewhat idealized conditions. The switch is closed in A and opened in B time interval:

Primary and secondary voltage and current versus time for Lucy's machine.

What is happening here? In time interval A the voltage of the source U1 appears on the secondary side and runs a current U1/R through the resistance of the multimeter. This current is also reflected on the primary side (the dotted line in i1(t) graph). However because of the self-inductance of the primary coil, the primary side current also has another component that is linearly increasing with time. So while the magnetic flux in the core of the coil due to U1/R on the primary side is compensated by the same current on the secondary side, the flux due to the self-inductance of the primary side is not (current difference I0 on the graph). This means that the magnetic flux in the core is steadily rising during interval A.

Magnetic field cannot collapse in an instance, so when the relay is switched off and primary side current is interrupted the only way it can be be sustained is by current on the secondary side. This effect causes the secondary side current to jump by I0, which then exponentially decays towards 0 as energy is lost in the resistance. This is also the principle of flyback converters.

Now we can explain the high voltage reading on the multimeter: when the multimeter is in voltage measurement mode, it has a high resistance between its probes (say 100 kΩ, but probably much higher). This means high R and a high R I0 voltage on the secondary side, since I0 current is forced through it by the collapsing magnetic field of the coil.

Since U1/R is negligible, the whole 0.5 A current budget appears as I0. 0.5 A times 100 kΩ gives a pretty respectable theoretical peak voltage. Of course, in practice this is much lower, but still high enough to affect the well-being of a multimeter.

On the other hand the high current readings are harder to explain. The theoretical peak current on the secondary side can't be higher than the peak on the primary side with this model. If the current limit on the power supply was working correctly, I can only offer some hand-waving explanations. One is that at higher speeds the machine gets in resonance with a tank capacitor in the power supply. So while the average current stayed below 0.5 A, peak current could have been well above that. The other is that some auto-ranging digital multimeters are very bad at measuring quickly changing values and may show completely wrong readings before they settle.

This analysis also ignores the effect of the permanent magnets moving in front of the coil. The effect of those is hard to judge, but my guess would be it is pretty insignificant due to the large air gap. For reference, I've included an idealized graph of the magnetic flux Φm through the core that is contributed by the magnets. If anything, the effect of this flux counteracts the self-induction of the coil and only causes the inducted voltages and currents in the circuit to be lower (which is logical, since the wheel is taking some energy from the system).

Posted by Tomaž | Categories: Analog | Comments »

Lab power supply

26.02.2010 20:56

I've been wanting to design and build a new 50 W lab power supply for some time now. It has turned out to be one of those projects that you think will take a month tops and then the lack of time stretches it to half a year and counting.

The minimum requirements are 0 - 25 V and 2 A with an adjustable current limit. I've considered four approaches for such a design:

  • A plain linear regulator,
  • linear regulator combined with a transformer with multiple taps,
  • linear regulator with a thyristor pre-regulator and
  • switched-mode regulator.

These are pretty much sorted by ascending complexity and efficiency.

The power requirements are just barely within the reach of the first option. However that would require a big passive heat sink (I want to keep away as far away from unreliable fans as possible). Plus building a new device that would operate around 10 - 20% efficiency most of the time doesn't really feel right. So scratch that.

I spent quite a bit of time researching the second option. In fact, I have an almost completed design for it on the drawing board right now. It uses a two-tap transformer with a relay to switch between them - transformers with more taps aren't easy to find. The regulator part is roughly based on the 0-30 V power supply from Electronics lab.

Still, I'm not really happy with it. I have doubts about the longevity of the relay and worst-case heat dissipation is still uncomfortably high.

By the way, the original Electronics lab design is pretty broken in several ways and I strongly doubt that it meets its specifications - but that is perhaps a topic for another post.

I'm not going to even consider building a switcher for this purpose. It's noisy and has worse regulation characteristics than a linear design. Not really something I would want in a lab supply. Plus finding appropriate ferrite cores for switchers is always a pain.

So, right now I'm looking into a thyristor pre-regulator. There's a pretty good application note from Linear technology that has a basic circuit. It looks solid on paper and I'm going to give it a try tomorrow to see how it behaves in practice. If it works as advertised I'm more than prepared to go back to the drawing board with this.

Posted by Tomaž | Categories: Analog | Comments »

This time multimeter survived

23.11.2009 18:07

This is how Apple Time Capsule's power supply looks from the inside:

Apple Time Capsule power supply, component side

It's quite small for a 30 W switcher. The label says Flextronics P/N 614-0414 and it's rated at 5 V 3.0 A, 12 V 1.2 A.

Apple Time Capsule power supply, solder side

What isn't obvious from the picture is that whoever designed this decided to leave out bleeder resistors. Combine with some quality high voltage capacitors that can hold their charge since my last visit and plastic wrapping around the circuit that can't be removed in any trivial way and you got a very nasty little trap.

The supply is now obviously completely dead (better it than me I guess) - it's not showing any signs of life on the secondary side. I'm not sure if it's because of the short circuit through my body or if it was broken to start with. Although I think the second possibility is more likely. If the switcher was working the capacitors probably wouldn't stay charged that long.

The next step I guess is to see if the computer and the hard drive work if I connect them to another power supply. But that will have to wait. I think I had enough Apple for one day.

Posted by Tomaž | Categories: Analog | Comments »

Motor-generator set and TEMPEST

14.07.2009 22:18

A few days ago I read of another attempt at recognizing key presses by analyzing noise generated by the computer on the power line. That's another one to add to the list of so called TEMPEST attacks - ways to gather information via side channels without having physical access to the computer itself, for example via stray radio-frequency transmissions or signals leaking to power and other lines connected to the machine.

The general consensus seems to be that the best way to prevent any secrets from leaking out of your datacenter through power lines is to have a motor-generator set between your private and public power grids (basically you have a large electric motor on the public side powering a generator that powers the private side). The idea is that since power is transmitted via a mechanical shaft any electrical signals present on the private side would be lost.

Why exactly is that so? A motor turning a generator is a dynamic system just like an electronic filter (or the suspension system of your car for that matter). The basic mathematics that comes from system theory doesn't change with the implementation (whether it's electrical, mechanical or something more exotic). The only thing that matters in the end is the transfer function between the input signal on the private side and the output signal on the public side.

Motor-generator set diagram

Let's look at the simplest example: a DC motor connected to a voltage source that is powering a DC generator via a heavy shaft. The input signal, that is emissions on the private side, is modeled by the alternating component of the source voltage ui and the output signal on the public side is the generator's open-circuit voltage uo. This model is a bit different from reality where the source of the signal is on the generator side, but this way it's easier to understand and the conclusions hold for the other case as well.

Since there's no load in the generator, its torque on the shaft is 0 and the output voltage has a nice linear relationship with the angular velocity ωm of the shaft (in the ideal case):

u_o = k_g \omega_m

On the other side of the shaft, the electric motor provides again a linear relationship between its driving voltage, the torque M exerted on the shaft and the angular velocity of the shaft:

M = k_u u_i - k_\omega \omega_m

Plug this relationship into the rotational version of Newton's second law, and you get the following linear differential equation for angular velocity:

M = \alpha J
\dot{\omega}_m J + \omega_m k_\omega = k_u u_i

Where J is the total moment of inertia for the rotating part of the machine (shaft and rotors of motor and generator). Now do a Fourier transform:

(j\omega) \Omega_m J + \Omega_m k_\omega = k_u U_i
\Omega_m = U_i \frac{k_u}{k_\omega} \frac{1}{j \omega \frac{J}{k_\omega} + 1}

Add the simple linear relation for Uo and you get the final, idealized transfer function:

U_o = U_i \frac{k_g k_u}{k_\omega} \frac{1}{j \omega \frac{J}{k_\omega} + 1}

If you ignore the constants in that equation, you can see that this is an ordinary transfer function for a first order low-pass filter. It has a single pole (at J/kω), which means that the attenuation of the filter falls by 20 decibels each frequency decade.


This is a frequency characteristic you might get for example for a simple RC or LR filter. So why go through all the difficulties of having to maintain a mechanical machine in your basement?

The answer is clear when you consider that the cut-off frequency for such a mechanical beast can easily be in the order of millihertz (think about how long it can take for a large motor to ramp up). Add a flywheel to the shaft (increasing J) and you can push it down for another few of orders of magnitude. Useful signals you might want to eavesdrop start beyond the kilohertz range, so you're seeing at least 120 dB of attenuation - well beyond any chance of recovering the already weak original signal from thermal noise.

To make an electronic filter with this performance you would need some pretty large coils and capacitors. And also keep in mind that a large amount of DC power needs to pass through the filter with a little loss as possible, which makes any kind of an active filter a big problem. There are no op-amps that will power a datacenter from their outputs.

An additional problem with electronic filters in this role is also that when you're talking about this level of attenuation, it's hard to get it right. Large coils get problematic because of stray capacitances between the windings and so on. Large physical separation between the private and public sides is just about the only thing that reliably reduces cross-talk.

A mechanical system doesn't have these hard-to-predict channels and a rotating shaft provides a convenient way to separate electric parts as much as required.

Posted by Tomaž | Categories: Analog | Comments »

Weather machine

28.06.2009 21:16

Here's another piece of electronics I saved from being dumped in a landfill: it's a wireless temperature and humidity sensor from one of those home weather stations. My sister gave it to me after I expressed my interest in it, but unfortunately I was too late to save the broken base station with the receiver. Now I'm playing with the idea of building a new receiver from scratch.

On the outside the sensor has a couple of buttons for setting up its connection with the receiver, self-test and choosing temperature display in Celsius or Fahrenheit (Kelvin fans are left out in the cold). There's a small LCD display on the unit that shows the current sensor readings.

Weather station transmitter, top side

Top side

Weather station transmitter, bottom side

Bottom side

There are no markings of any kind that would identify the manufacturer. That could be intentional, guessing from the sloppy way it's soldered together. Looks like the cost of assembling one of these things together was the primary concern of the designers: there's a single IC in the middle that uses direct chip attachment. Everything is SMD except for a couple of through-hole components that appear to be soldered by hand - in fact, whoever did it forgot to solder one of the pins of the trimmer capacitor (so I'm wondering if the base station was actually working just fine). Battery, buttons and LCD display all connect to the PCB by just being pressed against it - connectors really must cost a fortune these days.

Here's a schematic of the RF part. It appears to be a classical case of a cheap transmitter in the 433 MHz band. Basically it's a tuned oscillator: you have an amplifier and two tuned resonant circuits on both sides. One is a R433A SAW resonator and the other is a LC circuit that can be tuned with the trimmer. Because of the resonance the feedback can be minimal. In this case just the parasitic capacitance in the transistor's base-collector junction (Cbc) appears to do the trick. The antenna is just a fancy trace on the circuit board. I'm guessing there's only a simple amplitude modulation going on: either the transmitter is on, or it's off. But I have yet to hook up an oscilloscope to the circuit the verify that.

Schematic of a 433 MHz weather station transmitter

I'm planning to build a simple super-regenerative receiver, reverse engineer the data protocol and hook it up to an Arduino or some similar microcontroller. I know I could probably get a receiver module already built, but I want to get my hands dirty and finally try working with some RF circuit designs.

What I found so far on the internet seems encouraging. There's a really nice document about super-regenerative receivers by Eddie Insam and the protocol for weather stations has been broken before.

Posted by Tomaž | Categories: Analog | Comments »

A cubic inch of Ethernet

10.06.2009 16:28

Back when I was a student I designed and built an UTP cable tester. It's a battery operated hand-held device that uses finite state machine (more exactly a Moore automaton implemented with ROM and some logic - no microcontrollers with unreliable software here) to control some simple analogue circuits that check for proper connections and polarity of pairs in a standard Ethernet cable.

It was designed from the start to have two separate parts that need to be connected on the opposite ends of the cable. One part plays an active role and has all the logic and the diagnostic lights, while the other is a simple passive terminator with a diode circuit.

At the start I implemented both in a single case for simplicity, but that meant that you had to be able to bring both ends of the cable into one spot. Since I'm planning to lay some cables in my new apartment in Ljubljana I went on and made a second, separate terminator so I will be able to test cables once they are already fixed on the walls.

UTP cable terminator, before closing the box

I didn't bother to make a circuit board. It's going to be sealed shut and filled with hot resin, so nobody will be able to see the rat's nest anyway.

UTP cable terminator, finished box

On the second though it would probably be better if I made a metal box that would provide some shielding. But I had this piece of plywood at hand and no conductive paint. It works this way just as well and it's not something that will be in continuous operation anyway.

UTP cable terminator, painted black

Finally I gave it a coat of black paint to match the metal box of the tester.

Posted by Tomaž | Categories: Analog | Comments »