AC current source, NMOS H bridge? - Page 1
Forum section: electronics / projects

author: Martinn
author_rank: Frequent Contributor
timestamp: January 11, 2025, 02:32:51 pm
content: Hello all,I recently purchased a Chinese AC panel meter which I ultimately would like to use to measure phase current of the BLDC (1.5 kW) motor of my SX4 millhttps://www.paulimot.de/fraesmaschinen/sx4When first powering this thing up, I found that I have no AC current source to test this, not 50 Hz, not variable frequency, except for shorting my function generator input.So: How to build an AC current source for testing AC measurement devices?Specs:at least a few amps up to a few hundred Hz, better 10-30 A 1 kHz, best 100 A many kHzBut realistically, I'd go for something that can be built with decent effort.I searched around how to do this. Audio amps are too high voltage and too low current, using a 4 Ohms dummy load for 10 A gives 400 W of wasted power.In the end, I want to drive a piece of wire or a shunt, both near short circuits. One idea:For having just one high current supply (instead of bipolar), I'd go for an H bridge. Two transistor drops plus shunt voltage could be as low as 3 V, say 3 - 5 V supply for the output stage.This diagram shows a NMOS H bridge. It requires a linear mode capable device, which are very rare these days (or very expensive as Ixys linear L2). AoE fortunately lists a few choices in chapter 3x.18 Power Transistors for Linear Amplifiers. One of them is a IRL2505, an elderly discontinued HEXFET from IRF. As it has a spice model (Ixys transistors do not) I went with this one.What do you think? I attached the LTSpice file, give it a try!As both H and L side transistors are driven with the same voltage, the L side is fully on while the H side regulates current. I went for a simple long tailed pair as differential driver, right input would be feedback from a current sense amplifier, but as drawn it is open loop.The transient run shows a 1 kHz 100 mV drive resulting in about 18 A of amplitude with visible distortion (due to the quadratic characteristics of the MOSFET). Bias current is set to somewhat below 1 A to reduce crossover distortion.Reducing the LTP collector resistors to 100 Ohms (and increasing the drive current to 50 mA) gives a bandwidth of almost 100 kHz, which is better than what I would have expected.25 mA into 100 Ohms give 2.5 V at the gates when idle, resulting in some bias current (Vgsth is 2.3 V).Vgsth has a negative tempco so thermal runaway might be possible.Could a shoot-through happen?Another possibility would be to go for a 6 BJT bridge as shown by Tim herehttps://www.eevblog.com/forum/beginners/6-bjt-h-bridge/msg1351957/#msg1351957although that was not intended in linear mode. Different betas would make for interesting voltage distributions in the two branches.I'd use audio power BJTs like MJL21193/4, but for near saturation drive they'd use lots of base current.- Martin

author: Phoenix
author_rank: Frequent Contributor
timestamp: January 13, 2025, 02:02:40 am
content: You can use your function generator, just wrap lots and lots of turns around the CT core.You could use a H-Bridge running sinusoidal PWM with LC filter.You could use a variac off the mains into a resistive load (though this would only be a single frequency).

author: Martinn
author_rank: Frequent Contributor
timestamp: January 13, 2025, 07:17:48 pm
content: Quote from: Phoenix on January 13, 2025, 02:02:40 amWell... the current transformer in the first image is a 100 A one, even if the FG gives 100 mA this makes 1000 turns... I threaded through 10 turns of mains wire to give it a 10 A range, but much more than that is not going to be fun.Also there might be other current meters with shunts or clamp meters you would want to test.Quote from: Phoenix on January 13, 2025, 02:02:40 amActually switched mode was my first thought. Like processor supplies, 12 V in, 1 V 100 A out. But bipolar and variable voltage? I don't think so.H-bridge would need an inductor, you couldn't drive a short directly (it would vaporize the switches). With inductor it would be the same as driving a motor. But then, what frequency? Switching 50 A I doubt you get over 100 kHz of switching frequency, good enough for maybe 1 kHz sine output. And then there's the inductor value or residual ripple. If you design a 50 A stage with 10% of ripple, that makes 5 A. Not fun if you want to drive 1 A. Also inductors for 50 A are either huge/expensive or nanohenries.Same with class D audio: Voltage too high, current too low, voltage mode and not current.As much as I'd prefer a switched architecture from a loss point of view, I don't see that realistic.Quote from: Phoenix on January 13, 2025, 02:02:40 amThought of that, drive a toroid mains transformer from a variac and loop through a single secondary winding. Single frequency only, so not that interesting.

author: jbb
author_rank: Super Contributor
timestamp: January 14, 2025, 08:50:21 pm
content: If I were making several, I would go switched mode. I would:- use an interleaved multi-phase design to reduce current per switch / inductor- push up the switching frequency to reduce inductor size- use forced continuous PWM to get consistent control dynamics at light loadIf I were making just one… I’m not sure. A switched mode pre-regulator (from, say 24V down to 2V) followed by a chunky linear stage could work well.Maybe you could make several smaller current sources and put them in parallel…

author: CaptDon
author_rank: Super Contributor
timestamp: January 15, 2025, 02:20:56 pm
content: If you could find one of those 1KVA toroidal isolation transformers used in the medical field 120 in 120 out you could probably wrap a single shorted turn of copper strap or welder cable around the core. You would probably end up with something like a 200:1 turns ratio. It would seem you could get 60 to 100 amps in that shorted turn. For 60Hz you could drive the toroid with a variac. Kind of thinking along the lines of an old Weller soldering gun as to principle of operation. Doing some guesswork if the shorted turn had 100 amps flowing with a voltage of perhaps 1 volt within the shorted turn you are still only looking at 100 watts of input power. Most of the one kilowatt audio amplifiers simply drive anything from their lowest rated load impedance all the way up to an open circuit just fine. I would suspect those medical isolation toroid transformers would work easily up to 1KHz and maybe more. I used this technique for testing hall effect current sensors. My transformer was a filament transformer from an FM broadcast transmitter and was rated for 50 amps output constant duty with a 208vac input. I drove it with a Carver PM2.0-T (I have about 10 of them) and a signal generator. That big iron core transformer could easily do 1KHz+. We needed to examine the rise and fall times of the hall sensors. The sensors were being used in a control loop to fire diesel injectors. They had a prescribed current ramp up vs. time, Then a so called 'hold 1' current with a time limit followed by a lower 'hold 2' current if the injection was going to be long duration.

author: Martinn
author_rank: Frequent Contributor
timestamp: January 15, 2025, 07:05:10 pm
content: Quote from: jbb on January 14, 2025, 08:50:21 pmOK here's a quick try with a chunky linear stage.Set current as +-10 V from function generator input, full wave rectifier into TO-247 FET in low side current controller.To make it bipolar, compare input with zero and switch polarity by H bridge (comparator going into bridge driver).Quickly put together and quite crude. Works so-so. Absolute value circuit generates some artifacts, bridge switching as well. Textbook circuits with little optimization.Not sure if this could be a way to go.Power supply would be +-15 V for analog input/driver stage, power 2-5 V from external PSU or pre-regulator.

author: Martinn
author_rank: Frequent Contributor
timestamp: January 16, 2025, 06:43:36 pm
content: And here is an OPA541 version. The bridge is necessary if you want to have a unipolar supply only. At 10 A max, the question is what is more expensive - OPA541 or second power supply rail.At least the OPA541 avoids the problem of having to fill up a Mouser or Digikey order to $50! 5 V 10 A supply is < $10 though, so it would be cheaper to use one OPA541 only and use a bipolar supply.The spice model only drives 8 A, the real thing should to 10 A, SOA permitting. Simple enough circuit to breadboard even.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 17, 2025, 01:24:19 am
content: Seems a lot of effort to go to to simply check calibration of a meter.You can likely get something 'good enough' with a stepped sine current, like the quasi sine inverters used to do.The simplest form of that is a HEF4017 decade counter, and a single Quad OR gate, plus 6 MOSFETs, powered from 5V at > 10A and 12-16V for the gate drives.Power resistors set the test current.That has 10 clocks per cycle and 1+1 of those time slots are 100% +/- drive and 2+2 are some sine % and 4 are zero.Clock it from your function generator, and you are done.You can calibrate at 50Hz and use a derived crest factor for other frequencies.

author: Martinn
author_rank: Frequent Contributor
timestamp: January 19, 2025, 03:43:46 pm
content: Quote from: PCB.Wiz on January 17, 2025, 01:24:19 amI see it as a design challenge.Say a customer comes to you "build me a 30 A current amp for my function generator". How do you solve this? Sure you can go boat anchor, audio amp 10 pairs of BJT in the final stage, but I am looking for a design that does not require a shop crane to lug around.I find it particularly frustrating that it seems super easy to make a 100 A unipolar current source using one of IXYS' screw terminal FETs. But lifting this performance to bipolar...?Class AB audio is normally done using BJTs. But they have rather high saturation voltages and needs amperes of base drive current (beta=10 or so) for low dropout. My feeling is that you don't want to push BJTs beyond 10 A.Then there's MOSFET, where decent (if you know how to look) N channel devices exist. P channel don't, however. So it is NMOS only.Herehttps://www.diyaudio.com/community/threads/only-n-channel-mosfets-nmos-better-audio-from-non-complements-by-audio-power.148646/is a list of possible solutions.From that list United States Patent 5783970:This circuit does phase split differential drive, level shifted to two beefy TO-247 FETs, with settable bias current. Key of this patent I think is the thermal bias compensation, which works by multiplying the -2 mV/°C BJT gradient to for example -6 mV/°C for a (vertical, non-lateral) MOSFET. It seems intended for car audio. Maybe like this onehttps://www.sonicelectronix.com/landing/manuals3/thunderseries.pdf- 1000 W into 1 ohm, needs 100 A fuse.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 20, 2025, 03:52:36 am
content: Quote from: Martinn on January 19, 2025, 03:43:46 pmBecause you want current and least voltage, and only modest frequencies, it's not too difficult to run a bridge design, where half of it switches. (if youreallywant sine).You could call it ping-pong class AB.Buy a 5V or even 3.3V xxx AMP power supply and then two FETs switch sides and 2 FETs work in linear modeThe low main supply makes gate drive easy, as no level shifters or bootstrap are needed.Here is a simple example, running open-loop, no feedback at all, and with blanking FETs to keep things very simple.Even with no feedback applies it gives a passable sine output at 50Hz at 14.47A peak, with each linear FET needing to get rid of about 12W.Meter testing only needs a few seconds, so you can use thermal mass to your advantage.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 20, 2025, 08:36:25 am
content: Quote from: PCB.Wiz on January 20, 2025, 03:52:36 amand here is simple feedback added, for a better 50Hz sine wave.

author: Martinn
author_rank: Frequent Contributor
timestamp: January 20, 2025, 05:29:41 pm
content: Quote from: PCB.Wiz on January 20, 2025, 08:36:25 amThought about this as well, did not like the current spikes at crossover. Could you share your schematic? Which opamps did you use?One problem I see with your solution is that the current control opamps will go into positive saturation (LS FET on full steam ahead) when the side it belongs to is disabled. Then, when you switch it on, the FET gate is at 14 V and you have a 8 mOhm short until the current regulation kicks back in.Probably fixable, but I am not sure if the switching (see my version with the switching full bridge) is the best architecture if you also want lower currents. Could you try 0.1 A 1 kHz in your setup?Meanwhile I also added closed loop feedback to the Pleitz design:BTW my initial thought would have been measuring BLDC motor current of my mill. Most likely it has a six step control, meaning rectangular (trapezoidal) current waveforms.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 20, 2025, 09:21:36 pm
content: Quote from: Martinn on January 20, 2025, 05:29:41 pmThere is no crowbar effect, but there is a dead time, which can be < 10us, and depends on the OpAmps and fet Cgs.that's tolerable for 50Hz ~ 1kHzQuote from: Martinn on January 20, 2025, 05:29:41 pmThat's why the simpler stepped sine was suggested, it is likely good enough for meter testing.Quote from: Martinn on January 20, 2025, 05:29:41 pmThat's a more classic Audio amplifier approach, but that will be a challenge to get thermally stable.Even if you bolt a similar package for thermal sense to the same heatsink, the internal die temperatures will be significantly different.

author: Martinn
author_rank: Frequent Contributor
timestamp: January 21, 2025, 06:34:38 pm
content: Quote from: PCB.Wiz on January 20, 2025, 09:21:36 pmIt is a car audio amplifier. See link above.I see the problem... how serious is this in your opinion? MOSFET amplifiers exist, so somehow it can be done.In this case, I would hope that because of the very low supply voltage the effect of Vgsth -6 mV/°C is not as drastic - the relative increase of gate voltage will lead to higher current, but because supply is only 4-5 instead of 50-70 V, the positive feedback gain is much smaller. I'd hope that together with the thermal sense on the heatsink (which is not die temperature) it would be survivable. What do you think?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 21, 2025, 10:52:37 pm
content: Quote from: Martinn on January 21, 2025, 06:34:38 pmInteresting challenge. The docs claim Q6 & Q7 need to thermally couple, but Q1 also has an effect.It is highly sensitive to the value of R4, and the circuit as provided is over compensated. You would need a trimpot.eg if I replace Q1 with a current sink, to remove Q1 effects, and then tune R4 =49.8 Ohms for 40mA IQ at 50'C, it hits IQ of 7.6A (!) at 0'CIt will at least thermally regulateThermal coupling of Q6,Q7 could be a challenge, you can get matched pair PNP in larger packages - egOnSemi NSS40300MDR2G / NSV40300MDR2G (SO8)Nexperia PHPT610035PK LFPAK - lower thermal resistance, so will be better at thermally tracking.Or, you could manually match a couple of bolt-down PNP parts, like TO220F packages, since this will need a big heatsink.I did tune the dead-zone of the circuit I posted above, and with some sine pre-condition to drive with offset half sines, the gate-voltage slew effects greatly reduce, and disturbances drop to ~ 1us ballpark.An advantage of the current-feedback design, is you can use the same sense to define IQ. (for those obsessed with cross over distortion)Next I will try a single current regulator and a full bridge direction reverser. That's 5 FETs instead of 4, but just a single analog stage.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 22, 2025, 01:51:45 am
content: I changed your FETs to ones that give a more credible -6.124516mV/K, and tried both current sink, or Q1 with 2.5V base ref (allows a shunt regulator).With 15mA current, it can be tuned for a parabola with 91.37 Ohms, gives 59.16mA at 40'C and 57.95mA at 0/80'CCurrent sink 500R/91.37R Tempco Multiplier Ratio of = 5.472255664Add back Real Q1, 2v5 base. 176.5 Re 100R needs 67.995R 500R for parabola 53.582mA 52.845mATC of Q1 now needs 500/67.995 Tempco Multiplier Ratio = 7.353481874Q1 certainly has an effect, but it can be corrected. Problem then is it also needs to be thermally coupled.Plus, things are also very sensitive, without any source resistors to lower Gm.eg-2% change in R3 doubles ID(M1) to 106.31598mA-2% change in R4, leaps ID(M1) from ~53mA compensated, to 234.7mA - 197mA (0-80'C) (notice the null is gone too)

author: Martinn
author_rank: Frequent Contributor
timestamp: January 22, 2025, 07:03:01 pm
content: Quote from: PCB.Wiz on January 21, 2025, 10:52:37 pmI think we could limit temperature simulation to the four transistors on the heatsink (Q6+Q7+MOSFETs) and leave the rest at room temperature. That would remove Q1 influence. Not sure how to do this best in LTSpice, maybe define a parameter ptemp and assign this as temperature to those four transistors, then do a .op .step ptemp 0 100 1.Yes, the Infineon model does not have a proper Vgsth thermal model. VDMOS models have a parameter for this (Vtotc), but Infineon does not provide those (VDMOS seems to be a Mike Engelhardt specialty).As a quick fix I'd add a bv generating the correct offset voltage and put it in series to the gate.Where did you find a decent MOSFET model with proper thermal modeling? The builtin ones partly have a Vtotc parameter, but there is no really usable one in that list.I'd go for BD140 for Q6/Q7, beta is not great, but cheap and has a screw hole. I also have a model for those and I assume that Vbe thermal dependence is generally modeled in Si BJTs.Attached a thermal simulation with those four transistors only. As you write quite sensitive, a real build will need some 10 turn pots...The whole thing is a bit asymmetric unfortunately, due to the different voltages across Q4 and Q5. Tuned V5 for balance. Not relevant for closed loop current control, but annoying for those open loop simulations.Quote from: PCB.Wiz on January 21, 2025, 10:52:37 pmSee post #5, I tried this. Not sure if I really like it. All those switching schemes add more or less common mode noise from the switching, not ideal for a measurement tool.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 23, 2025, 12:45:26 am
content: Quote from: Martinn on January 22, 2025, 07:03:01 pmMaybe be best to replace Q1 with a proper current sink, using NMOS and shunt regulator.Quote from: Martinn on January 22, 2025, 07:03:01 pmFair point, but the switching occurs at the zero crossing, so has minimal effect on AC meters doing true RMS or averaged AC readings.I found by using simple, low threshold NMOS/PMOS pairs of gate driver FETS, x4, that the peak gate currents can be kept to local G-S loops and the load resistance 'noise' effect is reduced.Such simple source follower drivers also have zero IQ, so avoid disturbing the sine tracking.I see about +5mA for 80ns & -13mA for 200ns, alternating, when set for full scale of 166mA, with BSC009NE2LS5I Bridge FETS Vto = 2.05V 0.9mOOne appeal of the bridge, is it allows the current sink to future-change to a hysteretic feedback controller, for a simple switching current design with far lower power overheads.If you chase >> 10A, that may prove necessary.

author: Martinn
author_rank: Frequent Contributor
timestamp: February 03, 2025, 04:57:44 pm
content: OK. After doing more simulations on the dual NMOS driver idea from Pleitz, I have the feeling it would be quite tricky to adjust and rather sensitive.So instead I think I try to go for a really straightforward current controller with low side shunt - and two of them stacked on top of each other.To minimize crossover distortion, I'd keep them both conducting (shown 1 A), with the difference of high/low side current going into the output.ADA4510 is really nice, high voltage RR in-out, precision (digitrim), high Cload drive... ticks all checkboxes. Closed loop BW of one of the individual current controllers is above 300 kHz. This would eliminate all drift problems, one could even connect multiple high and low side sources in paralell, although a single IRFP4468 will be plenty for the time being.Next challenge will be to generate the level shifted, clipped and bias-added +in voltages for the two controllers.Anyone?As a side note, few days ago a colleague had the same problem. He used a Hameg PSU which had a 0-10 V modulation input. Connected to a function generator with a resistor at the output it gave some AC current for testing. Not bipolar, not 10 A but much better than nothing.

author: timeandfrequency
author_rank: Frequent Contributor
timestamp: February 08, 2025, 09:21:15 am
content: Hello Martinn,Quote from: Martinn on February 03, 2025, 04:57:44 pmI would suggest the following directions :A) Synchrounous control of isolated DDS chipsUse twoDDS chips. Isolate all logic lines with fast optocouplers, MCLK has to be the same and isolated too. Control the logic lines of each chip synchronously : the control lines coming out of the µC are linked to two sets of optocouplers. You drive both DDS chips as you would have just one unit downstream the µC.Even with a basic DDS chip, you should have at least - 55 dB SFDR@7MHz output (MCLK = 20 MHz).B) Analog chain with isolation barrierUse twoisolated opampsto drive each branch from a common sine source. Add the bias downstream the 'secondary' side of the ISO opamps by analog adding it with a vanilla opamp. You may want to digitally adjust the bias level by using a small serial DAC. Isolate its digital control lines by using the same optocoupler principle as above.Also check out theAMC0311S, AMC0211Sisolated opamps which are unipolar, have lower offset and more BW.FootnoteFor each controller/branch, you might need isolated power supplies. In the affirmative, DC-DC modules (Traco, Recom) + good filtering and followed by linear regulators allows you to create isolated unipolar and/or bipolar power supply rails.

author: JXC
author_rank: Newbie
timestamp: June 06, 2025, 08:17:29 am
content: I also want to make an AC current source with a ±300V power supply. The current is relatively small, with a maximum of 200mA. I didn't think of a better way to drive the H-bridge

author: Martinn
author_rank: Frequent Contributor
timestamp: July 27, 2025, 06:13:06 pm
content: Short update.I have been reluctant to throw a lot of effort onto this problem as - I don't really need it, just am curious how it could be done.Thinking of what I am least familiar with I decided to go with an audio style BJT amplifier. I remembered Rod Elliott has lots of those and found the 500 W subwoofer design P68 a good fit.https://sound-au.com/project68.htmRod confirmed this and also suggested some design modifications:Here's how it looks likeAnd here is an output screenshotwhere the orange channel is connected to the current probe and shows 5 A/div, so 15 A pk. That's the maximum I get out of my bench PSU.You can also see why I was not overly fond of this principle. There are ten (!) TO-247 transistors mounted to an undersized heatsink (just there to provide some thermal mass). At 15 A output (into a piece of wire with 10 mOhms resistance) the unit dissipates already over 100 W, which is just a few % of efficiency with 97% of power input dumped as heat into the heatsinks.I modified the amplifier to run from +-12 V as I have some 750W 12V server power supplies (modified to allow for floating output) I could use. With those, I should be able to achieve significantly more current output - for short periods only though, as otherwise the expensive output BJTs probably would melt.- Martin

author: coppercone2
author_rank: Super Contributor
timestamp: July 27, 2025, 06:18:23 pm
content: you need to buy a current transformer for high current testing. They exist for metrology stuff. Not sure how cheap you can get it.. but its like a real test equipment accessorybuilding one would not be a waste of time if you built it right. The fluke one costs 5k. They do 30:1 turns ratio on theirs roughlythis one looks cheaphttps://us.rs-online.com/product/simpson/01297/70209341/if your windings are correct it should be able to use audio power amp

author: Micke
author_rank: Regular Contributor
timestamp: July 27, 2025, 07:57:49 pm
content: Could this be useful?https://www.eevblog.com/forum/testgear/external-amplifier-for-laboratory-generator/msg2956398/#msg2956398I have built two, and it works fine up to like 10A.Could surely be upgraded for higher current!?