-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
#include <libhal/motor.hpp>
#include <libhal/pwm.hpp>
class dual_pwm_motor : public hal::motor
{
dual_pwm_motor(hal::pwm& p_forward, hal::pwm& p_reverse);
hal::status slow_decay(bool p_enable = true);
};Some motor controllers require two pwm signals to operate with speed control for both forward and reverse operations.
A list of such drivers can be found below:
- https://www.ti.com/lit/ds/symlink/drv8833.pdf
- https://www.st.com/en/motor-drivers/l298.html
- https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4950
This slow_decay() function allows the user to control whether the motor is in slow decay or fast decay mode. The driver should default to slow decay. Fast decay allows the motor to coast when not driven by the driver or when reducing speed. Slow decay means braking when speed is reduced which tends to give a better and more linear drive response for control.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request