FRC4564 / Maestro

Python class to support Pololu's Maestro servo controller over USB serial. Great with Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you to turn off and on (disable/enable) a channel that is stuck in a feedback loop?

vcalukovic opened this issue · comments

Hi,

I have a question about what I can best do when the servo is stuck in a feedback loop. When I set a target for the servo channel, it sometimes happens that the target it not fully reached and the servo keeps trying to get to the indicated position. This has happened for different target values. Unfortunately, I cannot tell it to stop the PWM sending, as only one of the channels has that option, and I plan on using two channels. I tried to fix it with this code, by simply restating the target when getting close to it, but it doesn't always solve the problem:

if abs(servo.getPosition(0) - target) < 5.:
    servo.setTarget(0, servo.getPosition(0))
    servo.close()

Even when you close the servo, the servo keeps working and you have to disable it manualy in the Maestro Control Center. Besides, you'd rather not have to fully close and reconnect the servo after each target statement, but rather only temporarily the channel that is experiencing issues. It's just that I don't know how best to define the rapid back-and-forth positions when it's stuck, since you don't have an iterative overview of all positions as the target it set.

I've tried using the fact that it's moving as a control condition, but while jammed/stuck in the loop it claimes it's not moving, even though you can hear it vibrating and working. This makes it difficult for me to pinpoint a solution, other than "keep the Maestro Control Center at hand in case of emergency".

In the Maestro Control Center I've also experienced this same problem, but there I could avoid damage to the servo controller by manually disabling the respective channel. Is there a way to also do this through python? Or are there other suggestions?
Are the settings like speed and acceleration relevant for this? I tend to use v=10 and a=5, but have this problem for different values as well.

Thanks!
Vera

Discussed in the "How do you immediately stop a servo's movement?" issue. Might be something that should be solved in a different way than through the Maestro code.