2020-06-24 03:05 AM
I use TIM1 as 3 Phase PWM for motor control. I need to adjust the dead time. But the dead time is not according the manual.
My code for dead time:
TIM_BDTRInitStruct.OSSRState = LL_TIM_OSSR_ENABLE;
TIM_BDTRInitStruct.OSSIState = LL_TIM_OSSI_DISABLE;
TIM_BDTRInitStruct.LockLevel = LL_TIM_LOCKLEVEL_OFF;
TIM_BDTRInitStruct.DeadTime = 1;
TIM_BDTRInitStruct.BreakState = LL_TIM_BREAK_ENABLE;
TIM_BDTRInitStruct.BreakPolarity = LL_TIM_BREAK_POLARITY_HIGH;
TIM_BDTRInitStruct.BreakFilter = LL_TIM_BREAK_FILTER_FDIV1;
TIM_BDTRInitStruct.BreakAFMode = LL_TIM_BREAK_AFMODE_INPUT;
TIM_BDTRInitStruct.Break2State = LL_TIM_BREAK2_DISABLE;
TIM_BDTRInitStruct.Break2Polarity = LL_TIM_BREAK2_POLARITY_HIGH;
TIM_BDTRInitStruct.Break2Filter = LL_TIM_BREAK2_FILTER_FDIV1;
TIM_BDTRInitStruct.Break2AFMode = LL_TIM_BREAK_AFMODE_INPUT;
TIM_BDTRInitStruct.AutomaticOutput = LL_TIM_AUTOMATICOUTPUT_ENABLE;
LL_TIM_BDTR_Init(TIM1, &TIM_BDTRInitStruct);
f PWM is 20kHz
This setting I changed in the SFRs Watch window:
When I set DTG to 0: dead time is 9.3us
When I set DTG to 127: dead time is 9.5us
When I set DTG to 240: dead time is 4.7us
When I set DTG to 255: dead time is 3.4us
I need a dead time of approximate 0.2us.
How I can implement shorter dead time. Accorrding manual I must be possible. Somewhere must be an error between reality and manual.
Franz
2020-06-24 07:30 AM
Which STM32?
Read out and check/post TIM registers content, and screenshot of the respective waveform.
What is the TIM input frequency?
JW
2020-06-26 12:33 AM
2020-06-26 12:33 AM
2020-06-26 02:43 PM
Registers content you've posted display a stopped timer (TIM_CR1.CEN=0) disabled all channels in TIM_CCER and zero TIM_BDTR, i.e. no dead time. It's hard to judge whether the waveform is OK from a random set of registers.
JW
2020-06-29 12:15 AM
2020-06-29 10:55 PM
OK and is there any change if you don't enable the breaks, i.e. set *only* MOE in BDTR (and then try to change DTG)?
JW