> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/generic-machines/brushless-dc-machine-bldc-model.md).

# Brushless DC Machine BLDC Model

## Introduction <a href="#introduction" id="introduction"></a>

This document presents the formulation implemented on FPGA for **BLDC three-phase machine** with mechanical model. The three-phase to q-d park transform has the sqrt(2/3) factor. The machine can operate in both motor mode, when the mechanical torque is positive, and generating mode, when the mechanical torque is negative.

### Q-d transformation <a href="#q-d-transformation" id="q-d-transformation"></a>

The 3-phase to q-d transformation and the inverse used for the model are:

$$
\begin{bmatrix} V\_q \ V\_d \ V\_0 \end{bmatrix} = \frac{2}{3} \begin{bmatrix} \cos(\theta) & \cos!\left(\theta-\frac{2\pi}{3}\right) & \cos!\left(\theta+\frac{2\pi}{3}\right) \ \sin(\theta) & \sin!\left(\theta-\frac{2\pi}{3}\right) & \sin!\left(\theta+\frac{2\pi}{3}\right) \ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \end{bmatrix} \begin{bmatrix} V\_a \ V\_b \ V\_c \end{bmatrix} \\\[12pt]
\begin{bmatrix} V\_a \ V\_b \ V\_c \end{bmatrix} = \begin{bmatrix} \cos(\theta) & \sin(\theta) & 1 \ \cos!\left(\theta-\frac{2\pi}{3}\right) & \sin!\left(\theta-\frac{2\pi}{3}\right) & 1 \ \cos!\left(\theta+\frac{2\pi}{3}\right) & \sin!\left(\theta+\frac{2\pi}{3}\right) & 1 \end{bmatrix} \begin{bmatrix} V\_q \ V\_d \ V\_0 \end{bmatrix}
$$

θ required for the q-d transformation depends on the chosen reference frame as follows:

* Rotor reference frame: θ=θr,
* Stationary reference frame: θ=0
* Synchronous reference frame: θ=θe.

Since the Induction Machine is modeled in rotor reference frame, the θ required for the q-d transformation is the rotor electrical angle.

### Electrical model <a href="#bldc-electrical-model" id="bldc-electrical-model"></a>

Electric machine models in state space framework based on magnetic fluxes as the state variables and winding currents as the outputs can be represented as follows:

$$
I\_{abc} = \left\[L\_{abc}(\theta)\right]^{-1} \left\[ \int \left( V\_{abc} - RI\_{abc} \right),dt - \psi\_{abc} \right]
$$

## Standard DQ motor characteristics <a href="#standard-dq-motor-characteristics" id="standard-dq-motor-characteristics"></a>

In normal conditions, the ideal sinusoidal stator voltages of the BLDC, back-EMFs, and inductances all have sinusoidal shapes. One can transform the equation using the Park transformation with a referential locked on the rotor position θ using (2a) and (2b).

$$
\begin{bmatrix} V\_{ds} \ V\_{qs} \end{bmatrix} = T \begin{bmatrix} V\_{as} \ V\_{bs} \ V\_{cs} \end{bmatrix} \\\[8pt]
T = \sqrt{\frac{2}{3}} \begin{bmatrix} \cos(\theta) & \sin(\theta) \ -\sin(\theta) & \cos(\theta) \end{bmatrix} \begin{bmatrix} 1 & -0.5 & -0.5 \ 0 & \sqrt{3}/2 & -\sqrt{3}/2 \end{bmatrix}
$$

The Park transform (also called 'DQ' transform) reduces sinusoidal varying quantities of inductances, flux, current, and voltage to constant values in the D-Q frame thus greatly facilitating the analysis and control of the device under study.

It is important to note that there are many different types of Park transforms and this often leads to confusion when interpreting the motor states inside the D-Q frame. The one used here presents the advantage of being orthonormal (notice the sqrt(3/2) factor). This particular Park orthonormal transform is power-invariant which means that the power computed in the D-Q frame by performing a dot product of currents and voltages will be numerically equal to the one computed in the phase domain. With this transform (and only this transform) the BLDC torque can be expressed by (3), where pp is the number of pole pairs.

$$
T\_e = pp \left\[ I\_{abc} \cdot \frac{\partial \psi\_{abc}}{\partial \theta\_r} + (L\_d - L\_q)i\_d i\_q \right]
$$

One may notice the absence of the 3/2 factor in (3), which is usually present in the BLDC torque equation when using non-orthonormal transforms. This is, again, because this model uses the orthonormal Park transform. Figure 1 explains the principle of the Park transform. Considering fixed ABC referential with all quantities ( Vbemf, motor current I) rotating at the electric frequency ω, if we observe these quantities in a D-Q frame turning at the same speed we can see that the motor quantities will be constant.

$$\frac{d\psi\_{abc}}{d\theta\_r}$$ are the partial derivative of instantaneous permanent magnet flux.

This is easy to see for the Back-EMF voltage V<sub>bemf</sub> that directly follows the Q-axis (because the magnet flux is on the D-axis by definition). In the following figure, I leads and the Q-axis by an angle called β (beta). The modulus of the vector I is called Iamp. In the figure below, θ is the rotor angle, aligned with the D-axis.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-8f64368095e86a2d95680d3442dfb7c0e12e3dd3%2Fstandard-dq-motor-char-axis.png?alt=media" alt=""><figcaption></figcaption></figure>

## Mechanical model <a href="#mechanical-model" id="mechanical-model"></a>

The mechanical model is the same for all machine types to calculate the rotor mechanical speed (ωm) as follows:

$$
T\_e - T\_m = J\dot{\omega}\_m + F\_v\omega\_m + F\_s
$$

## Trapezoidal back-EMF characteristics <a href="#trapezoidal-back-emf-characteristics" id="trapezoidal-back-emf-characteristics"></a>

The main difference between the PMSM and the BLDC lies in the shape of the Back EMF voltage. The BLDC has a trapezoidal back EMF shape that is parametrized with λm the permanent flux linkage and H the back EMF flat area in degree.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-16bf33e4aaec569c58fe2c01adc85c53aa783072%2Fbldc-trapes-backemf.png?alt=media" alt=""><figcaption></figcaption></figure>

## Nomenclature <a href="#nomenclature" id="nomenclature"></a>

* **x**: state variables vector
* **y**: outputs vector
* **u**: inputs vector
* **A**,**B**,**C**: state space coefficient matrices
* Ts: simulation time step
* n: time step number
* Va: stator phase a voltage
* Vb: stator phase b voltage
* Vc: stator phase c voltage
* Vsq: stator q-axis voltage
* Vsd: stator d-axis voltage
* V'rq: rotor q-axis voltage (referred to the stator)
* V'rd: rotor d-axis voltage (referred to the stator)
* **I**: current vector
* Isq: stator q-axis current
* Isd: stator d-axis current
* I'rq: rotor q-axis current (referred to the stator)
* I'rd: rotor d-axis current (referred to the stator)
* I'c1q: cage 1 q-axis current (referred to the stator)
* I'c1d: cage 1 d-axis current (referred to the stator)
* I'c2q: cage 2 q-axis current (referred to the stator)
* I'c2d: cage 2 d-axis current (referred to the stator)
* **Ψ**: magnetic flux vector
* ψsq: stator q-axis flux
* ψsd: stator d-axis flux
* ψ'rq: rotor q-axis flux (referred to the stator)
* ψ'rd: rotor d-axis flux (referred to the stator)
* ψ'c1q: cage 1 q-axis flux (referred to the stator)
* ψ'c1d: cage 1 d-axis flux (referred to the stator)
* ψ'c2q: cage 2 q-axis flux (referred to the stator)
* ψ'c2d: cage 2 d-axis flux (referred to the stator)
* **R**: resistance matrix
* Rs: stator winding resistance
* R'r: rotor winding resistance (referred to the stator)
* R'c1: cage 1 resistance (referred to the stator)
* R'c2: cage 2 resistance (referred to the stator)
* **L**: inductance matrix
* Ls: stator self inductance (mutual (Lm) +leakage (Lls) )
* L'r: rotor self inductance (referred to the stator) (mutual (Lm) +leakage (Llr) )
* L'c1: cage 1 self inductance (referred to the stator) (mutual (Lm) +leakage (Llc1) )
* L'c2: cage 2 self inductance (referred to the stator) (mutual (Lm) +leakage (Llc2) )
* Lm: mutual inductance
* **Ω**: speed matrix
* ω, θ: rotation speed, and position of the reference frame
* ωe, θe: rotation speed, and position of the synchronous frame
* ωr, θr: rotation speed, and position of the rotor (electrical) frame
* ωm, θm: rotation speed, and position of the rotor (mechanical) frame
* Te: electromagnetic torque
* Tm: mechanical torque
* pp: number of pole pairs
* J: rotor inertia
* Fv: viscous friction coefficient
* Fs: static friction torque


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/generic-machines/brushless-dc-machine-bldc-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
