Control

These functions provide motor control without using effects from Feelix and are based on the SimpleFOC library. Visit simplefoc.com for more details.

Move Motor

  • In torque mode MotionControlType::torque the targetValue sets the voltage.

  • In angle mode MotionControlType::angle the targetValue sets the target position (radians).

  • In velocity mode MotionControlType::velocity the targetValue sets 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

transmission factor = (teeth of driven gear) ÷ (teeth of driving gear)

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?