Skip to content
Chris edited this page Jun 4, 2023 · 43 revisions

Deadtime

Bluejay hardware modulates motor windings voltage using a PWM waveform. When a phase is being switched it is driving a PWM signal to a half bridge arm (Q1 in the image below) and a complementary PWM to the same half bridge leg (Q2 below):

imagen

Switching does not happen immediately so Q1 and Q2 cannot be driven with PWM and complementary PWM respectively at the same time, otherwise there would be a short moment in time when Q1 and Q2 might be open at the same time letting current go directly between VCC and GND (shoot throught). For this reason BLDC ESCs insert a time between the commutation of Q1 and Q2 called deadtime.

Inserting deadtime prevents shoot through (shorting VCC and GND).

Every MOSFET model on the market has its own deadtime value. Manufacturers always use the same type of MOSFET with the same deadtime on their ESCs. For this reason each ESC model on the market has it's own deadtime for the ESC as whole.

PWM duty cycle and Deadtime

Bluejay hardware uses center aligned PWM, so deadtime is inserted at the beginning and the end of the PWM duty cycle. This way deadtime is subtracted from the actual PWM period.

For example: If the necessary deadtime is 816us and a PWM period takes 4000us this deadtime will reduce effective PWM by about a 20%, which means that until the PWM duty cycle is above 20% the effective duty cycle is still 0.

imagen

PWM resolution and Deadtime

Bluejay uses the system clock of 49Mhz as PCA (Programmable Counter Array, used to generate PWM signal) clock source. This peripheral has several bit resolution options to generate PWM waveforms. When choosing 8bit resolution the PCA is capable of producing a 96Khz waveform, when choosing 9bit, the PCA produces a 48khz waveform and when using 10bit it produces a 24khz waveform.

Bluejay uses 1/49000000 seconds (20,4ns) units to configure deadtime, so deatime values are directly substracted to PWM duty producing an effective PWM duty equals to duty - deadtime.

For example: The Layout O-H-5 indiciates a dead-time of 5 units, so 20.4 * 5 = 102ns.

For this reason the effective resolution is PWM resolution minus deadtime. For example, when using 96khz frequency 8bit resolution is used. If we have a 40 deadtime ESC the effective resolution is 256 - 40. This is over 15% resolution diluted simply because of the deadtime.

This loss of resolution is what causes issues when starting motors in Bluejay using high frequency PWM and ESCs with high deadtimes. PWM deadtime can be corrected, but Bluejay runs in EFM8BB21 8bit MCU, that is not able to do calculations fast enough to implement this correction.

Glossary

Duty cycle

The duty cycle is the duration of the PWM signal being in high state. Often times this is also referenced as percentage of a duty cycle.

Example: Duty cycle of 20% means the signal is high for the first 20% of the PWM period.

Period

The duration of a PWM period. On 24kHz this is equal to 41.67us.