Skip to content

Change motor output recuperation mode #7

@sporubcan

Description

@sporubcan

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions