Problem
I have a rotatory brushless motor with a sin-cos encoder as feedback but I don't know how to properly configure it and tune it. What is the right process that I need to follow?
Clarifications and checkings
- This article describes (step by step) the manual process of configuring a rotatory brushless motor with sin-cos encoder feedback with very optimal performance. A more automatic way of doing this configuration could be by using the Configuration Wizard with all the implications that this might have.
- This step by step process assumes that your motor does not have a brake. If you do have one, ensure that you have configured it correctly like it is shown in the following article before proceeding with any configuration: How to configure the brake of your motor.
- This step by step process assumes that neither the motor or the power stage of the drive is damaged. Please, if you are not sure of this, follow the instructions in the How to know if the motor phases or the power stage of the drive are damaged article in order to verify it.
- This step by step process assumes that your feedback device is working properly and no noise is coupled to the encoder lines. Please ensure that you have checked this by following the step process described in How to know if the feedback device is working properly.
- This step by step process assumes that there is no digital input mapped to the "Motor Enable" functionality of the drive. If that is the case, ensure to have the digital input ON (if active high, otherwise OFF) in all the steps that involve movement during the configuration or otherwise those steps will fail.
Steps
- Once you have connected to the drive, go to the Actuator window and set the right parameters for the Motor Type, Position sensor and Velocity sensor. Your window should look like the following:
- Then, you need to go to the Motor window in order to input all the motor data from its datasheet (it should all be in there). The parameters that you need to input mandatory are torque constant, continuous current, peak current (if known), max permissible speed and motor pair poles. The inductance and the resistance can be obtained in later steps with the system identification included in the torque tuning stage and the rated torque can be determined by the product of torque constant and continuous current. An example of motor parameters for a brushless motor could be the following:
- The next step is to configure the encoder feedback in the Sincos Encoder window. At first, this includes setting the Sensor resolution, the Multiplier factor and the Noise filter. The first one you can get directly by taking a look at the datasheet of the encoder, the second one you decide depending on the total resolution that you want and the third on you can determine it through the checking procedure that is explained in the article How to know if the feedback device is working properly. Finally, the Polarity can be determined either with the Auto identify tool or through the manual procedure explained in the article How to calibrate the polarity of your feedback device manually. An example of how to do it with the Auto identify tool is shown in the following pictures:
- After having configured the sin-cos encoder correctly, it is time to calibrate the commutation in the Commutation window. When attempting to do this, we usually find 2 different cases:
Commutation with a sin-cos encoder only
When commutating with the sin-cos encoder only, we need to perform a forced alignment procedure (also known as "wake and shake") after every power cycle of the drive in order to be able to command movements properly. Therefore, in the Commutation window, we need to select "SinCos encoder" as the Commutation sensor and "Forced alignment method" as the Initial angle determination method. As far as the forced alignment parameters are concerned, here are some basic guidelines in order to choose its values:
- Process time: 2000-5000 ms
- Process current: 5-20% of rated current if done with the motor without a load. If there is a load on the shaft, increase gradually beyond 20% until you get enough movement to get the alignment process done correctly.
- Process tolerance: 5-10%
An example of the Commutation window for a system like this one could be the following:
Commutation with incremental encoder + reference sensor
When using an additional absolute sensor as the reference sensor, we can skip having to perform an alignment procedure after every power cycle of the system by using the option "Non incremental sensor used" as the Initial angle determination method. A common case when working with sin-cos encoders is to have an SSI encoder as the Reference sensor is shown in the following image:
In such case, by using the Calibrate button you should be able to calibrate the reference sensor without problems. Start by using a small amount of torque and keep increasing it until you get enough movement to get the test finished successfully. However, please remember that for this procedure to be successful, you need to have the reference sensor properly configured in its own window. In the case of the example, this would mean to calibrate the SSI encoder in the SSI Absolute Encoder window:
- After having successfully calibrated the initial angle determination method, it is of good practice to do a quick verification to ensure that the commutation has indeed been properly calibrated. This can be very easily done by using the Open-loop by using the commutation sensor mode from the Move window while plotting in the Scope both position and velocity actual values. Try applying different target voltages in both directions and check that the motor is spinning at the same speed (for a certain target level) in both directions. If the motor does not spin the same way in both directions, if it spins erratically in one direction or any other strange anomaly please repeat the previous step and recalibrate the initial commutation angle. An example of this verification procedure is shown in the following image.
- Once the calibration is verified, it is time to move to the Limits window. In that window, make sure that your position, velocity and torque limits are properly set accordingly to your system. Make sure that the position limits match your motion range (if there is one), that the velocity/acceleration limits are correct and that the minimum and maximum torque limits match the peak torque value:
- After having set the Limits correctly, make sure that the Protections parameters are set up correctly as well. Adjust the voltage range to your application's and make sure that the maximum system current is equal to or higher than the peak current value:
- After this last step, the configuration is ready to start with the tuning of the different motion loops. In order to do a proper tuning, we advise to take a look at the following links: