27#define INTERNAL_AXIS_DAMPER_SCALER 0.7
28#define INTERNAL_AXIS_FRICTION_SCALER 0.7
29#define INTERNAL_AXIS_INERTIA_SCALER 0.7
30#ifndef AXIS_SPEEDLIMITER_P
31#define AXIS_SPEEDLIMITER_P 0.3
33#ifndef AXIS_SPEEDLIMITER_I
34#define AXIS_SPEEDLIMITER_I 0.03
55 uint16_t
power = ADR_AXIS1_POWER;
131 void setPos(uint16_t val);
169 void setGearRatio(uint8_t numerator,uint8_t denominator);
185 std::unique_ptr<MotorDriver>
drv = std::make_unique<MotorDriver>();
186 std::shared_ptr<Encoder>
enc =
nullptr;
201 .pid_torque_flux = 30000,
202 .pid_acc_lim = 2147483647,
203 .pid_vel_lim = 2147483647,
204 .pid_pos_low = -2147483647,
205 .pid_pos_high = 2147483647});
251 const std::array<biquad_constant_t,4>
filterSpeedCst = { {{ 40, 55 }, { 70, 55 }, { 120, 55 }, {180, 55}} };
252 const std::array<biquad_constant_t,4>
filterAccelCst = { {{ 40, 30 }, { 55, 30 }, { 70, 30 }, {120, 55}} };
float effect_margin_scaler
void errorCallback(const Error &error, bool cleared) override
const std::array< biquad_constant_t, 4 > filterAccelCst
float getEncAngle(Encoder *enc)
uint8_t idlespringstrength
const biquad_constant_t filterFrictionCst
AxisFlashAddrs flashAddrs
void startForceFadeIn(float start=0, float fadeTime=0.5)
void setEffectTorque(int32_t torque)
uint16_t nextDegreesOfRotation
Axis(char axis, volatile Control_t *control)
ClassChooser< MotorDriver > drv_chooser
uint8_t frictionIntensity
void setFxStrengthAndFilter(uint8_t val, uint8_t &valToSet, Biquad &filter)
int32_t updateIdleSpringForce()
void setDegrees(uint16_t degrees)
void calculateAxisEffects(bool ffb_on)
bool updateTorque(int32_t *totalTorque)
volatile Control_t * control
std::pair< int32_t, float > scaleEncValue(float angle, uint16_t degrees)
void setIdleSpringStrength(uint8_t spring)
virtual std::string getHelpstring()
uint16_t lastdegreesOfRotation
const Error outOfBoundsError
const ClassType getClassType() override
void setPower(uint16_t power)
MotorDriver * getDriver()
static const std::vector< class_entry< MotorDriver > > axis1_drivers
static const std::vector< class_entry< MotorDriver > > axis2_drivers
void updateMetrics(float new_pos)
static uint16_t encodeConfToInt(AxisConfig conf)
void resetMetrics(float new_pos)
CommandStatus command(const ParsedCommand &cmd, std::vector< CommandReply > &replies)
void setFxRatio(uint8_t val)
ClassChooser< Encoder > enc_chooser
static ClassIdentifier info
void setEncType(uint8_t enctype)
const biquad_constant_t filterDamperCst
void setPos(uint16_t val)
std::shared_ptr< Encoder > enc
int32_t getLastScaledEnc()
void restoreFlash() override
std::unique_ptr< MotorDriver > drv
void setGearRatio(uint8_t numerator, uint8_t denominator)
uint16_t degreesOfRotation
const biquad_constant_t filterInertiaCst
void setDrvType(uint8_t drvtype)
void saveFlash() override
const ClassIdentifier getInfo()
Command handlers always have class infos. Works well with ChoosableClass.
void emergencyStop(bool reset)
const float AXIS_DAMPER_RATIO
static AxisConfig decodeConfFromInt(uint16_t val)
const std::array< biquad_constant_t, 4 > filterSpeedCst
const float AXIS_INERTIA_RATIO
void updateTorqueScaler()
uint16_t speedAccelFilter
bool request_update_disabled