石榴姐

【CW32】BLDC

 
Overview

Brushless driver board

Typical MOS driver + three-phase bridge,

PCB design instructions

Nothing to pay attention to. Remember to lay wider copper in the high-current part of the MOS driver and use more Via for heat dissipation.

Software description

Upper tube modulation, lower tube switch;
void Commutation(unsigned int step,unsigned int OutPwmValue,unsigned int PWM_ON_flag)
{//
if(PWM_ON_flag==0) //Turn off output if not started
{
CW_ATIM->CH1CCRA=0;CW_ATIM->CH2CCRA=0;CW_ATIM->CH3CCRA=0;//Timer output comparison is set to 0
ATIM_CtrlPWMOutputs(DISABLE);
PWM_AL_OFF; PWM_BL_OFF; PWM_CL_OFF;
return;
}

PWM_AL_OFF; PWM_BL_OFF; PWM_CL_OFF;

//Output PWM to the upper bridge, example: AB means (A upper bridge is on, B lower bridge is on)
if(step==0||step==1){CW_ATIM->CH1CCRA=OutPwmValue; CW_ATIM->CH2CCRA=0; CW_ATIM->CH3CCRA=0; } //0:AB; 1:AC
if(step==2||step==3){CW_ATIM->CH1CCRA=0; CW_ATIM->CH2CCRA=OutPwmValue; CW_ATIM->CH3CCRA=0; } //2:BC; 3:BA
if(step==4||step==5){CW_ATIM->CH1CCRA=0; CW_ATIM->CH2CCRA=0; CW_ATIM->CH3CCRA=OutPwmValue;} //4:CA; 5:CB

//Control IO lower bridge
if(step==0||step==5){PWM_AL_OFF; PWM_CL_OFF;PWM_BL_ON;} //AB CB; B lower bridge is turned on
else if(step==1||step==2){ PWM_AL_OFF; PWM_BL_OFF; PWM_CL_ON;}//AC BC; C lower bridge is on
else if(step==3||step==4){ PWM_BL_OFF; PWM_CL_OFF; PWM_AL_ON;}//BA CA; A lower bridge is on

ATIM_CtrlPWMOutputs(ENABLE); //The output is valid
}
HALL sensed phase change

void GTIM2_IRQHandler(void)

{

unsigned int x;



/* USER CODE BEGIN */

if (GTIM_GetITStatus(CW_GTIM2, GTIM_IT_CC1))

{

GTIM_ClearITPendingBit(CW_GTIM2, GTIM_IT_CC1);

}



if (GTIM_GetITStatus(CW_GTIM2, GTIM_IT_CC2))

{

GTIM_ClearITPendingBit(CW_GTIM2, GTIM_IT_CC2);

}


if (GTIM_GetITStatus(CW_GTIM2, GTIM_IT_CC3))



{

GTIM_ClearITPendingBit(CW_GTIM2, GTIM_IT_CC3);

}


HALLcount++; //Hall pulse count
x=HALL_Check(); //According to the Hall count value, the status
Cur_step=STEP_TAB[x-1]; //Get the commutation sequence bit
if(Motor_Start_F==1&&ErrorCode==0) //Change phase according to start and stop status
Commutation(Cur_step,OutPwm,Motor_Start_F);



/* USER CODE END */

}
After the non-sense driver is completed, the code will be compiled and open sourced

Physical display instructions

Because it is a verification board, it is my first time to make a brushless motor driver, so the drawing is more casual and larger. The size will be compressed in the second version later;
ad9173aa-50e7-4bc2-8e35-9711d9b46a6e.jpgthing

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-23 04:18:06
  • ISE file type description
  • Competition B sound source
  • Is Telosb an intrinsically safe circuit?
  • Zigbee beginner's experience
  • Development of GPS Navigation Software Based on WIN CE
  • Raspberry Pi 2 Camera

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号