# BLDC HDL

Three-phase brushless DC motor with trapezoidal flux distribution

Since R2023b

Libraries:
Motor Control Blockset HDL Support / Electrical Systems / Motors

## Description

The BLDC block implements a three-phase brushless DC (BLDC) motor with a trapezoidal back electromotive force that remains constant for a position range of 120 electrical degrees. The block uses the three-phase input voltages to regulate the individual phase currents, allowing control of the motor torque or speed.

### Motor Construction

This figure shows a motor with a single pole pair.

The rotor magnetic field due to the permanent magnets creates a trapezoidal rate of change of flux with the motor angle.

For the axes convention, the phase-a aligns with d-axis when the motor angle θr is zero.

### Three-Phase Sinusoidal Model Electrical System

Instead of the standard dq reference frame, the block uses d’q’ reference frame, which is defined by these transformation equations.

`${v}_{d\text{'}}=\frac{2}{3}\left(\left({v}_{a}-R{i}_{a}-{E}_{a}\right)\mathrm{cos}{\theta }_{e}+\left({v}_{b}-R{i}_{b}-{E}_{b}\right)\mathrm{cos}\left({\theta }_{e}-\frac{2\pi }{3}\right)+\left({v}_{c}-R{i}_{c}-{E}_{c}\right)\mathrm{cos}\left({\theta }_{e}+\frac{2\pi }{3}\right)\right)$`

`${v}_{q\text{'}}=-\frac{2\pi }{3}\left(\left({v}_{a}-R{i}_{a}-{E}_{a}\right)\mathrm{sin}{\theta }_{e}+\left({v}_{b}-R{i}_{b}-{E}_{b}\right)\mathrm{sin}\left({\theta }_{e}-\frac{2\pi }{3}\right)+\left({v}_{c}-R{i}_{c}-{E}_{c}\right)\mathrm{sin}\left({\theta }_{e}+\frac{2\pi }{3}\right)\right)$`

`$\begin{array}{l}{E}_{a}=P{\omega }_{m}\frac{\partial {\psi }_{a}}{\partial {\theta }_{e}}\\ {E}_{b}=P{\omega }_{m}\frac{\partial {\psi }_{b}}{\partial {\theta }_{e}}\\ {E}_{c}=P{\omega }_{m}\frac{\partial {\psi }_{c}}{\partial {\theta }_{e}}\end{array}$`

`$\begin{array}{l}{i}_{a}={i}_{d\text{'}}\mathrm{cos}{\theta }_{e}-{i}_{q\text{'}}\mathrm{sin}{\theta }_{e}\\ {i}_{b}={i}_{d\text{'}}\mathrm{cos}\left({\theta }_{e}-\frac{2\pi }{3}\right)-{i}_{q\text{'}}\mathrm{sin}\left({\theta }_{e}-\frac{2\pi }{3}\right)\\ {i}_{c}={i}_{d\text{'}}\mathrm{cos}\left({\theta }_{e}+\frac{2\pi }{3}\right)-{i}_{q\text{'}}\mathrm{sin}\left({\theta }_{e}+\frac{2\pi }{3}\right)\end{array}$`

The block implements these equations expressed in the dq and d’q’ reference frame of the BLDC motor. All quantities in the motor reference frame are with respect to the stator phase A.

`$\begin{array}{l}{\omega }_{e}=P{\omega }_{m}\\ \frac{d}{dt}{i}_{d\text{'}}=\frac{1}{{L}_{d}}{v}_{d\text{'}}+\frac{{L}_{q}}{{L}_{d}}P{\omega }_{m}{i}_{q\text{'}}\end{array}$`

`$\frac{d}{dt}{i}_{q\text{'}}=\frac{1}{{L}_{q}}{v}_{q\text{'}}-\frac{{L}_{d}}{{L}_{q}}P{\omega }_{m}{i}_{d\text{'}}$`

`${T}_{e}=1.5P\left(\left({L}_{d}-{L}_{q}\right){i}_{d\text{'}}{i}_{q\text{'}}\right)+P\left(\frac{\partial {\psi }_{a}}{\partial {\theta }_{e}}{i}_{a}+\frac{\partial {\psi }_{b}}{\partial {\theta }_{e}}{i}_{b}+\frac{\partial {\psi }_{c}}{\partial {\theta }_{e}}{i}_{c}\right)$`

This table describes the variables used in these equations.

 Lq , Ld q- and d-axis inductances (H) R Resistance of the stator windings (ohm) iq' , id' q'- and d'-axis currents (A) vq' , vd' q'- and d'-axis voltages (V) ωm Angular mechanical velocity of the motor (rad/s) ωe Angular electrical velocity of the motor (rad/s) P Number of pole pairs Te Electromagnetic torque (Nm) θe Electrical angle (rad) va , vb , vc Stator phase A, B, and C voltages (V) ia , ib , ic Stator phase A, B, and C currents (A) Ea , Eb , Ec Back EMF of stator phases A, B, and C (V/m/s) ψa , ψb , ψc Total fluxes linking each stator winding (Wb)

### Mechanical System

The motor angular velocity is given by:

`$\begin{array}{c}\frac{d}{dt}{\omega }_{m}=\frac{1}{J}\left({T}_{e}-{T}_{f}-F{\omega }_{m}-{T}_{m}\right)\\ \frac{d{\theta }_{m}}{dt}={\omega }_{m}\end{array}$`

The equations use these variables.

 J Combined inertia of motor and load (kgm^2) F Combined viscous friction of motor and load (N·m/(rad/s)) θm Motor mechanical angular position (rad) Tm Motor shaft torque (Nm) Te Electromagnetic torque (Nm) Tf Motor shaft static friction torque (Nm) ωm Angular mechanical velocity of the motor (rad/s)

### Trapezoidal Rate of Change of Flux

The rotor magnetic field due to the permanent magnets create a trapezoidal rate of change of flux with the rotor angle. This figure shows the rate of change of flux for the three phases of a three-phase BLDC motor.

## Ports

### Input

expand all

Configuration signal for the BLDC HDL block containing the block configuration parameters. For more information about the constituent parameters, see the Config output port description in the BLDC Configuration block.

Data Types: `single`

Stator terminal voltages Va, Vb, and Vc, in V.

Data Types: `single`

Based on the mode of operation defined by the Port Configuration parameter available in the multiplexed Config input, the port supports one of these inputs:

• Tm — Load torque on the motor shaft in N·m.

• ωm — Angular velocity of the motor in rad/s.

Data Types: `single`

Bus signal that the block uses to reset the internal integrators.

Data Types: `Boolean`

### Output

expand all

The bus signal contains these block calculations.

Signal DescriptionVariableUnits

`IaStator`

Stator phase current A

ia

A

`IbStator`

Stator phase current B

ib

A

`IcStator`

Stator phase current C

ic

A

`IdSync`

d' axis current

id'

A

`IqSync`

q' axis current

iq'

A

`VdSync`

d' axis voltage

vd'

V

`VqSync`

q' axis voltage

vq'

V

`MtrSpd`

Angular mechanical velocity of the motor

ωm

`MtrPos`

Motor mechanical angular position

θm

`MtrTrq`

Electromagnetic torque

Te

N·m

`MtrHall`

Hall sensor output

--

`BackEMF`

Back EMF generated in motor Ea , Eb , Ec

V/m/s

Phase currents ia , ib , and ic , in A of phases a, b, and c, respectively.

Motor torque, Tmtr, in N·m.

Angular speed of the motor, ωmtr, in rad/s.

Electrical position of the motor, θe, in rad.

Data Types: `single`

## Parameters

expand all

The fixed time interval (in seconds) between consecutive instances of block execution. Alternatively, you can use `-1` to inherit the sample time from the input signals.

## Version History

Introduced in R2023b