Explore PI controller that controls the stator field in the 3 phase BLDC motor.

Set the stator field and see the controller set PWM pulses to converge to desired state.

Controller: PI (proportional + integral) current feedback · 24 V · stationary rotor.

Command the field

Drag the target in the center, or try a step.

Currents that make this field

amperes
PhaseTargetActualError

The field is the vector sum of the three winding contributions. A negative current reverses a contribution.

Model & controller settings

Equal R–L windings, fixed stator, no rotor motion or back EMF. Ideal complementary switches; no dead time. Field strength is current-equivalent, not tesla.

R = 0.8 Ω per winding. Changing a setting resets the experiment to zero current.

Desired → actual field

Ready
A
B
C
Σ actual
Start at zero current.
Press Play to build the field.
Desired 4.0 A eq. / 0°Actual 0.0 A eq.
A + B + C = actual fieldJoin the arrows head to tail.

PWM nudges the winding current

0.00 mJ stored

↑ / ↓ shows the change in signed current caused by vL = winding voltage − Ri. Current moves continuously; it does not jump at a switch.

A new command changes the target immediately. Inductance makes the current change gradually.

Error → voltage → PWM

The controller samples all three current errors at the start of each PWM period.

PhaseTarget average VDuty

Three half bridges

All six gate commands
Filled = gate ONOutline = gate OFF

Probe values are instantaneous pole-to-N voltages, across each entire R–L winding. Arrows show conventional current toward N or away from N.

Current error → changing PWM pulses

TARGET ···   ACTUAL ━
t = 0.00 ms

Desired field → required currents → target average voltage → three duties → current changes → actual field. The PI controller repeats this loop once per PWM period.

No recorded periods yet.

The current target is a destination. Each PWM period makes only part of the required change.

All three duties determine each winding’s average voltage because N floats. With sufficiently fast PWM, inductance keeps current ripple small. An average voltage also exists without inductance, but resistor-only current would jump with the switching.

No pulse yet

Playback is slowed down. One period is 1.00 ms of simulated time. Filled pulse = gate ON; empty = OFF. Scroll for earlier pulses; click a pulse or scrub to inspect. Scrubbing pauses the experiment; Play returns to its latest state.

How this pulse changes current

0 µs
Press Step 1 PWM to inspect the first pulse, or Play to watch convergence.

Store magnetic-field energy

Energy is stored in the magnetic field. During a zero-winding-voltage interval, that field releases energy into the closed current path. Current decays gradually toward zero as resistance dissipates the energy.

Generate the field

That same current creates each colored winding contribution. Their vector sum is the actual stator field.

A pulse nudges current; the current makes a field.

First choose the destination. The desired stator field sets each current target. The controller chooses a bounded target average winding voltage; the three duties reproduce that average. The current cannot reach its target instantly.

A voltage across inductance changes current at vL ÷ L amperes per second. Let it act longer and the current changes further.

On the graph, voltage is height and time is width. Their product is voltage-time area, measured in V·ms. Divide accumulated area by inductance to get the current change.

Same area → same current change
6 V
× 1 ms
=12 V
× 0.5 ms

Both give 6 V·ms. Across 12 mH:
6 V·ms ÷ 12 mH = +0.5 A

Example voltages are across L, after the resistive drop.

Follow the same instant down each column

Accumulated since this period began

Above zero: adds current change Below zero: subtracts current change. Negative vL can reduce a still-positive current. Only shading under vL has accumulated up to the cursor. Gate commands and unshaded curves show the whole recorded period.

The actual current marker follows start current + signed voltage-time area ÷ L. At the end of this PWM period, the controller measures the remaining error and chooses the next bounded voltage command. At a held field, the positive and negative inductive areas nearly cancel; PWM still covers resistance and a small current ripple remains. For example, holding 4 A through 0.8 Ω needs about 3.2 V average. With zero winding voltage and a closed current path, magnetic-field energy dissipates through resistance and current decays gradually toward zero. PWM usually reapplies voltage while current is still flowing. A lower, nonzero winding voltage does not necessarily make current decay to zero; the change depends on vL = winding voltage − Ri.

Hold a field → steady currents. Move it → changing currents. Smooth rotation can produce sinusoidal currents; the field command is what drives this experiment.