> 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/library-specific-guides/motor-drives/robot-axis-control-using-brushless-dc-motor-drive.md).

# Robot Axis Control Using Brushless DC Motor Drive

## Introduction

Robots are complex electromechanical systems where several electric drives are used to control the movement of articulated structures.

This case study presents the modeling and simulation of a six-degrees-of-freedom robot manipulator. The two main joints models are built using brushless DC motor drives that are connected to the rest of the manipulator through speed reducers. The control system, which consists essentially of two position control loops, is built with Simulink® blocks. The inner speed and torque control loops are already included in the drive model. The rest of the manipulator and its load are represented by two Simulink nonlinear models, one for each motor drive.

The operation of the joints using typical trajectories is simulated and results are presented.

## Description of the Robot Manipulator

The robot considered in this example is a general-purpose six-degrees-of-freedom robot manipulator (GMF S-360) of parallelogram linkage type. The following figure shows the structure of the robot and its workspace. The robot has six axes. The three axes (Θ<sub>1</sub>, Θ<sub>2</sub>, Θ<sub>3</sub>) shown in the figure are for arm positioning and the others (α, β, γ) are for orientation of the end effector. In the horizontal plane, the robot can cover a 300 degree arc (Θ<sub>1</sub> = -150° to Θ<sub>1</sub> = 150°).

The robot’s axes are driven by brushless DC motors that are modeled by permanent-magnet synchronous motors fed by PWM inverters (AC6 drive model). Speed reducers of belt type and gearbox are used to transmit torque from the motors to the joints.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-20b25d1abbe20475dcb062e37770fb9076d1239f%2Frobot_axiscontrol_6degreesfreddom.png?alt=media" alt=""><figcaption><p>Six-Degrees-of-Freedom Robot Manipulator</p></figcaption></figure>

### Position Control Systems for Joints 1 and 2

We will consider in particular the two first joints (axis 1 and axis 2), which drive the entire robot and its load. The first axis uses a 2 kW brushless DC motor and a 1:130 speed reducer. The second axis uses a 1 kW brushless DC motor and a 1:100 speed reducer. The next picture shows a simplified diagram of the position control system for one robot link.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-b9bfe7b85267df3b7bc75e5e49c06d06eb0be451%2Frobot_axiscontrol_positioncontrol.png?alt=media" alt=""><figcaption><p>Brushless DC Motor Drive for Position Control of Robot Joint</p></figcaption></figure>

The control system consists of three control loops connected in a cascade configuration: an outer position loop includes an inner speed control loop and an innermost current control loop. The PM synchronous motor is fed by a three-phase PWM inverter operating in current-controlled mode. Field-orientation scheme is used to decouple the variables so that flux and torque can be separately controlled by stator direct-axis current i<sub>ds</sub> and quadrature-axis current i<sub>qs,</sub> respectively. The quadrature-axis current reference i<sub>qs</sub>\* (which represents the torque command) is provided by the speed control loop. The direct-axis current reference i<sub>ds</sub>\* is kept equal to 0.

A speed/position sensor is used to provide the information required by the speed and position control loops. The rotor position is also required for coordinates conversion (dq to abc).

Each motor drives the rest of the robot structure, including the other links and the load, through a speed reducer.

## Modeling the Robot Position Control Systems

The entire drive system for the robot’s two first joints, including motor drives, speed reducers, equivalent loads, and controllers is available in the [Robot Axis Control Using Brushless DC Motor Drives](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/library-specific-guides/motor-drives/robot-axis-control-using-brushless-dc-motor-drive.md) example.

The brushless DC motor drives are represented by two AC6 (PM Synchronous Motor Drive) blocks. This block models a complete brushless DC motor drive including a permanent-magnet synchronous motor (PMSM), an IGBT inverter, speed controller, and current controller. The AC6 inputs are the speed commands and the outputs are the motor speed, which are fed to the inputs of the speed reducers.

The speed reducers are modeled by two [Speed Reducer](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/library-specific-guides/motor-drives/robot-axis-control-using-brushless-dc-motor-drive.md) blocks. The inputs for these blocks are the motors’ speeds, and the outputs are the torques from the low-speed sides, which are applied to the robot structure model. The speed reducers are characterized by their ratio and inertia and the stiffness and damping of input and output shafts.

The speed reducers' output shafts are connected to the T<sub>1</sub> and T<sub>2</sub> inputs of a Robot block that represents the rest of the robot structure. This block calculates the effective torque reflected to each joint. For each joint (numbered i), we can consider globally the other links effects as a single load reflecting to the joint a torque that is composed of three terms

$$
T\_L = J\_i \frac{d^2 \theta\_i}{dt^2} + C\_i \frac{d \theta\_i}{dt} + G\_i \cdot \theta\_i \space \space \text{(1})
$$

where $$\theta\_i$$ is joint angular position, J<sub>i</sub> is inertia, C<sub>i</sub> is centrifugal and Coriolis coefficient, and G<sub>i</sub> is gravitational coefficient.

The Robot model is built with Simulink blocks.

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

In this diagram, the parameters J<sub>1</sub>, C<sub>1</sub>, G<sub>1</sub>, J<sub>2</sub>, C<sub>2</sub>, and G<sub>2</sub>are functions of joint positions. Implement them by using polynomials or lookup tables.

The joint positions Θ<sub>1</sub> and Θ<sub>2</sub> are controlled by outer control loops that force Θ<sub>1</sub> and Θ<sub>2</sub> to follow the references imposed by the trajectories of the manipulator. Various algorithms can be used for these control loops. The most popular ones are proportional-derivative, computed torque, and adaptive. In this example, proportional-derivative controllers are implemented for both axes.

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

Cubic polynomial test trajectories for robot motion are generated by the Trajectory Generator block.

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

The test trajectories consist of a movement from position 6 to position 3 in the workspace (Θ<sub>2</sub> varying from -π/4 to π/4) while rotating around axis 1 from one position to another (Θ<sub>1</sub> varying from -π/6 to π/6). The parameters to be specified for this block are initial position \[Θ<sub>1ini</sub>, Θ<sub>2ini</sub>], final position \[Θ<sub>1fin</sub>, Θ<sub>2fin</sub>], and move time. The following figure shows the changes of robot structure during the programmed movement.

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

The variation of inertia due to structure changes is reflected to axis 1 as an inertia varying as a function of Θ<sub>2</sub> (from 215 kgm<sup>2</sup> to 340 kgm<sup>2</sup> passing by a minimum of 170 kgm<sup>2</sup>). The inertia reflected to axis 2 is a constant (J<sub>2</sub> = 50 kgm<sup>2</sup>). These inertia variations are represented by nonlinear functions implemented in the Robot block.

## Tracking Performance of the Motor Drives

The test trajectories described above constitute one of the most demanding trajectories for the motor drive of the first and second joints. They are used here to evaluate the tracking performance of the two electric drive systems.

In the example, the manipulator is programmed to rotate from -30° to 30° during 1.5 seconds, and at the same time the arm is moved from the back position (Θ<sub>2</sub> = -45°) to the most advanced position (Θ<sub>2</sub> = 45°). The simulation is run using a time step of 1 µs.

The responses of the manipulator and the motor drives 1 and 2 are displayed on three scopes connected to the output variables of the AC6 and Robot blocks.

During the movement, the joint positions Θ<sub>1</sub> and Θ<sub>2</sub> follow the imposed cubic trajectories with low tracking error.

The brushless DC motor drives behave very well during the test trajectories. The DC bus voltages are maintained at relatively constant levels during the deceleration of the motors. The developed torques are proportional to the motor currents' amplitudes. This demonstrates the good operation of the field-oriented control algorithms.

## **References**

\[1] Miller, T. J. E., *Brushless Permanent-Magnet and Reluctance Motor Drives*, Clarendon Press, Oxford, 1989.

\[2] Spong, M. W., and Vidyasagar, M., *Robot Dynamics and Control*, John Wiley & Sons, New York, 1989.


---

# 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/library-specific-guides/motor-drives/robot-axis-control-using-brushless-dc-motor-drive.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.
