cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any sample code to drive bldc motor in sinusoidal control?

Kenji1
Senior

Hi All.

​Does anyone know about a simple sample code to drive bldc motor with sinusoidal control?

I only want to know the way how to setting PWM and update the PWM output.

MCSDK’s output sample code is hard to use and understand, it take time. ​Something like the device peripheral sample code will suffice.

4 REPLIES 4
Igor Cesko
ST Employee

Hi Kenji ,

Please try to study Timer example in STM32Cube FW: "\STM32Cube_FW_G4_V1.4.0\Projects\NUCLEO-G474RE\Examples\TIM\TIM_PWMOutput". Or examples "TIM_DMA", "TIM_DMABurst", ... (some others).

Those examples are about PWM control. Maybe this can help.

Regards

Igor

Kenji1
Senior

Dear Igor-san

Thank you for the information.

I will check it.

Hello @Igor Cesko & @Kenji1 , 

I am unable to find the example code. Could you please send it ? 

Regards
Monica

Hello @Monica1 ,

Here it is: https://github.com/STMicroelectronics/STM32CubeG4/tree/master/Projects/NUCLEO-G474RE/Examples/TIM/TIM_PWMOutput

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.