brushless9  2.0.0.0
Main Page

Brushless 9 click

Brushless 9 Click is a compact add-on board suitable for controlling BLDC motors with any MCU. This board features the TC78B027FTG, a 1-Hall sine-wave PWM controller for three-phase brushless DC motors from Toshiba Semiconductor. It simplifies the motor selection by using only one Hall sensor input that can be used with either a single Hall sensor motor or the more conventional 3 Hall sensor motors.

click Product page


Click library

  • Author : Luka Filipovic
  • Date : Dec 2020.
  • Type : PWM type

Software Support

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

Standard key functions :

Example key functions :

Examples Description

This example works with motors using adequate PWM pin.

The demo application is composed of two sections :

Application Init

Initializes driver and sets up adequate module configuration. Once in this state, the module is ready to operate.

void application_init ( void )
{
log_cfg_t log_cfg;
brushless9_cfg_t brushless9_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
brushless9_cfg_setup( &brushless9_cfg );
BRUSHLESS9_MAP_MIKROBUS( brushless9_cfg, MIKROBUS_1 );
err_t init_flag = brushless9_init( &brushless9, &brushless9_cfg );
if ( init_flag == PWM_ERROR )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
brushless9_set_dir( &brushless9, direction );
brushless9_set_brk( &brushless9, 1 );
brushless9_set_duty_cycle ( &brushless9, 0 );
brushless9_pwm_start( &brushless9 );
log_info( &logger, " Application Task " );
}

Application Task

This example demonstrates the use of Brushless 9 click board. Brushless 9 click communicates with the device via PWM driver in order to set adequate voltage level for connected motor. Current PWM settings being output are sent via logger.

void application_task ( void )
{
log_info( &logger, " Starting... " );
brushless9_set_brk( &brushless9, 0 );
for ( float duty = 0.1; duty < 1; duty += 0.1 )
{
Delay_ms( DUTY_CHANGE_DELAY );
brushless9_set_duty_cycle ( &brushless9, duty );
log_printf( &logger, "Duty: %u%%\r\n", ( uint16_t )ceil( duty * 100 ) );
}
for ( float duty = 0.9; duty >= 0; duty -= 0.1 )
{
Delay_ms( DUTY_CHANGE_DELAY );
brushless9_set_duty_cycle ( &brushless9, duty );
log_printf( &logger, "Duty: %u%%\r\n", ( uint16_t )ceil( duty * 100 ) );
}
Delay_ms( DUTY_CHANGE_DELAY );
log_info( &logger, " Stopping... " );
brushless9_set_duty_cycle ( &brushless9, 0 );
brushless9_set_brk( &brushless9, 1 );
Delay_ms( BREAK_DELAY );
log_info( &logger, " Changing direction... " );
direction = !direction;
brushless9_set_dir( &brushless9, direction );
}

Note

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

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.


brushless9_t
Brushless 9 Click driver selector.
Definition: brushless9.h:97
BREAK_DELAY
#define BREAK_DELAY
Definition: main.c:26
brushless9_init
err_t brushless9_init(brushless9_t *ctx, brushless9_cfg_t *cfg)
Brushless 9 initialization function.
BRUSHLESS9_MAP_MIKROBUS
#define BRUSHLESS9_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: brushless9.h:77
application_task
void application_task(void)
Definition: main.c:71
brushless9_pwm_start
err_t brushless9_pwm_start(brushless9_t *ctx)
Brushless 9 start PWM module.
DUTY_CHANGE_DELAY
#define DUTY_CHANGE_DELAY
Definition: main.c:25
application_init
void application_init(void)
Definition: main.c:33
brushless9_set_brk
void brushless9_set_brk(brushless9_t *ctx, uint8_t state)
Brushless 9 brk pin setting.
brushless9_set_dir
void brushless9_set_dir(brushless9_t *ctx, uint8_t state)
Brushless 9 dir pin setting.
brushless9_cfg_setup
void brushless9_cfg_setup(brushless9_cfg_t *cfg)
Brushless 9 configuration object setup function.
brushless9_set_duty_cycle
err_t brushless9_set_duty_cycle(brushless9_t *ctx, float duty_cycle)
Brushless 9 sets PWM duty cycle.
brushless9_cfg_t
Brushless 9 Click configuration object.
Definition: brushless9.h:119