Phase Shift of PWM output & Faulty behaviour below 10 Hz

fungo16
Posts: 3
Joined: Thu Apr 11, 2019 4:56 pm

Phase Shift of PWM output & Faulty behaviour below 10 Hz

Postby fungo16 » Thu Apr 11, 2019 5:07 pm

Dear users,

I have been using the ESP32-WROOM 32 Devkit V1 and ESP32 IDF for many projects but now reached the point where I
need some help. Usually, I am using the MCPWM unit to generate PWM. Now, I would like to phase
shift two channels (A & B) with same frequencies (0 - 35 Hz) and duty cycle (50%) by 25%. I know that there might be limitations
due to the timer but maybe there is a workaround (sync, deadtime) that can achieve the desired result.

The second issue is related to stable PWM frequencies below 10 Hz. The corresponding output frequency is coarsely factor 3 higher. Above 10 Hz everything is fine.

Thank you very much!

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Phase Shift of PWM output & Faulty behaviour below 10 Hz

Postby WiFive » Fri Apr 12, 2019 3:54 am

https://github.com/espressif/esp-idf/issues/2255

For phase shift have one channel in count up mode and one channel in count up/down mode?

fungo16
Posts: 3
Joined: Thu Apr 11, 2019 4:56 pm

Re: Phase Shift of PWM output & Faulty behaviour below 10 Hz

Postby fungo16 » Fri Apr 12, 2019 6:33 pm

Thank you for your answer.

The link to the issues was very helpful to solve the frequency problem.

Regarding the phase shift, I would highly appreciate to maintain a maximum
number of PWM outputs. Thus, a solution - if possible - using only one timer
would be awesome.

fungo16
Posts: 3
Joined: Thu Apr 11, 2019 4:56 pm

Re: Phase Shift of PWM output & Faulty behaviour below 10 Hz

Postby fungo16 » Sun Apr 14, 2019 8:59 pm

I spent a few hours today to assess my issue and I think for the optimize implementation I
have to write my own driver.

As a workaround for now:

Is somebody aware of how to start two MCPWM timers with a delay in between to generate the phaseshift ?

Who is online

Users browsing this forum: jcolebaker and 142 guests