"Low Cost" stepper motor axes with digital control (24V / 2A)
The basic version of the 'low cost stepper motor axis' is operated without physical encoder (hence simulation encoder). This means that there is no actual physical feedback between set values and actual values, and therefore the axis is not operated with closed-loop control, but only with open-loop control. It is assumed that there is no slippage in the drive, and that the axis can accurately follow the specified step pattern (set value profile). Notwithstanding this constraint imposed for cost reasons, the stepper motor axis can be referenced physically, since the simulation encoder is implemented as an incremental encoder and supports virtually all features.
Configuration of the "low cost" stepper motor axis
Axis type: 'low cost stepper motor axis' (dig. I/O)'
Encoder type: 'simulation encoder'
Controller type: 'stepper motor controller'
Drive type: 'stepper motor drive'
Referencing
As usual, the digital referencing cam signal has to be mirrored into the axis interface to the NC (PlcToNc axis structure) via the PLC. The usual procedure for referencing an axis applies, but the hardware feature "latching of a position", initiated by a sync impulse, is not available. Instead, the falling edge is used as local event for determining a reference position during ramp-down from the referencing cam. The accuracy of the referencing process can be increased as required through a reduction in velocity during ramp-down from the cam (the maximum possible precision is one motor step).
Commissioning instructions
At this point, it is worth mentioning some technical restrictions of stepper motors. Note that all recommended tests have to be carried out under load.
- The maximum permitted limit frequency
[kHz] of the stepper motor in motion must not be exceeded, since otherwise the linear range of the drive would be exceeded and the drive limit approached.
- The maximum start and stop frequency
[kHz] during starting and stopping of the axis must not be exceeded, since otherwise the stepper motor could "lose steps" during this positioning start and end phase.
- The maximum acceleration and deceleration
[kHz/s] must not be exceeded during the start and stop phase of the motion, since otherwise steps could be "lost" here too.
- In the event of the stepper motor not being able to cope, the contact to the driving electromagnetic field is interrupted, and the motor comes to a halt (with a chaotic jitter). For commissioning, the motor should therefore be brought up to the desired set velocity (1st test parameter) with slowly and constantly increasing velocity during a first test series with slight ramps (low acceleration and deceleration), in order to ensure that the motor can follow. In a second test series (with fixed set velocity) the ramps should be increased slowly and constantly to the desired acceleration/deceleration (2nd test parameter).
IO configuration of the drive
The link (mapping) of the logical NC axis outputs (drive output structure, 'nCtrl' byte or 'nExtCtrl' byte) with the physical digital IO outputs (24V / 2A) still has to be carried out manually in the TwinCAT System Manager. Individual bits from the 'nCtrl byte' or 'nExtCtrl byte' are linked with the respective digital outputs. In order to select an individual bit from a byte (8 bit), a byte offset in the range between 0 and 7 should be entered. If, for example, the second bit of a byte is to be addressed, a value of 1 has to be entered as byte offset.
Configuration parameters
| Data type | Byte | Bit | Def.-Range | Variable name | Description |
---|---|---|---|---|---|---|
1 | INT32 | 0 – 3 | __ | __ | nOutData1 | Drive output data 1 (NC→I/O) |
2 | INT32 | 4 – 7 | __ | __ | nOutData2 | Drive output data 2 (NC→I/O) |
3 | UINT8 | 8 | __ | __ | nControlByte | Control byte |
3.0 | BOOL | 8 | 0 | 0 / 1 | bPhaseA | Phase A |
3.1 | BOOL | 8 | 1 | 0 / 1 | bPhaseAInv | Phase A inverse |
3.2 | BOOL | 8 | 2 | 0 / 1 | bPhaseB | Phase B |
3.3 | BOOL | 8 | 3 | 0 / 1 | bPhaseBInv | Phase B inverse |
3.4 | BOOL | 8 | 4 | 0 / 1 | __ | RESERVE |
3.5 | BOOL | 8 | 5 | 0 / 1 | __ | RESERVE |
3.6 | BOOL | 8 | 6 | 0 / 1 | bBreakInv | Inverse braking bit: (0 = ACTIVE, 1 = PASSIVE) |
3.7 | BOOL | 8 | 7 | 0 / 1 | bBreak | Braking bit (0 = PASSIVE, 1 = ACTIVE) |
4 | UINT8 | 9 | __ | __ | nExtControlByte | Extended control byte |
4.0 | BOOL | 9 | 0 | 0 / 1 | bFrequency | Frequency (square wave signal) |
4.1 | BOOL | 9 | 1 | 0 / 1 | bDirectionPlus | Direction positive |
4.2 | BOOL | 9 | 2 | 0 / 1 | __ | RESERVE |
4.3 | BOOL | 9 | 3 | 0 / 1 | __ | RESERVE |
4.4 | BOOL | 9 | 4 | 0 / 1 | __ | RESERVE |
4.5 | BOOL | 9 | 5 | 0 / 1 | __ | RESERVE |
4.6 | BOOL | 9 | 6 | 0 / 1 | __ | RESERVE |
4.7 | BOOL | 9 | 7 | 0 / 1 | __ | RESERVE |
5 | UINT16 | 10 -11 | __ | __ | nReserved | Reserved bytes |
Stepper motor parameters

Parameters | Description |
---|---|
Stepper motor operating mode | The stepper motor can be operated in different operating modes through the type of control used. The period at which various step pattern combinations are output can thus be set. The step size (full step or half step) and the motor torque can thus be influenced. The available operating modes are described in the "stepper motor operating mode" table below. |
Displacement per step dSStep | Physical scaling of a motor step (step change) according to the mechanical conditions such as gearbox, etc. Unit: [mm/INC] |
Minimum velocity for velocity profile Vmin | For generating the velocity profile, this minimum velocity Vmin is used as the start and end velocity of the calculated velocity profile, provided the required set velocity can be reached on the travel path. Obviously, due to the time discretisation (cycle time) not every velocity level can be reached. Only a certain number of discrete velocity levels is available (proportional to 1/(n*dT) with n=1,2,3... and dT axis cycle time in seconds). The value is rounded, and the next possible velocity level is used. Unit: [mm/s] |
Number of steps per velocity level >Nlevel
| According to the boundary conditions (minimum velocity, target velocity, travel path), a velocity profile with discrete velocity levels (proportional to the step frequency) is calculated. Maintaining of a certain velocity level in the range between 0 to 100 relative to the motor steps can be set via this parameter. The parameter Nlevel can therefore be used for scaling (extending or reducing) the velocity ramp. For the limit case of Nlevel = 0, no ramped velocity profile is generated, but the required set velocity is kept constant for the entire travel path. Unit: 1 |
Stepper motor operating modes
Stepper motor mode | Description |
---|---|
1 PHASE | 1-phase excitation (step pattern periodicity: modulo 4) (STANDARD) |
2 PHASE | 2-phase excitation (step pattern periodicity: modulo 4) |
12 PHASE | 1-2-phase excitation (step pattern periodicity: modulo 8) |
DRIVER | Control via power section (specification of direction and frequency |

Formula for calculating the discrete travel frequencies
Formula for calculating the discrete velocity levels

Stepper motor parameters of the drive
Depending on the type and operating mode of the stepper motor, up to 8 byte masks for the drive output pattern can be parameterized in the "stepper motor" drive tab of the System Manager. Depending on the operating mode of the axis, these patterns are cyclically output during active positioning and are repeated periodically. With the axis at standstill (no active travel), the last bit pattern to be output is linked to the holding current mask as a logical AND operation. This holding current mask is intended to reduce the motor current and therefore the motor temperature of the axis at standstill.
Example of velocity and position profile
The graph shows a typical velocity and position profile for a 'low cost' stepper motor axis vs. time [s]. The blue curve shows the velocity [mm/s], and the green curve the position [mm]. The set values and actual values are identical, because a simulation encoder was used, not a real encoder. The discrete velocity levels are noteworthy. Their value, starting from the start velocity, rises to the required set velocity, and falls again to the stop level towards the end of the target position.
