1#ifndef J_MOTOR_CONTROLLER_OPEN_H
2#define J_MOTOR_CONTROLLER_OPEN_H
6#include <Derivs_Limiter.h>
37 ,
dL(Derivs_Limiter(_velLimit, _accelLimit))
141 bool setPosDelta(
float _posDelta,
bool _run =
true,
bool _resetPos =
false)
This class defines a common interface for converting from speed to driver input. It should compensate...
Definition JMotorCompensator.h:9
A motor controller object that uses a JMotorCompensator to set velocity of a motor.
Definition JMotorControllerBasic.h:12
void setVelLimit(float _velLimit)
set maximum motor speed
Definition JMotorControllerBasic.h:52
bool setEnable(bool _enable)
change whether motor controller is enabled
Definition JMotorControllerBasic.h:108
void run()
update driver
Definition JMotorControllerBasic.h:87
float accelLimit
Definition JMotorControllerBasic.h:17
float velocityTarget
Definition JMotorControllerBasic.h:16
float velLimit
Definition JMotorControllerBasic.h:18
void setVel(float vel, bool _run=true)
set velocity for controller
Definition JMotorControllerBasic.h:57
float getMinVel()
slowest speed motor can go
Definition JMotorControllerBasic.h:153
float velocity
Definition JMotorControllerBasic.h:14
bool getEnable()
is the controller enabled
Definition JMotorControllerBasic.h:143
float getMaxVel()
How fast of a motor speed setting would get adjusted to full motor power.
Definition JMotorControllerBasic.h:148
void setAccelLimit(float _accelLimit)
set maximum rate that motor speed can be changed at
Definition JMotorControllerBasic.h:47
This class defines a common interface for classes which control velocity and position of a motor cont...
Definition JMotorController.h:8
This class controls velocity and position of a motor without any encoder feedback.
Definition JMotorControllerOpen.h:10
void setVelTarget(float vel, bool _run=true)
set target velocity for controller (acceleration limited)
Definition JMotorControllerOpen.h:191
void setVelAccelLimits(float _vel, float _accel)
set velocity and acceleration limits for motor
Definition JMotorControllerOpen.h:214
void setVel(float vel, bool _run=true)
set velocity for controller
Definition JMotorControllerOpen.h:183
float getPosTarget()
get position set as target (for smoothed position setting mode)
Definition JMotorControllerOpen.h:155
bool setPosTarget(float _posTarget, bool _run=true)
set target position (motor drives towards position, following acceleration profile)
Definition JMotorControllerOpen.h:104
bool posMode
Definition JMotorControllerOpen.h:12
bool setPosDelta(float _posDelta, bool _run=true, bool _resetPos=false)
alternative method for setting velocity that uses setPosSetpoint
Definition JMotorControllerOpen.h:141
bool isPosModeNotVelocity()
true if controller is in position target mode, false if in velocity mode
Definition JMotorControllerOpen.h:177
float positionTarget
Definition JMotorControllerOpen.h:15
bool setEnable(bool _enable)
change whether motor controller is enabled
Definition JMotorControllerOpen.h:94
bool setPosSetpoint(float _posSetpoint, bool _run=true)
set position for motor to drive towards position as fast as possible (setpoint for control loop if av...
Definition JMotorControllerOpen.h:125
float posDelta
Definition JMotorControllerOpen.h:16
float resetPos()
reset what position the controller thinks it's in
Definition JMotorControllerOpen.h:167
void setMinMotorPulseTime(unsigned long _minMotorPulseTime)
At low speeds in setPosDelta the motor cycles between min speed and stopped. What is the minimum puls...
Definition JMotorControllerOpen.h:224
float position
Definition JMotorControllerOpen.h:14
unsigned long lastRunOpenMicros
Definition JMotorControllerOpen.h:17
void run()
update driver
Definition JMotorControllerOpen.h:49
unsigned long minMotorPulseTime
Definition JMotorControllerOpen.h:18
void setAccelLimit(float _accelLimit)
set maximum rate that motor speed can be changed at
Definition JMotorControllerOpen.h:203
Derivs_Limiter dL
use functions from JMotorControllerOpen whenever possible, but the Derivs_Limiter object is public in...
Definition JMotorControllerOpen.h:26
float getPosSetpoint()
get position controller is currently trying to get to
Definition JMotorControllerOpen.h:159
void setVelLimit(float _velLimit)
set maximum motor speed
Definition JMotorControllerOpen.h:198
JMotorControllerOpen(JMotorDriver &_driver, JMotorCompensator &_compensator, float _velLimit=INFINITY, float _accelLimit=INFINITY, unsigned long _minMotorPulseTime=0)
Constructor for an object that controls a motor, and can smooth the motion of the motor and go approx...
Definition JMotorControllerOpen.h:35
bool smoothedMode
Definition JMotorControllerOpen.h:13
float getPos()
get what position the motor is currently at
Definition JMotorControllerOpen.h:163
unsigned long lastPosDeltaWrite
Definition JMotorControllerOpen.h:19
defines common interface for all types of JMotorDrivers
Definition JMotorDriver.h:10