Skip to content

Add hal::soft::dual_pwm_motor implementation #22

@kammce

Description

@kammce
#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:

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions