TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136723 times)
  2. FAT32 Library (69932 times)
  3. Network Ethernet Library (55939 times)
  4. USB Device Library (46265 times)
  5. Network WiFi Library (41885 times)
  6. FT800 Library (41168 times)
  7. GSM click (28979 times)
  8. PID Library (26412 times)
  9. mikroSDK (26357 times)
  10. microSD click (25357 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Stepper 19 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.3

mikroSDK Library: 2.0.0.0

Category: Stepper

Downloaded: 14 times

Not followed.

License: MIT license  

Stepper 19 Click is a compact add-on board for precise control over stepper motors. This board features the DRV8424, a stepper motor driver from Texas Instruments designed to drive both industrial and consumer stepper motors. The DRV8424 has dual N-channel power MOSFET H-bridge drivers, a microstepping indexer, and integrated current sensing, eliminating the need for external power sense resistors. Operating on a 5V to 30V external power supply, the DRV8424 can deliver up to 2.5A of full-scale output current, with an internal PWM current regulation scheme that includes smart tune, slow, and mixed decay options to optimize performance. Ideal for applications in multichannel system monitoring, robotics, precision positioning, and automated manufacturing processes, this Click board™ appears as a versatile solution for sophisticated stepper motor control.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Stepper 19 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Stepper 19 click" changes.

Do you want to report abuse regarding "Stepper 19 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Stepper 19 click

Stepper 19 Click is a compact add-on board for precise control over stepper motors. This board features the DRV8424, a stepper motor driver from Texas Instruments designed to drive both industrial and consumer stepper motors. The DRV8424 has dual N-channel power MOSFET H-bridge drivers, a microstepping indexer, and integrated current sensing, eliminating the need for external power sense resistors. Operating on a 5V to 30V external power supply, the DRV8424 can deliver up to 2.5A of full-scale output current, with an internal PWM current regulation scheme that includes smart tune, slow, and mixed decay options to optimize performance. Ideal for applications in multichannel system monitoring, robotics, precision positioning, and automated manufacturing processes, this Click board™ appears as a versatile solution for sophisticated stepper motor control.

stepper19_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Nov 2023.
  • Type : I2C type

Software Support

We provide a library for the Stepper 19 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 19 Click driver.

Standard key functions :

  • stepper19_cfg_setup Config Object Initialization function.

    void stepper19_cfg_setup ( stepper19_cfg_t *cfg );
  • stepper19_init Initialization function.

    err_t stepper19_init ( stepper19_t *ctx, stepper19_cfg_t *cfg );
  • stepper19_default_cfg Click Default Configuration function.

    err_t stepper19_default_cfg ( stepper19_t *ctx );

Example key functions :

  • stepper19_rotate_by_angle This function rotates the shaft through a desired step speed and angle.

    err_t stepper19_rotate_by_angle ( stepper19_t *ctx, uint8_t step_speed, float angle, uint16_t res_360 );
  • stepper19_rotate_by_step This function rotates the shaft through for the specific number of steps at the selected speed.

    err_t stepper19_rotate_by_step ( stepper19_t *ctx, uint8_t step_speed, uint16_t steps );
  • stepper19_set_direction This function sets the desired direction of motor movement: clockwise or counterclockwise.

    err_t stepper19_set_direction ( stepper19_t *ctx, uint8_t dir );

Example Description

This example demonstrates the use of Stepper 19 Click board by driving the motor in both directions for a desired rotation angle.

The demo application is composed of two sections :

Application Init

The initialization of I2C module and log UART. After driver initialization, the app sets the default configuration.

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    stepper19_cfg_t stepper19_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    stepper19_cfg_setup( &stepper19_cfg );
    STEPPER19_MAP_MIKROBUS( stepper19_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == stepper19_init( &stepper19, &stepper19_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( STEPPER19_ERROR == stepper19_default_cfg ( &stepper19 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
    log_printf( &logger, "-----------------------------\r\n" );
}

Application Task

The application task represents an example that demonstrates the use of the Stepper 19 Click board with which the user can sequentially move the motor. The first part of the sequence executes the clockwise/counterclockwise motor movement for an angle of 90 degrees with a step speed of 50%, all the way to the last sequence of the same movement routine of 360 degree angle with a step speed of 90%. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void ) 
{
    log_printf( &logger, " Clockwise motion\r\n" );
    log_printf( &logger, " Angle of rotation :  90 degrees\r\n" );
    log_printf( &logger, " Step speed        :  50 %%\r\n" );
    stepper19_set_direction( &stepper19, STEPPER19_DIR_CLOCKWISE );
    if ( STEPPER19_OK == stepper19_rotate_by_angle( &stepper19, 50, 90, STEPPER19_STEP_RES_200 ) )
    {
        log_printf( &logger, "-----------------------------\r\n" );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }

    log_printf( &logger, " Counterclockwise motion\r\n" );
    log_printf( &logger, " Angle of rotation :  180 deg\r\n" );
    log_printf( &logger, " Step speed        :  50 %%\r\n" );
    stepper19_set_direction( &stepper19, STEPPER19_DIR_COUNTERCLOCKWISE );
    if ( STEPPER19_OK == stepper19_rotate_by_angle( &stepper19, 50, 180, STEPPER19_STEP_RES_200 ) )
    {
        log_printf( &logger, "-----------------------------\r\n" );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }

    log_printf( &logger, " Clockwise motion\r\n" );
    log_printf( &logger, " Angle of rotation : 270 deg\r\n" );
    log_printf( &logger, " Step speed        :  90 %% \r\n" );
    stepper19_set_direction( &stepper19, STEPPER19_DIR_CLOCKWISE );
    if ( STEPPER19_OK == stepper19_rotate_by_angle( &stepper19, 90, 270, STEPPER19_STEP_RES_200 ) )
    {
        log_printf( &logger, "-----------------------------\r\n" );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }

    log_printf( &logger, " Counterclockwise motion\r\n" );
    log_printf( &logger, " Angle of rotation : 360 deg\r\n" );
    log_printf( &logger, " Step speed        : 90 %%\r\n" );
    stepper19_set_direction( &stepper19, STEPPER19_DIR_COUNTERCLOCKWISE );
    if ( STEPPER19_OK == stepper19_rotate_by_angle( &stepper19, 90, 360, STEPPER19_STEP_RES_200 ) )
    {
        log_printf( &logger, "-----------------------------\r\n" );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }

    log_printf( &logger, " Clockwise motion\r\n" );
    log_printf( &logger, " Angle of rotation : 360 deg\r\n" );
    log_printf( &logger, " Step speed        : 90 %% \r\n" );
    stepper19_set_direction( &stepper19, STEPPER19_DIR_CLOCKWISE );
    if ( STEPPER19_OK == stepper19_rotate_by_angle( &stepper19, 90, 360, STEPPER19_STEP_RES_200 ) )
    {
        log_printf( &logger, "-----------------------------\r\n" );
        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 way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Stepper19

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 MikroElektronika compilers.


ALSO FROM THIS AUTHOR

LightRanger 9 click

0

LightRanger 9 Click is a compact add-on board suitable for range-finding and distance sensing applications. This board features the TMF8828, a dToF (direct time of flight) optical distance sensor with an integrated Vertical Cavity Surface Emitting Laser (VCSEL) achieving up to 5m target detection distance from ams AG. Due to its lens on the SPAD, it supports 3x3, 4x4, 3x6, and 8x8 multizone output data and a wide, dynamically adjustable field of view. All raw data processing is performed inside the TMF8828, providing distance information and confidence values through its I2C interface. A unique addition to this Click board™ represents an additional 0.7mm thick protective lens that further reduces interference and improves the sensor's accuracy.

[Learn More]

Nano GPS 2 click

5

Nano GPS 2 Click features the smallest GPS module with an integrated patch antenna, the ORG1510-MK05 a module from OriginGPS. It’s the world’s smallest multi-constellation antenna module enabling high-performance in a variety of applications.

[Learn More]

Nano Power click

5

Nano Power click is a boost (step-up) DC-DC converter click with extremely high efficiency and very low input voltage, aimed at the low power IoT market and battery-powered sensors and other devices.

[Learn More]