TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136822 times)
  2. FAT32 Library (69986 times)
  3. Network Ethernet Library (55975 times)
  4. USB Device Library (46287 times)
  5. Network WiFi Library (41894 times)
  6. FT800 Library (41203 times)
  7. GSM click (29009 times)
  8. PID Library (26421 times)
  9. mikroSDK (26387 times)
  10. microSD click (25383 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 7 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: Brushless

Downloaded: 134 times

Not followed.

License: MIT license  

Brushless 7 Click is, as its name said, a motor driver based expansion board for controlling BLCD motors with any microcontroller.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Brushless 7 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Brushless 7 click" changes.

Do you want to report abuse regarding "Brushless 7 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Brushless 7 click

Brushless 7 Click is, as its name said, a motor driver based expansion board for controlling BLCD motors with any microcontroller.

brushless7_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Jul 2020.
  • Type : I2C type

Software Support

We provide a library for the Brushless7 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Brushless7 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void brushless7_cfg_setup ( brushless7_cfg_t *cfg );

  • Initialization function.

    BRUSHLESS7_RETVAL brushless7_init ( brushless7_t ctx, brushless7_cfg_t cfg );

  • Click Default Configuration function.

    void brushless7_default_cfg ( brushless7_t *ctx );

Example key functions :

  • Function for changeing duty of device

    uint8_t brushless7_change_duty ( brushless7_t *ctx, float duty_ptc );

  • Function for setting max rpm parameter of device

    uint8_t brushless7_max_speed_rpm ( brushless7_t *ctx, uint8_t max_speed_rpm );

  • Function for setting type of device control

    uint8_t brushless7_control_mode_set ( brushless7_t *ctx, uint8_t ctrl_type );

Examples Description

This example demonstrates the use of Brushless 7 Click board.

The demo application is composed of two sections :

Application Init

Sets the default configuration and then configures the click board for the selected mode.


void application_init ( void )
{
    log_cfg_t log_cfg;
    brushless7_cfg_t cfg;
    uint8_t error_flag = 0;

    /** 
     * 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.

    brushless7_cfg_setup( &cfg );
    BRUSHLESS7_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    brushless7_init( &brushless7, &cfg );
    Delay_ms ( 100 );

    brushless7_default_cfg( &brushless7 );
    Delay_ms ( 100 );

    demo_type_data = BRUSHLESS7_CTRL_TYPE_DUTY;

    if ( BRUSHLESS7_CTRL_TYPE_DUTY == demo_type_data )
    {
        error_flag |= brushless7_max_duty( &brushless7, 95.0 );
        error_flag |= brushless7_start_duty( &brushless7, 5.0 );
        error_flag |= brushless7_stop_duty( &brushless7, 2.0 );
        log_printf( &logger, " ----- DUTY CONTROL ----- \r\n" );
    }
    else if ( BRUSHLESS7_CTRL_TYPE_RPM == demo_type_data )
    {
        error_flag |= brushless7_max_speed_rpm( &brushless7, BRUSHLESS7_MAX_SPEED_4096 );
        log_printf( &logger, " ----- RPM CONTROL ----- \r\n" );
    }

    if ( BRUSHLESS7_DEV_ERROR == error_flag )
    {
        log_printf( &logger, " ----- ERROR ----- \r\n" );
        for( ; ; );
    }
}

Application Task

Increases and decreases the speed of the motor rotation by setting the duty cycle or rpm values depending on which mode is previously selected. It also switches the direction of rotation at the beginning of each cycle. All data is being logged on the USB UART where you can track their changes.


void application_task ( void )
{
    brushless7_control_mode_set( &brushless7, BRUSHLESS7_CTRL_TYPE_STOP );
    brushless7_toggle_dir_pin_state ( &brushless7 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    brushless7_control_mode_set( &brushless7, demo_type_data );
    if ( BRUSHLESS7_CTRL_TYPE_DUTY == demo_type_data )
    {
        log_printf( &logger, " The motor is accelerating...\r\n" );
        log_printf( &logger, "------------------------------\r\n" );
        brushless7_change_duty( &brushless7, 70.0 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );

        log_printf( &logger, " The motor is slowing down...\r\n" );
        log_printf( &logger, "------------------------------\r\n" );
        brushless7_change_duty( &brushless7, 8.0 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }
    else if ( BRUSHLESS7_CTRL_TYPE_RPM == demo_type_data )
    {
        log_printf( &logger, " The motor is accelerating...\r\n" );
        log_printf( &logger, "------------------------------\r\n" );
        brushless7_start_rpm( &brushless7, 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );

        log_printf( &logger, " The motor is slowing down...\r\n" );
        log_printf( &logger, "------------------------------\r\n" );
        brushless7_start_rpm( &brushless7, 100 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Brushless7

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.


ALSO FROM THIS AUTHOR

Pressure 19 click

0

Pressure 19 Click is a compact add-on board that contains a board-mount pressure sensor. This board features the MLX90817, a factory-calibrated absolute pressure sensor delivering ratiometric analog output from Melexis Technologies. The MLX90817 comes with a configurable host interface that supports I2C serial communication and configurable signal processing (the user is allowed to process the output signal in analog or digital form). It measures pressure from 0.2 up to 3bar with a pressure accuracy of ±33mbar. Its DSP-based architecture using a 16bit microcontroller provides outstanding performance in terms of initial accuracy and assures operation in a temperature range of -40°C to +120°C, ensuring stable operation under extreme conditions.

[Learn More]

TDC 2 click

0

TDC 2 Click is a compact add-on board that recognizes events and provides a digital representation of the time they occurred. This board features ScioSense’s AS6500, a four-channel time-to-digital converter (TDC) frontend with high measurement performance and high data throughput. The AS6500 is characterized by simple data post-processing thanks to calibrated results (calculates calibrated stop measurements referenced to the applied reference clock).

[Learn More]

RTC 21 click

0

RTC 21 Click is a compact add-on board that accurately keeps the time of the day. This board features the PT7C4311, an I2C-configurable real-time clock module with programmable square-wave output from Diodes Incorporated. The PT7C4311 includes time and calendar functions providing various information such as hour, minute, second, day, date, month, year, and century. It operates in a 24-hour format indicator, has automatic leap year compensation, and low power consumption, allowing it to be used with a single button cell battery for an extended period.

[Learn More]