This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8306: can not start BLDC motor.

Part Number: DRV8306

Hi everyone,

This is my schematic:

And source code:

void bldc_motor(void) {
	HAL_Delay(2000);

	HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);	// Start PWM
	__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 20); // Duty = 20%
	HAL_Delay(1000);

	HAL_GPIO_WritePin(BLDC_DIR_GPIO_Port, BLDC_DIR_Pin, GPIO_PIN_SET);// DIR = 1
	HAL_GPIO_WritePin(BLDC_BRAKE_GPIO_Port, BLDC_BRAKE_Pin, GPIO_PIN_SET);// BRAKE = 1, turn-off brake
	HAL_GPIO_WritePin(BLDC_EN_GPIO_Port, BLDC_EN_Pin, GPIO_PIN_SET);// EN = 1 - ON

	for (int i = 0; i < 5; i++) {
		__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 50); // Duty = 50%
		HAL_Delay(2000);
		__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 20); // Duty = 20%
		HAL_Delay(2000);
	}

	HAL_GPIO_WritePin(BLDC_BRAKE_GPIO_Port, BLDC_BRAKE_Pin, GPIO_PIN_RESET); // Brake = 0
	HAL_GPIO_WritePin(BLDC_EN_GPIO_Port, BLDC_EN_Pin, GPIO_PIN_RESET); // EN = 0
}

The motor I use

http://www.wonsmart.com.cn/ws7040-24-v200-15655816895217949.html

Normally, the system works well and the motor still rotates, reverses, adjusts speed...

However, at some time I cannot start the motor.

If I deflect the rotor out of its current position the motor will rotate.

Please view attached video.

  • Hi Kevin,

    Can you please:

    • Set ENABLE = 1 first
    • Wait 1ms for device to wake
    • Set BRAKE = 1 and DIR = 1
    • Set PWM


    Currently you set ENABLE = 1 and then the next lines of code set the PWM. See if adding the twake time helps the application.

    Other things you may try:

    • Set the IDRIVE to a lower setting
    • Ensure the phase current is aligned with the phase voltage. If not, a lead angle may need to be applied to the solution. 

    Thanks,
    Aaron

  • I change the source code to:

    void bldc_motor(void) {
    	HAL_GPIO_WritePin(BLDC_EN_GPIO_Port, BLDC_EN_Pin, GPIO_PIN_SET);// EN = 1 - ON
    	HAL_Delay(1000);
    	HAL_GPIO_WritePin(BLDC_BRAKE_GPIO_Port, BLDC_BRAKE_Pin, GPIO_PIN_SET);// BRAKE = 1
    	HAL_GPIO_WritePin(BLDC_DIR_GPIO_Port, BLDC_DIR_Pin, GPIO_PIN_SET);// DIR = 1
    
    	HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);	// Start PWM
    	__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 20);
    	HAL_Delay(1000);
    
    	for (int i = 0; i < 5; i++) {
    		__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 50); // Duty 50%
    		HAL_Delay(2000);
    		__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_3, 20); // Duty 20%
    		HAL_Delay(2000);
    	}
    
    	HAL_GPIO_WritePin(BLDC_BRAKE_GPIO_Port, BLDC_BRAKE_Pin, GPIO_PIN_RESET); // BRAKE = 0
    	HAL_GPIO_WritePin(BLDC_EN_GPIO_Port, BLDC_EN_Pin, GPIO_PIN_RESET);  // EN = 0
    }

    This did not solve my problem.

    The motor stop at the position special, I still deflect the rotor to start.

    If I use another motor type (not WS7040-24-V200 motor type)  then DRV8306 normally works.

  • Hello Kevin,

    Thanks for the feedback. It is interesting that another type of motor does not encounter the same problem as the WS7040-24-V200 motor that you are using in the video above.

    As Aaron recommended above, you should monitor the phase current to make sure that it is aligned with the phase voltage of your motor. This would also be useful to check at startup to see if there are any differences in startup waveforms between the two motors.

    Another thing to check would be the hall states, they can sometimes be an issue in sensored system. Such as if the hall states are not indicating the right state so the motor could be energized incorrectly or may sometimes get stuck in a state. When you move the rotor this could cause a state update and the systems proceeds with the algorithm as it should.

    Best,

    Isaac