← 2.2.1 BLDC - Closed Loop - Torque v 1.0

2.2.3 BLDC - Speed Mode - Acceleration Feedforward control v1.0 →
2.2.4 BLDC-Position Relative v 1.0 →
2.2.5 BLDC - Closed loop position tracking v 1.0 →

2.2.6 BLDC-Closed Loop Count Position v 1.0 →

2.2.7 BLDC-Closed Speed Position v 1.0 →

 

 

Note: The Guide can be downloaded in PDF format at the end of the article.

 

Disclaimer and Safety Information

 

Disclaimer

This quick startup guide is provided as a complementary resource to the official motor drive manual and datasheets. It is not intended to be the sole source of information for proper motor drive configuration and operation. Incorrect configuration or software bugs may cause unintended behavior, including uncontrolled motor operation or runaway. Users must always conduct tests cautiously and ensure they have a reliable method to safely stop the system in such scenarios. Roboteq, the author, and related parties are not liable for any hardware damage, personal injury, or other consequences arising from the use or misuse of the information in this guide.

 

Safety Symbols Explanation

 

 

Table of Contents

 

  1. How to Use This Guide

  2. Theory

  3. Required Motor Parameters

  4. Configuration Steps

  5. Tuning

    1. Useful Command

    2. Tuning Steps

    3. Limitations and Considerations

  6. Troubleshooting

 

1. How to Use This Guide

 

  • This guide is part of a series of documents that must be followed sequentially to configure and test a BLDC motor. The process begins with the Open Loop configuration and continues through the sequence of documents until reaching the final target operating mode.

  • The Open Loop mode guides are organized based on the sensor(s) used to commute the rotor (e.g., Hall, Hall & Encoder, Sin/Cos, etc.).

  • According to this sequential structure, configuring a higher-level operating mode, such as Count Position with Hall sensors, requires completing the configuration and testing of lower-level modes, including Open Loop with Hall sensors, FOC Torque and FOC Speed.

 

 

  • The Speed tuning of the motor consists of two portions: Closed Loop Speed PID tuning and acceleration Feedforward control tuning, which should be configured in a sequence. First, the Closed Loop Speed will be tuned, and then it can be optimized using the acceleration feedforward control. The feedforward control step is optional.

 

2. Theory: Closed Loop Speed Operation

Speed mode uses the Speed PID controller to drive the motor to the desired speed.

 

Speed mode operates by utilizing the Torque mode to provide the required PWM voltage to the motors. Therefore, both Open Loop and Torque modes must be already configured and tested.

 

A very important step before proceeding to the Closed Loop configuration is to ensure that the motor speed is reported as positive when a positive command is given. Failure to configure the motor sensors properly can lead to uncontrolled motor movement.

 

Warning: Ensure that the sensor speed is reported positive when a positive command is given. Otherwise follow the corrective actions presented in the Open Loop guides. 

 


3. Required Parameters List

 

To complete the configuration sequence, ensure you have the following specifications readily available:

 

 

4. Configuration Steps

1. Set the Closed Loop Feedback Sensor. 

The feedback sensor should be set according to the type of sensor being used.

Other: Encoder, SSI

Internal: Hall, Sin/Cos, Resolver, Analog

 

 

2. Configure the motor Min and Max Speed. 

These are the maximum and minimum values that the controller is allowed to command. 

 

 

3. Set the motor Acceleration/Deceleration values. 

This profile will be followed by the drive when a speed command is given. 

 

 

 

4. Set the Operating mode to Closed Loop Speed

 

 

 

5. Tuning

5. Configure the Speed PID parameters. 

The default values are 0 and will not result in any motor power. Start by giving a small value on the Proportional and Integral gains. Values between 0.03 to 0.3 for both P and I will make the unloaded motor to follow the given command in most cases.

 

 

6. Disable the Loop Error detection. 

At this point, the system is still untuned so Loop Error detection might be triggered

 

 

 

7. Navigate to the run tab and test the motor by using the slider. 

Ensure that the command is reached in both directions and the speed is stable. It is not required to have a fast response at this point. If the set point is not reached, increase the I gain. Increase the P gain if the motor response is very slow.

 

 

5.1 Tuning: Useful Commands

Loading the motor might result in limitations related to the available space for movement. Two useful tools that can prevent the motor from reaching the space limits are the Watchdog timer and the Console commands.

In contrast to the slider, which sends continuously motor commands to the controller over a specific time period, console commands can be used to send the motor command only once. 

 

Console commands, in combination with the Watchdog timer, can be used to stop the motor after a specific amount of time. The watchdog will stop the motor if the command is not renewed within a defined time period. 

 

 

Sending the commands through the console guarantees that the watchdog timer will expire after the configured time.

 

Watchdog timer will stop the motor using the configured Fault Deceleration parameter, so ensure that it has been set with the desired value:

 

A motor command in Speed Mode can be sent with the following syntax:

!S cc nn

where cc is the channel and nn is the desired speed in RPM.

For example, the following command will give a set point of 300 RPM in channel 1:

!S 1 300

There is also the option to send a simultaneous motor command to both channels by combining the two commands with an underscore (“_”).

For example, the following command will give a desired speed of 500 RPM to both channels:

!S 1 500_!S 2 500

Issuing a motor command for both motors can be useful in dual-channel applications like differential drive AGVs.

 

5.2 Tuning: Tuning steps

1. Give some small initial values on P and I gain:

 

2. Adjust the P and I gains to have a smooth feedback curve resembling the one in the image below.

This curve exhibits the characteristics of a first-order system and will result in stable behavior. At this stage, a fast response is not necessary; focus on creating a smooth feedback curve with no steady state error and overshoot. 

 

 

To achieve that, we increase the P gain to make the response faster and we increase the I gain to remove the steady state error:

 

3. Multiply P and I gains by the same factor to increase the Closed Loop Speed Bandwidth:

 

4. If necessary, decrease the Low Pass Filter Cutoff frequency.

 

When the Feedback follows the Ramped command in a fast and stable manner, the system can be considered tuned!

 

5.3 Tuning: Limitations and Considerations

1. PID Loop Limitations: 

Minimizing the Transient Loop Error may not be possibleThe PID loop requires a certain amount of loop error to function. With lower loads, the feedback may be able to closely follow the ramped command. However, as the load increases, some transient loop error may remain. The transient system's response can be further optimized by using the Feedforward control, which will be demonstrated in the next training.

 

2. Motor Power Limitations: 

The drive may not be able to provide efficient power or the motor may not be powerful enough to move the load. This can be determined by looking at the voltage and current during the transient response of the motor

  1. Voltage limitation: 

If the PWM voltage has reached 100% (+/- 1000 value) and the motor still cannot achieve the desired torque, speed, or acceleration, it indicates that the power demand exceeds the motor drive limits. In this case, the motor cannot follow the desired ramp, regardless of the applied voltage.

 

  1. Current limitation: 

Similar to the voltage limitation scenario, the motor will not be able to accelerate faster if there is not enough current available to support it. The maximum allowed current is set through the Amps Limits parameter. If the current required for a faster move exceeds the motor or drive limitations, this parameter ensures that the current is kept to a safe limit.

 

3. Ramped Command and Feedback considerations: 

The input to the Speed loop is the error that arises when subtracting the Feedback from the motor trajectory, reported by the Ramped Command. When employing traditional PID control, the motor will not exceed the trajectory during transients. When monitoring motor performance, it's advisable to examine the Ramped command instead of the motor command, as this disregards the configured acceleration profile.

 

 

4. Motor current Slew Rate: 

The output of the Speed Loop becomes a current demand for the Current Loop (including also the acceleration feedforward and adaptive controller output current command parameters). This requested current will also follow a trajectory, which is determined by the Slew Rate Parameters.

 

 

The Slew Rate can be set with the ^ISLR command as follows:

^ISLR cc nn

Where cc is the channel and nn is the current slew rate at x10 A/sec. The default value 100 , that is 1000 A/sec = 1A/msec.

Min=0 (disabled slew rate) Max=65000 (650 A/msec)

 

5. Motor tuning tips:

When selecting the motor acceleration and deceleration profile, prefer a ramp that the motor can closely follow. This will lead to a more precise and controlled movement. Even if the actual speed response of the motor in both cases is the same, the motor will react better in command changes and disturbances if it can closely follow the ramped command.

 

6. Troubleshooting

 

 

← 2.2.1 BLDC - Closed Loop - Torque v 1.0

2.2.3 BLDC - Speed Mode - Acceleration Feedforward control v1.0 →
2.2.4 BLDC-Position Relative v 1.0 →
2.2.5 BLDC - Closed loop position tracking v 1.0 →

2.2.6 BLDC-Closed Loop Count Position v 1.0 →

2.2.7 BLDC-Closed Speed Position v 1.0 →