How does it work?
Stepper 11 Click as its foundation uses the TB9120AFTG, a constant-current 2-phase stepping motor driver for automotive applications from Toshiba Semiconductor. The TB9120AFTG incorporates low on-resistance DMOS FETs, which can deliver a 2A maximum current. A built-in mixed decay mode helps to stabilize the current waveforms. Numerous protection mechanisms are also incorporated, such as over-current and over-temperature detection, thermal shutdown, and stall detection.
Thanks to the large number of micro-steps they support, motor noise can be significantly reduced with smoother operation and more precise control. It is suited to a wide range of general automotive applications using stepping motors and supports an operational temperature range covering -40°C to 125°C. The current value is set by the reference voltage value obtained by the MCP1804, a low-dropout voltage regulator. The current threshold point for the VREF pin of the TB9120AFTG, alongside MCP1804, can be set manually using an onboard trimmer labeled as VR1.
Alongside I2C communication, several GPIO pins connected to the mikroBUS™ socket pins are also used to forward the information to the MCU, associated with the PCA9538A port expander with a maximum frequency of 400kHz. The PCA9538A also allows the choice of the least significant bit (LSB) of its I2C slave address by positioning SMD jumpers labeled as ADDR SEL to an appropriate position marked as 0 and 1.
The Enable pin, labeled as EN and routed to the CS pin of the mikroBUS™ socket, optimizes power consumption and is used for power ON/OFF purposes. All circuits, including the interface pins, are inactive in this state, and the TB9120AFTG is in the form of minimum power consumption. A simple DIR pin routed to the AN pin on the mikroBUS™ socket allows MCU to manage the direction of the stepper motor (clockwise or counterclockwise). At the same time, the onboard switches labeled from SW1-SW3 enable users to set the excitation mode, stepper motor step resolution, and SW4-SW5 sets torque, rotational force.
In addition to these features, this Click board™ also uses the CLK step clock pin, routed to the PWM pin of the mikroBUS™ socket, for PWM constant-current control, allowing stable output waveforms in mixed decay mode. The RST pin of the mikroBUS™ socket initializes an electrical angle in the internal counter to set an initial position. Achieving an initial position is indicated via onboard blue LED labeled as MO.
This Click board™ also has two additional LEDs for anomaly indication. Suppose a state such as a motor load open, overtemperature, or overcurrent is detected. In that case, such anomaly is indicated by a red LED marked as DIAG, while an orange LED labeled as SD indicates when a stall (step-out) situation is detected. Motor-stall detection threshold can also be set manually using an onboard trimmer labeled as VR2.
The Stepper 11 Click supports an external power supply for the TB9120AFTG, which can be connected to the input terminal labeled as VM and should be within the range of 7V to 18V, while the stepper motor coils can be connected to the terminals labeled as B+, B-, A-, and A+.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Stepper
Applications
Can be used for a small stepping motors in a wide range of automotive applications
On-board modules
TB9120AFTG – constant-current 2-phase stepping motor driver for automotive applications from Toshiba Semiconductor
Key Features
PWM constant-current control, built-in a mixed decay mode, selectable excitation mode, anomaly detection functions, stall detection function, and many more
Interface
GPIO,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V,External
Pinout diagram
This table shows how the pinout on Stepper 11 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LD2 | M0 | – | Initial Position LED Indicator |
LD3 | DIAG | – | Anomaly Detection LED Indicator |
LD4 | SD | – | Stall Detection LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP3 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
SW1-SW3 | SW1-SW3 | Down | Step Resolution Setting Switches |
SW4-SW5 | SW4-SW5 | Down | Torque Setting Switches |
VR1 | VR1 | – | Current Threshold Trimmer |
VR2 | VR2 | – | Stall Detection Threshold Trimmer |
Stepper 11 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage VCC | 3.3 | – | 5 | V |
External Supply Voltage VM | 7 | – | 18 | V |
Maximum Output Current | – | – | 2 | A |
Maximum Step Clock Frequency | – | – | 100 | kHz |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the Stepper 11 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Stepper 11 Click driver.
Key functions:
stepper11_cfg_setup
– Config Object Initialization function.stepper11_init
– Initialization function.stepper11_default_cfg
– Click Default Configuration function.
Examples description
This example showcases the device’s ability to control the motor. It initializes the device for control and moves the motor in two directions in a variety of resolutions for 360 degrees.
The demo application is composed of two sections :
void application_task ( void ) { stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_FULL ); stepper11_set_direction( &stepper11, 1 ); log_info( &logger, " Rotate motor CW for 360 degrees in full step" ); stepper11_move_motor_angle( &stepper11, 360, STEPPER11_SPEED_FAST ); Delay_ms( 1000 ); stepper11_set_direction( &stepper11, 0 ); stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_QUARTER ); log_info( &logger, " Rotate motor CCW for 180 degrees in half step" ); stepper11_move_motor_angle( &stepper11, 180, STEPPER11_SPEED_FAST ); Delay_ms( 1000 ); stepper11_set_step_resolution( &stepper11, STEPPER11_RESOLUTION_1div16 ); log_info( &logger, " Rotate motor CCW for 180 degrees in 1/8 step" ); stepper11_move_motor_angle( &stepper11, 180, STEPPER11_SPEED_FAST ); Delay_ms( 1000 ); }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Stepper11
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with 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.