Tips & Tricks for stepper motors using SDC

This post reviews some of the important aspects that needs to be kept in mind in order to get the most out of a stepper motor that it is controlled using SDC (Smart Device Controller).

Generic configuration:

In order to ensure that no files are missing in our AS project, we should always use the Wizard from Automation Studio to add the X20SM.

Next, we define the current configuration for the stepper motor. The percentages will depend on the motor that is going to be used and unlike the servo motors (with EnDat encoders), the drive is unable to detect which motor is connected to it. Having a wrong parameter configuration would make the motor work with less torque than its nominal value (if they are too low) or damage it (if they are too high).


Keep in mind that unlike the servomotors, with the stepper motors we do not have a feedback about its current consumption. For that reason, the parameters must take into consideration the mechanics were the motor is coupled to.

A good starting point would be to define the β€œMaximum current” as the nominal value specified on the motor datasheet while the β€œRated current” a value 20% lower than the maximum.

The image above shows an initial configuration for a stepper motor of 2.5A using an X20SM module that can provide up to 3A.

Configuration depending on the type of control:

If the motor does not have an encoder, we will only be able to control it using an open-loop control.

On the other hand, if an encoder is available we can choose to control it using an open-loop or a closed-loop type of control. For example, if we need precision (such as in a CNC application) it is better to use a close-loop type of control. Otherwise, if we only need to perform discrete movements from A to B, an open-loop control with position correction should be enough.

  1. Open loop control (without encoder):

The mode β€œStep counter” should be selected for that case. It will be using an internal counter for the X20SM module itself and it has a resolution of 2^8 for every β€œfull-step”.


If we are using stepper motors from B&R, they all have a resolution of 1.8ΒΊ for each step. That gives us a total of 200 steps for each 360ΒΊ revolution. To get the β€œEncoder increments per rev”, we shall multiply the resolution of the step counter times the steps of the motor. This gives us a total of 51200 encoder increments per revolution.


For that case, in the task called β€œ” we must make sure that the parameter DrvIf_Typ is configured as it is shown in the picture below.


  1. Closed loop control (with encoder):

The most common case is to use an ABR encoder to close the control loop. The default module configuration is considering this scenario.



The only parameter that we must remember to change is the β€œDrvIf_Typ” from the β€œ”.


  1. Open loop control (with encoder):

In this case, we do not need to change anything. It is the default configuration when we add an axis using SDC.




IMPORTANT: Remember that the parameters regarding the axis configuration should match in the following 3 different files. In some AS versions if the user changes one of those parameters, it is automatically changed in all the different files. However, it is recommended to check that they match in all the files.

Init Parameter Table:
ACOPOS Parameter Table:

Reducing the lag error:

From that point, we could already go to the NC Test Window and start performing some movements. It is possible though that depending on the type of movement we get lag errors or the stepper motor could start making some noise. The reason for that is that some parameter has to be adjusted.

To adjust and improve the control with such type of motors we must consider the following 4 parameters: t_predict, t_jolt, current configuration and Kv of the position controller.

  1. t_predict:

It has a strong influence in this type of systems and it is adjusted in the same way that it is done with the servomotors. The best way to find this value is to compare the difference between S_SET (set position) and S_ACT (actual position) when a movement is started. For that test, the parameters t_predict and t_total should be set to zero.

It must be calculated for both open and closed loop systems. However, its effect is bigger when we work with closed loop systems as for that case, we could get values for t_predict around 50 to 70ms.

  1. t_jolt:

After the t_predict has been adjusted, we can reduce the lag error even more with the t_jolt. With stepper motors, this value is normally between 0.02 to 0.1 seconds being always lower than 0.2 seconds. This will allow us to prevent negative lag errors and we will be able to work with higher accelerations.

Having the t_predict and the t_jolt adjusted, the lag error during the acceleration and deceleration phases will be largely reduced.

  1. Currents (Rated & Maximum current):

The value for the β€œRated current” has an effect during the movements at constant speed while the β€œMaximum current” will affect the acceleration and deceleration phases. Depending on the mechanics, those parameters should be adjusted (always inside the max. current limits of the motor) so the lag error is the lowest possible and the motor does not warms up too much.

  1. Kv from the position controller (only when closed loop control is used):

It is recommended to start with very low kv values (with this type of systems it is relatively easy that they become unstable with high gains) and keep increasing it until we get an acceptable lag error value.

From our past experience, we know that the kv value will be between 3 to 10. It is also important to never add integral part when using stepper motors because it is often generating unstable controls (by default, those type of systems are already using an integral part to generate the SetPos values).

I hope you find this information usefull. I will be happy to hear your feedback!


@roger.vila - What is the benefits from your perspective to use SDC for stepper motors when you can use mpMotion and have a much simpler way to setup and control your axis?

Thanks for this valuable contribution. I also agree that mapp Motion would be the state of the art approach to do this.
Check out the following tutorial on the B&R Tutorial Portal.

Tutorial: β€œGetting Started with stepper motors”

More tutorials you can get here: B&R Tutorial Portal

You can use the following login credentials for accessing the B&R tutorial:

Username: Automation
Password: Academy1

More learning and teaching materials and trainings as well can be seen on the Automation Academy landing page:

BR Hubert

mappMotion is easier to use than SDC for steppers, but mappMotion does not allow writing/reading of parid’s like encoder direction or proportional gain of position loop.
For this ProcessParam and/or ProcessConfig is needed. The structures used in these functions are larger, so the result is writing more than one parameter, which could influence timing when converting acp10 software.

Hi @alexandre.morin!

I would personally always use mappMotion for new projects. It has a much easier setup, and it is future proof.

However, ACP10 it is still widely used by a lot of B&R users, and it might still be like this for a few more years. That is why I thought that it is still nowadays an interesting information to share.

Also, even the name of this topic has the word β€œSDC” on it, the information regarding on how to reduce the lag error can be used for both ACP10 and mappMotion.

Hi @roger.vila ,

Thanks for your feedback.
I agree 100% with you.