Skip to content

Latest commit

 

History

History
 
 

brushless4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

\mainpage Main Page


Brushless 4 click

Brushless 4 click is a 3 phase sensorless BLDC motor driver, which features a 180° sinusoidal drive, providing high efficiency and low acoustic noise. This type of drivers inherently provides higher torque in general, compared to classical 120° BLDC motor drivers.

click Product page


Click library

  • Author : MikroE Team
  • Date : Jan 2020.
  • Type : PWM type

Software Support

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

Standard key functions :

  • Config Object Initialization function.

void brushless4_cfg_setup ( brushless4_cfg_t *cfg );

  • Initialization function.

BRUSHLESS4_RETVAL brushless4_init ( brushless4_t *ctx, brushless4_cfg_t *cfg );

  • Click Default Configuration function.

void brushless4_default_cfg ( brushless4_t *ctx );

Example key functions :

  • This function sets the PWM duty cycle.

void brushless4_set_duty_cycle ( brushless4_t *ctx, pwm_data_t duty_cycle );

  • This function starts PWM module.

void brushless4_pwm_start ( brushless4_t *ctx );

  • This function sets the state of the PWM pin.

void brushless4_pwm_pin ( brushless4_t *ctx, uint8_t state );

Examples Description

This click has many features for driving a wide range of small to medium BLDC motors. It provides the rotor position digital output, via the FG pin, routed to the mikroBUS INT pin.

The demo application is composed of two sections :

Application Init

Initializes the GPIO driver and configures the PWM peripheral for controlling the speed of the motor.

void application_init ( void )
{
    log_cfg_t log_cfg;
    brushless4_cfg_t cfg;

    //  Logger initialization.

    LOG_MAP_USB_UART( log_cfg );
    log_cfg.level = LOG_LEVEL_DEBUG;
    log_cfg.baud = 9600;
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    brushless4_cfg_setup( &cfg );
    BRUSHLESS4_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    brushless4_init( &brushless4, &cfg );

    brushless4_pwm_start( &brushless4 );  
    brushless4_set_duty_cycle ( &brushless4, duty_cycle );  
    Delay_ms( 1000 );
    
    log_printf( &logger, "---------------------- \r\n" );
}
  

Application Task

Increases and decreases the speed of the motor demonstrating the speed controll.

void application_task ( void )
{
    brushless4_pwm_start( &brushless4 );
    Delay_ms( 100 );
    
    log_printf( &logger, "    acceleration      \r\n" );
    
    for ( duty_cycle = 0.1; duty_cycle <= 1.0; duty_cycle += 0.1 )
    {
        brushless4_set_duty_cycle ( &brushless4, duty_cycle );
        log_printf( &logger," > " );
        Delay_ms( 500 );
    }

    log_printf( &logger,  "\r\n ---------------------- \r\n" ); 
    log_printf( &logger, "    slowing down     \r\n" );
    
    for ( duty_cycle = 1.0; duty_cycle > 0; duty_cycle -= 0.1 )
    {
        brushless4_set_duty_cycle ( &brushless4, duty_cycle );
        log_printf( &logger," < " );
        Delay_ms( 500 );
    }
    
    brushless4_pwm_stop( &brushless4 );
    log_printf( &logger,  "\r\n ---------------------- \r\n" ); 
    Delay_ms( 100 );
}  

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

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.