Skip to content

Change motor output recuperation mode #7

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

Open
sporubcan opened this issue Mar 23, 2025 · 0 comments
Open

Change motor output recuperation mode #7

sporubcan opened this issue Mar 23, 2025 · 0 comments

Comments

@sporubcan
Copy link

DRV8833/8836 has two options, how to recuperate motor inductive current during PWM-off state. Currently, the library uses recuperation through body diodes back into the power line capacitors through the driver output MOSFETs body-diodes. This mode is not very good for regulation, because motor current is not linearly dependent on PWM duty.

I strongly recommend to use the other recuperation mode, when bottom MOSFETs of full-bridge short the motor and keep the current circulating. Then is the average motor current proportional to the duty cycle.

Modifications needed:

  • Change line 82 to ledcWrite(_in2Pin, _pwmMaxDutyCycle);
  • Change line 88 to ledcWrite(_in1Pin, _pwmMaxDutyCycle);

(I am not sure right now, whether this will cause as side effect also reverse motor rotation, need to verify before modification)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant