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


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 Read This Guide

2. Theory

3. Hardware Connections  

4. Required Parameters List

5. Configuration Steps

6. Troubleshooting

7. Configuration Example



  1. How To Read 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 sensors used (e.g., Hall, Hall & Encoder, Sin/Cos, etc.).
  • For example, 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                                                       


Field Oriented Control


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 (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). 


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.



Encoder Commutation


Quadrature encoders are one of the supported sensor types that can be used to commutate the rotor.


  • They typically offer high resolution and can be used to precisely commute the rotor
  • The number of counts per revolution registered by the drive is four times higher than the encoder’s pulses per revolution:
      Counts per Revolution (CPR) = Pulses per Revolution (PPR) * 4


  • While having a high resolution, they do not provide a reference point (Index pulse cannot be utilized) making it necessary to automatically perform a zero-search sequence during every power-up.
  • Since the rotor angle is unknown prior to the zero-search sequence, the sequence cannot be performed with optimal torque. Therefore, the motor should be under a relatively low load during calibration.



Max PPR vs Max RPM


  • RoboteQ controllers use high-speed inputs to read encoder pulses, with a maximum frequency limit of approximately 200 KHz. 
  • The measured frequency is proportional to the motor speed and the sensor’s resolution.
  • The maximum supported sensor’s resolution is given by: Max_PPR= 60 x Max_Input_Frequency / RPM
  • The below figure illustrates the RPM/PPR curve with a input’s maximum frequency of 200KHz, which is the case for most of the Roboteq RogoG4 models.

   






 3. Hardware Connections                              



  • 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.



 


  • For BLDC drives, the encoder is commonly connected to the motor drive’s I/O connector.
  • It uses 4 wires, two for the AB signals and 2 for powering (5V from the drive and GND).
  • If the A/B signals are swapped, the sign of the measured speed will be inverted. However, this can also be corrected through the motor drive's configuration.



Supported Encoder output types


The motor drive supports Push-pull, TTL and Open-collector output encoders. While the first two types of sensors are directly supported, Open-collector output sensors require pull-up resistors from both the ENCA and ENCB inputs to 5 V in order to function properly.

   

To avoid reducing the signal below the MCU’s HIGH threshold, a pullup resistor of maximum 10Kohm should be used. 




 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 switching mode to "Sinusoidal"


Roboteq controllers support two ways of supplying current to the motor: Trapezoidal and Sinusoidal. In sinusoidal mode the current is sinusoidal, so it has fewer harmonics, and the motor is driven in a smoother and quieter way, developing the minimum torque ripple. Since sinusoidal commutation is superior to Trapezoidal, this method should be configured.



 3. 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. If the reference current is too low or too high the motor/sensor setup will not be performed correctly.




 4. Configure the Sinusoidal angle sensor to "Encoder"


This is the sensor that will be used to get the angle of the rotor. Knowing the exact angle of the rotor at each time is necessary to commute it.




 5. Configure the Encoder PPR and Channel


The PPR (Pulses per revolution) parameter can be obtained from the encoder datasheet. Make sure that the PPR is configured correctly as it is an essential parameter for the commutation of the motor. The channel that the encoder will be used as well. The action of the encoder (e.g. Feedback) is not necessary to be configured yet, but it can be set as "Feedback" if the encoder will be used for the Closed Loop operation as well.




 6. Configure the FOC Flux and Torque gains


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 the 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.



2) Calculate the 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.




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 Amps Limit parameter


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 final target is to use Close Loop Speed or Position mode, it is mandatory to first test the motor in Open Loop.



 9. Disable the Sensor Error Detection on the unused channel


In dual-channel controllers, if one of the two sensors is not connected, the Sensor Error will be triggered. Disable the Sensor Error Detection in the unused channels



 10. Go to Diagnostics Tab and run the Motor/Sensor Setup


The motor/sensor setup is an initialization procedure where the drive aligns the rotor to the zero point of the commutation sequence. The motor drive will pull the rotor to the zero position and store the number of encoder counts to the badj parameter. 



This process also occurs automatically on every power-up and must be performed with minimal load. Failure to observe these requirements may cause the procedure to fail silently without warning, potentially compromising motor commutation. Such failure could result in unintended behavior including uncontrolled runaway condition.



Run the motor sensor setup process several times and ensure the following:


  • Motor amps is equal to the reference seek power parameter value
  • The motor drive will return the badj parameter value. This value should not vary significantly across each setup. Any variation will depend on the sensor resolution and the rotor’s equilibrium point. A variation of a few counts to a few tens is acceptable, depending on the sensor's resolution.


 11. Go to the Run Tab and Evaluate the Open Loop response without load


On the Chart enable the below parameters.



 12. Give a motor command using the slider and verify the following: 


  • Run the motor in both directions. Verify that the Motor Amps value is below 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 low. 
  • Give full command in both directions. Verify that the Motor Amps in both CW and CCW direction is symmetrical. If the current is very different (more than 1 A) then something in the configuration might not be correct.
  • Verify that the Motor Flux Amps parameter is has a small fluctuation and is stabilizes quickly to zero when the motor accelerates/decelerates.
  • Verify that the FOC angle correction parameter is stable or that it stabilizes quickly by changing the motor speed 
  • Verify that the Encoder 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 Encoder Speed RPM is stable when supplying a constant command 
  • Verify that the Encoder Speed RPM  is reported as positive by giving a positive motor command. If not, invert the PPR parameter, to fix it (e.g., -4096 from 4096). 
  • It is crucial having the encoder speed reported with the correct sign otherwise the motor can go into a runaway condition when configuring the Closed Loop modes.

   


If all the steps have been passed, then the Open Loop configuration is effective, and the motor is ready to be configured in any of the supported Closed Loop operating modes!



 6. Troubleshooting                                     


A troubleshooting table with some common Problems and solutions follows:




To examine issues that may be related with the Encoder signals perform the following checks using an oscilloscope: 


 Probe both encoder channels and ensure:


  • When rotor is rotating, both channels are present
  • Signal Amplitude is higher than 3,8V
  • The phase difference of the signal is 90 degrees

   



 7. Configuration Example