2.2.1 BLDC - Closed Loop - Torque 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. Hardware Connections  

4. Required Parameters List

5. Configuration Steps  

6. Troubleshooting  

7. Configuration Example

 

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.

   

 

 

 2. Theory

Motor Commutation

Below are some key points concerning the commutation of a Brushless DC (BLDC) motor:

  • BLDC motors use permanent magnets in the rotor
  • A three-phase voltage applied to the stator windings creates a rotating magnetic field that pulls the rotor and produces motion
  • For SPM (Surface Permanent Magnet) motors, optimal torque is achieved when the stator’s magnetic field leads the rotor’s magnetic field by 90 electrical degrees. This is why BLDC motors typically require sensors to determine the rotor’s position and properly align the magnetic fields.
  • Motor commutation is handled by a control algorithm called Field Oriented Control (FOC).
  • The same sensor used to commute the motor can also be used for feedback
  • Although the same sensor may be used, commutation and control are distinct functions managed by the motor drive.

Field Oriented Control

  • Field Oriented Control (FOC) transforms the angle difference between the rotor and stator magnetic fields into two current vectors by applying Clarke and Park equations: Id (Flux amps) and Iq (Torque amps).

 

 

  • These vectors allow direct control of the magnetic field angle by adjusting the Id and Iq currents
  • Iq current is the component providing torque while Id controls the rotor flux
  • In Open Loop mode (SPM motors), optimal torque is achieved by minimizing the Id current while Iq current results from the applied voltage command and the load. 

 

 

  • Id and Iq currents are regulated using two PI (Proportional-Integral) control loops 
  • The PI gains of these control loops are tuned based on the motor’s Resistance (R) and Inductance (L) parameters using the zero-pole cancellation method
  • The RL parameters can be obtained from the motor datasheet or by using the motor characterization tool of the drive
  • The user only needs to select the bandwidth of the FOC loop, which determines its responsiveness.

 

 

 

Hall Sensor Commutation

  • Hall sensors can provide the rotor's angular position, albeit with limited resolution.
  • The Hall sensor counter changes every time there is a change in the Hall states
  • The numbers of sensor counts during one full rotor rotation is equal to the number of motor pole pairs multiplied by 6 
  • The rotor’s angle between consecutive Hall states, can only be estimated based on the current Hall state, the rotor’s speed and direction
  • The speed is calculated by measuring the time between two hall transitions.

 

 

 

Counts and Valid States

  • The Hall Status is calculated from the binary states of each Hall sensor, converted to decimal 
  • Valid Status values for a 120° placement Hall sensor, which is the common case, range from 1 to 6 
  • 0 and 7 states are invalid and indicate a sensor failure

   

 

 

3. Hardware Connections

Power Wires

  • Vmot is the connector for the voltage supplied to the motor and can operate within a range of 14 to 60 V.
  • The Pwr Ctrl supply is optional and can be used to keep the drive operational in case of main battery disconnection. However, Pwr Ctrl must be connected to the battery’s negative terminal to allow the drive to shut down properly.
  • The motor should be connected to the UVW power connectors.

 

 

 

Hall Sensors

In most motor drives the Hall sensors are connected to the dedicated Molex connector. 

 

  • The Hall sensor uses 3 wires for the A,B and C sensor signals and two wires for the Vcc and GND.
  • The sensor is powered from the 5V output and the GND of the dedicated sensor connector.
  • Hall sensors typically have open collector outputs, which are pulled up internally by the motor drive’s internal pull-up resistors. No additional circuitry is required to be added by the user. 

   

 

4. Required Parameters List

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

   

 

 

5. Configuration Steps

1. Configure the Number of Pole Pairs

Pole pairs parameter is essential for the sinusoidal commutation and for the speed calculation. Pole pairs is the number of motor poles divided by 2.

2. Configure the Molex Input to Hall Sensors

SSI sensors and Hall sensors share the same Molex connector, so the sensor being used must be declared.

3. Configure the Switching Mode  to Sinusoidal

Both trapezoidal and sinusoidal commutation modes are supported by Roboteq drives. Sinusoidal mode results in quieter motor operation with reduced harmonics and current ripple, making it the preferred choice.


 

4. Set the Reference Seek Power  to the rated current of the motor

The reference seek power is the current that will be provided to the motor during the motor/sensor calibration process. 

 

NOTICE

If the reference current is set too low or too high, the motor/sensor setup may not be performed correctly, which can negatively affect motor commutation.


 

5. Configure the Sinusoidal Angle Sensor  to Hall

This is the sensor that will be used for the commutation of the motor

 

6. Configure the FOC Parameters

These are the gain values for the two PI controllers in the FOC loop, which regulate the torque and flux currents. The FOC gains can be set using the Motor Characterization tool. 

The Motor Characterization tool offers two options: 

  1. Calculate Gains Using the datasheet Parameters:

The datasheet parameters should list the phase-to-phase or the phase Resistance and Inductance values. If these parameters are given as phase-to-phase values, they should be divided by 2. Pay attention to the units, as the Tool accepts mOhm and uH. 

The motor Resistance (R) and Inductance (I) values should be manually entered to the respective fields. The same inductance value should be entered to Ld and Lq parameters, if the motor is an SPM type.

 

  1. Calculate Gains by Characterizing the Motor

If the datasheet values are not available, the Roborun+ Utility offers the option to characterize the motor. The motor's resistance and inductance values are estimated by supplying a variable voltage to the motor. Be aware that the rotor will move during the characterization process, so it should not be blocked or loaded.

 

NOTICE

Make sue that the motor is free to rotate and without load before performing the motor characterization


  • After setting the gains manually or through Motor Characterizations, you will be prompted to select a bandwidth for the FOC controllers. 

  • The motor drive will calculate the FOC gains based on the following formulas:

  • Prefer a moderate bandwidth value, as high values may cause vibrations, while low values will result in a slower current response.
  • After closing the tool, the FOC parameters are updated. To view the changes in the utility, click Load from Controller.

7. Configure the Current Limits

The drive regulates the motor current based on three configurations: the Amps Limits Parameter, the I²T Protection setting, and the Maximum Motor Output Power. Each of these defines a maximum allowed current, and the drive will restrict the current to the lowest of the three values.

 

7.1 Set the motor Amps Limit  Parameter: 

The drive will prevent the motor current from exceeding this value by reducing the motor voltage. The amp limit value should be set equal to the peak current of the motor.
 

 

7.2 Optionally set the Amps Trigger Action  and Amps Trigger Delay parameters

Since the peak current of a motor is typically only allowed for a short duration, Roboteq drives offer the option to trigger an action if the motor current exceeds a specified value for a specific amount of time. This can be configured using the Amps Trigger Action and Amps Trigger Delay parameter.

 

7.3 Enable the I2T protection: 

I2T protection is a method that measures the energy supplied to the motor in order to protect it from overheating. It works by integrating the excessive current supplied to the motor and comparing it with a threshold value. If the accumulator exceeds the I2T threshold, the drive will start limiting the current at 80% of the nominal current, allowing the motor to cool down and causing the I²T accumulator to decrease accordingly.

 

To enable the protection, configure the I2T Time, which is the time that the motor can handle its maximum current, and Nominal Current, which is the nominal current of the motor. 

 

7.4 Set the Maximum Motor Output Power parameter: Similar to the Amps Limits parameter, the Maximum Motor Output Power parameter restricts current to prevent the motor's power from exceeding the configured value. Set this parameter according to the motor datasheet by calculating the product of the motor's maximum rotational speed (in rad/s) and peak torque. 

 

8. Configure the Operating Mode to Open Loop

Even if the intention is to use Torque, Speed or Position modes, the configuration and test of Open Loop mode is a mandatory step.

 

9. Disable the Sensor Error Detection on the unused channels

The Sensor Error Detection feature monitors for sensor-related faults. In dual-channel drives, if one sensor is not connected, this feature will trigger a Sensor Error. Therefore, this detection must be disabled for unused channels.

 

10. Navigate to the Diagnostics tab and run Motor/Sensor Setup

Motor/Sensor Setup is the process by which the drive records the positions of the Hall sensors in both the positive and negative directions. This step is essential for the sinusoidal commutation of the motor. During calibration, the rotor will complete one full mechanical rotation in each direction. The actual movement of the shaft will depend on the gear ratio.

 

NOTICE

Ensure the motor is free to rotate during the motor/sensor setup process. The rotor should have no load, and the brake must be disengaged. There is no need to remove the motor’s gear system. Failure to perform the motor/sensor setup correctly can negatively affect motor commutation.


In the chart, enable the Motor amps and Hall Status variables and ensure the following: 

  • Hall status Min and max is 1 and 6
  • Hall status takes all the intermediate values including 1 and 6 
  • Hall status 7 and 0 which would indicate a sensor fault value are not present
  • The Motor Amps are equal to the Reference seek power value


When the motor/sensor setup finishes, it will print the Hall Sensor Angle Table (HSAT). 

  • Ensure that by repeating the process, you get similar values
  • Additionally, ensure that the HSAT does not contain repeated values, as this could indicate a sensor error. The presence of multiple instances of the value 64 may also suggest a fault.

11. Navigate to the Run Tab and Evaluate the motor’s Open Loop response without load. 

In the Chart, enable the parameters that are illustrated below:

 

Provide a motor command by using the slider and verify the following: 

  • Run the motor in both directions. Verify that the Motor Amps value is below or equal to the “no load current” of the motor, when the given command is constant. The motor current can increase during acceleration/deceleration but at constant power, the motor amps should be relatively low. The motor’s no-load current should be typically be below 3 A, however the value may vary depending on the motor’s size and gearbox ratio.
  • Supply a full command in both directions. Verify that the Motor Amps in both clockwise (CW) and counterclockwise (CCW) directions are symmetrical. If the current differs significantly (by more than 1 A), then something in the configuration might not be correct.
  • Verify that the motor Flux Amps variable exhibits a small fluctuation and stabilizes quickly to zero during motor acceleration and deceleration.
  • Verify that the FOC Angle Correction variable is stable or that it stabilizes quickly when changing the motor speed.
  • Verify that the Internal Sensor Speed RPM is stable when supplying a constant command 
  • Verify that the Internal Sensor Speed RPM is symmetrical when supplying full command in both directions. Depending on the motor, an error up to 5% can be acceptable, but higher variation may indicate a tunning or sensor issue. 
  • Verify that the Internal Sensor Speed RPM  is reported as positive by giving a positive motor command. If not, invert the pole pairs sign, to fix it (e.g., -5 from 5).
  • It is crucial having the Hall (internal sensor) speed reported with the correct sign otherwise the motor can go into a runaway condition when configuring the Closed Loop modes.

 

WARNING

If the motor speed in Open Loop mode is reported as negative when a positive command is given, it will lead to an uncontrolled runaway condition if the operating mode is later changed to any of the supported Closed Loop modes. Fixing the reported speed as described is essential before proceeding with the configuration of the rest operating modes. 

 

If all the steps have been passed, then the Open Loop configuration is effective, and the motor is ready to be configured in Torque mode!

 

 

 

 

 6. Troubleshooting

Troubleshooting Table

A troubleshooting table with some common Problems and solutions follows:
 

 

 

Hall Sensor Issues

One common reason for a motor's inability to rotate is a failure on either the sensor or motor drive side. To troubleshoot, you can use the motor drive's diagnostic tab to review the Hall sensor signals and identify any issues:

  • During motor/sensor setup, check if the hall signal has the correct pattern. The Hall status should take all the states from 1 to 6. States 0 or 7 are invalid and indicate a sensor error (missing signal or sensor misalignment)
      

 

During motor and sensor setup, ensure that all Hall states have the same duration. If the sensor is misaligned, as shown in this example, the commutation will be compromised. This can cause the motor to draw high and unstable current, leading to noisy performance, even if it manages to rotate.

 

 

If a signal is missing on the diagnostics tab chart, check if all signals are present at the sensor’s output. To achieve this, connect the sensor to the drive's input as the pull-up resistors that are integrated internally are required. Then, manually rotate the shaft, and use a multimeter to verify that all signals are present. Their state should change from 0 to 5V. If all signals are present but the drive is unable to read any of them, the drive’s input may be damaged. 

 

 

   

7. Configuration Example

 

 

 


 

 

2.2.1 BLDC - Closed Loop - Torque v 1.0 →