Transport at Nanoscale Interfaces
Engineering Group
ESCO - Empa Stepper Controller
Overview
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.
Hardware
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.
Software
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:
*IDN? |
Standardized identification command (SCPI). Returns "ESCO V<version>" |
help |
Returns human-readable list of commands. Designed to be used in a terminal. |
help_setting |
Returns human-readable list of settings. Designed to be used in a terminal. |
init |
Resets all settings to default. Should be executed before all settings are set. |
exit |
Does nothing at the moment |
get_status |
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; |
get_position |
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) |
move_absolute |
Takes argument position (int32_t). Can be positive or negative. |
move_relative |
Takes argument amount of steps (int32_t). Can be positive or negative. |
set_setting |
Takes two arguments, <setting> <value> separated with a space. See settings below for possible values |
get_setting |
Takes one argument, <setting>. See settings below for possible values |
get_address |
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 |
drive_on |
Turns the power of the motor on. |
drive_off |
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. |
stop_movement |
Stops the motor, cancels ongoing movement commands. |
get_version |
Returns 24bit version number SW_VERSION | INTERFACE_VERSION << 8 | HW_VERSION << 16 |
zero_position |
Zeroes the current position. Works only with Software Encoder/ Software Positioning. |
const_v+ |
Constantly move with the velocity set in one direction (increasing the position) |
const_v- |
Constantly move with the velocity set in the other direction (decreasing the position) |
In addition, here the list of the available settings:
motor_current |
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 |
steps_per_revolution |
How many full steps the motor has in one revolution: 0-> 200 steps (default) 1-> 400 steps |
encoder_type |
Configure the type of encoder used: 0-> Software encoder (default) 1-> Absolute, SSI, 8192 per turn, 4096 turns |
hold_current |
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%
|
microstepping |
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
|
endswitches |
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 |
endswitches_polarity |
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 |
velocity |
0...(2^23)-512 [μsteps/t] t = 2^24 / fCLK fCLK = ~13.5MHz, see Datasheet TMC5130 |
acceleration |
0...(2^16)-1 [μsteps/ta²] a² = 2^41 / (fCLK)² fCLK = ~13.5MHz, see Datasheet TMC5130 |