cancel
Showing results for 
Search instead for 
Did you mean: 

TIM1 Dead time not working according manual

franz2
Associate III

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

6 REPLIES 6

Which STM32?

Read out and check/post TIM registers content, and screenshot of the respective waveform.

What is the TIM input frequency?

JW

franz2
Associate III

Dear JW

I use Nucleo-G474RE Board

CH 3 has duty fact 25%

Scope with dead time setting = 1 --> exactly code attached 2 days back

Franz

franz2
Associate III
 

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

franz2
Associate III

Sorry here the running state. The scope diagram is equal and SW is unchanged.

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