brushless31  2.1.0.0
Main Page

Brushless 31 click

Brushless 31 Click is a compact add-on board for precise and efficient brushless motor control. This board features the TB6605FTG, a three-phase full sine-wave brushless motor controller from Toshiba Semiconductor. The board features six onboard external N-channel MOSFETs for smooth motor operation, sine-wave PWM driving with 2-phase modulation for high efficiency and low noise, and includes essential functions like dead time, brake, and manual/auto lead-angle control. It supports clockwise and counterclockwise rotation and offers motor lock protection for added safety. Brushless 31 Click is ideal for home appliances, fans, and office equipment applications, where reliable and precise motor control is critical.

click Product page


Click library

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

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of the Brushless 31 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 performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
brushless31_cfg_t brushless31_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
brushless31_cfg_setup( &brushless31_cfg );
BRUSHLESS31_MAP_MIKROBUS( brushless31_cfg, MIKROBUS_1 );
if ( PWM_ERROR == brushless31_init( &brushless31, &brushless31_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( BRUSHLESS31_ERROR == brushless31_default_cfg ( &brushless31 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Controls the motor speed by changing the PWM duty cycle every 500 milliseconds.

The duty cycle ranges from 80% to 0%. 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 int8_t duty_cnt = 8;
static int8_t duty_inc = -1;
float duty = duty_cnt / 10.0;
brushless31_set_duty_cycle ( &brushless31, duty );
log_printf( &logger, "> Duty: %d%%\r\n", ( uint16_t )( duty_cnt * 10 ) );
Delay_ms ( 500 );
duty_cnt += duty_inc;
if ( duty_cnt > 8 )
{
duty_cnt = 8;
duty_inc = -1;
log_printf( &logger, " Pull brake\r\n" );
brushless31_pull_brake ( &brushless31 );
Delay_ms ( 1000 );
log_printf( &logger, " Switch direction\r\n" );
brushless31_switch_direction ( &brushless31 );
Delay_ms ( 1000 );
log_printf( &logger, " Release brake\r\n" );
brushless31_release_brake ( &brushless31 );
Delay_ms ( 1000 );
}
else if ( duty_cnt < 0 )
{
duty_cnt = 1;
duty_inc = 1;
}
}

Note

This click board is designed for 5V systems but can also be controlled with 3V3 GPIO lines.

Ensure your MCU is 5V tolerant on mikroBUS GPIO lines before turning on the power supply.

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

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.


BRUSHLESS31_ERROR
@ BRUSHLESS31_ERROR
Definition: brushless31.h:157
brushless31_cfg_t
Brushless 31 Click configuration object.
Definition: brushless31.h:135
brushless31_set_duty_cycle
err_t brushless31_set_duty_cycle(brushless31_t *ctx, float duty_cycle)
Brushless 31 sets PWM duty cycle.
BRUSHLESS31_MAP_MIKROBUS
#define BRUSHLESS31_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: brushless31.h:98
application_task
void application_task(void)
Definition: main.c:70
brushless31_switch_direction
void brushless31_switch_direction(brushless31_t *ctx)
Brushless 31 switch direction function.
brushless31_init
err_t brushless31_init(brushless31_t *ctx, brushless31_cfg_t *cfg)
Brushless 31 initialization function.
brushless31_release_brake
void brushless31_release_brake(brushless31_t *ctx)
Brushless 31 release brake function.
brushless31_default_cfg
err_t brushless31_default_cfg(brushless31_t *ctx)
Brushless 31 default configuration function.
brushless31_cfg_setup
void brushless31_cfg_setup(brushless31_cfg_t *cfg)
Brushless 31 configuration object setup function.
brushless31_t
Brushless 31 Click context object.
Definition: brushless31.h:113
application_init
void application_init(void)
Definition: main.c:34
brushless31_pull_brake
void brushless31_pull_brake(brushless31_t *ctx)
Brushless 31 pull brake function.