The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version.
Problem Overview
I have recently been working on a project involving PWM control of an electromagnet, and I was surprised to find that PWM at different frequencies seemed to produce different power consumption at the same duty cycle. I therefore did some simple calculations and analysis and have put the results here.
Here, the resistance R mainly comes from the resistance of the enamelled wire itself; the inductance L describes the relationship between the magnetic flux linkage in the coil and the current. When the current changes, the coil produces an induced electromotive force and, according to Lenz’s law, opposes changes in the current and magnetic flux.
Current Under Constant Voltage
Because PWM can be regarded as a periodic piecewise function, we can first consider the simplest case under constant voltage and then consider the piecewise function of PWM. For V(t)=V0, the differential equation of the LR system is:
Ldtdi+Ri=V0
For the homogeneous solution, write the corresponding characteristic equation:
Lr+Rr=0=−LR
Therefore, the homogeneous solution is:
ih(t)=Ce−LRt
The time constant can be defined as:
τ=RL
The homogeneous solution can then be written as:
ih(t)=Ce−τt
Because the input voltage is constant, we can guess that the particular solution is a constant ip(t)=A. Substituting it into the differential equation gives:
RA=V0becausedtdip=0
Therefore,
ip=RV0
Combining the homogeneous and particular solutions gives the general solution:
i(t)=Ce−τt+RV0
Next, determine the constant C from the initial condition. Assume that the initial current is i(0)=i0. Substitution gives:
i0C=C+RV0=i0−RV0
The final result is:
i(t)=RV0+(i0−RV0)e−τt
Drag the sliders below to observe how the time constant τ, initial current i0, and DC steady-state current if(V0/R) affect the current response. The part of the graph where t<0 remains at the initial current, and the response begins at t=0.
Loading chart...
The first term is the DC steady-state current, while the second is the continuously decaying transient current.
Current Under PWM
For a PWM signal with period T and duty cycle D, its voltage can be expressed as:
V(t)={V000≤t<DTDT≤t<T
The graph below shows the periodically repeating PWM voltage. The duty cycle D, period T, and high-level voltage V0 can be adjusted.
Loading chart...
Cycle Peak and Valley Currents
Let the DC steady-state current be if=V0/R, and assume that the initial current is i0=0. Then, at the first transition from the high level to the low level, the current is:
imax1=if+(0−if)e−τDT=if(1−e−τDT)
Let E=1−D. Then, at the first transition from the low level to the high level, the current is:
imin1=imax1e−τET=if(1−e−τDT)e−τET
We can observe that the current in each state can be calculated from the current in the preceding state and the time constant τ. Therefore, the following recurrence relations can be written:
To make the pattern easier to observe, continue by listing several transitions. The following is the second transition from the high level to the low level:
Notice that the odd-numbered terms (red) and even-numbered terms (blue) in the equation above can each be generalized as a geometric sequence. Both have the common ratio e−τT, but their first terms differ. Let k=τT; the general formula can be written as:
After letting n→∞, use the infinite geometric series sum formula 1−ra, where the first term is a=if(1−e−Dk) and the common ratio is r=e−k. This gives:
n→∞limimax(n)=imax=if1−e−k1−e−Dk
Note that this series converges only when ∣e−k∣<1, that is, −k<0⟹k>0. Because T,τ>0, this condition is clearly always satisfied.
According to the recurrence formula above, the current at each transition from the low level to the high level is:
imin=imaxe−τET=if1−e−ke−Ek(1−e−Dk)=if1−e−ke−Ek−e−k=if1−e−ke−(1−D)k−e−kdivide the numerator and denominator bye−k=ifek−1eDk−1
Next, let the frequency be f=1/T and observe how the cycle peak current imax and cycle valley current imin vary with PWM frequency after the system has entered the periodic steady state. The horizontal axis uses a logarithmic scale, and the duty cycle D, time constant τ, and DC steady-state current if(V0/R) can be adjusted.
The buttons inside the graph can be used to switch between logarithmic and linear coordinates.
Loading chart...
We can observe that, as the frequency increases, the current fluctuation amplitude decreases and approaches the product of the DC steady-state current and the duty cycle, ifD. Taking the limits of the cycle peak current imax and the cycle valley current imin separately gives the following. Because both expressions are of the form 00 as k→0, differentiate the numerator and denominator separately with respect to k and apply L’Hôpital’s rule:
The calculated result agrees with the graph above.
Period-Average Current
The preceding calculations obtained the cycle peak current imax and cycle valley current imin. We can therefore calculate the relationship between the period-average current i and the duty cycle D.
The average current over one period is the sum of the current integrals over the on and off stages divided by the period T:
i=T1[∫0DTion(t)dt+∫0(1−D)Tioff(t)dt].
The currents during the on and off stages are, respectively:
The two exponential integral terms cancel exactly:
(imin−imax)+(imax−imin)=0.
Therefore:
i=TifDT=ifD.
Thus, the period-average current is independent of the PWM frequency and equals the product of the DC steady-state current if and the duty cycle D.
For an ideal energized solenoid, the magnetic field strength satisfies H=nI, while the magnetic flux density satisfies B=μH=μnI, where μ is the permeability and n is the number of turns per unit length. The relationship above therefore shows that, under this ideal model, the electromagnet’s average magnetic field strength is independent of frequency and varies linearly with the duty cycle.
Power Under PWM
For an LR system, the average power of the inductor is zero, as can be shown by the following process.
The inductor voltage satisfies:
VL(t)=Ldtdi
Substituting this into P=VI gives:
PL(t)=Lidtdi
For a PWM signal with period T, the average power of the inductor is:
Because the current i(t) is periodic over one period, i2(t) is also periodic, and its values at the beginning and end of the period are equal. Therefore:
i2(t0+T)−i2(t0)=0.
Thus, the boundary term above is zero, and the average power of the inductor over one period is also zero.
Therefore, in the period-average sense, only the power dissipated by the resistor remains in the entire system:
PR(t)=i2(t)R
Now consider the average input power P over one complete period after the system has entered the periodic steady state. Divide the PWM period into the off and on stages. During the off stage, V=0, so the input power from the source, V(t)i(t), is zero; however, the resistor continues to dissipate power at i2(t)R, with the energy released by the inductor. During the on stage, the following relationship is obtained:
P=T1∫t0t0+TV(t)i(t)dt=TV0∫0DTion(t)dt
During the on stage, the current can be understood as rising gradually from the cycle valley current imin to the cycle peak current imax with the time constant τ. Therefore, we can write:
P=TV0∫0DT[if+(imin−if)eτ−t]dt
Because:
∫0DTeτ−tdt=τ(1−e−τDT)
substituting the integral result into the equation above gives:
define the DC power as Pref=V0if=RV02. Therefore:
P=Pref[D−k11−e−k(1−e−Dk)(1−e−Ek)]
Then substitute E=1−D:
P=Pref[D−k11−e−k(1−e−Dk)(1−e−(1−D)k)]
Finally, use:
f=T1,k=τT=fτ1,k1=fτ,
to write the average power as a function of PWM frequency and duty cycle:
P(f,D)=PrefD−fτ1−e−fτ1(1−e−fτD)(1−e−fτ1−D)
Here, fτ is a dimensionless quantity. The result obtained here is the average input power from the source over one period. Because the inductor’s average power is zero in the periodic steady state, it is also equal to the average power dissipated by the resistor over one period.
Chart Analysis
Below, we separately observe how the period-average power varies with the duty cycle D and PWM frequency f. Here, Pref=RV02 is adjusted as a whole and represents the DC power.
Period-Average Power Versus Duty Cycle
The horizontal axis is the duty cycle D. The frequency f, time constant τ, and DC power Pref can be adjusted. The frequency slider uses logarithmic adjustment.
The graph also shows the linear reference PrefD and quadratic reference PrefD2 for comparing the trends at low and high frequencies.
Loading chart...
Period-Average Power Versus Frequency
The horizontal axis is the frequency f and uses a logarithmic scale. The duty cycle D, time constant τ, and DC power Pref can be adjusted.
The button inside the graph can be used to switch to linear coordinates.
Loading chart...
Normalized Period-Average Power Contour Plot
The contour plot presents the same function from a top-down view. Its horizontal axis is D, its vertical axis is fτ, and both the colors and contour values represent P/Pref.
Loading chart...
The three graphs above show that, as the frequency increases, the power approaches the quadratic reference P(D)=PrefD2, whereas at low frequencies the variation in power is closer to the linear reference P(D)=PrefD. In other words, at the same duty cycle, because ∀D∈[0,1]D2≤D, the power consumption of high-frequency PWM is always lower than or equal to that of low-frequency PWM.
Note that in the “Period-Average Current” section, we have already concluded that the electromagnet’s average magnetic field strength is related to the duty cycle and independent of frequency. Combining this with the power analysis shows that using a higher PWM frequency to control an electromagnet is always more energy-efficient.
Understanding Through Variance
From the preceding discussion, the period-average power consumption P depends only on the period-average resistive power i2R, while the average power of the inductor is zero. Notice that i2 has a form similar to the variance formula:
Var(i)=⟨i2⟩−⟨i⟩2
Here, ⟨i⟩ represents the average value of i over one period and has the same meaning as i. Rearranging gives:
⟨i2⟩=Var(i)+⟨i⟩2
Substituting this back into the average-power formula gives:
P=⟨i⟩2R+Var(i)R
From the “Period-Average Current” section, we know that ⟨i⟩ is independent of frequency. Variance measures the amplitude of current fluctuations. As the frequency increases, the current ripple decreases, the current waveform approaches the constant value ifD, and the power consumption gradually decreases.