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

convert voltage to value needed to set driver at to get that voltage, uses reference to variable that should be equal to measured supply voltage More...

#include <JVoltageCompAdjust.h>

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

Public Member Functions

 JVoltageCompAdjust (float &_supplyVoltage)
 constructor
 
float adjust (float voltage, float driverRange)
 do conversion
 
void changeSupplyVoltageVariable (float &_supplyVoltage)
 if for some reason you want to provide a new reference to a variable that contains the current voltage supplied to the motor controller
 
float getSupplyVoltage ()
 

Detailed Description

convert voltage to value needed to set driver at to get that voltage, uses reference to variable that should be equal to measured supply voltage

Constructor & Destructor Documentation

◆ JVoltageCompAdjust()

JVoltageCompAdjust::JVoltageCompAdjust ( float &  _supplyVoltage)
inline

constructor

Parameters
_supplyVoltage(float) reference to a variable that contains the current voltage supplied to the motor controller
_driverRange(float) what value makes the driver output 100% of supply voltage (default=1.0)
Return values

Member Function Documentation

◆ adjust()

float JVoltageCompAdjust::adjust ( float  voltage,
float  driverRange 
)
inlinevirtual

do conversion

Parameters
voltage(float) voltage wanted from motor driver output
driverRange(float) set what value makes the driver output 100% of supply voltage
Return values
(float)value to set driver at

Reimplemented from JVoltageCompensator.

◆ changeSupplyVoltageVariable()

void JVoltageCompAdjust::changeSupplyVoltageVariable ( float &  _supplyVoltage)
inline

if for some reason you want to provide a new reference to a variable that contains the current voltage supplied to the motor controller

Parameters
_supplyVoltage(float)

◆ getSupplyVoltage()

float JVoltageCompAdjust::getSupplyVoltage ( )
inlinevirtual
Return values
(float)returns current supply voltage

Reimplemented from JVoltageCompensator.


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