JMotor
Loading...
Searching...
No Matches
JMotorControllerBase.h
Go to the documentation of this file.
1#ifndef J_MOTOR_CONTROLLER_BASE_H
2#define J_MOTOR_CONTROLLER_BASE_H
3#include <Arduino.h>
8public:
14 virtual void setAccelLimit(float _accelLimit) = 0;
15
21 virtual void setVelLimit(float _velLimit) = 0;
22
29 virtual void setVel(float vel, bool _run = true) = 0;
30
37 virtual void setVelTarget(float vel, bool _run = true) = 0;
38
43 virtual float getVelTarget() = 0;
44
49 virtual float getVel() = 0;
50
55 virtual float getDriverSetVal() = 0;
56
61 virtual void run() = 0;
62
69 virtual bool setEnable(bool _enable) = 0;
70
75 virtual bool isDriverInRange() = 0;
76
81 virtual bool enable() = 0;
82
87 virtual bool disable() = 0;
88
93 virtual float getDriverMinRange() = 0;
94
99 virtual float getDriverMaxRange() = 0;
100
105 virtual bool getEnable() = 0;
106
112 virtual float getMaxVel() = 0;
113
117 virtual float getMinVel() = 0;
118
123 virtual void setMaxDriverRangeAmount(float _driverRangeAmount) = 0;
124
129 virtual float getAccelLimit() = 0;
130
135 virtual float getVelLimit() = 0;
136};
138#endif
This class defines a common interface for classes which control velocity of a motor controlled by a J...
Definition JMotorControllerBase.h:7
virtual void setAccelLimit(float _accelLimit)=0
set maximum rate that motor speed can be changed at
virtual void setVelTarget(float vel, bool _run=true)=0
set target velocity for controller (acceleration limited)
virtual float getVel()=0
get current velocity of motor
virtual float getVelTarget()=0
get target velocity for controller
virtual bool enable()=0
enable motor controller
virtual void setVel(float vel, bool _run=true)=0
set velocity for controller
virtual void setVelLimit(float _velLimit)=0
set maximum motor speed
virtual bool disable()=0
disable motor controller
virtual float getDriverMaxRange()=0
if getDriverSetVal exceeds this, isDriverInRange will go false
virtual void setMaxDriverRangeAmount(float _driverRangeAmount)=0
set what fraction of driverRange can be used
virtual float getDriverMinRange()=0
if getDriverSetVal goes below this, isDriverInRange will go false
virtual bool isDriverInRange()=0
true if motor driver is being set to within its range, false if driver is at a maximum
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 getVelLimit()=0
returns value of velLimit
virtual float getDriverSetVal()=0
returns the value the motor driver is being set to
virtual float getMinVel()=0
slowest speed motor can go
virtual void run()=0
update driver
virtual float getAccelLimit()=0
returns value of accelLimit
virtual bool setEnable(bool _enable)=0
change whether motor controller is enabled