Explain like I'm 5: torque control

You can implement your own Spring-Damper PD on top of the torque layer of SimpleFOC, so something like:

MotionControlType::torque

and then feed the torque controller with something like:

float targetTorque = Kp * (targetPos - motorPos) + Kd * (targetVel - motorVel);

motor.move(targetTorque);
motor.loopFOC();

Set Kp = 0.0f so you can move freely, set targetVel = 0.0f then tune Kd, it’s going to be basically like a Damper.

1 Like