Controller Tuning


The manual describes how to tune the cascaded position controller using the Auto-tuning feature. The feature is available in firmware version 3.2 and above.

Before conducting any of the tuning activities please check if motor is functional in the torque mode and sensor data is transmitted normally. For high-quality motor control tasks a precise and reliable sensor should be used, such as SOMANET Sense REM 16 MT. Quality of the motor position control may be insufficient with low resolution sensors, especially if a HALL is used.

The current version of the auto-tuning feature allows user to tune a BLDC motor drive. A load can be attached to the motor. However, if the motor position has very strict limits this feature is not recommended, because the motor may make a few full turns.

Concept of Auto-Tuning

The main idea behind the auto-tuning is the following:

  • The first step is to identify physical properties of the object and then use the obtained parameters to build a mathematical model of the target system.
  • The second step is to use the model to calculate controller gains that results in specified position control-loop performance.

Goal of Auto-tuning

The tuning process calculates the gains for the P-PI (proportional on position cascade, proportional + integral on velocity cascade) cascaded controller automatically.



According to academic sources, the cascaded PID controller structure is considered to be the most efficient for the motor control applications. See PID Controllers: Theory, Design, and Tuning

The obtained controller gains meet the following position control loop requirements:

  • Step response qualities:
    • settling time set by the user (in the current version it is set to 0.3 seconds by default)
    • zero overshoot.
  • Robustness qualities:
    • phase margin more than 60 degree
    • gain margin more than 10 dB.
  • Disturbance rejection:
    • Amplification of all disturbance frequencies no more than 0 dB.

The velocity control loop is tuned in the same time to be as sharp as possible.


The above mentioned position control-loop specifications may differ from the actual performance due to physical reasons: noise, nonlinearities or a complex mechanical structure. These effects can not be fully covered by the mathematical model and thus manual fine after-tuning should be used.

How to use

Make sure that the motor can work in a torque mode and nothing is blocking it from moving. Press the ‘auto-tune’ button to start the process. When the procedure is finished, the cascade controller gains would be updated. Depending on the purpose you want to tune your system for you can define some tuning criteria to adjust the goals and focus of the auto-tuning algorithm(see next section ‘adjustable parameters’). For general robotic applications, the pre-configured default setup is sufficient, so manual tweaking of these criteria is not required.

After the auto-tuning is done, a control-loop performance should be verified using the position and velocity profiles command. If the performance does not satisfy the application’s requirements, the auto-tuning procedure can be repeated with adjusted parameters or the controller gains can be corrected directly.

Adjustable parameters

In the current release the user can adjust the following parameters:

  • Test signal amplitude in percentage of the motor rated torque. This is the amount of torque applied to the motor during the plant identification experiment. High values are preferable because they result in good signal to noise ratio. However, high values may result in vibration of the system.
  • Settling time. This is the time the tuned overall system will need to rotate the motor 1 radiant and stop. The parameter helps the user to influence the sharpness of the controller. Low values may give undershoot, “soft” controller tuning and low system dynamics. High values make the system more dynamic and “sharper”. Depending on the physical capabilities of the hardware (sensor noise, torque limitations, elasticities), a too sharp tuning may result in system instability. It strongly depends on the whole system. As a rule of thumb for seizing most of the possible system dynamics, it is recommended to repeat the auto-tuning procedure several times while stepwise decreasing this value from approximately 0.3 seconds to lower values until oscillations appear.


This version of the auto-tuning feature should not be used for robotic arms with strict position limitations because the arm may move and collide with other objects. Also, the whole structure is going to vibrate during the experiment.

Additionally, performance of this feature strongly depends on the data quality. Thus, HALL sensors produce unreliable auto-tuning performance. Moreover, using a 16-bit resolution QEI sensors may result in a fault state during the high velocity motion and thus should not be used.

Manual Tuning

Auto-tuning is the most convenient and in most cases sufficient way to get a sufficiently tuned overall system. However, all controller gains can also be adjusted manually.

Manual Tuning of torque/current control loop

In the torque control loop the current is controlled, while the torque is directly proportional to the current.

Under normal operating conditions, the default tuning of the torque control loop should not be changed, because this control loop mostly relies on a model-based feedforward controller which has no need to be tuned at all. Instead the feedforward controller is parameterized by the specified physical motor parameters like phase resistance and inductance.

On top of the feedforward controller, the feedback controller is a purely proportional. Thus, there is only one gain, and it is accessible in the tuning area of OBLAC Drives. A change in this parameter is only recommended for expert users and the effects of any changes here should be tested in torque control mode first.

The torque control loop is the most inner loop of any velocity or position control loop, so changes in the torque control loop apply to any other control mode as well.

Manual Tuning of the velocity control loop

If the drive is intended to be operated in velocity control mode, the proportional and integral gains of the velocity control loop have to be tuned manually.

To do so, it is recommended to use OBLAC Drives to generate a velocity reference similar to a typical velocity reference of the intended application. This can either be a constant velocity or a dynamic signal (sinewave, trapezoidal etc.). While this reference trajectory is continuously being sent to the drive, you can increase the controller gains to optimize the tracking behaviour. Proportional and Integral gains should both be iteratively increased. There are various procedures on how to carry out this iterative process. As a general rule of thumb on which parameter to change next, the following is helpful:

  • If the behaviour of the system at low frequencies shall be improved, the Integral gain has to be changed. This applies if either it takes one or several seconds too long to reach a desired speed or if the speed oscilates between ‘too fast’ and ‘too slow’ slowly (once per second or even slower)
  • If the behaviour of the system at high frequencies shall be improved, the Proportional gain has to be changed. This applies if either acceleration and deceleration durations shall be reduced even further (to less than about 1 second) one if the speed shows indesired fast oscilations which often become perceptabile acoustically

Further reference

Manual Tuning of the position control loop: Cascaded controller

The cascaded controller can be tuned manually, which can become necessary if:

  • The auto-tuner cannot be run due to mechanical limitations, attached robot arms or other restrictions
  • The auto-tuner fails or does not give sufficient results for a very specific application scenario
  • For experimental purposes

As shown in 3.3, the cascaded controller implements two PI controllers, one on the position loop and one on the velocity loop. The one on the velocity loop uses different parameters than the pure velocity controller (the velocity controller which is not part of the cascaded position controller). You can tune both independently.

To avoid instabilities caused by the cascaded controller, it is recommended to use only one of the integrators at a time: Either the integrator on the position loop or the integrator on the velocity loop. When the integrator on the position loop is used, the gain for the velocity integrator should be set to 0. This configuration is refered to as PI-P. When the integrator on the velocity loop is used, the gain for the position integrator should be set to 0. This configuration is refered to as P-PI.

These initial parameters can be used as a starting point for cascaded position control-loop:

  • Position P: 0.05.
  • Position I: 0 for P-PI configuration. 0.5 otherwise.
  • Velocity P: 0.5;
  • Velocity I: 0 for PI-P configuration. 0.5 otherwise.

Using these initial values, controller gains could be manually tuned using different methods. See: Cascaded PID controller tuning

The simple PID controller has generally poorer dynamic performance than the cascaded PID controller. However, it can be used for experimental investigations as the easiest configuration. Manual tuning is mandatory.

The following initial parameters could be used:

  • Position P: 0.01
  • Position I: 0.02
  • Position D: 0.001

Using these initial values, controller gains could be manually tuned using your preferred methods. Classical tuning methods for PID controllers like Ziegler-Nichols can be applied here.

The PI-P cascade controller may look similar to the simple PID controller, however the structure is different and therefore a different tuning method should be used.

Please check out further functionality of OBLAC Drives:

  • Learn how to make your drive part of a higher level robotic control structure:

Drive Control via EtherCAT

  • Get to know the different Control Modes and Controller Types that are available additionally to the ones that you have just been using.

Control Modes and Controller Types

  • Increase the performance of your drive even more using Advanced Control Options.

Advanced Control Options