WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::Koors40 Class Reference

AndyMark Koors40 Motor Controller with PWM control. More...

#include <wpi/hardware/motor/Koors40.hpp>

Inheritance diagram for wpi::Koors40:
wpi::PWMMotorController wpi::MotorController wpi::MotorSafety wpi::util::Sendable wpi::util::SendableHelper< PWMMotorController >

Public Member Functions

 Koors40 (int channel)
 Constructor for a Koors40 connected via PWM.
 Koors40 (Koors40 &&)=default
Koors40operator= (Koors40 &&)=default
Public Member Functions inherited from wpi::PWMMotorController
 PWMMotorController (PWMMotorController &&)=default
PWMMotorControlleroperator= (PWMMotorController &&)=default
void SetDutyCycle (double dutyCycle) override
 Sets the duty cycle of the motor controller.
double GetDutyCycle () const override
 Gets the duty cycle of the motor controller.
virtual wpi::units::volt_t GetVoltage () const
 Gets the voltage output of the motor controller, nominally between -12 V and 12 V.
void SetInverted (bool isInverted) override
 Sets the inversion state of the motor controller.
bool GetInverted () const override
 Gets the inversion state of the motor controller.
void Disable () override
 Disables the motor controller.
void StopMotor () override
 Called to stop the motor when the timeout expires.
std::string GetDescription () const override
 Returns a description to print when an error occurs.
int GetChannel () const
void EnableDeadbandElimination (bool eliminateDeadband)
 Optionally eliminate the deadband from a motor controller.
void AddFollower (PWMMotorController &follower)
 Make the given PWM motor controller follow the output of this one.
template<std::derived_from< PWMMotorController > T>
void AddFollower (T &&follower)
 Make the given PWM motor controller follow the output of this one.
Public Member Functions inherited from wpi::MotorController
virtual ~MotorController ()=default
virtual void SetVoltage (wpi::units::volt_t voltage)
 Sets the voltage output of the motor controller.
Public Member Functions inherited from wpi::MotorSafety
 MotorSafety ()
virtual ~MotorSafety ()
 MotorSafety (MotorSafety &&rhs)
MotorSafetyoperator= (MotorSafety &&rhs)
void Feed ()
 Feed the motor safety object.
void SetExpiration (wpi::units::second_t expirationTime)
 Set the expiration time for the corresponding motor safety object.
wpi::units::second_t GetExpiration () const
 Retrieve the timeout value for the corresponding motor safety object.
bool IsAlive () const
 Determine if the motor is still operating or has timed out.
void SetSafetyEnabled (bool enabled)
 Enable/disable motor safety for this device.
bool IsSafetyEnabled () const
 Return the state of the motor safety enabled flag.
void Check ()
 Check if this motor has exceeded its timeout.
Public Member Functions inherited from wpi::util::Sendable
virtual constexpr ~Sendable ()=default
Public Member Functions inherited from wpi::util::SendableHelper< PWMMotorController >
constexpr SendableHelper (const SendableHelper &rhs)=default
constexpr SendableHelperoperator= (const SendableHelper &rhs)=default

Additional Inherited Members

Static Public Member Functions inherited from wpi::MotorSafety
static void CheckMotors ()
 Check the motors to see if any have timed out.
Protected Member Functions inherited from wpi::PWMMotorController
 PWMMotorController (std::string_view name, int channel)
 Constructor for a PWM Motor Controller connected via PWM.
void InitSendable (wpi::util::SendableBuilder &builder) override
 Initializes this Sendable object.
void SetDutyCycleInternal (double dutyCycle)
double GetDutyCycleInternal () const
void SetBounds (wpi::units::microsecond_t maxPwm, wpi::units::microsecond_t deadbandMaxPwm, wpi::units::microsecond_t centerPwm, wpi::units::microsecond_t deadbandMinPwm, wpi::units::microsecond_t minPwm)
Protected Member Functions inherited from wpi::util::SendableHelper< PWMMotorController >
constexpr ~SendableHelper ()
Protected Attributes inherited from wpi::PWMMotorController
PWM m_pwm
 PWM instances for motor controller.

Detailed Description

AndyMark Koors40 Motor Controller with PWM control.

Note that the Koors40 uses the following bounds for PWM values. These values should work reasonably well for most controllers, but if users experience issues such as asymmetric behavior around the deadband or inability to saturate the controller in either direction, calibration is recommended. The calibration procedure can be found in the Koors40 User Manual available from AndyMark.

  • 2.004ms = full "forward"
  • 1.520ms = the "high end" of the deadband range
  • 1.500ms = center of the deadband range (off)
  • 1.480ms = the "low end" of the deadband range
  • 0.997ms = full "reverse"

Constructor & Destructor Documentation

◆ Koors40() [1/2]

wpi::Koors40::Koors40 ( int channel)
explicit

Constructor for a Koors40 connected via PWM.

Parameters
channelThe PWM channel that the Koors40 is attached to. 0-9 are on-board, 10-19 are on the MXP port

◆ Koors40() [2/2]

wpi::Koors40::Koors40 ( Koors40 && )
default

Member Function Documentation

◆ operator=()

Koors40 & wpi::Koors40::operator= ( Koors40 && )
default

The documentation for this class was generated from the following file: