-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
MCPWM: both low level at complementary pwm's with dead time. #12237
Comments
Please related commit: 5680d28 |
I saw the commit and Note at
but I can find how to set S1 and S2 to low. |
because there's an extra inversion introduced by the deadtime, so when you call Same situation in this example: https://github.com/espressif/esp-idf/blob/master/examples/peripherals/mcpwm/mcpwm_bldc_hall_control/main/mcpwm_bldc_hall_control_example_main.c#L109-L111 |
I try both: lines L369 and L370
but |
hi @IhorNehrutsa I think we get your point now. The reason why you always get a high level on Generator A is that, the generator B is derived from Generator A by the dead time module. So you lost the control of the generator B. something like this: flowchart LR
Generator_A --> Generator-Action-Setting-A --> Dead-time-A --> output_A
Generator-Action-Setting-A --> Dead-time-B --> output_B
A way to walk through is: flowchart LR
Generator_A --> Generator-Action-Setting-A --> Dead-time-A --> output_A
Generator_B --> Generator-Action-Setting-B --> Dead-time-B --> output_B
You can refer to this example for configuring the MCPWM generators and dead time independently. |
@suda-morris |
Answers checklist.
General issue report
I try to use MCPWM in 2MCPWM/4IN full H-Bridge driver for brushed DC motor
in
MicroPython/ESP32/MCPWM: Add motor control MCPWM driver.
I use Dead Time Configurations for Classical PWM Waveforms
Active High Complementary mode
I need five output states for half-bridge
![image](https://private-user-images.githubusercontent.com/70886343/267599486-3aa06c91-9c8d-4c41-a1df-bd4c42456be4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2ODg0MDksIm5iZiI6MTcxOTY4ODEwOSwicGF0aCI6Ii83MDg4NjM0My8yNjc1OTk0ODYtM2FhMDZjOTEtOWM4ZC00YzQxLWExZGYtYmQ0YzQyNDU2YmU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDE5MDgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyOGY5Yzg1NTM4MjU3YmI5ODExMGMxODFkNTQwNTA0ZWNmNmVjMGQ4NmFhNjZkMWJmMzUzZGE4NjNkOWZhNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.myoONkpVlCS7-xq0MltOden1xuIGzLMtfIBTOPio5hw)
where:
MCPWM1 - High side left aka S1 and Low side left aka S2
MCPWM2 - High side right aka S3 and Low side right aka S4
PWM and _PWM are complementary pwm's at MCPWMx
I can set states 1 an 2 by mcpwm_comparator_set_compare_value().
I can set states 4 an 5 by mcpwm_generator_set_force_level().
But I can not set state 3 with mcpwm_generator_set_force_level().
I need both output MCPWMx in LOW level.
DC5V~27V 5A DC Motor Driver Board Module Reversible Speed Control "H" Bridge PWM Signal Controller
Thanks.
I saw that @suda-morris is MCPWM developer.
The text was updated successfully, but these errors were encountered: