Mikroe STEPPER click - A3967 Bipolar Stepper Motor Driver with Full / Half and Micro Steps
- Product ID: 8340
- MPN: MIKROE-1528
Stepper click is a complete solution for driving bipolar stepper motors with full/half and micro-steps. It features the A3967 IC from Allegro Microsystems with proprietary Satlington™ sink drivers on its outputs, which ensure high efficiency and reliable operation of the internal H-Bridges. This IC has the integrated translation 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 undervoltage, shoot-through, and thermal protection, so the Click board™ can operate reliably. With its input voltage range up to 25V, it can drive a wide range of stepper motors with up to 750mA 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 A3967, a micro-stepping driver IC with a translator, 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 throughout the rotation cycle, a constant torque is achieved for every position. The current regulator uses an internal comparator, DA converter, and external sensing resistor. The sensing resistor value determines the maximum current during the operation, limiting it to 568mA when using 5V, or to 350mA when using 3.3V as the reference voltage.
The reference voltage and the logic voltage levels can be selected by the I/O LEVEL selection SMD jumper. This jumper routes either 3.3V or 5V power rail from mikroBUS™ to LOG SUP and REF pins. LOG SUP pin is used as the power supply input for the logic section of the A3967 IC, while the voltage at the REF pin determines the reference voltage for the current regulator section. I/O LEVEL jumper allows the Click board™ to be interfaced to both 3.3V and 5V MCUs.
A LOW to HIGH transition on the STEP pin of the A3967 IC will perform one rotational step. The direction of the rotation is controlled by the logic state on the DIR pin. The step size is determined by two pins: MS1 and MS2. The truth table below provides a correlation between the logic states of these pins and the step size. It is possible to work with full step (using two phases), half step, quarter step, and eighth step. The STEP pin is routed to the mikroBUS™ PWM pin and it is labeled as STP. MS1 and MS2 pins are routed to the mikroBUS™ AN and RST pins respectively, labeled as MS1 and MS2. DIR pin is routed to the CS pin of the mikroBUS™ and it is labeled as DIR.
The SMD jumper labeled as EN pin can be used to route the #EN pin of the IC to the INT pin of the mikroBUS™. This allows the host MCU to enable or disable the A3967 IC. By default, this jumper is positioned to route the #EN pin to the GND directly, permanently enabling the IC.
The Click board™ offers a choice to use a power source for driving the motor: one is the external voltage routed to the input connector, while the other is 5V power rail from the mikroBUS™. While using the external connector, the voltage of the external power supply should remain below 25V. Selection between the external power supply and 5V rail from the mikroBUS™ can be done by moving the jumper labeled as MOTOR PWR, to either 5V position or EXT position. This jumper is a 3x1 male header with the standard 2.54mm pitch, providing a simple and effortless operation.
The stepper motor can be connected via the disconnectable crimp style XH connector with 2.5mm pitch, which can be usually found on many small size stepper motors. This header is optional and comes unsoldered, in case that some other type of header or connector needs to be used, instead.
Microstep resolution configuration
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.
A3967, a microstepping driver IC with a translator, from Allegro Microsystems, LLC.
Integrated translation section used to simplify the control, proprietary Satlington™ sink drivers on the output stages, ability to run in full, half, quarter, eighth step, undervoltage and thermal protection, etc.
3.3V or 5V
Click board size
M (42.9 x 25.4 mm)
This table shows how the pinout on Stepper click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Stepper click electrical specifications
|External power supply voltage||5||5||25||V|
|Current limit (min 3.3V/max 5V)||375||-||560||mA|
Onboard settings and indicators
|LD1||PWR||-||Power LED indicator|
|J1A||I/O LEVEL||Left||LED driver voltage selection: left position 3.3V, right position 5V|
|J4A||EN Pin||Left||#EN Pin routing: OFF position - #EN pin routed to the GND, ON position - #EN pin routed to the mikroBUS™ INT pin|
|J3B||MOTOR PWM||Left||Motor power supply selection: left position - 5V rail from mikroBUS™, right position - external power supply|
|HD1||5-30V||-||External power supply connector|
|CN1||-||-||5-pole crimp style XH stepper motor connector (optional)|
We provide a library for Stepper click on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
The library carries everything needed for stepper motor control including speed
and acceleration setup. The library is also adjustable to working on different amounts of ticks per second, also speed and acceleration can be provided in float format. The buffer used for movement calculation is defined by the user so this library can be adjusted for MCUs with very limited RAM resources. Check the documentation for more details on how to use it.
uint8_t stepper_setSpeed( float minSpeed, float maxSpeed, float accelRatio, T_STEPPER_OBJ obj )- Function for setting the motor speed.
uint8_t stepper_setRoute( const uint8_t direction, uint32_t steps, T_STEPPER_OBJ obj )- Setup new route.
void stepper_start( T_STEPPER_OBJ obj )- Start motor movement.
The application is composed of three sections:
- System Initialization - Initializes all GPIO pins found on Stepper Click and timer to 1ms interrupt.
- Application Initialization - The first segment initializes the driver and stepper control. The second segment setup limits movement, maximum and minimum speed, and acceleration ratio. The third segment enables the motor and sets up a new route which will be called from the application task.
- Application Task - (code snippet) - Sequentially moves the motor. The first part of the sequence executes movement until the end. The second part stops the motor movement after one second and continues the sequence after two seconds.
stepper_start( (T_STEPPER_OBJ_P)&myStepper );
while( myStepper.status.running )
stepper_process( (T_STEPPER_OBJ_P)&myStepper );
Delay_ms( 2000 );
stepper_start( (T_STEPPER_OBJ_P)&myStepper );
Delay_ms( 1000 );
stepper_stop( (T_STEPPER_OBJ_P)&myStepper );
Delay_ms( 2000 );
In addition to the library function calls example carries the necessary Timer ISR and Timer initialization. Check the Timer initialization settings and update it according to your MCU - Timer Calculator.
The full application code, and ready to use projects can be found on our Libstock page.
Additional notes and information
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
This click board is supported by mikroSDK - MikroElektronika 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.