> 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/smart-power-simulation-software-sps/example-models/motor-drives/speed-regulation-of-brushless-dc-motor-drive-using-a-hysteresis-based-current-controller.md).

# Speed Regulation of Brushless DC Motor Drive Using a Hysteresis Based Current Controller

This example shows the speed regulation of a brushless DC motor (BLDC) drive using a hysteresis-based current controller.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-ad7c397de62d2b1b3c27a4bcc8362db4410b91b7%2Fspeed_regul_brushlessDCmotor_hysteresis_currentcontrol.png?alt=media" alt=""><figcaption></figcaption></figure>

## Description

BLDC motors differ from brushed DC motors in that they use electronic commutation (rather than mechanical) to provide power to the windings. In its basic form, a brushless DC motor consists of a trapezoidal back-EMF permanent magnet synchronous motor fed by a three-phase inverter. A position sensor attached to the rotor provides the position signals required to synchronize the stator currents with the back-EMFs so that the motor operates as a synchronous motor at all times.

Because the back-EMFs are of trapezoidal form (with a flat area of 120 degrees), the maximum torque with the lowest ripple is developed if the currents are kept constant during the time intervals when the back-EMFs are also constant. This condition implies a six-step operation for the inverter where only two phases are conducting at a time.

### Electrical Model

The DC bus, modeled by an ideal DC voltage source of 310 V, connects to a three-phase, two-level converter. This converter generates the appropriate three-phase voltages to operate the 300 W, 4000 rpm BLDC motor.

### Control System

The main components of the control system are:

1. Speed Regulator - The regulator compares the actual motor speed to the speed reference. If the motor needs to be accelerated, the regulator increases the reference current magnitude in order to create more torque. If the motor speed is higher than the reference, the regulator reduces the reference current magnitude.
2. Decoder on the Hall sensor signals that detect the rotor position, the decoder outputs three square-wave signals that are synchronized to the motor back-EMFs.
3. Hysteresis-Based Current Controller - Based on the reference current magnitude and the signals provided by the decoder, three current references are generated and compared to the measured motor phase currents. The errors are fed to a hysteresis control with an adjustable band to generate the required gating signals for the three-phase inverter. The switching frequency is variable and dependent on the value of the hysteresis band and the dynamics of the stator circuit.

## Simulation

Run the simulation and observe the waveforms on the Scope blocks. Initially, the motor rotates at 3000 rpm with no load.

At 0.05 s, a load torque of 0.7 N.m is applied to the motor. The control system increases the reference current in order to maintain the motor speed at 3000 rpm.

At 0.1 s, the speed reference is reduced to 1500 rpm. To respect this new speed set point, the control system produces a large negative torque. Notice the reduced frequency of the motor phase currents.

At 0.15 s, a negative load torque of -0.7 N.m is applied to the motor. The motor is now acting as a generator producing 68 Watts.

## Command

Example model name: power\_motordrive\_BLDC\_CurrentControl

{% code lineNumbers="true" %}

```matlab
open('power_motordrive_BLDC_CurrentControl')
```

{% endcode %}


---

# 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/smart-power-simulation-software-sps/example-models/motor-drives/speed-regulation-of-brushless-dc-motor-drive-using-a-hysteresis-based-current-controller.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.
