Hey guys I need your help.
I’m sorry in advance if this is a stupid question but it is exceeding my current programming skills.
I am currently bulding a cable driven robot for my final project and running out of time. Motors: Hoverboard Motors, ESP32 S3, Driver: Self built (working as intended), Encoder: AS5600 (I know it’s not recommended but working fine for now, will upgrade).
In short:
I am calculating the target angle and torque of the Motors in ROS and sending them to the 4 ESP32.
The motors need to be controlled in position control, to make sure the ropes reach their desired length BUT the motors must NEVER apply less than a minimum torque, to keep the cables tensioned.
So even if the target angle is in the clockwise direction, the Motor must always pull counter clockwise with a minimum torque. The motor can never actively unwind itself, otherwise the cable loses tension and falls off the pulleys. The Motor will reach it’s desired angle, becaus all the other ropes can pull stronger and unwind it while keeping all ropes tensioned.
I tried implementing this in the feedforward torque/current, but the PID Controller can “overrule” the feedforward current e.g. if the minimum torque is 1Nm and the PID controllers output is -2Nm, the Motor will apply -1Nm and unwind the cable.
I tried solving it with claude and it said to “clamp” the motor current setpoint to a minimum with this function after the motor.loopFOC() and motor.move(target_angle):
motor.current_sp = max(motor.current_sp, MIN_CURRENT_A)
This describes exactly what I want and makes perfect sense in my opinion.
However I can’t find motor.current_sp in any example program or variables. Where do i implement this function?
Thanks for every answer
Felix
