> 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/courseware/electric-courseware/electric-motor-drives/permanent-magnet-synchronous-motor-pmsm-drive/virtual-test-bench-overview.md).

# Virtual Test Bench Overview

The Synchronous Machine (SM) is an electrical machine whose rotating speed is proportional to the frequency of the alternating current supply and independent of the load.\
It is mostly used as a generator where it is almost without a competitor, but it also serves as a motor in several fields.\
The **Permanent Magnet Synchronous Motors (PMSM)** is a type of SM with no damper winding, and excitation at the rotor is provided by a permanent magnet.\
It has high-density power, large torque to inertia ratio and high efficiency making it very useful in many applications, such as home equipment, robotic applications, and electric vehicles \[[***2***](https://www.opal-rt.com/docs/courseware/electric-courseware/electric-motor-drives/permanent-magnet-synchronous-motor-pmsm-drive/references.md)].

## Virtual test bench diagram

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FxNhiIUg1MH07DGlEQhW4%2Fa223773e-6b20-4471-96b6-8f99b441c642.png?alt=media&amp;token=3e9fbdbf-79dc-4302-81de-9cb8b33f74a5" alt="" width="525"><figcaption><p><strong>Figure 1</strong>: Virtual Test Bench of the PMSM Drive</p></figcaption></figure>

Model simulation is one of the safest and most efficient ways to tackle real-life problems.\
By simulating a dynamic model, a wide range of tests could be done on the simulation to analyze and validate the proposed model before making a functioning prototype.\
Real-time simulation gives the user time accurate results of a process, making it a useful tool in stimulating electric machines for a wide range of applications, for instance in the education sector.\
Electrical engineer undergraduates have to do electrical machines laboratories in order to apply and further their theoretical knowledge in that domain.\
But those labs aren’t as effective as they need to be because of the limitations put on the students to protect them and to preserve the machines tested.\
That’s why it is primordial to have virtual test bench laboratories, giving students more flexibility to fully analyze the electrical and mechanical limits of electric machines without the fear of costly damages.\
Here, a virtual test bench for **variable speed drive of PMSM** is implemented (see figure 1 above).\
The modeling is such that real-time accurate results are obtained.

The different modules covered in this laboratory are discussed next.

## Transformations <a href="#transformations" id="transformations"></a>

Consider a direct three-phase system given by:\
$$s\_a(t) = S\sqrt{2}\sin(\omega t) \\\[8pt] s\_b(t) = S\sqrt{2}\sin(\omega t - 2\pi/3) \\\[8pt] s\_c(t) = S\sqrt{2}\sin(\omega t + 2\pi/3) \\\[8pt]$$    ( 1 )

The time domain and the spatial representations of the system are shown in figures 2 and 3.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FadF9sv0ZMcAV8NSmrdot%2Ffb9861e6-a45e-4388-bc43-eb2be78a49e3.png?alt=media&amp;token=177d982f-6dde-4dd5-bcd7-fdb0d7447de3" alt="" width="450"><figcaption><p><em><strong>Figure 2</strong>: Three-Phase System in Time Domain</em></p></figcaption></figure>

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FfZmqzILZPpMyiczCQBdy%2F698cfac1-2ecf-4724-b168-6262110829e0.png?alt=media&amp;token=747603bd-a4ca-445a-a2ea-7249a45c3073" alt="" width="450"><figcaption><p><em><strong>Figure 3</strong>: Spatial Representation Taken at t = 0</em></p></figcaption></figure>

### Transformations from (a, b, c) to (α, β) <a href="#transformations-from-a-b-c-to-a-v" id="transformations-from-a-b-c-to-a-v"></a>

Knowing that for a three-phase system the summation of signals is zero, it makes sense to get rid of the summation equation and to move to a two-signals system in which those signals are orthogonal, therefore, non-dependent.\
For that, two transformations are suggested: **Clarke and Concordia.**

#### **Clarke Transformation** <a href="#clarke-transformation" id="clarke-transformation"></a>

Clarke transformation applied to the three-phase system leads to:

$$
\begin{bmatrix}
s\_\alpha \\
s\_\beta \\
s\_0
\end{bmatrix}
=============

\frac{2}{3}
\begin{bmatrix}
1 & -1/2 & -1/2 \\
0 & \sqrt{3}/2 & -\sqrt{3}/2 \\
1/2 & 1/2 & 1/2
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
$$

Therefore,

$$
s\_\alpha = S\sqrt{2}\sin \omega t = s\_a \\\[8pt]
s\_\beta = -S\sqrt{2}\cos \omega t = S\sqrt{2}\sin(\omega t - \pi/2) \\\[8pt]
$$

From which the inverse of Clarke transformation is computed as:

$$
s\_a = s\_\alpha \\\[8pt]
s\_b = -\frac{1}{2}s\_\alpha + \frac{\sqrt{3}}{2}s\_\beta \\\[8pt]
$$

The properties of Clarke transformation are:

* This transformation keeps the amplitude invariant, hence the amplitudes of s<sub>a</sub> and s<sub>α</sub> are both equal to S
* $$\sqrt{2}$$

  . However, the power is variant.
* The determinant of this transformation is 2/(3

  $$\sqrt{3}$$&#x20;
* ), hence this is not a rotation.

#### Concordia Transformation <a href="#concordia-transformation" id="concordia-transformation"></a>

$$
\begin{bmatrix}
s\_\alpha \\
s\_\beta \\
s\_0
\end{bmatrix}
=============

\sqrt{\frac{2}{3}}
\begin{bmatrix}
1 & -1/2 & -1/2 \\
0 & \sqrt{3}/2 & -\sqrt{3}/2 \\
1/\sqrt{2} & 1/\sqrt{2} & 1/\sqrt{2}
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
$$

Therefore,

$$
s\_\alpha = S\sqrt{3}\sin \omega t \\\[8pt]
s\_\beta = -S\sqrt{3}\cos \omega t = S\sqrt{3}\sin(\omega t - \pi/2) \\\[8pt]
$$

The properties of Concordia transformation are:

* This transformation changes the amplitude but keeps the power invariant.
* The determinant of this transformation is 1.\
  Additionally, columns are orthogonal and have unity-norm.\
  Consequently, this is a rotation, and the inverse is nothing but the transpose.

### Transformations from (α, β) to (d, q) <a href="#transformations-from-a-v-to-d-q" id="transformations-from-a-v-to-d-q"></a>

#### Rotation of Angle *-Ѳ* <a href="#rotation-of-angle" id="rotation-of-angle"></a>

This transformation is used to move from (α, β) stationary frame to (d, q) rotating frame.\
The goal behind is to remove the *ωt* component and to end-up with time-invariant signal s<sub>d</sub> and s<sub>q</sub>.

Knowing that the three-phase system depicted in **figure 3** above is undergoing a counterclockwise rotation at *ω* rd/s, a rotation of an angle *Ѳ = -ωt* is to be applied in order to get time-invariant signals in the (d, q) frame, leading to:

$$
\begin{bmatrix}
s\_d \\
s\_q \\
s\_0
\end{bmatrix}
=============

\begin{bmatrix}
\cos\theta & \sin\theta & 0 \\
-\sin\theta & \cos\theta & 0 \\
0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
s\_\alpha \\
s\_\beta \\
s\_0
\end{bmatrix}
\\\[8pt]
$$

Obviously, this transformation corresponds to a rotation matrix ***Q*** with a determinant of value of 1.\
The calculation of the speed matrix goes as follows:

$$
\Omega = \dot{Q} Q^{T} = \dot{\theta}
\begin{bmatrix}
0 & 1 & 0 \\
-1 & 0 & 0 \\
0 & 0 & 0
\end{bmatrix}
\\\[8pt]
$$

It is noteworthy that the speed matrix **Ω** is skew-symmetric, which is a necessary condition for the speed term.

### Transformations from (a, b, c) to (d, q) <a href="#transformations-from-a-b-c-to-d-q" id="transformations-from-a-b-c-to-d-q"></a>

There are four possible combinations to bring the three-phase system (a, b, c) to a (d, q) one, namely:

1. Clarke followed by a rotation of *-Ѳ*
2. Concordia followed by a rotation of *-Ѳ* + π/2
3. Clarke followed by a rotation of *-Ѳ*
4. Concordia followed by a rotation of *-Ѳ* + π/2.

Notice that these transformations are known as **Park transformations** in literature.

#### Combination of Clarke and Rotation of *-Ѳ* <a href="#combination-of-clarke-and-rotation-of" id="combination-of-clarke-and-rotation-of"></a>

$$
\begin{bmatrix}
s\_d \\
s\_q \\
s\_0
\end{bmatrix}
=============

\begin{bmatrix}
\cos\theta & \sin\theta & 0 \\
-\sin\theta & \cos\theta & 0 \\
0 & 0 & 1
\end{bmatrix}
\frac{2}{3}
\begin{bmatrix}
1 & -1/2 & -1/2 \\
0 & \sqrt{3}/2 & -\sqrt{3}/2 \\
1/2 & 1/2 & 1/2
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
========

\frac{2}{3}
\begin{bmatrix}
\cos\theta & \cos(\theta - 2\pi/3) & \cos(\theta + 2\pi/3) \\
-\sin\theta & -\sin(\theta - 2\pi/3) & -\sin(\theta + 2\pi/3) \\
1/2 & 1/2 & 1/2
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
$$

For the three-phase system defined in (**1**), *s*<sub>*d*</sub> and *s*<sub>*q*</sub> become:

$$
s\_d = 0 \\\[8pt]
s\_q = -S\sqrt{2} \\\[8pt]
$$

As expected, *s*<sub>*d*</sub> and *s*<sub>*q*</sub> are time-invariant since they do not depend on *ωt*.

Since *s*<sub>*d*</sub> vanished, it is hard to check whether *s*<sub>*q*</sub> leads or lags *s*<sub>*d.*</sub>\
For that, consider a three-phase system with a delay *δ* as follows:

$$
s\_a(t) = S\sqrt{2}\sin(\omega t - \delta) \\\[8pt]
s\_b(t) = S\sqrt{2}\sin(\omega t - \delta - 2\pi/3) \\\[8pt]
s\_c(t) = S\sqrt{2}\sin(\omega t - \delta + 2\pi/3) \\\[8pt]
$$

Apply Clarke transformation leads to:

$$
s\_\alpha = S\sqrt{2}\sin(\omega t - \delta) \\\[8pt]
s\_\beta = S\sqrt{2}\sin(\omega t - \delta - \pi/2) \\\[8pt]
$$

Applying a rotation of *-Ѳ* leads to:

$$
s\_d = -S\sqrt{2}\sin\delta = S\sqrt{2}\sin(-\delta) \\\[8pt]
s\_q = -S\sqrt{2}\cos\delta = S\sqrt{2}\sin(-\delta - \pi/2) \\\[8pt]
$$

Figures 4 and 5 show the spatial representation of this system for *δ =* π/6 and *ωt = 0*, then *ωt =* π/3.\
It is worth noticing that *s*<sub>*q*</sub> lags *s*<sub>*d*</sub>.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FOLIF25IIKUnoCJQ24oYO%2F664d2535-b930-478b-99d1-df65890f6718.png?alt=media&amp;token=84c5f90f-fe93-42fe-8a57-6b332bf6700c" alt="" width="450"><figcaption><p><strong>Figure 4</strong>: Spatial Representation Taken at ωt = 0 and δ = π/6</p></figcaption></figure>

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2Fbc4IqpRAuNpUUzNGXWhq%2F8523c86e-cfe2-456b-b60f-510c601b47bc.png?alt=media&amp;token=2ee6f6eb-3fed-4a67-9ed4-e8bbe5325484" alt="" width="450"><figcaption><p><strong>Figure 5:</strong> Spatial Representation Taken at ωt = π/3 and δ = π/6</p></figcaption></figure>

#### Combination of Concordia and Rotation of *-Ѳ* <a href="#combination-of-concordia-and-rotation-of" id="combination-of-concordia-and-rotation-of"></a>

$$
\begin{bmatrix}
s\_d \\
s\_q \\
s\_0
\end{bmatrix}
=============

\begin{bmatrix}
\cos\theta & \sin\theta & 0 \\
-\sin\theta & \cos\theta & 0 \\
0 & 0 & 1
\end{bmatrix}
\sqrt{\frac{2}{3}}
\begin{bmatrix}
1 & -1/2 & -1/2 \\
0 & \sqrt{3}/2 & -\sqrt{3}/2 \\
1/\sqrt{2} & 1/\sqrt{2} & 1/\sqrt{2}
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
========

\sqrt{\frac{2}{3}}
\begin{bmatrix}
\cos\theta & \cos(\theta - 2\pi/3) & \cos(\theta + 2\pi/3) \\
-\sin\theta & -\sin(\theta - 2\pi/3) & -\sin(\theta + 2\pi/3) \\
1/\sqrt{2} & 1/\sqrt{2} & 1/\sqrt{2}
\end{bmatrix}
\begin{bmatrix}
s\_a \\
s\_b \\
s\_c
\end{bmatrix}
\\\[8pt]
$$

For the three-phase system defined in (**1**), *s*<sub>*d*</sub> and *s*<sub>*q*</sub> become:

$$
s\_d = 0 \\\[8pt]
s\_q = -S\sqrt{3} \\\[8pt]
$$

## Self-Control <a href="#self-control" id="self-control"></a>

The first drive implemented is the self-control mode of the PMSM, which is a method controlling the three-phase currents (*i*<sub>*a*</sub>, *i*<sub>*b*</sub>, and *i*<sub>*c*</sub>) of the machine.\
A synchronous machine is said to be self-controlled if it gets its operating frequency from an inverter whose converters are fired through signals calculated using data obtained from a rotor position sensing unit.\
This ensures that the stator and rotor fields move in synchronism for all operating points.\
The current references are calculated using the angle coming from the sensor and the amplitude is either obtained directly from a reference or from a higher-level regulation loop, like the speed control loop.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FhUSIHpy0omDPQSZexRZR%2Ff2a253e8-1653-4b26-a7b4-32ae1d297c98.png?alt=media&amp;token=b2886001-0ad5-4e93-8ed2-e070161df6d4" alt=""><figcaption><p><strong>Figure 6</strong>: Self-Control Diagram of PMSM</p></figcaption></figure>

The self-control diagram of the PMSM is shown in figure 6 above.\
Here, the current references (*i\**<sub>*a*</sub>, *i\**<sub>*b*</sub>*,* and *i\**<sub>*c*</sub>) can be directly imposed or calculated from a torque reference.\
Thus, it is essential to establish the relation between torque and current. In order to obtain the maximum torque possible, we must impose through the reference currents the internal angle of the machine *δ*.

By imposing:

$$
\delta = \pi/2 \\\[8pt]
$$

The electromagnetic torque of the synchronous machine is expressed as follows:

$$
T\_{em} = k' , i\_s \\\[8pt]
$$

The current reference is generated using the following equation:

$$
I\_{nRef} = I\_m \cos!\left(\xi(t) + \delta - (n - 1)\frac{2\pi}{3}\right) \\\[8pt]
$$

*I*<sub>*m*</sub> being the current amplitude reference, and *ξ* the measured rotor angle times *p*.\
*I*<sub>*m*</sub> is calculated using the torque reference:

$$
I\_m = \frac{T\_{ref}}{k'} \\\[8pt]
$$

With,

$$
k' = \frac{3}{2}\* , p \*, \varphi\_r \\\[8pt]
$$

It should be noted that ϕ<sub>r</sub> and *p* are respectively the rotor flux and number of poles of the PMSM.

Two types of current controller are applied in self-control: **hysteresis current control** and **PI controller**.\
These two self-control modes are discussed next.

### Hysteresis Current Control <a href="#hysteresis-current-control" id="hysteresis-current-control"></a>

The implementation of hysteresis control methods can be done in either analog or digital form.\
Every time the error between control references and control variables crosses the negative hysteresis band's boundary (see figure 7) the controller's output will automatically send in the upper bound\
in order to make the current stick to the reference and when the error crosses the positive hysteresis band's boundary the controller's output will automatically send in the lower bound,\
thus creating switching gates for the inverter connected to the machine \[[***3***](https://www.opal-rt.com/docs/courseware/electric-courseware/electric-motor-drives/permanent-magnet-synchronous-motor-pmsm-drive/references.md)].

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FBcUsd39w1ja4I2pvz5sF%2Fb8e18126-d146-40ef-988c-f1a10adcda75.png?alt=media&amp;token=e9c6e921-4011-4934-9601-fd39e0ea18ad" alt=""><figcaption><p><strong>Figure 7</strong>: Hysteresis Band [<a href="https://www.opal-rt.com/docs/courseware/electric-courseware/electric-motor-drives/permanent-magnet-synchronous-motor-pmsm-drive/references.md"><strong>3</strong></a>]</p></figcaption></figure>

### PI Controller <a href="#pi-controller" id="pi-controller"></a>

This method is easily implementable and widely used by engineers because of its accurate results.\
The general form of a PI controller is as follows:

* ***e(t)***: the error calculated by the difference between the measured and the reference currents.
* ***u(t)***: the input of the PI controller.
* ***K***<sub>***p***</sub>  and ***T***<sub>***i***</sub>: proportional and integral gains of the PI controller.

The proportional gain is used to produce an output proportional to the error value, which means that if the error is high, the output of the proportional gain will also be high and vice versa.\
If the proportional gain is increased, the system will have a quicker response with a smaller steady state error, but if the proportional gain is too high, a large overshoot is expected to appear in the system’s response.

The integral term neutralizes the steady state error and reduces it to zero by increasing the system’s response rate towards a certain setpoint.\
If the integral gain is too high, a large overshoot will also be observed, and the system might become unstable.

Using the PMSM d-axis inductance *L*<sub>*d*</sub> and stator windings resistance *R*<sub>*s*</sub>, the PI gains are given as:

$$
K\_p = R\_s \\\[8pt]
T\_i = \frac{L\_d}{R\_s} \\\[8pt]
$$

## Vector Current Control <a href="#vector-current-control" id="vector-current-control"></a>

To use this control method, the stator currents of a three-phase AC electric motor are identified as two orthogonal components (*i*<sub>*d*</sub>, *i*<sub>*q*</sub>).\
The first define the magnetic flux of the motor, and the latter the toque.

The purpose is to control *i*<sub>*d*</sub> and i<sub>*q*</sub> currents to be able to control the transient regime of the motor.\
There exist multiple vector control methods, and in this laboratory the **zero d-axis current (ZDC)** has been considered.

### Zero d-axis current (ZDC) control <a href="#zero-d-axis-current-zdc-control" id="zero-d-axis-current-zdc-control"></a>

First let’s introduce the equations of the PMSM in the dq reference frame.

* Voltage equations:

$$
v\_d = R\_s i\_d + L\_d \frac{di\_d}{dt} - L\_q \omega i\_q \\\[8pt]
v\_q = R\_s i\_q + L\_q \frac{di\_q}{dt} + L\_d \omega i\_d + \varphi\_r \omega \\\[8pt]
$$

* Mechanical equation:

$$
J \frac{d\Omega}{dt} = T\_{em} - T\_l - f \Omega \\\[8pt]
$$

* Electromagnetic torque equation:

$$
T\_{em} = p \left(\varphi\_r - (L\_q - L\_d)i\_d\right) i\_q \\\[8pt]
$$

In ZDC control method, the d-axis armature current *i*<sub>*d*</sub>  of the PMSM is set to zero (see figure 8 below), thus simplifying the control scheme design and implementation.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2Fmaamwl9pJWin8P7NPq4y%2F73cdef3b-5eb5-4cca-8700-073eb8d41315.png?alt=media&amp;token=f99d487f-fa92-47f0-84af-430dd028e414" alt=""><figcaption><p><strong>Figure 8</strong>: Schematic of ZDC Control Loop</p></figcaption></figure>

With *id*=0, the PMSM equations become:

$$
v\_d = -L\_q \omega i\_q \\\[8pt]

v\_q = R\_s i\_q + L\_q \frac{di\_q}{dt} + \varphi\_r \omega \\\[8pt]

T\_{em} = \frac{3}{2} , p , \varphi\_r , i\_q \\\[8pt]
$$

The *v*<sub>*d*</sub>, *v*<sub>*q*</sub> voltages depend on both the currents on the dq-axes, so they need to be decoupled.\
This decoupling is based on the introduction of decoupling terms *e*<sub>*d*</sub>, *e*<sub>*q*</sub> and the compensation term *e*<sub>*0*</sub>.

$$
e\_d = -\omega L\_q i\_q \\\[8pt]

e\_q = \omega L\_d i\_d \\\[8pt]

e\_0 = \omega \varphi\_r \\\[8pt]
$$

The voltage *v*<sub>*d*</sub> and *v*<sub>*q*</sub> can be rewritten as:

$$
v\_d = e\_d \\\[8pt]

v\_q = R\_s i\_q + L\_q \frac{di\_q}{dt} + e\_q + e\_0 \\\[8pt]
$$

The direct current reference 𝑖\*<sub>𝑑</sub> is fixed to zero and the torque reference is converted to 𝑖\*<sub>q</sub>.\
When PI regulators are used to control the currents, both current references 𝑖\*<sub>𝑑</sub> and 𝑖\*<sub>q</sub> are compared separately with the real currents of the machine *i*<sub>*d*</sub> and *i*<sub>*q*</sub>, and the obtained errors are eliminated by the integral term of the PI.\
The PI gains are calculated as follows:

$$
K\_{pq} = R\_s \\\[8pt]
K\_{pd} = R\_s \\\[8pt]

T\_{iq} = \frac{L\_q}{R\_s} \\\[8pt]
T\_{id} = \frac{L\_d}{R\_s} \\\[8pt]
$$

The reference voltages v\*<sub>𝑑</sub>  and v\*<sub>q</sub> at the output of the current controllers are converted into three-phase voltages which generate the pulses to drive the inverter (see [**figure 8**](#zero-d-axis-current-zdc-control) above).\
A three-phase two-level inverter has been considered in this laboratory.

## Speed control <a href="#speed-control" id="speed-control"></a>

In the PMSM speed control strategy, the reference current 𝑖\*<sub>q</sub> is calculated via a torque reference *T\**, which is the output of the speed controller block (see figure 9).

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2Fr56PgwIp4p2W0ugfas8j%2F2d9fa49c-ad8e-469b-abca-afcf23603a8f.png?alt=media&amp;token=d932a2f3-dec4-46a3-a4ce-2a0ffcdfb4f3" alt="" width="563"><figcaption><p><strong>Figure 9</strong>: Speed Control Loop</p></figcaption></figure>

The gain *K* is the inverse of *k’*, with:

$$
k' = \frac{3}{2} , p , \varphi\_r \\\[8pt]
$$

{% hint style="info" %}
The current in d-axis is still maintained to zero in speed control.
{% endhint %}

The list of **symbols** previously used in sections [**Self-Control**](#self-control)**,** [**Vector Current Control**](#vector-current-control) **and** [**Speed Control**](#speed-control) and their definitions are presented in table 1 below.

#### ***Table 1**: List of Symbols of the PMSM Drive*

| Symbols                    | Definition                                                   | Units                           |
| -------------------------- | ------------------------------------------------------------ | ------------------------------- |
| ***L***<sub>***d***</sub>  | d-axis inductance                                            | H                               |
| ***L***<sub>***q***</sub>  | q-axis inductance                                            | H                               |
| ***R***<sub>***s***</sub>  | Stator windings resistance                                   | Ω                               |
| ***T***<sub>***em***</sub> | Electromagnetic torque                                       | N.m                             |
| ***T***<sub>***L***</sub>  | Load torque                                                  | N.m                             |
| ***p***                    | Number of pole pairs                                         | <p><br><br></p>                 |
| ***i***<sub>***d***</sub>  | d-axis current                                               | A                               |
| ***i***<sub>***q***</sub>  | q-axis current                                               | A                               |
| ***i***<sub>***s***</sub>  | stator current                                               | A                               |
| ***v***<sub>***d***</sub>  | d-axis voltage                                               | V                               |
| ***v***<sub>***q***</sub>  | q-axis voltage                                               | V                               |
| ***ω***                    | Electrical speed                                             | rad.s<sup>-1</sup>              |
| ***f***<sub>***v***</sub>  | Viscous friction                                             | kg.m<sup>2</sup>.s<sup>-1</sup> |
| ***K***<sub>***p***</sub>  | Proportional gain of the self-control PI controller          | <p><br><br></p>                 |
| ***T***<sub>***i***</sub>  | Integral gain of the self-control PI controller              | <p><br><br></p>                 |
| ***K***<sub>***pq***</sub> | Proportional gain of the PI controller for *i*<sub>*q*</sub> | <p><br><br></p>                 |
| ***K***<sub>***pd***</sub> | Proportional gain of the PI controller for *i*<sub>*d*</sub> | <p><br><br></p>                 |
| ***T***<sub>***iq***</sub> | Integral gain of the PI controller for *i*<sub>*q*</sub>     | <p><br><br></p>                 |
| ***T***<sub>***id***</sub> | Integral gain of the PI controller for *i*<sub>*d*</sub>     | <p><br><br></p>                 |
| **φ**<sub>**r**</sub>      | Magnet rotor flux                                            | Wb                              |
| ***δ***                    | Internal angle                                               | rad                             |
| ***Ω***                    | Rotor speed                                                  | rad.s<sup>-1</sup>              |
| ***ξ***                    | Electrical angle                                             | rad                             |
| ***J***                    | Inertia                                                      | kg.m<sup>2</sup>                |


---

# 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/courseware/electric-courseware/electric-motor-drives/permanent-magnet-synchronous-motor-pmsm-drive/virtual-test-bench-overview.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.
