Back to all tutorials

Motion tutorial

Stepper Motor Control

Wire, configure, and program a stepper motor with Velocio Motion Out functions.

Tutorial overview

Stepper Motor Control

Wire, configure, and program a stepper motor with Velocio Motion Out functions.

Stepper fundamentals

Control position and speed with step and direction signals.

A stepper motor has a defined number of steps per rotation. The PLC controls its position and speed by sending step and direction signals. Steppers can be accurate when operated within their limits, but they do not provide position feedback on their own; add an encoder when the application must verify position. A Velocio PLC can control as many as three stepper motors with Motion Output functions.

Wire the PLC through a stepper driver.

The PLC supplies step and direction pulses and manages acceleration and deceleration. A stepper driver interfaces those signals to the motor. Typical differential inputs are Step+, Step−, Dir+, and Dir−. Velocio sinking transistor outputs connect to Step− and Dir−; connect Step+ and Dir+ to the positive PLC supply. An optional Enable input can use another digital output.

Stepper motor driver wiring to a Velocio PLC

Know when motion is complete.

Motion Out can include a soft-start and soft-stop time. Compare the stored current-position tag with the requested destination; when they are equal, the move is complete.

vBuilder motion-complete comparison

Example movement sequence

The downloadable state-machine example waits for a digital input and moves to 200, back to 0, then 400, 0, and finally 600.

Review state machines

Video walkthrough

Follow the complete series.

Watch the steps, then use the downloadable files when available to inspect the finished project.

PLC Stepper Motor Control Example

Stepper Motor PLC Programming Example

Project files

Download the example.

Use the original project files as a reference or starting point for your own application.

Keep building

Continue with another practical example.

Browse the full tutorial library or download vBuilder to put the example to work.