JMotor
Loading...
Searching...
No Matches
JMotorController.h
Go to the documentation of this file.
1#ifndef J_MOTOR_CONTROLLER_H
2#define J_MOTOR_CONTROLLER_H
4#include <Arduino.h>
8class JMotorController : public virtual JMotorControllerBase {
9public:
16 virtual bool setPosTarget(float _posTarget, bool _run = true) = 0;
17
25 virtual bool setPosSetpoint(float _posSetpoint, bool _run = true) = 0;
26
35 virtual bool setPosDelta(float _posDelta, bool _run = true, bool _resetPos = false) = 0;
36
41 virtual float getPosTarget() = 0;
42
47 virtual float getPosSetpoint() = 0;
48
53 virtual float getPos() = 0;
54
60 virtual float resetPos() = 0;
66 virtual void setVelLimit(float _velLimit) = 0;
67
72 virtual bool isPosModeNotVelocity() = 0;
73};
77#endif
This class defines a common interface for classes which control velocity of a motor controlled by a J...
Definition JMotorControllerBase.h:7
This class defines a common interface for classes which control velocity and position of a motor cont...
Definition JMotorController.h:8
virtual float resetPos()=0
reset what position the controller thinks it's in
virtual float getPos()=0
get what position the motor is currently at
virtual void setVelLimit(float _velLimit)=0
set maximum motor speed
virtual float getPosTarget()=0
get position set as target (for smoothed position setting mode)
virtual float getPosSetpoint()=0
get position controller is currently trying to get to
virtual bool setPosTarget(float _posTarget, bool _run=true)=0
set target position (motor drives towards position, following acceleration profile)
virtual bool setPosSetpoint(float _posSetpoint, bool _run=true)=0
set position for motor to drive towards position as fast as possible (setpoint for control loop if av...
virtual bool isPosModeNotVelocity()=0
true if controller is in position target mode, false if in velocity mode
virtual bool setPosDelta(float _posDelta, bool _run=true, bool _resetPos=false)=0
alternative method for setting velocity that uses setPosSetpoint