Needing an analog multiplier, a special oscillator, or something to control duty cycle in my power conversion circuit

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
I am currently working on a power electronics project in Kicad. It's a special kind of power converter.

The part of the project that I'm struggling with is that I need either a voltage-controlled amplifier, analog multiplier, analog divider, or some kind of transistor oscillator with 3 states.

For this project I need to rapidly alternate between turning on 3 transistors. Generally only one will be turned on at a time, but with the duty cycle of each one being proportional to a voltage. There are 3 voltages that should be should determine the relative duty cycle of each transistor. They follow a rectified sine wave. Here is the waveform of these 3 voltages:
3-phases.png

One idea I had was to synthesize 3 triangle waves, and multiply them by the above voltages. The transistor turned on at any given time would be determined by the highest product. Here is the circuit I created for a 3-phase triangle wave synthesizer, and their waveforms.
Screenshot_20231222_134850.png
triangle-waves.png

The problem is that I have tried a variety of analog multiplier or voltage-controlled amplifier circuits that I found online, but none of them worked as expected. It might be a problem with NGSpice, but I want to be able to simulate my circuit to make sure it works. Even if I could get one of them to work, I don't know exactly how it should be configured for what I'm doing.

An alternative to the analog multiplier would be to have a kind of oscillator using transistors and capacitors. It can use 3 capacitors. One capacitor at a time would be charged until it reaches a given voltage, and then it would be immediately discharged and the next capacitor would begin charging. The speed at which the capacitor is charged would be determined by the voltage at the other side of a resistor. But I don't know how to implement this.
 

Ian0

Joined Aug 7, 2020
13,097
Generally, if you want a squarewave with a duty cycle proportional to a given voltage, all that is necessary is to make a triangle or sawtooth waveform then compare the given voltage with the sawtooth using a comparator.
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
Generally, if you want a squarewave with a duty cycle proportional to a given voltage, all that is necessary is to make a triangle or sawtooth waveform then compare the given voltage with the sawtooth using a comparator.
But that doesn't do what I want. That works when using a single power transistor and are switching between two states; on and off. In this case, I need to switch between 3 states.
 

Papabravo

Joined Feb 24, 2006
22,058
But that doesn't do what I want. That works when using a single power transistor and are switching between two states; on and off. In this case, I need to switch between 3 states.
So you build 3 copies of the basic circuit. Now you have 3 PWM generators that can be used with reference copies of the sine waves. I think you have a great deal to learn before you will be ready to launch. Good luck.
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
So you build 3 copies of the basic circuit. Now you have 3 PWM generators that can be used with reference copies of the sine waves. I think you have a great deal to learn before you will be ready to launch. Good luck.
I've tried testing something like that, but it doesn't work. I used each of the phase-offset triangle waves from the oscillator circuit I created to do that. In that case, the switching of each transistor is independent of the others. When one of the half-sine waves is peaking, it's respective transistor should have half the duty cycle, and the other two should get a quarter each. But because the triangle waves are 120 degrees apart, there is some overlap between the transistors' on time, and for 30⁰ (or 1/12) of the cycle, all the transistors are off.
 

Papabravo

Joined Feb 24, 2006
22,058
I've tried testing something like that, but it doesn't work. I used each of the phase-offset triangle waves from the oscillator circuit I created to do that. In that case, the switching of each transistor is independent of the others. When one of the half-sine waves is peaking, it's respective transistor should have half the duty cycle, and the other two should get a quarter each. But because the triangle waves are 120 degrees apart, there is some overlap between the transistors' on time, and for 30⁰ (or 1/12) of the cycle, all the transistors are off.
Well, I certainly understand the need for deadtime. Did you actually try to figure out why it did not work. We often learn more from our failures than from our successes. I don't know what to tell you, but since you seem convinced you know which way you want to go, I'll leave you to your own devices. Good Luck
 

LowQCab

Joined Nov 6, 2012
5,101
"" I am currently working on a power electronics project in Kicad.
It's a special kind of power converter. ""


It sounds like You have just enough understanding of Electronics to think that
You have come up with an idea that's going to flip the World of Power-Generation on it's head.

If this is true, it's not gonna happen like You may have envisioned.

If You will provide a detailed description of what it is that You are trying to accomplish
I'm sure that You will get some useful insights here,
but if there's anything "secret" about it, then you're on your own.

Are You trying to create a multi-phase Buck-Converter ???
( just like the type that every Computer built in the last ~30-years operates on )
.
.
.
 

Audioguru again

Joined Oct 21, 2019
6,826
Your opamps have no negative feedback then their voltage gain at 50kHz is about 1000 times.
Also, your very high frequency is approaching the spec'd slew rate limiting that causes a sinewave or squarewave output to be a triangle waveform.
 

MrAl

Joined Jun 17, 2014
13,667
I am currently working on a power electronics project in Kicad. It's a special kind of power converter.

The part of the project that I'm struggling with is that I need either a voltage-controlled amplifier, analog multiplier, analog divider, or some kind of transistor oscillator with 3 states.

For this project I need to rapidly alternate between turning on 3 transistors. Generally only one will be turned on at a time, but with the duty cycle of each one being proportional to a voltage. There are 3 voltages that should be should determine the relative duty cycle of each transistor. They follow a rectified sine wave. Here is the waveform of these 3 voltages:
View attachment 310637

One idea I had was to synthesize 3 triangle waves, and multiply them by the above voltages. The transistor turned on at any given time would be determined by the highest product. Here is the circuit I created for a 3-phase triangle wave synthesizer, and their waveforms.
View attachment 310638
View attachment 310639

The problem is that I have tried a variety of analog multiplier or voltage-controlled amplifier circuits that I found online, but none of them worked as expected. It might be a problem with NGSpice, but I want to be able to simulate my circuit to make sure it works. Even if I could get one of them to work, I don't know exactly how it should be configured for what I'm doing.

An alternative to the analog multiplier would be to have a kind of oscillator using transistors and capacitors. It can use 3 capacitors. One capacitor at a time would be charged until it reaches a given voltage, and then it would be immediately discharged and the next capacitor would begin charging. The speed at which the capacitor is charged would be determined by the voltage at the other side of a resistor. But I don't know how to implement this.
Hi,

I've designed all kinds of analog and digital circuitry both professionally and as a hobby so I should be able to help with this.
Only thing is, I do not completely understand the requirements of the circuit from your description.

You say you need transistors to turn on with that three phase sine yet you say only one transistor will be on at a time. If the transistors turn on according to the voltage levels and provide a pulse due to that voltage level, then the transistors will all be on most of the time except when one phase is zero, and except if they are producing a duty cycle proportional to the voltage levels.
That's because although the duty cycle will vary for each transistor, they will be generating pulses that start out narrow and then get wider and wider, then start getting more narrow again. That's all three transistors though because they will all follow their respective input voltages, and the voltages are mostly non-zero for the entire time.

Thus it would be a good idea if you explain this a little more and maybe provide a diagram not of a circuit that does not work (haha) but a diagram of the waves vs the output of each transistor. THAT would help a lot in determining what kind of circuit would be best.

Offhand I can think of one ... a microcontroller ... if you are into that. With a uC you can do almost anything like this if the frequency is not ultra high.
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
"" I am currently working on a power electronics project in Kicad.
It's a special kind of power converter. ""


It sounds like You have just enough understanding of Electronics to think that
You have come up with an idea that's going to flip the World of Power-Generation on it's head.

If this is true, it's not gonna happen like You may have envisioned.

If You will provide a detailed description of what it is that You are trying to accomplish
I'm sure that You will get some useful insights here,
but if there's anything "secret" about it, then you're on your own.

Are You trying to create a multi-phase Buck-Converter ???
( just like the type that every Computer built in the last ~30-years operates on )
.
.
.
You've guessed correctly. I suppose there is no point in keeping things secret at this point. It is indeed a 3-phase buck converter. It's supposed to convert 3 phases to DC with little waveform distortion. When I get home I will declassify more of it's design (so far).

It's entirely possible that what I'm trying to make has already been invented, as I don't know much about what's out there. I don't see why you would claim that every computer of the past 30 years already has one. Most computers aren't connected to 3-phase power.
 

schmitt trigger

Joined Jul 12, 2010
2,027
What you are mentioning is a three phase PFC, power factor corrected power power supply.
If you have a available a 3 phase Wye source, you simply add three individual single phase PFC circuits, for which there are literally dozens and dozens of solutions already. No need to reinvent the wheel.

The only difficulty consists of equal load sharing across all three phases. An independent control loop whose feedback is phase current, modifies the individual PFCs. Because it is another feedback loop with nested feedback loops, compensation is tricky.
 

Ian0

Joined Aug 7, 2020
13,097
Firstly, you can never get a truly sinusoidal current waveform from a buck converter, because there will be no current flowing when the input voltage is less than the output voltage.
If you operate it in discontinuous mode, then the current will be proportional to the pulse width multiplied by the difference between input and output voltages. If the input voltage is large compared to the output voltage, then it approaches a sinusoid, but buck converters aren't so great with a big input-output differential.
So, if you keep it in discontinuous mode, and make all the pulse widths the same, then you will get a pretty good sinusoid.
If you want a perfect sinewave, then you will have to use a boost converter or a Čuk converter.
 

LowQCab

Joined Nov 6, 2012
5,101
"" I don't see why you would claim that every computer of the past 30 years already has one.
Most computers aren't connected to 3-phase power. ""

Many, if not most, Computers have 6-Phase Voltage-Regulators.
This has nothing to do with the Main-Input-Power form.
.
.
.
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
I said that I would share what this project really is, so here it is.

It's a kind of switching power converter that regulates the DC output voltages by switching between the 3 input phases.
3-phase-to-DC-magic_1.png
Some of the components are chosen for easy simulation. All the voltage sources should be replaced by the secondary windings of a transformer. V1, V2, & V3 are all 50hz sine waves with peaks of 180 volts (about 127V RMS). Each phase has a bridge rectifier, and a pair of transistors. Normally, only one transistor pair should be turned on at any given time. They should be timed in such a way to make the voltage at 'Vout' 13/15ths of the the peak voltage on each phase. That would be about 156V in this case.

This is similar to a buck converter, but instead of alternating between a higher voltage and 0 volts (with an inductor pulling current through a diode), it switches between 3 voltages which are all above 0.

The diodes D26, D36, & D39 are only there for demonstration purposes so that we can see the a proper rectified sine wave at P1, P2, & P3. C1 is set to 0 for testing purposes.

V7, V8, and V9 are just the same 3 phases but with 30V peaks, used as references for the control circuitry. You can ignore the circuit on the right. It was my attempt to make a voltage reference for the desired output voltage, but it isn't being used right now.

magic-control-circuit_1.png

For the control circuitry, I was struggling to simulate analog multipliers, and I haven't found any designs for the kind of capacitor oscillator I mentioned earlier, so for now I decided to just make some "magic" components with mathematically ideal behaviour; at least ideal according to the theory in my head. This can be used to test how the circuit behaves under the timings that I was aiming for. Obviously, these will have to be replaced by real components if this is ever to be built in reality. I still have the old non-magical control circuit saved that I can go back to when I've figured things out.

V4, V5, & V6 are the triangle wave generators 120° out of phase with each-other. Even though I designed a circuit that roughly does this, I thought I should test the circuit with ideal triangle waves that start at 0V.

There are 3 magical voltage multipliers I wrote spice models for. They multiply the higher-frequency triangle waves by the rectified sine waves. Comparators are used to turn on the transistors for a phase when it's respective product voltage is higher than the others. The formula for the duty cycle of Phase 1 is `vP1/(vP1+vP2+vP3)`. Therefore, when it has a 50% duty cycle at peak, 0% when at 0V, and 25% when at P1 is at 90V (or half it's peak voltage).

Here is the Desmos link for the math I used to determine the ideal timings. I've realized just while writing this that I got the math wrong for the ideal duty cycle, but I might as well share what I have anyway. Here are some voltage waveforms from the simulation:

3-phase-to-DC-magic_1_products.png
Purple, orange, and yellow are 60% of the voltages at P1r, P2r, & P3r respectively. The voltages are sampled at the inputs of the voltage multipliers. Red, blue, & green are the products of these voltages with their respective triangle waves.

So what is the resulting voltage at Vout? Let's see:
3-phase-to-DC-magic_1_high-voltages.png
Red, blue, and green are the voltages at P1, P2, & P3. Purple is the voltage at Vout. As you can see, the voltage stays around the desired 155V for some of the time, but then drops down to 143V when one of the phases peaks. The last formula you see in the Desmos graph (in orange) I just added while writing this to confirm that I got the math right. It looks like I didn't, as it's not flat. I will need to rethink the math to get the timings right. It's possible that the ideal output voltage isn't actually 13/15ths of the peak input voltage, but something lower.

I should also note that the currents from V1, V2, & V3 currently aren't sine waves in this simulation, but they pulsate. When they are replaced by transformers, the inductance would solve this, but then tiny capacitors may need to be added for proper functioning of the circuit.
 

Ian0

Joined Aug 7, 2020
13,097
I should also note that the currents from V1, V2, & V3 currently aren't sine waves in this simulation, but they pulsate. When they are replaced by transformers, the inductance would solve this, but then tiny capacitors may need to be added for proper functioning of the circuit.
They never will be, transformer or no transformer. Buck regulators cannot take current from the supply if the supply is lower than the output voltage. That means the current can never be sinusoidal.
If that is the objective of the project, then you need to start again from the beginning.
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
They never will be, transformer or no transformer. Buck regulators cannot take current from the supply if the supply is lower than the output voltage. That means the current can never be sinusoidal.
If that is the objective of the project, then you need to start again from the beginning.
You should reread the whole thing. The term "buck regulator" must be throwing you off. This is a different, but related design for a switching power converter.

In a typical buck regulator, the input voltage is indeed higher than the output, but it switches between this and 0 volts. The one that I'm designing instead switches between 3 fluctuating input voltages. At least one will always be higher than the output voltage, but at least one will always be lower.
 

Ian0

Joined Aug 7, 2020
13,097
I see what you are trying to do - more like an asymmetric half bridge than a buck.
I think that if you switch each input for equal times, then the current from each phase should be proportional to its voltage. That should result in a DC voltage of 63% of Vpeak, with about 5% ripple.
If you want ripple-free DC then you can't have sinusoidal currents.
Your power switching stage leaves a lot to be desired. MJE350 is a really slow transistor and really not up to the job. You definitely need a MOSFET, but driving the gate will be interesting as the usual high-side gate drivers need the voltage to go down to zero in order to charge the bootstrap capacitor.
[Edit] but when you have done it, exactly how much improvement over a six-pulse rectifier followed by single buck converter have you achieved?
 
Last edited:

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
I think that if you switch each input for equal times, then the current from each phase should be proportional to its voltage. That should result in a DC voltage of 63% of Vpeak, with about 5% ripple.
Wouldn't the inductor L1 equalize the current from each phase in that case?

Your power switching stage leaves a lot to be desired. MJE350 is a really slow transistor and really not up to the job. You definitely need a MOSFET, but driving the gate will be interesting as the usual high-side gate drivers need the voltage to go down to zero in order to charge the bootstrap capacitor.
Thank you. I didn't find the switching time of MJE350 in the datasheet. But I found the outputs to be different when using faster BJTs. In all these simulations, there is a switching frequency of 33.3 kHz. Here is what I got when replacing them with various PNP transistors all rated for 30 MHz, and one P-channel MOSFET:

FJL4215 (PNP):
converter-output-FJL4215_2.png

2SA1943 (PNP):
converter-output-2SA1943.png

NJW0302 (PNP):
converter-output-NJW0302.png

IRF9640 (P-channel MOSFET):
converter-output-IRF9640.png
For this last one, I had to play with the resistor values to not make it just a rectifier. I set the source-gate resistor to 1k and the resistor from the gate to the other MOSFET's drain to 6.8k.

I think an IGBT with reverse-blocking would be ideal, but I remember there being some simulation difficulties last time I tried that. I may also try a Sziklai pair.

[Edit] but when you have done it, exactly how much improvement over a six-pulse rectifier followed by single buck converter have you achieved?
The goal is to achieve a good combination of 3 factors; high efficiency (including transmission losses from the 3 phases), low distortion of the sinusoidal input waveforms, and low output voltage fluctuation. I'm starting to think I should put less priority on the final one, which is unfortunately the only one I've been able to accurately measure.

A 6-pulse rectifier is just 3-phase power going through some diodes. It distorts the input waveform very heavily. A 12-pulse rectifier would be a more reasonable comparison.

Unfortunately, Ngspice is quite finicky, and the simulation is more likely to fail when the circuit gets more complex. I've tried adding a transformer to this circuit, which caused the simulation to fail. Putting too big of an inductor on V1 caused the simulation to end prematurely. Because of this I don't have an accurate reading of input current with an inductor to smooth out the pulsation. But from what I can tell, it's probably not too far off from a sine wave when setting each phase's duty cycle proportional to it's voltage divided by the average phase voltage.
 
Last edited:
Top