TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 codes)
  5. Bugz Bensce (97 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 (140533 times)
  2. FAT32 Library (73022 times)
  3. Network Ethernet Library (58025 times)
  4. USB Device Library (48212 times)
  5. Network WiFi Library (43821 times)
  6. FT800 Library (43292 times)
  7. GSM click (30353 times)
  8. mikroSDK (28983 times)
  9. PID Library (27112 times)
  10. microSD click (26712 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

Brushless 18 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-26

Package Version: 2.1.0.1

mikroSDK Library: 2.0.0.0

Category: Brushless

Downloaded: 47 times

Not followed.

License: MIT license  

Brushless 18 Click is a compact add-on board that controls three-phase sensorless brushless DC (BLDC) motors. This board features the ATmega8A, an 8-bit microcontroller from Microchip, ensuring precise and efficient motor control. This board features six high-performance N-channel MOSFETs (STL120N4F6AG) for switching power from an external source to the motor's stator coils, supporting currents up to 50A and operating with input voltages ranging from 0 to 40V.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Brushless 18 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Brushless 18 Click" changes.

Do you want to report abuse regarding "Brushless 18 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Brushless 18 Click

Brushless 18 Click is a compact add-on board that controls three-phase sensorless brushless DC (BLDC) motors. This board features the ATmega8A, an 8-bit microcontroller from Microchip, ensuring precise and efficient motor control. This board features six high-performance N-channel MOSFETs (STL120N4F6AG) for switching power from an external source to the motor's stator coils, supporting currents up to 50A and operating with input voltages ranging from 0 to 40V.

brushless18_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2024.
  • Type : PWM type

Software Support

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

Standard key functions :

  • brushless18_cfg_setup Config Object Initialization function.

    void brushless18_cfg_setup ( brushless18_cfg_t *cfg );
  • brushless18_init Initialization function.

    err_t brushless18_init ( brushless18_t *ctx, brushless18_cfg_t *cfg );

Example key functions :

  • brushless18_throttle_calib This function performs the ESC throttle calibration.

    err_t brushless18_throttle_calib ( brushless18_t *ctx );
  • brushless18_drive_motor This function drives the motor at the selected speed and direction.

    err_t brushless18_drive_motor ( brushless18_t *ctx, uint8_t direction, uint8_t speed );

Example Description

This example demonstrates the use of the Brushless 18 Click board by driving the motor in both directions at different speeds.

The demo application is composed of two sections :

Application Init

Initializes the driver and calibrates the Click board.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    brushless18_cfg_t brushless18_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.
    brushless18_cfg_setup( &brushless18_cfg );
    BRUSHLESS18_MAP_MIKROBUS( brushless18_cfg, MIKROBUS_1 );
    if ( PWM_ERROR == brushless18_init( &brushless18, &brushless18_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BRUSHLESS18_ERROR == brushless18_throttle_calib ( &brushless18 ) )
    {
        log_error( &logger, " Throttle calibration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Changes the motor speed every 500 milliseconds with steps of 5%. At the minimal speed, the motor switches direction. Each step will be logged on the USB UART where you can track the program flow.

void application_task ( void )
{
    static uint8_t direction = BRUSHLESS18_DIRECTION_CW;
    static int8_t speed = BRUSHLESS18_SPEED_MIN;
    static int8_t speed_step = 5;
    brushless18_drive_motor ( &brushless18, direction, speed );
    log_printf( &logger, " Direction: %s\r\n", 
                ( char * ) ( BRUSHLESS18_DIRECTION_CW == direction ? "CW" : "CCW" ) );
    log_printf( &logger, " Speed: %u%%\r\n\n", ( uint16_t ) speed );
    Delay_ms ( 500 );

    speed += speed_step;
    if ( speed > BRUSHLESS18_SPEED_MAX )
    {
        speed_step = -speed_step;
        speed += speed_step;
        speed += speed_step;
    }
    else if ( speed < BRUSHLESS18_SPEED_MIN )
    {
        speed_step = -speed_step;
        speed += speed_step;
        direction ^= 1;
        Delay_ms ( 1000 );
    }
}

Note

The theoretical maximal PWM Clock frequency for this Click board is 500 Hz. The default PWM Clock frequency is set to 400 Hz. To achieve such a low frequency, the user will probably need to decrease the MCU's main clock frequency in the Setup MCU Settings.

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.Brushless18

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

Rotary RGB Click

0

Rotary RGB Click is a compact add-on board for creating visual effects and precise position indications. This board features 16 individual RGB LEDs (WS2812B-2020) from Worldsemi and a high-quality rotary encoder (EC12D1564402) from ALPS. The WS2812B-2020 offers low driving voltage, high brightness, and excellent consistency, while the rotary encoder provides accurate 15-pulse incremental encoding with push-button functionality.

[Learn More]

Thermo 5 click

12

THERMO 5 click measures temperature in default range of 0°C to 127°C and extended range of -64°C to 191°C with ±1°C accuracy. It carries the EMC1414 temperature sensor. The click is designed to run on a 3.3V power supply.

[Learn More]

10x10 RGB 2 Click

0

10x10 RGB 2 Click is a compact add-on board designed for creating vibrant LED displays and lighting solutions. This board features the IN-PC20TBT5R5G5B, an RGB LED with an advanced IC for seamless operation from Inolux. The board features a 10x10 matrix of smart RGB LEDs capable of dual-wire transmission and a sophisticated control circuit for dynamic color rendering. It incorporates CMOS technology for low power consumption and supports 256 grayscale levels for precise PWM dimming, along with 32 levels of brightness control.

[Learn More]