Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

[FEATURE] Centre ESP32 LEDC PWM, add dead time and 6-PWM support

Open runger1101001 opened this issue 2 years ago • 0 comments

Looks like LEDC actually allows setting a centre-aligned PWM. See the ledc_timer_config_t field hpoint field, which defines the point at which the PWM switches on. By setting both duty cycle and hpoint we can centre the signal. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#_CPPv421ledc_channel_config_t

See also ledc_set_duty_and_update()

If we can centre the signal, we can also introduce dead-time. We have to consider if this can be done in a safe manner, since the channels are not actually complementary. But it should in the end not be different to the software dead-time of the other drivers.

runger1101001 avatar May 21 '23 21:05 runger1101001