Small drive unit deadtime

Topics concerning the Tesla front and rear drive unit drop-in board
Post Reply
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Small drive unit deadtime

Post by catphish »

Would anybody be able to confirm the correct deatime for the Tesla SDU in nanoseconds? :?:

From the openinverter documentation, I see the following:
deadtime The time between switching off one IGBT and switching on the other. 28=800ns, 63=1.5µs. More values can be found in the STM32 data sheet. Make sure to test the deadtime at low power levels. Setting the deadtime too low while operating of a potent power source can blow up your power stage!
However, I'm having a little trouble making sense of these numbers. I can the correct value by trial and error if necessary, but it would be great if anyone has aleady looked into this and knows the correct value.

Additionally, could anyone confirm if the above documentation is correct? At 72MHz I would expect 28 to give 389ns, and 63 to give 875ns. Even at a different frequency, 28=800ns, 63=1.5µs do not appear to be proportional.

Thanks!
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Small drive unit deadtime

Post by EV_Builder »

The setting is made "smart".

This is from the reference manual:
deadtime_F103.PNG
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: Small drive unit deadtime

Post by catphish »

EV_Builder wrote: Fri Apr 01, 2022 5:12 pm The setting is made "smart".

This is from the reference manual:

deadtime_F103.PNG
Thanks. You're absolutely correct that the value is a little more complicated, however my reading of this is that it shouldn't have any impact until the value reaches 128.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Small drive unit deadtime

Post by EV_Builder »

It depends if the value we set is including the last bits or not.

Ok our system clock is 72Mhz.

so one tick = 1/72 = 13.89nS.

We need smallest step size so 28 = 388,92nS.

Maybe its applied 2 times because of turning one side off and the other on happens after each other??!?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Small drive unit deadtime

Post by jon volk »

To get the math to match, you probably need to multiply by 32. Then the nanosecond values should align with the data sheet.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: Small drive unit deadtime

Post by catphish »

EV_Builder wrote: Fri Apr 01, 2022 7:21 pm It depends if the value we set is including the last bits or not.

Ok our system clock is 72Mhz.

so one tick = 1/72 = 13.89nS.

We need smallest step size so 28 = 388,92nS.

Maybe its applied 2 times because of turning one side off and the other on happens after each other??!?

Check the code. Maybe the divisor is active on the system clock and its not 72Mhz...
Thanks for looking. It's entirely possible that openinverter doesn't run the clock at 72MHz. If the peripheral clock that drives the PWM was running at 35MHz then a setting of 28 would yield a deadtime of 800ns. But then a setting of 63 would give 1800ns, so I'm still totally lost.

I will dig into the code, and see if I can get any answers. I'm primarily only interested in knowing the correct deadtime for the SDU (in ns).
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Small drive unit deadtime

Post by EV_Builder »

Ok i did already. The system clock is 72Mhz
The setting value is set to all the 8 bits (the function writes all 8 bits).
So we should definitely stick to max value 127.

APB1 runs at 36Mhz but i'm not sure if TIM1 (our PWM timer) runs from that if so we have found our doubler and then a small bit of margin for the FETS them selves?

Johu will come allong and tell us his little dirty secret :evil: :evil: :D :D :)
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1013 times
Contact:

Re: Small drive unit deadtime

Post by johu »

Yes the STM32 clock network is a bit challenging. So yes TIM1 runs at 72 MHz on APB2. The dead time generator has its own prescaler but that is x1.
With that I arrive at the same values as catfish. Now I really need to get the hardware out and check it.

We need all 8 bits, e.g. Nissan Leaf Gen3 needs setting of 160 which *should* be 2.66 µs
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: Small drive unit deadtime

Post by catphish »

johu wrote: Sat Apr 02, 2022 6:38 am We need all 8 bits, e.g. Nissan Leaf Gen3 needs setting of 160 which *should* be 2.66 µs
I realise that something in my code might be different from yours, but running on my STM32F103 at 72MHz, I have confirmed that a value of 108 gives a deadtime of 1.5µs. I will use this as a starting point.

I agree that a value of 160 should give a time of 2.667µs, but haven't confirmed this.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Small drive unit deadtime

Post by EV_Builder »

Cool let us know what you learn 🙂
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
Post Reply