CNAP

Biaxial Stepper Reference

Two independent 4-wire bipolar stepper motors in one component, for 2-axis mechanisms like a CNC plotter or camera gimbal. Each axis has its own A/B coil pair.

Pin names

NameDescription
A1- / A1+Axis 1, Coil A terminals
B1+ / B1-Axis 1, Coil B terminals
A2- / A2+Axis 2, Coil A terminals
B2+ / B2-Axis 2, Coil B terminals

Attributes

This component has no configurable attributes.

Usage

Wire each axis's four coil terminals to its own stepper driver board (e.g. ULN2003), and each driver's control inputs to four Arduino digital pins. Drive both axes with the built-in Stepper library, one instance per axis.

#include <Stepper.h>

const int STEPS_PER_REV = 2048;

Stepper axis1(STEPS_PER_REV, 8, 10, 9, 11);   // axis 1 driver pins
Stepper axis2(STEPS_PER_REV, 2, 4, 3, 5);     // axis 2 driver pins

void setup() {
  axis1.setSpeed(10);
  axis2.setSpeed(10);
}

void loop() {
  axis1.step(STEPS_PER_REV / 8);  // move X
  axis2.step(STEPS_PER_REV / 8);  // move Y
  delay(500);
}

Steppers draw more current than a GPIO pin can safely supply — always drive each axis through a dedicated driver board, never wire the coils directly to the Arduino.

Examples

DescriptionAttrs
Default biaxial stepper{}

See also

  • Stepper Motor — single-axis equivalent of each half of this component
  • Servo Motor — simpler absolute-angle alternative for single-axis positioning