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

Converts from speed to driver input compensating for variable supply voltage. More...

#include <JMotorCompBasic.h>

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

Public Member Functions

 JMotorCompBasic (JVoltageCompensator &_voltComp, float _voltsPerSpeed, float _minSpeed)
 Converts from speed to driver input compensating for variable supply voltage.
 
float compensate (float val)
 calculate
 
float getMaxVel ()
 How fast of a motor speed setting would get adjusted to full motor power.
 
float getMinVel ()
 Slowest speed motor can go.
 
void setVoltsPerSpeed (float _voltsPerSpeed)
 
float getVoltsPerSpeed ()
 
void setMinSpeed (float _speed)
 
- 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 variable supply voltage.

Constructor & Destructor Documentation

◆ JMotorCompBasic()

JMotorCompBasic::JMotorCompBasic ( JVoltageCompensator _voltComp,
float  _voltsPerSpeed,
float  _minSpeed 
)
inline

Converts from speed to driver input compensating for variable supply voltage.

Parameters
_voltCompreference to JVoltageCompensator to convert voltage to driver input
_voltsPerSpeedmultiplier for speed input, units: voltage per speed
_minSpeedif the motor is told to go slower than this speed, just turn it off

Member Function Documentation

◆ compensate()

float JMotorCompBasic::compensate ( float  val)
inlinevirtual

calculate

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

Reimplemented from JMotorCompensator.

◆ getMaxVel()

float JMotorCompBasic::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 JMotorCompBasic::getMinVel ( )
inlinevirtual

Slowest speed motor can go.

Return values
(float)

Reimplemented from JMotorCompensator.

◆ getVoltsPerSpeed()

float JMotorCompBasic::getVoltsPerSpeed ( )
inline

◆ setMinSpeed()

void JMotorCompBasic::setMinSpeed ( float  _speed)
inline

◆ setVoltsPerSpeed()

void JMotorCompBasic::setVoltsPerSpeed ( float  _voltsPerSpeed)
inline

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