Control
These functions provide motor control without using effects from Feelix and are based on the SimpleFOC library. Visit simplefoc.com for more details.
This code works with the Feelix Effect Arduino Library
Move Motor
In torque mode
MotionControlType::torquethetargetValuesets the voltage.In angle mode
MotionControlType::anglethetargetValuesets the target position (radians).In velocity mode
MotionControlType::velocitythetargetValuesets the target speed (rad/s).
feelix.move_feelix(float targetValue, MotionControlType controlType);Motor Control Parameters
PID controller settings (more information)
Angle PID
feelix.bldc->P_angle.P = 14.0;
feelix.bldc->P_angle.I = 0.0;
feelix.bldc->P_angle.D = 0.0;Velocity PID
feelix.bldc->PID_velocity.P = 0.5;
feelix.bldc->PID_velocity.I = 10.0;
feelix.bldc->PID_velocity.D = 0.0;Functions and Parameters
Set rotation range
rangeMin – start position in degrees (default: 0)
rangeMax – end position in degrees (default: 360)
updateStartPos (optional) – set current position to zero (default: true)
Constrain range within which effects can be played
Set voltage limit
Set velocity limit
Transmission Factor
Setting this factor lets you account for gear ratios so motion is calculated at the output shaft rather than just at the motor.
Last updated
Was this helpful?