Main Content

Phase Current Extractor for Single Shunt FOC

Transform DC shunt currents into phase currents for single shunt FOC

Since R2026a

Libraries:
Motor Control Blockset / Controls / Math Transforms

Description

The Phase Current Extractor for Single Shunt FOC block transforms the DC shunt currents, measured at the rising or falling edges of each phase's PWM pulses, into phase currents for the Single-Shunt Field Oriented Control (FOC) algorithm.

The block accepts three DC shunt measured currents as muxed input, and Sector information as integer value in the range 1 to 6.

DC Bus Current Sensing

The FOC current controller uses the computed rotor position as well as measured motor currents to compute the three-phase voltages required for the motor to follow a given reference speed. The controller converts these three-phase voltages into pulse width modulation (PWM) duty cycles that operate the six inverter switches.

To generate PWM duty cycles, the current controller uses a triangular carrier waveform with a specific sampling time and generates three pulse trains that operate the inverter switches as shown in the following figure.

The controller operates the inverter in a complementary mode. The pulse that controls the lower transistor in an inverter leg is always opposite to the one controlling the upper transistor. Therefore, the upper-transistors of a three-phase inverter can have eight switching states (for space vector modulation PWM) described in the following table.

By operating the switches, the PWM pulses energize the three motor phases appropriately to generate the three-phase voltages. Based on the sequence of duty pulse duration of three motor phases, you can define six sectors. For example, the following figure shows a sector (phase a duty duration > phase b duty duration > phase c duty duration). It shows how during a PWM cycle, these three duties for the three motor phases, switch ON the three inverter leg switches for different durations.

In the preceding example of PWM cycle, the three inverter leg switches show the following states.

For switching state 1 in the above figure, the switches operate as following:

  • Switch A1 is ON

  • Switch B1 is OFF

  • Switch C1 is OFF

The DC bus or single shunt current measurement method only measures the current in the DC shunt. From the preceding figure, you can infer that the DC shunt current is equal to +Ia during this switching state. Similarly, for switching state 2, the switches operate as following:

  • Switch A1 is ON

  • Switch B1 is ON

  • Switch C1 is OFF

From the preceding figure, you can infer that the DC shunt current is equal to -Ic during this switching state. Therefore, for this PWM cycle, by measuring DC shunt current during two relevant switching states (state 1 and 2), you can determine currents for two motor phases (in this example, you determined Ia and Ic). Because the example assumes a balanced system, the algorithm computes the third phase current mathematically for each PWM cycle.

Ib = - (Ia + Ic)

Similarly, other sectors have a different sequence of switching states. You can determine the motor phase currents from the measured IDC value using the following table.

Examples

Ports

Input

expand all

Inverter DC current passing through the single shunt resistor placed on the negative DC bus rail, and sampled at rising edge or falling edge of the PWM pulse .

Data Types: single | double | fixed point

One of the six sectors, which is a 60° slice of the Space Vector PWM (SVPWM) hexagon that defines which inverter switches are active.

The SVPWM hexagon is divided into six equal sectors (1 through 6). Each sector represents a 60° region of the 360° electrical cycle.

In any given sector, the controller approximates the target voltage vector by blending the two nearest active voltage vectors and one or more null vectors (where all phases are shorted). Because the DC shunt only sees current during active vectors, the sector information indicates which motor phases are currently connected to the DC bus.

Data Types: single | double | fixed point

Output

expand all

Reconstructed phase current (Ia, Ib, and Ic), specified as a vector, based on the sampled DC shunt current and SVPWM sector. At any given sector, the block samples two values for the two phase currents that are active, and calculates the third phase using Kirchhoff's Law.

Data Types: single | double | fixed point

Parameters

expand all

Specific moment (rising or falling edge) of PWM pulse when the PWM signals for the three phases transition between High (1) and Low (0) within a single switching period.

Specifying the correct edge is critical because it defines the window during which the DC shunt resistor is connected to specific motor phases and the corresponding DC link current is flowing through the motor phases in a predictable path.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced in R2026a