ServoESP32 icon indicating copy to clipboard operation
ServoESP32 copied to clipboard

Servo::detach() can change servo position

Open dkwach opened this issue 3 years ago • 0 comments

it is useful to detach servo after movement in cases like:

  • limit current consumption (servo mechanic could keep position without electronic control for small forces)
  • limit servo vibrations (usually present in cheap servos) - sometimes we can observe vibrations after reaching designed position

In current implementation (if I understood correctly) detach() is not controlling pwm state and can disable pwm during high state and move servo to different position.

It would be great to support some safe detach, which will check if pwm is not in active state and won't change servo position. Proposal for interface:

detach(bool isSafe=false); //false default to keep backward compatibility 
or
safeDetach();

dkwach avatar Oct 31 '22 21:10 dkwach