Servo Position Status Variable?


#1

Does the GoPiGo hardware maintain a “last servo angle cmd” status variable? (I don’t see a “getter” in gopigo.py )

My servo tends to move on its own when not enabled, so it probably would be unreliable. Perhaps that is reason not to keep it around.


#2

Hi @cyclicalobsessive,

You’re right.
We don’t have a getter for the servo position.
I think we’ll implement it in the near future - this could work by regularly updating the servo, so that we avoid having the servo move on its own.


My servo tends to move on its own when not enabled, so it probably would be unreliable. Perhaps that is reason not to keep it around.

I think this post should help you understand why it’s moving sometimes :
forum.dexterindustries.com/t/solved-servo-trouble-servo-moves-unexpectedly-on-power-up-and-during-regular-operation/3137/3

This can also happen while the servo is not activated. Interferences might be the cause.
I haven’t tried, but maybe writing to the servo port digitalWrite(servo_pin, 0) might hold the line down and prevent the servo from rotating while it’s not operational. Again, it’s something I haven’t tested and it might not work.


Thank you!