-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inverting the mcpwm dead-time output is not selective per generator (IDFGH-10050) #11327
Comments
Hi @moefear85 the inverting is not applied to either generator, it's applied to the "deadtime path". mcpwm_dead_time_config_t dead_time_config = {
.posedge_delay_ticks = 50,
.negedge_delay_ticks = 0
};
ESP_ERROR_CHECK(mcpwm_generator_set_dead_time(gena, gena, &dead_time_config)); This way, we're applying the dead time to the dead_time_config.posedge_delay_ticks = 0;
dead_time_config.negedge_delay_ticks = 100;
dead_time_config.flags.invert_output = true;
ESP_ERROR_CHECK(mcpwm_generator_set_dead_time(gena, genb, &dead_time_config)); Now we're producing S2 and S3 are independent. The result is woking as expected: |
The documentation clearly is claiming that the inversion is done on the signal, not on the edgeness of the dead-time (whether applied to positive or negative). So if you are claiming the latter, then the documentation is not just misleading, it is outright wrong, and that still needs to be corrected. Also, the o-scope diagram does not show anything, because it is unclear what is changing before and after applying the inversion. there are no labels. did you really miss that? Anyways it's up to you to fix the problem. In case anyone wants to invert the signal, it is possible over the gpio matrix using the generator. |
@moefear85 |
Okay, this is the hardware limitation: Based on your snippet code, if we change the mcpwm_dead_time_config_t deadtime_config_H = {.negedge_delay_ticks = 1}; Then you can see the inverter works only for generator1, not for generator0. We will update the programming guide to mention this limitation. |
This is a hardware limitation, one delay module can only be used by one generator at one time. Closes #11327
This is a hardware limitation, one delay module can only be used by one generator at one time. Closes #11327
Please tell me which document this drawing is from? |
Answers checklist.
IDF version.
fatal: No names found, cannot describe anything. (I'm on latest master).
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
esp32 rev1 module
Power Supply used.
External 3.3V
What is the expected behavior?
from the page MCPWM Dead-Times, I feel it is correct to assume that it is possible to selectively invert the output for only one signal but not the other, by setting
dead_time_config.flags.invert_output = true;
as in the following excerpt from that page:When I try it myself, I expect it to selectively invert only one signal but not the other.
What is the actual behavior?
Either both signals are inverted simultaneously, or neither.
Steps to reproduce.
This bug exists since a long time, at least many months. Only now have I been able to distill a minimal example that exposes it (it is a c++ project, in case that is relevant):
Debug Logs.
No response
More Information.
I know you might object that I've got the generators wrong in the call to
mcpwm_generator_set_dead_time(...)
, but not only is the documentation confusing as to what it actually means, and not only does everything else work fine when I use the combination as above, but also there are 16 possible combinations in total, and I've iterated over all of them. Neither one produces the desired output.So if selective inversion truly is possible, and there is a combination of generators that works, then there must be a bug in the library.
The text was updated successfully, but these errors were encountered: