An AVR for the Lister diesel

I spent entirely too long pondering why Lister wouldn’t run the welder, and decided to build an automatic voltage regulator (AVR) for the generator to investigate further. My reasoning went as follows: If stepping the generator output voltage down to 200V from 240 made the welder happy, then surely regulating it down to 200V would do the same?

I started out intending to build a straight copy of the Homo Ludens AVR2 but it mutated and mutated eventually turning into the above circuit.

The AVR2 is simple and ingenious, but:

I wanted an accurately defined 200-240 or 100-120V adjustment range.

I discovered the principle of keeping the peak voltage under control with a bridge rectifier and large capacitor, and wanted to include that and make it track the average voltage, without using a multi-gang pot.

The Homo Ludens circuit needs a normally closed relay to start up. I accepted his challenge of getting rid of the relay.

The Homo Ludens triac output stage really didn’t work that well in practice with my generator that derives its field excitation from its main output. It mostly functioned as an on-off switch and hardly gave any range of phase angle control.

Explanation of my circuit:

The whole circuit is powered off the rectified and filtered output voltage of the generator. This can be either 115 or 230V nominal. C1 charges to something between 140 and 360V DC in use, clipping the generator peak voltage as it powers everything.

Depletion MOSFET Q2 and regulator U1 work together to provide an accurately regulated 10V supply that powers the low voltage part of the circuit and also functions as the voltage reference. Using a depletion MOSFET here allows the circuit to start with less than 10V AC from the generator, achieving the goal of getting rid of the Homo Ludens relay. The DN2540 is also a really docile part with quite low gain, and showed no signs of oscillation. It does get rather warm and would need a small heatsink when the circuit is running in 230V mode.

R1-R6 form two voltage dividers that sense the peak and rectified average generator output voltage. C2 and C3 provide some low-pass filtering of ripple, and for the average channel the amount of filtering is adjustable by RV1. The operating concept of the circuit is basically the same as the Homo Ludens one: the field coils and clipping resistor are driven by PWM, and the ripple on the sensed voltage functions as the PWM carrier. The smaller the ripple amplitude, the higher the control loop gain. Again like the Homo Ludens AVR2, this is a proportional controller only, no attempt was made to add integral or derivative terms.

The voltages are all scaled such that 40V RMS true sine wave input gives 1V at VPEAK and VAVG. RV2 and its associated fixed resistors make a reference voltage that varies between 2.5 and 3.0V in 120V mode, or 5.0 to 6.0V in 240V mode, thus giving adjustment ranges of 100-120 and 200-240V.

U2A and U2B function as comparators with a little AC hysteresis to avoid multiple transitions and high frequency oscillations. The values were found by trial and error to give happy PWM at twice the AC frequency.

The output stages are quite conventional, though scraping the junk box somewhat at this point. A 555 was used as an inverting MOSFET driver, and Q3 as a non-inverting one. A TC4428 dual MOSFET driver chip would have been a more elegant solution. The IRF840 and UF4007 were chosen by the same junk box scraping principle.

The original Homo Ludens optoisolated triac output stage can of course still be used with this circuit. Connect the opto-triac LED between U2A output and +10V. I would be interested to try this with the common and low cost “brushless self-excited” generators, connecting the triac in series with the capacitor. Internet wisdom says that these can’t be AVRd.

This circuit was tested with 50Hz AC supply from a variac and found to have rather low gain even with RV1 at maximum. It took maybe 30-40V change in variac setting to go through the full range of PWM. A 50k trimmer for RV1 would have been better, and the peak clipping channel could do with a similar increase in filtering. (The two iron cored chokes and series light bulb are simulating a generator field winding.)

I decided I would try it with Lister anyway though.

AVR was connected in place of original Brush generator excitation circuit. It used a variable series resistor and bridge rectifier connected to one of the generator’s 120V sections, so I did the same. With the generator switched to 240V I would only be sensing/regulating half of the output voltage, so I hoped the magnetic coupling between the two sections would be tight enough that the unregulated one would follow the regulated one.

The series fields with their excitation from rectified load current were left connected, while the AVR controlled the shunt field.

I take my breadboards seriously. πŸ˜€

Note the small inductors (salvaged from dimmer switches) to filter out MOSFET switching spikes and reduce EMI.

Turning the pot adjusted voltage from 200 to 240V as designed. It worked a lot better than I expected from testing with the variac.

Throwing a 30uF capacitive load onto the generator to make it self-excite showed good control over the voltage.

Sadly it didn’t work, the welder would trip out almost instantly on an overvoltage error, even with the AVR turned down to 200V.

What I think is happening is that the average voltage regulating channel is quite slow to respond as it has to contend with the inductance of the generator’s shunt field coils, so for very rapid changes in voltage, it basically does nothing, the voltage regulation is determined by the impedance of the generator’s windings. Which turned out to be high enough to make the welder’s PFC front end unstable.

The welder PFC then ended up in a fight with the AVR’s peak clipping channel, one trying to distort the voltage waveform into a thin and peaky shape, the other trying to chop the peaks off. The welder apparently won, distorting the voltage to the point that it tripped its own overvoltage protection.

Why won’t Lister run the welder?

[~A tale of weird waveforms~]

My main motivation for borrowing Lister was to run the welder at Container Labs. My GYS Protig 201 AC/DC claims to be “generator friendly and protected” but also “minimum generator size 7.5kVA”.

Lister is rated for 3kW at power factor 1.0, but looks massively overbuilt, so I thought it would be worth a try.

My first attempt at welding was pretty anticlimactic, on striking an arc the welder instantly shut down with error code “US1”. According to the GYS manual this means input voltage over 265V RMS. On further reading the unit claims to withstand up to 400V RMS/700V peak without damage but will apparently shut down above 265.

Since the welder has a PFC front end, I tried substituting the Odin PFC to see if this would manifest the same issue. It is rated to run at 415V RMS and has 1200V semiconductors so I had no worries about blowing it up with overvoltage. I used the Tesla Model 3 cabin heater as a dummy load for the PFC output.

This was somewhat inconclusive as the Odin PFC happily ate all of the generator output, showing no signs of serious instability under load, and making an impressive blast of hot air from the cabin heater.

The unloaded peak voltage did look somewhat high, due to the PFC’s EMI filter capacitors resonating with the generator winding inductance at the tooth ripple frequency.

Unloaded

These scope shots only show one-half of the generator output voltage, as I didn’t have an isolated scope probe handy, and the generator output is centre tapped to earth. So the total peak voltage is 472V unloaded and 368V under full load. These would equate to 335V and 261V RMS with an ideal sine wave. Since the actual RMS is 256V unloaded and 232V loaded, we certainly have some evidence of waveform distortion under both conditions.

Fully loaded

So on the face of it I could see how this could trip the welder’s overvoltage protection. I also heard from a friend who had experience of using similar generators to power his ham radio field day stations, and he said the waveforms tended to be “thin” with too high peak voltage for their RMS.

I pondered various ways of attacking the problem, a filter to remove the tooth ripple? This would need some seriously expensive and bulky inductors, so I didn’t bother. My first experiment was to step the output voltage down using an autotransformer (as I had one handy) and clip the peaks off using a rectifier, capacitor and resistive load.

This contraption (which I’ll call the Happy Welder 3000) worked surprisingly well, using the 190V tap, the peak and RMS voltages were both brought somewhat under control, and I was able to crank the welder to about 150A output at which point the engine began to bog down and belch black smoke, but would recover by letting off the TIG foot pedal.

Voltage and current drawn by the peak clipper

The Happy Welder 3000 seemed like a bodge so I went looking for a more elegant solution. I discovered that just switching the generator to 115V would give a decent result with no extra hardware needed. Voltage drop in the 25m x 2.5 sq mm extension cord (used to get generator noise and diesel fumes away from me) now limited me to a somewhat lower welding current before I got error “US2”, undervoltage this time. I was able to do a small job on mild steel this way.

I spent way too long thinking about this problem and ended up building an AVR which to my surprise, made the problem even worse! The welder was quite happy with 200V from the autotransformer, but with generator output reduced to 200V by the AVR, it wouldn’t run for more than a fraction of a second before tripping on error US1.

I don’t know how it took me so long, but I eventually stumbled on the idea of filming the scope screen while welding and examining the footage frame by frame.

I believe this frame captures the instant that the welder shuts down on error US1. Top trace is generator output voltage, bottom is current drawn by the AVR’s peak clipping channel. DVM shows the voltage across the AVR’s filter capacitor, which should be one-half of the peak output voltage.

The waveform is completely different to any I saw previously, and leaves only one possible explanation, the impedance (resistance and inductance) of the generator windings is too high for the welder’s PFC front end, it goes unstable and wrenches the waveform out of shape.

The instability pushes the peak voltage way higher than anything I measured while not welding, and does this so quickly that the meters I’d been using didn’t have time to register it. The AVR’s peak clipper tries to keep the peak voltage under control but fails.

This explains why stepping the voltage down to 200, and switching the generator to 115V, both worked and enabled me to weld, but using the AVR to reduce the voltage to 200 didn’t.

Switching to 115V gives an impedance one-quarter of the 230V setting. A transformer that steps the voltage down from 240 to 200 reduces the impedance to 76%.

On the other hand, the AVR only compensates for relatively slow fluctuations in voltage by adjusting the field current. It has no effect on the resistance and inductance of the windings, so can’t do anything about the waveform distortion.

I think I earned my professional development points on this one.

Schematic and replacing the rectifiers

After a period of working OK Lister’s output voltage began to sag horribly under load. The selenium rectifiers are known to be unreliable so I decided to replace them.

The below schematic shows how the Brush 3kVA alternator is wired (Brush connection diagram 9840322)

OOps, the series and shunt field labels are swapped.

The generator has both shunt and series fields. A silicon bridge rectifier provides excitation for the shunt field while the series fields are energised by a portion of the load current, through the selenium rectifiers. The armature and series fields are in two identical sections that can be switched in parallel for 115V or in series for 230.

Note that in 230V mode the output is centre tapped to earth. Both live and neutral pins of the outlet have 120V on them. This seems to be a design decision by Brush to reduce the risk of electric shock, however it means that live and neutral both need to be fused.

I took the opportunity to do some 4 wire resistance measurements while the wiring was disconnected. One section had a series field resistance of 0.20 ohms and a diverter resistance of 1.00 ohms. The other had a field DCR of 0.21 and the diverter resistor was set to 0.87. This resistor was burnt from a previous short circuit so I cleaned it and reset to 0.96 ohms using the unburnt end.

I prepared two KBPC3506 silicon bridge rectifiers on a heatsink. These are an inexpensive 35A 600V part available from many distributors.

The new rectifiers are much smaller so I was able to get rid of a lot of wiring, and that sketchy looking woven tube that was probably asbestos.

Of course I saved the original rectifiers, lol no, they went straight in the toxic waste.

A coat of paint for the “Power Tank”

Fittingly the paint colour is Valspar “Thunderbolt” left over from painting the front door at home. Still waiting on some more industrial looking socket outlets to replace the chrome ones.

I’ve been warned that after going to Powerpole connectors for 12V DC distribution, I’ll never want to touch a cigarette lighter plug again. That sounds about right.

Off-grid power bank

I’ve been renting a 20ft container to use as storage and workshop space, and wanted some electrical power.

The prototype was not very elegant. πŸ˜€ The basic components are a 135W solar panel on the roof, a 12V 100Ah AGM leisure battery, a Victron MPPT charge controller, and a 1kW pure sine wave inverter.

The inverter is a reasonably priced “Mercury” branded unit from TLC Electrical. I believe the Chinese OEM is Ningbo Kosun. I may do a more detailed review in another post.

Lead-acid batteries aren’t great for geek points, but I thought it would be the best technology for the job. I only visit about once or twice per week and rarely drain the battery completely. It can also get very hot in there in summer, so the battery figure of merit I’m interested in is basically calendar life when fully charged at high temperature. Lead-acid offers a lot of that for the money.

The first problem I found is that the Victron’s load output is wimpy. It won’t even run a 12V compressor. However the Victron has a good algorithm for turning off the load when the battery gets low to avoid damaging depth of discharge, and I wanted to make use of that.

So my first addition was a large MOSFET solid-state relay that would allow the Victron load output to control a much heavier load at 12V. I made this myself using 3x IRFP7430 MOSFETs in parallel, driven by a Si8712 isolated driver chip. The MOSFETs are rated at 40V, 195A, 1mOhm Rds(on). Turn-on and off seems to be rather slow. The small package on the right is a flyback diode to avoid a large transient when turning off an inductive load such as a motor. The MOSFETs would probably be ok with this, but it could damage other loads on the 12V bus.

The solid-state relay does not switch the supply to the inverter. This is connected directly to the battery to minimise voltage drop.

I modified the inverter to have a remote on/off switch, which was very easy as the internal on/off switch just connects 12V from the positive input terminal to the control circuitry. I simply hacked it so the control circuitry got its 12V feed from the Victron’s load output via a front panel toggle switch. This allows the Victron’s low battery algorithm to turn off the inverter alongside the other loads, and allows me to bury the inverter inside the enclosure with no access worries…

Note that I couldn’t find the official remote control panel for the “Mercury” inverter. I bought what I thought was the correct one on eBay, and on plugging it in, there was smoke… Luckily it all came from the remote and the inverter still appeared to be in good shape.

I also got this 500 amp battery monitor in Renogy’s Black Friday sale. 500A is overkill but it was cheaper than the lower current versions. The accuracy at low currents turned out to be fine.

I wanted a visual indication that the inverter was on, and also some geeky statistics relating to the AC output. This power meter module from Amazon did the trick with its cheery blue backlight. It is powered from the AC supply, and this increases the 12V power draw of the inverter by about 1 watt.

A British Army F632 ammo box was procured to fit all the parts in and… they didn’t fit. To gain some extra space, I added a wooden frame to the front made from CLS studs. I am quite proud of the Stratocaster jack cups as PV input connectors.

I provided 3 DC outputs: two Powerpole connectors protected by 32A circuit breakers and a cigarette lighter with a 10A breaker. Household AC circuit breakers do seem to work on 12V DC. I’ve seen them used up to 48V DC.

The inverter feeds two British standard socket outlets via RCBOs (earth leakage trips). In order for these to function the inverter’s neutral is connected to earth. Battery negative is also connected to earth and in use the earth stud is connected to the container. I believe this is the best overall solution from an electrical safety point of view.

The RCBOs do consume some AC power to perform their earth leakage monitoring function, but the amount is tiny, and doesn’t increase the inverter standby consumption noticeably. I tried Axiom and British General brands, and the BG ones had the lowest consumption.

These also have a 6A overcurrent trip function (the O in RCBO) but the inverter’s own current limiting would probably always operate before they tripped.

The inverter was mounted on a plywood divider and some holes punched in the sides of the box to promote airflow. I also removed the AC socket outlet from the inverter, leaving a large square hole for extra airflow, cut out the fan grill from the inverter casing, and reversed the fan. Hopefully these changes will make up for jamming it inside a relatively small compartment.

To be honest I have no idea if reversing the fan helped the inverter’s own cooling. Stock behaviour is to suck hot air out of the enclosure, and the old rule of thumb is that it’s always better to blow in cooling systems, but the inverter seemed like a quite well balanced and optimised design otherwise, so I can’t believe the designers left much on the table with sub-optimal cooling.

Really it was for my own convenience at a system level, the fan is at the 12V input end of the inverter and I wanted the hot air exhaust at the opposite end to the battery terminals, so I could have shortest possible battery wiring and a neat “signal path” from DC to AC without the inverter’s hot air blowing onto the Victron charge controller.

You might notice the lack of fuses on the battery positive terminal. Every connection to the battery is ultimately protected by a fuse or circuit breaker, but not directly at the terminal.

In use, you can see the inputs from the PV panel and the earth wire leading to an earth clamp on the container. (A steel framed building as far as BS7671 is concerned I guess.) The 12V and 240V wiring are not done yet.

The power bank itself could also do with a coat of paint and some more industrial looking unswitched AC outlets. The chrome ones are a bit flashy. Weighing in at 45kg (perhaps Power Tank would be a more appropriate name?) it also needs some serious handles to assist in moving it around…

I love the way the meter backlights come on when the inverter switch is flipped.

Appliances the inverter has run successfully:

  • Toaster, obviously
  • 1kW electric heater
  • 400W “Eco Henry” vacuum cleaner
  • Clarke CDP102 pillar drill
  • Clarke 6″ bench grinder
  • 1200W travel hair dryer (output sags to 220V, hair dryer only produces 1kW)
  • Ikea TILLREDA induction hotplate (only up to 40% power…)
  • A selection of guitar amps (works surprisingly well with no noise issues)

Tesla Space Gun 2000

For this year’s Gaussfest I decided to make a dub siren and connect it to Odin.

A dub siren is basically a very simple analog synth used to make sound effects for dub reggae. The original ones were a simple circuit with two 555 timers, but there are all sorts of variations on the theme. I was especially impressed by the Rigsmith GS1, which seems to contain some sort of toy sound effect IC.

I’m sure I had something similar mounted on the handlebars of my Raleigh Chopper in the 80s. How hard could it be to build one?

After some Googling and searching eBay, I found a surplus dealer selling some promising looking chips: the HK620 and HK623.

To make my dub siren I copied the data sheet application circuits almost exactly. The only change I made was to replace the timing resistor (“Rosc” in the datasheet) with a 1M pot in series with a 47k fixed resistor. I also added a 3.3 volt regulator so it could run off the standard 9V guitar pedal supply.

Buttons… So many buttons…
And a Hammond diecast box and some other bits and pieces

It sounds identical to the Rigsmith! Have they been shopping at Budgetronics too? πŸ˜€

Testing with a delay pedal and guitar amp

The Futurama FU-3 (part 4)

In this part the FU-3 gets its final faceplate…

I started with a 3mm piece of aluminium pre-cut to size by Metal Supermarkets. The existing screw holes were easily replicated with PEM nuts, but the old faceplate vibrated horribly, so I wanted to add 2 more mounting bolts, and oh dear, the drilling for the top one just missed the panel.

This was a perfect excuse to zap something with the TIG welder.

Zap and tap

With this done, a coat of gold paint and a pasting with letter punches…

Gaussfest 2021

This bonkers event was organised by Extreme Electronics at Papplewick Pumping Station in Nottinghamshire. One of the few venues where Odin‘s full power can safely be deployed…

Check #Gaussfest on Twitter for more πŸ™‚

Odin set up in the boiler house. All steam powered, no EMC worries πŸ™‚
The control position next to the boilers
Tapping into 3 phase 415V supply
Can you identify the tune being covered?
More importantly, can YouTube’s content ID algorithm?

Look out for Mike “Electricstuff” with fingers in his ears

Boiler house switchboard… Yes my setup moved the meters πŸ™‚
Mmmm, asbestos
This generator was a bit too small to power Odin πŸ™
This one was too big
My performance did actually use about 10kW
An event like this would not be possible without defibrillators and a tea room.

PFC part 11: 3 phase test

Finally the long awaited test happened πŸ™‚ (you can read all posts about the PFC here)

We plugged it into the 3 phase outlet and it started up normally! πŸ˜€

When smashed with 750V the Tesla cabin heater would draw an impressive amount of power while warming up. Unfortunately the steady state power draw was only about 2kW, probably something to do with the rather weak fan cooling it.

The PFC line current waveforms at (roughly) this 11kW output power level. No surprises here, they look exactly like the theoretical ones for this circuit. (Except strictly speaking the red one is upside down πŸ™‚ ) The theoretical power factor for this waveform is 0.95.

We don’t have a 3 phase power analyser in the lab, so I used 2 single phase ones on the input, according to the old “2 wattmeter method“. To be honest this didn’t work very well, as the power drawn by the PTC heater was always changing, and it was impossible to make sure the 2 meter readings corresponded to exactly the same time. Also, the PF reading is rubbish due to the inherent 30 degree phase shift: to get the actual PF you have to plug the wattage readings into a complicated formula.

When the heater reached steady state, I measured an input power of 2000W, an output of 1900W, and a power factor of 0.96. From an academic point of view it would have been nice to measure the efficiency at higher powers, I expect that 100W is mostly switching losses and the efficiency will increase with heavier loads.

The main goal was to get confidence that the PFC would work at its first gig, and this has been achieved πŸ™‚

PFC part 10.5: Don’t contact me, I’ll contact you

Another problem I have with the cabin heater testing (And the PFC testing πŸ™‚ ) is that the PFC is not designed to start up into a load. This isn’t a problem for the intended application, as the Tesla coil won’t draw any current until it’s commanded to. But to power a resistive load, I have to use a switch to connect the load after the PFC has started up.

For the previous immersion heater tests I used an ordinary 240V AC rated switch. This will make a DC circuit, but won’t break it: the arc simply won’t go out until the entire switch is incinerated. Of course if you’re reading this there’s a fair chance that you actually enjoy burning things to a crisp with electric arcs, but I have to be on my best behaviour to get the keys to the 3 phase outlet at work, and proper DC rated contactors are getting cheaper anyway thanks to the proliferation of electric vehicles.

The Kilovac LEV200 has hydrogen filling and a permanent magnet to blow out the arc. It’s good for several hundred amps at 900V DC.

As one might expect, it makes a satisfying clunk.