JMotor
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JMotorControllerBase Class Referenceabstract

This class defines a common interface for classes which control velocity of a motor controlled by a JMotorDriver. More...

#include <JMotorControllerBase.h>

Inheritance diagram for JMotorControllerBase:
Inheritance graph
[legend]

Public Member Functions

virtual void setAccelLimit (float _accelLimit)=0
 set maximum rate that motor speed can be changed at
 
virtual void setVelLimit (float _velLimit)=0
 set maximum motor speed
 
virtual void setVel (float vel, bool _run=true)=0
 set velocity for controller
 
virtual void setVelTarget (float vel, bool _run=true)=0
 set target velocity for controller (acceleration limited)
 
virtual float getVelTarget ()=0
 get target velocity for controller
 
virtual float getVel ()=0
 get current velocity of motor
 
virtual float getDriverSetVal ()=0
 returns the value the motor driver is being set to
 
virtual void run ()=0
 update driver
 
virtual bool setEnable (bool _enable)=0
 change whether motor controller is enabled
 
virtual bool isDriverInRange ()=0
 true if motor driver is being set to within its range, false if driver is at a maximum
 
virtual bool enable ()=0
 enable motor controller
 
virtual bool disable ()=0
 disable motor controller
 
virtual float getDriverMinRange ()=0
 if getDriverSetVal goes below this, isDriverInRange will go false
 
virtual float getDriverMaxRange ()=0
 if getDriverSetVal exceeds this, isDriverInRange will go false
 
virtual bool getEnable ()=0
 is the controller enabled
 
virtual float getMaxVel ()=0
 How fast of a motor speed setting would get adjusted to full motor power.
 
virtual float getMinVel ()=0
 slowest speed motor can go
 
virtual void setMaxDriverRangeAmount (float _driverRangeAmount)=0
 set what fraction of driverRange can be used
 
virtual float getAccelLimit ()=0
 returns value of accelLimit
 
virtual float getVelLimit ()=0
 returns value of velLimit
 

Detailed Description

This class defines a common interface for classes which control velocity of a motor controlled by a JMotorDriver.

Member Function Documentation

◆ disable()

virtual bool JMotorControllerBase::disable ( )
pure virtual

disable motor controller

Return values
(bool)true if state changed

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ enable()

virtual bool JMotorControllerBase::enable ( )
pure virtual

enable motor controller

Return values
(bool)true if state changed

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getAccelLimit()

virtual float JMotorControllerBase::getAccelLimit ( )
pure virtual

returns value of accelLimit

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getDriverMaxRange()

virtual float JMotorControllerBase::getDriverMaxRange ( )
pure virtual

if getDriverSetVal exceeds this, isDriverInRange will go false

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getDriverMinRange()

virtual float JMotorControllerBase::getDriverMinRange ( )
pure virtual

if getDriverSetVal goes below this, isDriverInRange will go false

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getDriverSetVal()

virtual float JMotorControllerBase::getDriverSetVal ( )
pure virtual

returns the value the motor driver is being set to

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getEnable()

virtual bool JMotorControllerBase::getEnable ( )
pure virtual

is the controller enabled

Return values
(bool)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getMaxVel()

virtual float JMotorControllerBase::getMaxVel ( )
pure 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)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getMinVel()

virtual float JMotorControllerBase::getMinVel ( )
pure virtual

slowest speed motor can go

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getVel()

virtual float JMotorControllerBase::getVel ( )
pure virtual

get current velocity of motor

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getVelLimit()

virtual float JMotorControllerBase::getVelLimit ( )
pure virtual

returns value of velLimit

Return values
(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ getVelTarget()

virtual float JMotorControllerBase::getVelTarget ( )
pure virtual

get target velocity for controller

Return values
(float)current velocity target

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ isDriverInRange()

virtual bool JMotorControllerBase::isDriverInRange ( )
pure virtual

true if motor driver is being set to within its range, false if driver is at a maximum

Return values
(bool)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ run()

virtual void JMotorControllerBase::run ( )
pure virtual

◆ setAccelLimit()

virtual void JMotorControllerBase::setAccelLimit ( float  _accelLimit)
pure virtual

set maximum rate that motor speed can be changed at

Note
set to INFINITY to disable acceleration limiting
Parameters
_accelLimit(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, JMotorControllerOpen, and JServoController.

◆ setEnable()

virtual bool JMotorControllerBase::setEnable ( bool  _enable)
pure virtual

change whether motor controller is enabled

Parameters
_enable(bool)
Note
velocity related variables are reset to zero on disable. you can set velocity then enable
Return values
(bool)true if state changed

Implemented in JMotorControllerBasic, JMotorControllerClosed, JMotorControllerOpen, JServoController, and JServoControllerAdvanced.

◆ setMaxDriverRangeAmount()

virtual void JMotorControllerBase::setMaxDriverRangeAmount ( float  _driverRangeAmount)
pure virtual

set what fraction of driverRange can be used

Parameters
_driverRangeAmount(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, and JServoController.

◆ setVel()

virtual void JMotorControllerBase::setVel ( float  vel,
bool  _run = true 
)
pure virtual

set velocity for controller

Note
this function can be called repeatedly, or just once if run() is called frequently
Parameters
vel(float)
_run(bool) default:true, true = call run() in this function, false = you'll call run() yourself

Implemented in JMotorControllerBasic, JMotorControllerClosed, JMotorControllerOpen, and JServoController.

◆ setVelLimit()

virtual void JMotorControllerBase::setVelLimit ( float  _velLimit)
pure virtual

set maximum motor speed

Note
set to INFINITY to disable velocity limiting
Parameters
_velLimit(float)

Implemented in JMotorControllerBasic, JMotorControllerClosed, JMotorControllerOpen, JMotorController, and JServoController.

◆ setVelTarget()

virtual void JMotorControllerBase::setVelTarget ( float  vel,
bool  _run = true 
)
pure virtual

set target velocity for controller (acceleration limited)

Note
this function can be called repeatedly, or just once if run() is called frequently
Parameters
vel(float) target velocity
_run(bool) default:true, true = call run() in this function, false = you'll call run() yourself

Implemented in JMotorControllerBasic, JMotorControllerClosed, JMotorControllerOpen, and JServoController.


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