Stepper 2 click is a complete solution for driving bipolar stepper motors with full/half and micro-steps. It features the A4988 IC from Allegro Microsystems with DMOS low RDSON drivers on its outputs, which ensure high efficiency and reliable operation of the internal H-Bridges. This IC has the integrated translator section, used to simplify the control: using simple step control inputs from the host MCU, the stepper motor can be driven in both directions, with the predetermined step sizes. In addition, the output current is regulated allowing for noiseless operation of the stepper motor, with no resonance and ringing typically observed at unregulated stepper driver designs.
Additional features of the Stepper click include under-voltage, shoot-through, short circuit, overcurrent and thermal protection, so the Click board™ can operate reliably. With its input voltage range up to 35V, it can drive a wide range of stepper motors with up to 2A max. Due to simplicity of the step motor control, as well as the selection of various stepping modes offered by this Click board™, it is a perfect solution for building various applications that require precise and reliable stepper motor control, such as the movement control of beds, heads, and assemblies of various CNC plotting, milling and 3D printer designs.
How does it work?
Stepper click uses the A4988, a micro-stepping driver IC with a translator and overcurrent protection, from Allegro Microsystems. This is a highly integrated IC, which offers a very simple bipolar stepper motor control interface, thanks to the integrated translator section. This section controls the output drivers, providing smooth action of the stepper motor. By controlling the current intensity and its decay throughout the rotation cycle, a constant torque is achieved for every position. The current regulator uses an internal comparator, DA converter (DAC), and external sensing resistor. The current is limited by the sensing resistor to about 1.6A (for a reference voltage of 3.3V). Absolute current limit on this IC is 2.1A, after which the overcurrent protection is activated.
A LOW to HIGH transition on the STEP pin of the A4988 IC will perform one rotational step. The direction of the rotation is controlled by the logic state on the DIR pin (routed to the mikroBUS™ INT pin, labeled as DIR). The step size is determined by three pins: MS1, M2, and MS3. It is possible to work with five-movement step sizes, ranging from full step size up to sixteenth step size. MS1, MS2, and MS3 pins are routed to the SMD jumpers labeled as STEP MODE (J1, J2, and J3), allowing step size to be selected by moving each of them according to the truth table below.
This device supports the Sleep mode, which is activated by a LOW logic level on the SLEEP pin. This will power down the unused sections of the A4988 IC, reducing power consumption to a minimum. After the wake-up event (logic HIGH on the SLEEP pin), at least 1ms of delay is required until the charge pump capacitors are recharged, allowing normal operation of the output stage drivers.
The #ENABLE pin allows the host MCU to enable or disable the output stage MOSFETs of the A4988 IC. Asserting this pin to a LOW logic level enables the output stage. The #RESET pin is used to set DACs and the phase current polarity to the initial Home state. The #ENABLE pin is routed to the AN (labeled as EN), while the #RESET pin is routed to the RST pin of the mikroBUS™, allowing the host MCU to control the IC via these pins.
The Click board™ is equipped with the input and output screw terminals. The terminal labeled as CN1 on the schematic is used to connect the external power supply, which should stay in the range from 8V to 35V. The stepper motor can be connected via the CN2 and CN3 screw terminals, with their input terminals labeled as 1A, 1B, and 2A, 2B. The logic section and the reference voltage pin of the IC are powered via the 3.3V mikroBUS™ rail.
Microstep resolution configuration
Step size: | Full | Half | 1/4 | 1/8 | 1/16 |
---|---|---|---|---|---|
MS1 | L | H | L | H | H |
MS2 | L | L | H | H | H |
MS3 | L | L | L | L | H |
Specifications
Type
Stepper
Applications
This Click board™ is a perfect solution for building various applications that require a precise and reliable stepper motor control, such as the movement control of beds, heads, and assemblies of various CNC plotting, milling, and 3D printer designs.
On-board modules
A4988, a micro-stepping driver IC with a translator, from Allegro Microsystems, LLC.
Key Features
Integrated translation section used to simplify the control, ability to run in full, half, quarter, eighth and sixteenth step, undervoltage, overcurrent and thermal protection, etc.
Interface
GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Stepper 2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Stepper 2 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
External power supply voltage | 8 | – | 35 | V |
Current limit | – | – | 1.6 | A |
Step size | 1 | – | 1/16 | step |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | – | Power LED indicator |
J1-J3 | STEP MODE | Left | Step size selection: left position L, right position H (settings in the truth table) |
CN1 | VIN | – | External power supply connector |
CN2 | 2A,2B | – | Stepper motor coil 2 connector |
CN3 | 1A,1B | – | Stepper motor coil 1 connector |
Software Support
We provide a library for the Stepper 2 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Stepper 2 Click driver.
Key functions
-
stepper2_drive_motor
This function drives the motor for the specific number of steps at the selected speed. -
stepper2_set_direction
This function sets the motor direction by setting the DIR pin logic state. -
stepper2_enable_device
This function enables the device by setting the ENABLE pin to low logic state.
Example Description
This example demonstrates the use of the Stepper 2 Click board™ by driving the motor in both directions for a desired number of steps.
void application_task ( void )
{
log_printf ( &logger, " Move 64 steps clockwisernn" );
stepper2_set_direction ( &stepper2, STEPPER2_DIR_CW );
stepper2_drive_motor ( &stepper2, 64, STEPPER2_SPEED_VERY_FAST );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 32 steps counter-clockwisernn" );
stepper2_set_direction ( &stepper2, STEPPER2_DIR_CCW );
stepper2_drive_motor ( &stepper2, 32, STEPPER2_SPEED_FAST );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Stepper2
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.