# DC or AC Analysis?

#### DC_Kid

Joined Feb 25, 2008
924
Does AC analysis apply when using PWM to turn on/off an inductor? We typically use 2piFL to get XL and then use vector some to obtain a Z for some frequency. This assumes AC sine wave.

If you only turn on an inductor in one direction, and it has time to sit idle between 'on' times, does the analysis collapse back to DC and Z get's tossed out the window?

As example, drive 1mH(Rdc=1) with a 12v 50% 10kHz PWM. Is there a Z equation for this, or is it all approximated using DC analysis?

#### Papabravo

Joined Feb 24, 2006
18,131
Hard to do a DC analysis when

$$V\;=\;L\dfrac{di}{dt}$$

and then you decide to make L a function of frequency. Now we are no longer in ODE territory.

#### DC_Kid

Joined Feb 25, 2008
924
Yeah, but the equation for Z, based on sine AC, does not appear to hold true. I can't just calculate Z as normal, and then take Z into ohms law. Does not seem to work.

From physics, doesn't Z (based on sine AC) manifest itself because when the voltage flips over it's fighting against a reverse voltage from collapsing mag field? With PWM drive you don't have this.

So, is there a special formula for "Z" when driving an inductor 50% PWM as some frequency? What if the PWM changes, 10% vs 50% vs 90%?

#### Papabravo

Joined Feb 24, 2006
18,131
Inductance is a property of an inductor that is independent any applied waveform. Consider the series RL circuit where the current has an exponential rise and an exponential fall. The inductance L shows up explicitly as part of the time constant for that first order system. Nothing about this system requires a sine wave and the reactance is still equal to jωL. Now it is true that, a square wave can be decomposed as a sum of sine waves of various frequencies and the inductor represents an impedance Z to all of those components. The impedance at each frequency is given by the familiar expression.

#### MisterBill2

Joined Jan 23, 2018
11,624
PB is the first one to get it right!! Inductive reactance is dependent on frequency, not inductance. And for a square wave or a PWM wave, transient analysis is appropriate. So there may be a bit of confusionbecause transient analysis is rather complex.

#### crutschow

Joined Mar 14, 2008
29,521
AC analysis is normally used when the signals are sinewaves.
For a switching circuit, transient analysis is used.

#### DC_Kid

Joined Feb 25, 2008
924
PB is the first one to get it right!! Inductive reactance is dependent on frequency, not inductance. And for a square wave or a PWM wave, transient analysis is appropriate. So there may be a bit of confusionbecause transient analysis is rather complex.
Huh?
For a fixed inductor, The L becomes constant, therefore XL is a function of frequency.
This does not hold true for an inductor system/frame where L changes with use, as example, solenoids where a magnetic core changes position and will/can change L, and when you have fixed frequency the XL then becomes a function of L, not frequency.

#### DC_Kid

Joined Feb 25, 2008
924
AC analysis is normally used when the signals are sinewaves.
For a switching circuit, transient analysis is used.
So, drive 1mH(Rdc=1) with a 12v 50% 10kHz PWM. Is there a Z equation for this?

Model in Spice and it only measures inductor current using ohms law (voltage of PWM and Rdc of coil). This is not the same as sine Z math.

#### Ian0

Joined Aug 7, 2020
4,882
AC analysis is normally used when the signals are sinewaves.
For a switching circuit, transient analysis is used.
Agreed - AC analysis implies frequency domain analysis to me, and results in a Bode plot or something similar.
For a switching circuit with PWM, time domain analysis is required.

#### Papabravo

Joined Feb 24, 2006
18,131
Huh?
For a fixed inductor, The L becomes constant, therefore XL is a function of frequency.
This does not hold true for an inductor system/frame where L changes with use, as example, solenoids where a magnetic core changes position and will/can change L, and when you have fixed frequency the XL then becomes a function of L, not frequency.
If L is not constant, then the reactance becomes a function of multiple variables. To see how the reactance changes you have to use partial derivatives.

#### DC_Kid

Joined Feb 25, 2008
924
A video shows DC analysis on LTspice.
Change Vsource to a Pulse type making it Ton 0.5m and Tperiod 1m (50% 1kHz).
PWM is typically always DC. I suspect we could could get crafty to make a PWM where the square wave swings from +5v down to -5V. But in basic PWM the voltage is zero to some +v.

#### sparky 1

Joined Nov 3, 2018
705

#### DC_Kid

Joined Feb 25, 2008
924
Spice is calculating amps using Rdc only (12ohms), and not calculating any Z what-so-ever.
1mH coil with Rdc=1
11ohm Resistor
1kHz
XL= 2pifL = 6.28
Rdc(ckt) = 12 = (1coil + 11resistor).
Z = sqrt(6.28^2 + 12^2) = 13.54 ohms

12/13.54 does not equal 12/12. Spice shows 12/12.
If were basic 1kHz sine across the resistor and inductor, the amps would never reach 1A.

Last edited:

#### DC_Kid

Joined Feb 25, 2008
924
The capacitors are opens and the inductors are shorts, the simulation in LTspice works.
An inductor that looks like a short means XL=0 for any freq, which means the part collapses down to Rdc of the inductor wire only. If XL=0 for any freq of PWM, then you technically don't have any L (electrically) for a portion of the ckt analysis. I say 'portion' because the L is still real, we get V spike on collapsing mag field.

Which goes back to my original question, if the ckt looks like Rdc only at any frequency of PWM, then that's basic DC math, Rdc and Volts, ohms law when PWM is 'on' and 'off'.

#### Papabravo

Joined Feb 24, 2006
18,131
An inductor that looks like a short means XL=0 for any freq, which means the part collapses down to Rdc of the inductor wire only. If XL=0 for any freq of PWM, then you technically don't have any L (electrically) for a portion of the ckt analysis. I say 'portion' because the L is still real, we get V spike on collapsing mag field.

Which goes back to my original question, if the ckt looks like Rdc only at any frequency of PWM, then that's basic DC math, Rdc and Volts, ohms law when PWM is 'on' and 'off'.
A pair of resistors would not have the exponential rise and fall that you see with the resistor and the inductor. The inductance is responsible for the shape of the waveform and it is the ratio of the inductance to the resistance that will change the shape. Hard to say what your major malfunction is, but there we have it.

#### DC_Kid

Joined Feb 25, 2008
924
A pair of resistors would not have the exponential rise and fall that you see with the resistor and the inductor. The inductance is responsible for the shape of the waveform and it is the ratio of the inductance to the resistance that will change the shape. Hard to say what your major malfunction is, but there we have it.
I have to look at it closer. But as you explain it, the waveform shape is one thing, the actual electrical characteristics is something else. Thus far PWM seems to show that peak amps is basic V/Rdc, no regard to L.
I don't have a ckt yet. Just trying to understand the impedance analysis, which looks like Rdc component only.

Last edited:

#### Papabravo

Joined Feb 24, 2006
18,131
I have to look at it closer. But as you explain it, the waveform shape is one thing, the actual electrical characteristics is something else. Thus far PWM seems to show that amps is basic V/Rdc, no regard to L.
I don't have a ckt yet. Just trying to understand the impedance analysis, which looks like Rdc component only.
Again look at the difference between the series RL circuit and the identical circuit with the inductor replaced by a resistor. The fast rising edge of the voltage source looks like a high frequency signal to the inductor which changes the shape from a linear ramp to a rising exponential. the value of the inductance and the associated reactance is what is responsible for the shape change. Have LTspice put the output of the voltage generator on top of the exponential waveform and notice how the rise of the exponential gets flatter the closer you get to the final value of the rising pulse.

#### DC_Kid

Joined Feb 25, 2008
924
Again look at the difference between the series RL circuit and the identical circuit with the inductor replaced by a resistor. The fast rising edge of the voltage source looks like a high frequency signal to the inductor which changes the shape from a linear ramp to a rising exponential. the value of the inductance and the associated reactance is what is responsible for the shape change. Have LTspice put the output of the voltage generator on top of the exponential waveform and notice how the rise of the exponential gets flatter the closer you get to the final value of the rising pulse.
Yes, understood. I understand how LR of coil changes amps waveform shape.
Changing coil H and Rdc of the component parts does impact waveform (shape and min max amps).
So, it does not follow simple sine AC math (typical Z equation). Spice and the like the only way to see what's going on. so simple equation?

#### Papabravo

Joined Feb 24, 2006
18,131
Yes, understood. I understand how LR of coil changes amps waveform shape.
Changing coil H and Rdc of the component parts does impact waveform (shape and min max amps).
So, it does not follow simple sine AC math (typical Z equation). Spice and the like the only way to see what's going on. so simple equation?
No. You can also solve the first order differential equation which will give you a closed from result for the resulting current and voltage waveforms. It is not DC, but it is also not AC, It is somewhere in between. If differential equations are beyond your math level, the circuits are explained in the following articles. The series RC circuit is similar. Look at the subheading for Time-Domain Considerations

https://en.wikipedia.org/wiki/RL_circuit
https://en.wikipedia.org/wiki/RC_circuit

#### DC_Kid

Joined Feb 25, 2008
924
What is "DC"? Amps in one direction only? If those amps change in magnitude only, is it not DC?
For clarity, "amps" is a vector.

The wiki's are ok.
Some confusing words in there. The simplest RL ckt is a coil all by itself, because a coil is itself also a resistor (Rdc). Where in the Wiki equations does it account for the Rdc of the coil itself?

It explains the RL ckt using two components for analysis, namely R and pure inductor L.
In reality, an inductor has it's own R. What does that analysis look like when the ckt is R1 resistor, R2 of coil wire, and pure L , when R2 is of significant value, like R1=R2=200ohms (small wire lots of turns).

In other words, with just a coil (L & R) you cannot measure VR and VL separately when viewing it as a voltage divider.