JMotor
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
JMotorCompensator Class Reference

This class defines a common interface for converting from speed to driver input. It should compensate for factors like motor response and supply voltage. More...

#include <JMotorCompensator.h>

Inheritance diagram for JMotorCompensator:
Inheritance graph
[legend]

Public Member Functions

void setDriverRange (float _driverRange)
 set what value makes the driver output 100% of supply voltage
 
void setMaxDriverRangeAmount (float _driverRangeAmount)
 set what fraction of driverRange can be used
 
virtual float compensate (float val)
 calculate
 
virtual float getMaxVel ()
 How fast of a motor speed setting would get adjusted to full motor power.
 
virtual float getMinVel ()
 Slowest speed motor can go.
 
float getDriverRange ()
 get what value makes the driver output 100% of supply voltage
 
float getMaxDriverRangeAmount ()
 get what fraction of driverRange can be used
 

Protected Attributes

float driverRange = 1.0
 
float maxDriverRange = 1.0
 

Detailed Description

This class defines a common interface for converting from speed to driver input. It should compensate for factors like motor response and supply voltage.

Member Function Documentation

◆ compensate()

virtual float JMotorCompensator::compensate ( float  val)
virtual

calculate

Parameters
val(float) speed
Return values
(float)value to set driver

Reimplemented in JMotorCompBasic, JMotorCompDirect, and JMotorCompStandard.

◆ getDriverRange()

float JMotorCompensator::getDriverRange ( )
inline

get what value makes the driver output 100% of supply voltage

Return values
(float)

◆ getMaxDriverRangeAmount()

float JMotorCompensator::getMaxDriverRangeAmount ( )
inline

get what fraction of driverRange can be used

Return values
(float)

◆ getMaxVel()

virtual float JMotorCompensator::getMaxVel ( )
virtual

How fast of a motor speed setting would get adjusted to full motor power.

Note
may change as battery voltage changes
Return values
(float)

Reimplemented in JMotorCompBasic, JMotorCompDirect, and JMotorCompStandard.

◆ getMinVel()

virtual float JMotorCompensator::getMinVel ( )
virtual

Slowest speed motor can go.

Return values
(float)

Reimplemented in JMotorCompBasic, JMotorCompDirect, and JMotorCompStandard.

◆ setDriverRange()

void JMotorCompensator::setDriverRange ( float  _driverRange)
inline

set what value makes the driver output 100% of supply voltage

Parameters
_driverRange(float) max range of driver

◆ setMaxDriverRangeAmount()

void JMotorCompensator::setMaxDriverRangeAmount ( float  _driverRangeAmount)
inline

set what fraction of driverRange can be used

Parameters
_driverRangeAmount(float)

Member Data Documentation

◆ driverRange

float JMotorCompensator::driverRange = 1.0
protected

◆ maxDriverRange

float JMotorCompensator::maxDriverRange = 1.0
protected

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