Category Archives: Electronics

Electronics

Regulated High Voltage Power Supply: Switchmode control, 30 kV, about 1 mA

Disclaimer: This circuit description is for your information only. Do not attempt to duplicate! Danger! High voltages can kill you!

For many purposes, a regulated high voltage supply can be very handy. Purchasing one is not easy because such supplies are in high demand by all hobbyists that love sparks, and used units are quite expensive.
Fortunately, high voltage transformers are much more commonly available, from TV sets, so-called “Flyback” transformers. These provide, depending on type, up to 30 kV of DC voltage, at a pretty decent power of about 20-30 Watts.

Quite a few circuits are around, to provide drive signals for flybacks. These work, but often only for a short time – after a few sparks, the driver stage transistor blows. And, most of them have no means of adequately controlling the voltage.

Control of the high voltage typically requires measurement of the high voltage, a task that is not easily implemented – requiring expensive and bulky divider resistors.

The circuit described here is time-proven, and eliminates many of these shortcomings.

(1) Snubber networks around the coil and switching MOS-FET eliminate spikes in case of a shorted output (sparks act like shorts on the output).

(2) The primary winding – it is of very low inductance, just a few turns. This makes it easier to control the voltage spikes on the primary, and allows low voltage drive circuits (much reduced risk of electric shock, much better for amateur use). Still this circuit is dangerous! Do not attempt to replicate!

(3) Switchmode regulation with current limit – also this provides added protection against overload. Dead-time control limits the maximum duty cycle (power).

The design, all build around a real classic, a TL494 switchmode regulator.

hvpwr schematic switching regulator

Power is supplied via mains filter, and two transformers. Second transformer is only a needed for the LCD panel meter (Voltage display in kV). Note that the regulator and primary coil is on a floating ground. Earth ground is used for the high voltage coil, with a 1 mA full scale amp meter. Actual output current can be above 1 mA, depite the caption “0.5 mA”. Make sure to adjust the maximum current conservatively, and also the dead time, to keep the output power limited – otherwise, the flyback transformer will suffer and eventually stop working.

hvpwr schematic pwr supply

The most interesting part, the flyback driver and snubber circuits. The snubber circuits were designed with a lot of effort, using a scope to probe the overshoot voltages, etc. – if you change the flyback or primary inductance, make sure the check proper dampening! The BY329-1200 is a fast diode, with rather slow (soft) recovery. This will lead so some extra power losses, but this can be tolerated here. The VDRs add some more protection, but actually, they were added more for peace-of-mind than for any real purpose.
One thing to be improved in further design updates is the gate drive: the gate to source voltage is currently the full voltage of (about 24 Volts), it works, but it is running close to the limit of the IRFP450 device, or even above the limit. Furture circuits will include an independent linear regulator, to run the TL494 from a 15 V supply, derived from the main supply, and maybe a Zener diode added to the gate drive signal path, for added protection agains gate voltage excursions.

The IFRP450 is driven rather hard, via a 47 Ohm gate resistor, and has very small switching losses. No heatsink required, mounting it to the rear panel will provide ample heat dissipation.

hvpwr schematic flyback driver

The flyback itself, a 0100170 equivalent to HR 8409 type. The only coils used are the secondaries. The high voltage coils, for the output, and the 11-12 coil, for the voltage feedback. The voltage derived from this coil by half-wave rectification is a very accurate representation of the high voltage output. This has been checked at multiple voltages and load conditions!
The primary winding is 8-1/2 turns of rather heavy copper wire. You can also twist multiple thinner wires, if no thick wire is handy. I used double-isolated type; the device below is just a lab demonstrator for personal use, for professional cirucits, it is suggested to use PTFE (Teflon) or silicon tubing to provide additional isolation of the primary winding from the ferrite core.

Keep your fingers (and other wires) off the other primary windings!! These carry dangerously high voltages, at significant power, and might be more dangerous than the acutal high voltage secondary!

hvpwr flyback hr 8409 equiv 0100170

The actual unit:
hvpwr front panel

hvpwr inner workings 1

hvpwr inner workings 2

hvpwr inner workings 3

hvpwr inner workings 4

hvpwr rear panel

The rear panel has the high voltage output: a big isolator, machined from HDPE plastics, with a 4 mm receptacle hidden inside.

Stepper and Multi-phase Motor Control: LMD18245 based driver

For quite a few projects, I need to control DC, stepper or similar motors, with moderate power, anywhere from 0.5 to 2 Amps. For smaller motors, I have a well-established circuit using ULN drivers (to be described elsewhere), and for powerful motors, I generally use the reasonably inexpensive Leadshine or Leadshine-compatible controls – but for the intermediate range, below circuit has provided great service in many applications over the years.
Mostly, it is used together with bipolar stepper motors, like, in a big engraving machine build about 10 years ago. Recently, I re-used the design to control a rather uncommon 3-phase stepper motor.

The original prototype:

lmd18245 driver

The key part is a LMD18245 from National, now, Texas Instruments, about USD 10 per piece. This is a full H bridge, with 4-bit DAC current control, integrated diodes, and utilizing DMOS technology. It is working up to about 3 Amps, 50 Volts; and has overcurrent/overtemperature protection. Not bad, and it allows for very small designs, without going to the trouble of thermal engineering of power SMD components used in more recent designs (and reliability issues, if such design is not properly done).

The LMD18245 uses a remarkable current sensing technique – the main DMOS switches are made up of about 4000 elements, and only one of these is used, along with a current sense amplifier, to provide a 4000:1 scaled version (250 µA per Amp) of the coil current. This eliminates the need of heavy/expensive low-ohm low-inductance resistors.

lmd18245 dmos current sense

To protect the circuit, two capacitors are used – a 1 µF film capacitor, close to the VCC input of the LMD18245, and a 470 µF electrolytic (1 for each pair of phases).

The digital interface is very simple, and has been used in assemblies of multiple motors/multiple phases with success. The data bus input is buffered by 74LS374 edge-triggered D-flip-flops. Many units can be connected to a common bus, using a ribbon cable, and solder bridges for the address (LS374 clock) lines.

Typically, these are set by a micro-processor, using a look-up table (if MCU pin number is limited, a shift register, 74LS164 or similar, can be used instead). This allows full control of magnitude of current (4-bit DAC), and direction (via H bridge).

lmd18245 driver schematic

Judging from experience, the LMD18245 is a very robust device that can be employed of all kinds of motor control, in particular, if you need a easy to implement, but still fully customizable, reliable solution.

USB RTL SDR 28.8 MHz Reference: VCXO

One of the shortcomings of the USB RTL SDR devices is the build-in oscillator. It is actually very stable and sufficient for all kinds of everyday uses, but I am using these SDR devices for narrowband applications, with down-converted microwave signals. So utmost frequency stability is a must.

Not only needs to frequency be stable, it is also a good idea lock all oscillators to a common reference, which typically is derived from a 10 MHz rubidium source (like in my lab), or a GPS-controlled VCXO.

How to get from 10 MHz to 28.8 MHz – well, not all that difficult, but needs quite a few parts. First, we need a circuit that can receive 10 Mhz signals, and clean them up and prepare them to be used by a PLL. Then, we need a VCXO (voltage controlled quarz oscillator) that can be tuned by the loop filter of the PLL to keep it at 28.8 MHz. The loop BW will be very very narrow, a few Hz at maximum. Comparator frequency can be up to 400 kHz, the largest common divider of 10000 and 28800; but I might select a value more like 100 kHz which can be readily derived from a 10 Mhz reference. There are plenty of programmable PLLs around, but I might just use a hardware solution here (only need to put together :288 and :100 dividers using some TTL logic).

The circuit-
rtl sdr 28-800 MHz ref pll

– nothing too fancy, and still needs some fine tuning. The xtal, it’s the original part de-soldered from the RTL SDR stick. These are actually pretty stable and well-behaved, at least for the devices I sourced from China.

The circuit employs a Pierce oscillator, build around a J310 FET. This is coupled into a common-bias amplifier, another J310, which provides the low output impedance. A matching network is added the make the circuit rather insensitive to changes in the load impedance. The circuits draws about 20 mA at 12 V. Not quite a power safer, hey, but this is not the objective here.

The items circled are just temporary parts, will need further optimization.

The big question – tuning range (pullability) of the xtal. Ideally, it should be a few 10s of ppm, to give the PLL some room to operate, and to account for aging effects over the years. Temperature-induced changes are on the order of a few ppm (see earlier post); but there is also drift, and other factors.

A quick test with some capacitors, and, stable oscillation can be found in a range of -1.8 to about 1.8 kHz around the 28.8 center frequency, this is quite satisfactory.

rtl sdr ref vcxo circuit

At the moment, still run with fixed capacitors, but I will add a varactor network to provide about 8 to 40 pF tuning capacity, by voltage input.
In an effort to keep phase noise down, I might employ a circuit used a lot for earlier projects, with anti-parallel varactor diodes.

rtl sdr ref 10 pf

rtl sdr ref 37 pF

The spectra look pretty clean, and the power is as expected, about -10..-6 dBm. I will use this output to drive the PLL, and add another amplifier to drive the RTL SDR R820T reference input – well shielded from everything else to avoid spurs from the divider and PLL circuits.

A quick test of the phase noise – hooked it up to a 3585A Spectrum Analyzer – there are some mains spurs, which will be reduced by adequate filtering once the circuit is fitted to a shielded box. Other than that, nothing really suspicious. All very close or at the noise floor of the 3585A.

10 pF sdr ref0

3585a noise floor

AIOM: updated schematics, differential input bias, high-impedance input protection and amplifier

Some progress, with the universal analog input output module, analog response analyzer, or line tracer, digitizer – however you want to call it. Added a few features – a bias supply for the differential input, and a high impedance amplifier (and a bit of protection circuitry) for the single-ended input.

First the bias supply – to allow a wide range of input voltages, say +-20 V (even below ground and well above the positive rail), we need a resistive divider network, and this needs to convert a differential voltage (with absolute voltages centered around ground), to a differential 0 to 2.5 V input, centered around 2.5 V (the internal bias of the ADC). A little calculator is used to find the right resistors and bias voltage. About 2.65 V will do the trick, for the desired input range, and resistor combination. Bias current is just about 1 mA or so, easily sourced/sinked by a OPA703 opamp.

adc input bias calculator

This input is mainly designed to sense low impedance sources, e.g., current shunts or supply voltages (lead compensation, or similar configurations). So the ~50 k input impedance will be perfectly fine.

aiom schematic 1 of 2

aiom schematic 2 of 2

The general circuit, nothing really exciting about it – the AD7712 has a 8 MHz crystal, will run easily up to 1 kHz conversion rate. But mostly, it will be run at 50 or 60 Hz, to suppress any mains related noise, or even at 10 Hz.

A quick test showed that the USB communication is working (using a JY-MCU ATmega32L minimum board) – just waiting for some long waiting times and train travels to write a simple user interface, to control the outputs and the data acquisition by Windows GUI. For plotting and data analysis, I will resort to gnuplot and/or R, not re-inventing the wheel here. Maybe a simple preview screen.

AIOM – Analog Input Output Module: the low-voltage low-current SMU

Quite frequently, I encounter rather large stacks of system power supplies and multimeters to test various types of equipment or circuit prototypes. Often, voltages are just in the 0..10 V range, sometimes, up to 40 V, at small currents. The response of the ciruit is then measured, often, after conversion to a voltage, or as a frequency, etc, with a counter.
This all works, but consumes space, a lot of power, heavy lifting, etc.

Therefore, what is needed, is a kind of Swiss Army Knife, a ADC-DAC unit, with some capable software, a small box that replaces at least two power supplies, and two voltmeters. Preliminary name: AIOM

Essentially, a small brother of the now very common source measure units, aka, “SMU”s.

Possible uses include:

(1) Test of diodes etc – trace recorder.

(2) Control of sweep generators, synthesizers, analog spectrum analyzers (most of these devices have a 0..10 V tuning-frequency control input, and often, a chart recorder-analog output, +-5 V, +-10 V, +-1 V, or similar).

(3) Test of VCO tuning curves, YIG current drivers, YTF circuits. Special VCO analyzers exist, but no need to block a whole lot of space just for some tuning test, and are too expensive to have multiple units at hand all the time. Often VCO tests need to be done at various temperatures, and over considerable time, to ensure performance of a circuit – multiple small test units will allow parallel testing, at very resonable cost.

aiom scheme draft

Features:

(1) Two 0..10 V outputs, 16 bit resolution, low drift, better than 0.05%; source and sink. Needs to have reasonable low noise.

(1b) Optional, to be added, voltage to current converter (to control current, rather than voltage, 0..10 mA, source and sink).

(2) Two inputs, one referenced to ground, one fully differential +-10 V.

(3) Ramp generator and similar features (rough sine, triangle, square/PWM), in hardware, to allow fast sweeps or steps or PWM-related tests (something like a simple arbitrary function gen).

(4) While the basic design will be kept strictly unipolar, there will be a simple switching matrix, to allow polarity reversal. This will also ensure fully symmetrical tests, e.g., for charge counting-battery test, charge-discharge efficiency tests.

The whole little thing has two parts: the AD/DA converter board (prototype build), and a switching materix (still waiting for some parts).

aiom board

First tests successful, stay posted!

aiom test setup

Reference Signal Conditioning: 10 MHz amplifier/limiter, :2 divider, 5 MHz output

A common task for most projects involving a PLL or other RF circuitry requiring a reference frequency signal is the conditioning of the incoming reference. These reference signals are typically very accurate in frequency, but never very accurate in levels, nor at the levels constant (sometimes, multiple instruments are connected to a single 10 MHz source, an disconnected when the setup is re-configured etc.). Also, there is always a risk of incorrect connection, with all these BNC inputs.

Therefore, we have a few requirements:

(1) Input needs to be stable to a reasonable DC voltage, say, a few Volts.

(2) Input needs to widthstand at at least 20-25 dBm input, about 0.25 Watts.

(3) Input needs to widthstand ESD, or other transients, and provide reasonable termination to avoid reflection. In the given case, we want about 50 Ohm – some reference inputs have higher resistance.

(4) Circuit needs to work from about -10 dBm on, up to 10 or 20 dBm, with no significant change in jitter, etc., and provide a stable, constant level output, TTL levels, or whatever is required.

The current circuit, which is intended to be a reference signal conditioner for a Micro-Tel MSR-904A Microwave Receiver, also needs a 5 MHz output – the PLL will run off 10 MHz, but the MSR-904A still is ancient enough to require 5 MHz (5 MHz used to be the standard reference frequency from early times up until the end of the 70s – since then, 10 MHz is almost exclusively used, and sometimes, 100 MHz, for double-digit GHz circuits).
Such 5 MHz output is easily realized by a divider circuit, based on a 74F74.

Now, how do we achieve all this. Well, here is the schematic:
ref signal conditioner schematic

The essential part – a 74HCU04. This little circuit is extremely useful – get a handful of these, they are not just “inverters” but acutally work at frequencies from DC to many MHz, can source and sink at least 4 mA to 5 V. The 74HCU04 is more or less a set of 6 push-pull MOSFET pairs, in a handy package. These pairs can also be paralleled with no precautions to get more current, if needed.

The signal input is protected by a 56 Ohm termination (which can burn out if you feed excess DC or more than 0.25 W of RF – unlikely to happen). Then, there is a 47 n decoupling capacitor, a series resistor, and a clipping circuit – which will most likely never be activated.
The 22k resistor, along with the first inverter, and the 470 Ohm resistor form the first amplifier.

Signal A (see letter on schematic, input of first inverter):
ref signal circuit A
-scope is set to 1 V per div vertical, 50 ns per div horizontal.

Output B:
ref signal circuit B

Note that the first gate is self-biased, no need to adjust anything.

This is then squared-up by the limiting action of the following 2 inverters:
ref signal circuit C

ref signal circuit 10 mhz E 1 v-div 50 ns-div

Now, we have a clean 10 MHz square wave. This is fed to a 74F74 edge-triggered flip-flop. The 74F74 is pretty fast, it easily works up to 100 MHz and will provide fast-rising edges.
The flip-flop will also ensure pretty much exact 50% duty cycle of the 5 MHz output.

ref signal circuit 5 MHz F

The output is fed through a low pass, 51 Ohm – 470 p, about 6.6 MHz, because we want low jitter at the divider stage (fast rise time pulses feeding the flip-flop), but not too steep edges at the output:
ref signal circuit G

After amplification by another 74HCU04 inverter:
ref signal circuit 5 MHz H
– this signal is still referenced to ground, and after another resistor and capacitor, finally, an AC signal, that can be used for various purposes, including frequency locking a MSR-904A.
ref signal circuit 5 mhz output I

Note: when you measure in such circuits, always use a >10 Meg, 10:1 low capacitance probe. Otherwise, you will get results, but these won’t reflect reality.

A quick test with a 10 MHz test signal – the circuit works well from about -22 dBm to 20 dBm, no issues at all. For the specification, and to ensure that is is working even under awkward conditions, we might limit it to -10 dBm to +16 dBm.

The little thing in action:
ref signal circuit test setup

HP Fundamental/Harmonic Mixer 5086-7285 (22 GHz): digital bias control

In an effort to build a 2-18 GHz down converter, a HP mixer 5086-7285 needs to be controlled. This is one of a group of 22 GHz mixers, all used in earlier HP spectrum analyzers. These mixers are very linear, and useful both at fundamental and harmonic frequencies.

That’s the little magic thing, and the frequency list-harmonics:
5086-7285 mixer
5086-7285 mixer harmonics

All in all, at a first glance, pretty easy to use – it only needs +10 and -10 V power supply and bias for the diode.

Well, bias, after looking through the schematics, this is the assembly taking care of it: a board full of resistors and amplifiers, with no less than 22 (!) adjustment pots.
08565-60023 bias assembly

The interesting part are the bias drivers itself –
hp bias circuit for harmonic mixer
– the linearization, etc., this can all be done easily by using digital memory and a DAC nowadays, but the drivers, we still need them.

The bands B3 and B5, the even harmonics, the things are clear and as expected – a voltage source, and a resistor. Easy enough. But, what did HP do for the odd harmonics?? – the are a few extra resistors around the opamps, and these resistors make it a tricky thing. Too tricky to make it easy to understand. Some kind of negative resistance circuit/kind of a voltage to current converter, which depends a bit on the load resistance.

So, what do you do to understand such things better – build a little test circuit, here we go:
mixer bias test circuit
-it is essentially the same circuit, as for the B1/B4/B2 bands, U6B of the HP circuit- just left out the switching transistor.

It works pretty well, and as a U to I converter, see here:
bias driver test 200 mv-div ramp  1 mA-div current
– ramp voltage is the drive signal, 800 mV p-p, 200 mV per div (center line is zero). During the negative signal period, the output is active – current signal is 1 mA per div (center line is zero).

Having the basic functionality of the ciruit confirmed – some calculations with LTSpice, one of the best general purpose analog simulators around, Thank You, Linear Technology!

Here the files, in case you want to investigate it yourself:
hp mixer bias

This is a typical result, mixer bias current, vs. input voltage of the circuit, at resistance (of the mixer), of 950 (steepest)-1050-1150-1250 ohms.
r6-92 1-9 bias rscan vs Vi
So, this cirucit really is a U to I converter, with the slope depending on the load resistance.
Also note the model circuit of the mixer internal resistor and diodes. The two diodes and the 970 Ohm resistor are the result of bias current vs. bias voltage measurement. Bias voltage is in the range of -1 to -7 volts, about 0 to 8 mA.

With these findings, next step will be to build a driver circuit that can work fully digitally controlled, with no adjustment pot at all (series resistors will be manually selected).

YTO YTF Driver: 0..250 mA, 16 bits resolution

Quick update on the YTO/YTF driver board – with 16 bits of resolution. Assembly, is complete, and basic function has been checked – digital control test will follow tomorrow.
Current is settable from 0 to 250 mA, with 65535 counts of resolution – about 3.8 Microamps per LSB. All has been build to minimize noise, with heavy filtering on the supplies. The DAC is run from a dedicated 5 V supply, with a 2.5 V precision reference, 1 ppm/K, MAX6325ESA+.
The U to I converter is powered by 11.4 V – provided by a LM317 voltage regulator.
Switching element is an IRF730, operated as a series variable resistance in series with the coil.

YTO YTF driver 2x250 mA 16 bit

YTO YTF driver 2x250 mA 16 bit schematic

Looking at the BoM, the parts sum up to about USD 35 plus board, not bad – target is to stay below about $100 for the final assembled unit, which will be achievable, no issue. Main cost comes from the MAX reference, and the DACs (DAC8830), almost USD 22.

To come: bandwidth testing

YIG tuned oscillator (YTO) / YIG tuned filter (YTF) driver: digitally controlled current source

For a digitally controlled YIG oscillator and filter, a driver is needed that can convert serial data from a microcontroller to a well defined, stable, and low noise current.
Bandwidth of the circuit should be a few 100 Hz, and maximum current in the 300 mA range, so it needs to run of a reasonably high supply voltage, otherwise, the inductance of the coil will limit the slew rate. The YTO needs about 120 mA full scale, the YTF about 260 mA.

I might do some fine tuning on the DACs later or change the current sense resistors for a 2.5 V drop at close to max current, for best signal to noise ratio, but for the test circuit, 10 Ohm RH-25 resistors will be used. The current sense resistors are a very critical part – they need to be low drift, over time, and over temperature, regular resistors, with 100 ppm/K or more will only cause drifting frequencies, and trouble.

Here, the draft schematic, as-build:
YIG driver schematic dac control - u to i converter

That’s the test setup, with +20 V and -10 V power supply, for the YIG. In the final setup, there will be independent, filtered and regulated supplies for low phase noise.

YTO driver test setup

The circuit is driven by a HP 8904A signal generator, with independent adjustment of offset and voltage. Here, the output at 70 mA current, with a +-1 mA amplitude variation:

YTO output 70 mA +-1 mA
YTO is a HP 5086-7259, 2.0-4.5 GHz (nominal).

So, about +-40 MHz – close to expected +-35 MHz.

Bandwidth analysis will follow.

Here a quick calculation of the DAC resolution, 1 LSB will be about 0.13 MHz, more than sufficient for the DAC tune. The DAC used, a DAC8830ICD has typical +-0.5 LSB non-linearity, max +-1 LSB. Additional tuning will be easily accomplished by the FM coil, using a PLL.

yto ytf dac calculator

Avantek AFT-4231-10F 2-4 GHz Amplifier: some characterization and modeling

The task for today – characterization of a bunch of microwave amplifiers, Avantek/HP AFT-4231-10F. These are quite rugged and affordable components, widely available surplus, and hermetically sealed – will last forever, if things are not messed up completely.

aft-4231-10f under test

The specification however, it’s not quite clear, and no detailled information could be found on the web. That’s why I have been asked to come up with measurements and a calculation model that allows to estimate the gain (and the actual maximum output power, and the necessary input power, to reach close to maximum output), at any given frequency and input power. Also, it needs to be checked how far above 4 GHz this device still works.
Last item is to measure the supply voltage sensitivity of the gain, to get a feeling on the required stabilization, to avoid incidental AM on the signal.

The datasheet –
aft series amplifier

The only equipment at hand at my temporary workshop here, a microwave source, EIP 928, and an HP 8565A spectrum analyzer was used to measure the gain at various input levels. Accuracy of this setup is about 1 dB.

Some of the results (0 dBm input: blue diamonds; 10 dBm input: green triangles):
aft-4231-10f pout at 0dbm and 10 dbm pin vs frq

To get a proper continuous description, these data were fit to a non-linear function, fractional polynomial term (fits are done using Tablecurve 2D, an excellent program, highly recommended, but doesn’t come cheap):
gain fit
The gain fit (0 dB input) can also be used to describe the maximum power, with some scaling factors – this considerably reduces the number of parameters needed, and the calculation effort later, when implemented in a microcontroller. Black lines in above diagram show the fit results.

For the gain compression, a 2nd order polynomial is used, and scaled for the 10 dBm input gain.
aft-4231-10f gain compression vs pin at 3 GHz

Once this is all established, no big deal to see the full picture.

Gain, at various input power levels, Pin:
aft-4231-10f gain vs frq at various pin

Output power, Pout, at various input power levels, Pin:
aft-4231-10f pout vs frq at various pin

Accordingly, no problem to get 18 dBm+ in the 1.8 to 4.5 GHz range, perfect for the application requirement.

The final item – supply voltage impact on gain: tested at 3 GHz, 0 dBm input power.
Using a Micro-Tel 1295 test receiver, the reference level was set to 0 dB at 15 V supply voltage, which is the nominal voltage.
Down to 9.0 V, the AFT stays within an excellent 0.01 dB variation. Output power slightly increases (0.15-0.25 dB) down to 6 V. At about 5 V, amplification cuts out. So the AFT can work with any voltage from 10 to 15 V, at about 80 mA, and seems to have pretty good internal regulation.

amp avantek aft-4231-10f