Transport at Nanoscale Interfaces

Engineering Group

ESCO - Empa Stepper Controller


The goal of the Empa Stepper Controller (ESCO) project was to create a very simple and easy to use in-terface between a PC application and a stepper motor.

The USB serial interface is human-readable and can be used in a terminal program or any application that is able to drive a serial port (LabVIEW, Python, Matlab, C/C++/C#, etc.).
Here an example of the communication (PC, ESCO):
move_relative -100000
move_relative pending
(moving to new position)
move_relative ok
ESCO is very flexible but also has limitations:
- Drives only one motor, has to be bi-polar type
- Stepper motor voltage <=24V*, current <=2A
- Only Software encoder and differential SSI Encoder implemented yet (Hardware accepts addi-tional types like Quadrature)
*ESCO and the stepper motor can be powered up to 36V, some voltage reserve is advised to reach full power and acceleration.

The hardware has built-in isolation to prevent ground loops:
Colored are the different power domains that are isolated. USB is isolated right after it enters the Step-per Controller. The external power (DC 9…36V) is also isolated with the main parts of the circuit.
The PCB is made in the Eurocard format (small, 100x100) and has on the left side connectors for DC Power, Shield, ext. Position Display, manual Remote Control and USB. On the right side are the con-nectors for the motor, Encoder, additional Outputs and the end-position switches. Each ESCO in a sys-tem can be identified via an address which set by the DIP Swtich on the bottom.


The integrated FTDI Device shows up as a USB serial port on the PC when connecting ESCO with a USB-C cable. Default settings are 115200baud, 8bit, no parity, one stop bit, no HW flow control. Each com-mand sent to ESCO has to finish with either a carriage return ('\r') or a line feed ('\n') or both. All com-mands except for a few  (marked orange below) return <command> pending once the command is accepted and <command> ok once it is executed respectively <command> <value> when something is returned or <command> error/not_supported/illegal_argument/command_overflow when there was an error
Here is a list of the available commands: 


Standardized identification command (SCPI). Returns "ESCO V<version>"


Returns human-readable list of commands. Designed to be used in a terminal.


Returns human-readable list of settings. Designed to be used in a terminal.


Resets all settings to default. Should be executed before all settings are set.


Does nothing at the moment


Returns value of type stepperStatus_t


typedef struct


  uint32_t undervoltage :1;

  uint32_t communication_error :1;

  uint32_t motor_moving :1;

  uint32_t motor_moving_dir :1;

  uint32_t motor_error :1;

  uint32_t motor_overtemp_prewarn :1;

  uint32_t motor_overtemp :1;

  uint32_t motor_open_cable :1;

  uint32_t motor_short :1;

  uint32_t motor_stall :1;

} stepperStatus_t;


Returns position value, type int32_t. If a HW-Encoder is configured, the position is read and sent back. Otherwise the Software position is returned (zeroed on power up or when zero_position command is sent)


Takes argument position (int32_t). Can be positive or negative.


Takes argument amount of steps (int32_t). Can be positive or negative.


Takes two arguments, <setting> <value> separated with a space. See settings below for possible values


Takes one argument, <setting>. See settings below for possible values


Returns the address that is set on the PCB with the DIP Switches. Useful for identification and assignment of COM Ports when multiple ESCOs are used in the setup


Turns the power of the motor on.


Turns the power of the motor off. Useful to save energy or prevent the motor from getting hot. Be careful when using microstepping and SW positioning, the motor can move to the next full step.


Stops the motor, cancels ongoing movement commands.


Returns 24bit version number SW_VERSION | INTERFACE_VERSION << 8 | HW_VERSION << 16


Zeroes the current position. Works only with Software Encoder/ Software Positioning.


Constantly move with the velocity set in one direction (increasing the position)


Constantly move with the velocity set in the other direction (decreasing the position)


In addition, here the list of the available settings:


The motor current can be set in discrete steps. Possible values are:

0 -> 0.2A (default)

1-> 0.5A

2-> 0.75A

3-> 1A

4-> 1.5A

5-> 2A


How many full steps the motor has in one revolution:

0-> 200 steps (default)

1-> 400 steps


Configure the type of encoder used:

0-> Software encoder (default)

1-> Absolute, SSI, 8192 per turn, 4096 turns


Configure the motor current when the motor is not moving as a percentage of the setting 'motor_current'

0 -> 100% (default)

1-> 50%

2-> 25%



Configure the amount of microsteps in between full steps. Higher allows for smoother operation:

0 -> 256 (default)

1-> 128

2-> 64

3-> 32

4-> 16

5-> 8

6-> 4

7-> 2

8-> no microstepping



If you want to use position end switches e.g. to guard your linear movement they can be enabled here:

0-> no endswitches (default)

1-> endswitches on lower end enabled

2-> endswitches on upper end enabled

3-> endswitches on both ends enabled


Configure the polarity of your endswitch signal:

0-> low voltage level means end stop hit on both (default)

1-> invert lower end

2-> invert upper end

3-> invert both


0...(2^23)-512 [μsteps/t]

t = 2^24 / fCLK

fCLK = ~13.5MHz, see Datasheet TMC5130


0...(2^16)-1 [μsteps/ta²]

a² = 2^41 / (fCLK

fCLK = ~13.5MHz, see Datasheet TMC5130


Transport at Nanoscale Interfaces Laboratory

Contact us