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

Converts from speed to driver input compensating for motors not being perfect. More...

#include <JMotorCompStandard.h>

Inheritance diagram for JMotorCompStandard:
Inheritance graph
[legend]
Collaboration diagram for JMotorCompStandard:
Collaboration graph
[legend]

Public Member Functions

 JMotorCompStandard (JVoltageCompensator &_voltComp, JMotorCompStandardConfig _config, float _multiplier=1.0)
 Converts from speed to driver input compensating for motors not being perfect.
 
float compensate (float val)
 calculate
 
void setConfig (JMotorCompStandardConfig &_config)
 
float getMaxVel ()
 How fast of a motor speed setting would get adjusted to full motor power.
 
float getMinVel ()
 Slowest speed motor can go.
 
void setMultiplier (float _multiplier)
 
- Public Member Functions inherited from JMotorCompensator
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
 
float getDriverRange ()
 get what value makes the driver output 100% of supply voltage
 
float getMaxDriverRangeAmount ()
 get what fraction of driverRange can be used
 

Additional Inherited Members

- Protected Attributes inherited from JMotorCompensator
float driverRange = 1.0
 
float maxDriverRange = 1.0
 

Detailed Description

Converts from speed to driver input compensating for motors not being perfect.

Constructor & Destructor Documentation

◆ JMotorCompStandard()

JMotorCompStandard::JMotorCompStandard ( JVoltageCompensator _voltComp,
JMotorCompStandardConfig  _config,
float  _multiplier = 1.0 
)
inline

Converts from speed to driver input compensating for motors not being perfect.

Parameters
_voltCompreference to JVoltageCompensator to convert voltage to driver input
_configJMotorCompStandardConfig (settings for your motor)
_multipliermultiplier for speed input, optional, default 1.0

Member Function Documentation

◆ compensate()

float JMotorCompStandard::compensate ( float  val)
inlinevirtual

calculate

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

Reimplemented from JMotorCompensator.

◆ getMaxVel()

float JMotorCompStandard::getMaxVel ( )
inlinevirtual

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 from JMotorCompensator.

◆ getMinVel()

float JMotorCompStandard::getMinVel ( )
inlinevirtual

Slowest speed motor can go.

Return values
(float)

Reimplemented from JMotorCompensator.

◆ setConfig()

void JMotorCompStandard::setConfig ( JMotorCompStandardConfig _config)
inline

◆ setMultiplier()

void JMotorCompStandard::setMultiplier ( float  _multiplier)
inline

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