2023-09-12 10:13 PM
Hello,
I am using Timer 1 for the generation of 3PWM and their complimentary Signals and I am getting all 6 PWM waveforms.
For six step commutation I need to add phase delay between the channels of the timer. Is it possible using any HAL function? I am not using any motor control library or example code.
Can anyone guide me.
Regards,
Ajish Saji
2023-09-12 11:47 PM
Hello @ajishsaji
This video is making the same thing you want to do. I suggest you to use it.
Best regards
II
2023-09-13 12:28 AM
Hello @Issamos
I referred to that video but my hardware has been developed and it uses only Timer 1 for PWM generation -> Chanel1,2&3 Please refer the below snap.
Can you please help me in this scenario, I need to start the Timer 1, Channel 2 PWM 120 degree apart
2023-09-13 12:45 AM - edited 2023-09-13 12:46 AM
Hello again @ajishsaji
It is so easy. Use exactly the same methode of the video but use the ch1,ch2 and ch3 of TIM1 as PWM generator ( he is using ch1 of TIM1,2 and 3 .replace them respectively with ch1,ch2 and ch3 of TIM1) then use TIM2 channels 1 and 2 for the output compare(he is using ch2 of TIM1 and TIM2. Replace them with channel 1 and 2 of TIM2). and do exactly as in the video.
Best regards.
II
2023-09-13 02:03 AM
Hello @Issamos,
I did the as you said and it worked for only 1st cycle.
Please refer the below snap
Do you want me to attach the Project?
2023-09-13 02:27 AM - edited 2023-09-13 02:27 AM
2023-09-13 02:54 AM
Hello @Issamos
I have attached the main file for your reference.
2023-09-13 02:58 AM
Hello @ajishsaji
I'm sorry but you should use different timer for each pwm. And take care of timers internal trigger connections. As described her.
Best regards.
II
2023-09-13 03:02 AM
Hello @ajishsaji welcome to ST Community,
You need to start your question by stating which stm32 are you using,
One straightforward method is to use the toggle on match mode of the output compare to control the phase shift, but all the signals will have 50% duty cycles
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.
2023-09-13 03:30 AM