> 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/exercises.md).

# Exercises

After completing the following series of exercises, the student will understand the control of a permanent magnet synchronous motor.\
Real-time simulation results are shown in the laboratory panel.

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

1. Open the model with the default settings.
2. Gradually apply a field voltage of 460 V for the DC machine.
3. Connect K1, as shown in figure 12.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FCxzr2A56J2PeJc2ALNLg%2F9d4610eb-dca2-4fee-b256-ea443973a62b.png?alt=media&amp;token=158f1714-84a1-41b0-8cc2-4f0d5dc96987" alt=""><figcaption><p><strong>Figure 12</strong>: PMSM Armature Connected to Three-phase Resistance</p></figcaption></figure>

4. Gradually increase the armature voltage of the DC machine to 120 V.
5. Apply the Trigger.
6. Show the obtained waveforms from the simulation.\
   It should be noted that Clarke transformation is selected by default.
   * What do you observe in terms of current magnitudes in (a, b, c) and (α, β) reference frames?\
     Explain.
   * What are the values of the currents *I*<sub>*d*</sub> and *I*<sub>*q*</sub>?
   * What are the active powers in (a, b, c), (α, β), and (d, q) reference frames?
   * What do you observe in terms of active powers’ values?\
     Explain.
7. Switch the Transformation to Concordia, as shown in figure 13.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FO6H591Vn5fRuRTYthmg9%2F55d4697f-17c1-480e-9767-b6f3c2e72ba4.png?alt=media&amp;token=2ec8436c-b305-4611-ae6f-2e6650a9a2a7" alt=""><figcaption><p><strong>Figure 13</strong>: Selection of Concordia Transformation</p></figcaption></figure>

8. **200px** Show the obtained waveforms from the simulation.
9. What do you observe in terms of current magnitudes in (a, b, c) and (α, β) reference frames?\
   Explain your observation.
10. What are the values of the currents *I*<sub>*d*</sub> and *I*<sub>*q*</sub>?\
    How do they differ from the values obtained when Clarke transformation was applied?
11. What are the active powers in (a, b, c), (α, β), and (d, q) reference frames?
12. What do you observe in terms of active powers’ values? Explain.

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

### Hysteresis <a href="#hysteresis" id="hysteresis"></a>

1. Decrease the armature voltage of the DC machine to 0 V.
2. Deactivate the Trigger.
3. Disconnect K1, switch the Transformation to Clarke, and connect K2 (see figure 14).

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2F68635PxBClGWY91wTDVA%2Fdf9d9189-32bd-42d4-a3fd-063a3296da04.png?alt=media&amp;token=250d3e8b-2d76-46b2-a05c-7b1527ed2c73" alt=""><figcaption><p><strong>Figure 14</strong>: Selection of Clarke Transformation with PMSM Connected to the Inverter</p></figcaption></figure>

4. Go to “**Current Control”** tab and enter a hysteresis band value of **0.05** (see figure 15).

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2Fv6Ia8c718B2bTL9dlakY%2F0d528346-8321-4bed-89d0-50f57fadc2be.png?alt=media&amp;token=e98b8f26-bce8-4648-b804-56085b64091c" alt=""><figcaption><p><strong>Figure 15</strong>: Self-Current Control with Hysteresis Controller</p></figcaption></figure>

5. Apply a **reference current** of **5 A**.
6. Do the measured currents in (a, b, c) follow the reference currents?\
   Show your results.
7. Do the measured currents in (d, q) follow the reference currents?\
   Show your results.
8. What are the values of torque (Tem) and speed (N)?
9. Increase the **reference current** to **10 A**.
   * Do the measured currents in (a, b, c) follow the reference currents?\
     Show your results.
   * Do the measured currents in (d, q) follow the reference currents?\
     Show your results.
   * What are the values of torque and speed ?
10. Increase the **reference current** to **15 A**.
    * Do the measured currents in (a, b, c) follow the reference currents?\
      Show your results.
    * Do the measured currents in (d, q) follow the reference currents?\
      Show your results.
    * What are the values of torque and speed ?
    * How does the increase in reference current impact the torque and speed of the PMSM?

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

1. **Decrease** the **reference current** to **10 A**, then **0 A**.
2. In the “**Current Control**” tab, switch the “Control” to PI as shown in figure 16.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2Ffon76jqmD4cwRZKxOipk%2F98af9e98-45cc-459b-a776-662aba5a9651.png?alt=media&amp;token=74b21fa6-b07b-4360-a486-b21141db1c69" alt=""><figcaption><p><strong>Figure 16</strong>: Self-Current Control with PI Controller</p></figcaption></figure>

3. Apply a reference current of 8 A.
4. Tune the gains Ki\_self and Ti\_self (see figure 17) of the PI controller so that the measured currents follow the reference currents in (a, b, c) and (d, q) reference frames.
   * Explain how you proceed to set the values of the gains.
   * Do the same gain’s values work if a reference current of 12 A is applied?\
     Show your results.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2FZZqVClgUDMmRUHEKuxty%2F24e23f25-8c16-45bc-ba1f-410658a6505b.png?alt=media&amp;token=6651e6a3-c52d-416a-873e-4c007857385c" alt=""><figcaption><p><strong>Figure 17</strong>: Gains of the Self-Control PI Controller</p></figcaption></figure>

{% hint style="info" %}
For the PI controller implemented in this laboratory, the gain *K*<sub>*i*</sub> is defined as the ratio of the proportional gain *K*<sub>*p*</sub> and the integral gain *T*<sub>*i*</sub>.\
***K***<sub>***i***</sub>**&#x20;=&#x20;*****K***<sub>***p***</sub>***/T***<sub>***i***</sub>
{% endhint %}

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

1. Decrease the reference current to 6 A, then 0 A.
2. In the “**Current Control**” tab, switch the “Control” to Hysteresis and “Self/Vector Control” to **Vector**, as presented in figure 18.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2F8B88fofmbJhD0Cin9JYa%2F24c18206-485e-46ab-9454-38f7920c75fd.png?alt=media&amp;token=0667de11-c00b-4463-a0f0-0f9fc3d5901b" alt=""><figcaption><p><strong>Figure 18</strong>: Selection of Vector Current Control</p></figcaption></figure>

3. Apply a **reference current** of **4 A**.
   * Do the measured currents in (a, b, c) follow the reference currents?\
     Show your results.
   * Do the measured currents in (d, q) follow the reference currents?\
     Show your results.
   * What are the values of torque and speed ?
4. Increase the reference current **to 8 A.**
   * Do the measured currents in (a, b, c) follow the reference currents? Show your results.
   * Do the measured currents in (d, q) follow the reference currents? Show your results.
   * What are the values of torque and speed ?
5. Increase the **reference current** to **12 A**.
   * Do the measured currents in (a, b, c) follow the reference currents?\
     Show your results.
   * Do the measured currents in (d, q) follow the reference currents?\
     Show your results.
   * What are the values of torque and speed ?
   * How does the increase in reference current impact the torque and speed of the PMSM?
6. With the **reference** at **12 A**, **decrease** the **load resistance** of the DC machine to **15 ohms**.
   * What do you observe in terms of current magnitudes, speed, and torque values?\
     Explain your observation.
   * How does the decrease of resistance impact the armature voltage and current of the DC machine?
7. Increase the **reference current** to **15 A**.
   * Do the measured currents in (a, b, c) follow the reference currents?\
     Show your results.
   * Do the measured currents in (d, q) follow the reference currents?\
     Show your results.
   * Explain the importance of decreasing the load resistance when the reference current is approaching the maximum current ($$\sqrt{2} , I\_{nom}$$ ) of the PMSM.

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

1. Decrease the reference current to 10 A, then 5 A, and finally 0 A.
2. Increase the resistive load of the DC machine to 25 ohms.
3. Go to “**Speed Control**” tab and enable the Speed Control, as shown in figure 19.

<figure><img src="https://4054096626-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbyVjpgEQX9nfCkpYoFP%2Fuploads%2F7n7maO9Vp0f6NhYPc4Ij%2Fcfeb91ec-4bc3-4e50-a8e2-db9bb6a0b96e.png?alt=media&amp;token=843cbeb6-9dbe-48c5-b225-228914554ee0" alt=""><figcaption><p><strong>Figure 19</strong><em>: Activation of the Speed Control</em></p></figcaption></figure>

4. Set the reference speed as **250 rpm**.
   * Does the measured speed follow the reference speed?
   * Does the measured torque follow the reference torque?
   * Do the measured currents follow the reference currents?
   * What are the values of armature voltage and current of the DC machine
   * Show the results to support your answers.
5. Set the r**eference speed** as **500 rpm**.
   1. Repeat questions 1 to 5 above.
6. Set the **reference speed** as **750 rpm**.
   * Repeat questions 1 to 5 above.
7. Set the **reference speed** as **900 rpm**.
   * Repeat questions 1 to 5 above.

How does the increase in reference speed impact the armature voltage and current of the DC machine? Explain.


---

# 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/exercises.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.
