0

Adafruit_PWMServoDriver how to stop sending a signal the ser
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_PWMServoDriver how to stop sending a signal the ser

by funvill on Fri Mar 10, 2017 11:19 pm

I have a Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685 board that is powering 16x unloaded servos. I am using a Arduino nano with the Adafruit_PWMServoDriver library.

The servos need to move once every few mins, most of the time they are idle. While the servos are idle they make a small noise, that i assume is them attempting to get the "perfect" alignment. While the servos are not moving I would like to turn off the signal to the servos in hopes to remove this sound.

How do I turn off the signal going to the servos with the Adafruit_PWMServoDriver library ?

If anyone is curious here is more information on my project.
https://github.com/funvill/mathclock

funvill
 
Posts: 6
Joined: Sat Jan 23, 2010 5:01 am

Re: Adafruit_PWMServoDriver how to stop sending a signal the

by adafruit_support_mike on Sat Mar 11, 2017 4:47 am

That's called 'hunting', and unfortunately, it's unavoidable.

Servos use a simple feedback loop with two rules:

1) if the position sensor says the rotor is too far to the left, go right.
2) if the position sensor says the rotor is too far to the right, go left.

so the feedback loop will constantly overshoot the correct position, then overcorrect the other way.

Servo control systems can improve things a little by making the amount of "go right" proportional to the amount of "too far to the left", so small offsets trigger more gentle correction.

That doesn't really solve the problem though. The system is still equivalent to a ball bearing in a hemispherical bowl. Even if the ball does end up at the exact lowest point in the bowl, there's no force keeping it there. Any small disturbance can kick it off-center again.

The formal solution is to add damping.. basically brakes. For a servo, you'd need to add a source of friction so the motor has to apply a minimum amount of torque before the rotor will actually move. Finding the right balance for that can be tricky though.

adafruit_support_mike
 
Posts: 38514
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit_PWMServoDriver how to stop sending a signal the

by rorkijon on Thu Mar 16, 2017 3:11 pm

I'm using Python on the RPi3 and to get something like that I use:

for servos in range (15):
servoController01.set_pwm(servos, 4096, 0)

My code for that on the Arduino was:

//disable PWM pulses on the server controller module, so all servos remain idle on startup
servoController01.begin();
servoController01.setPWMFreq(60); // Analog servos run at ~60 Hz updates, sample freq was 1600…???
for (int idle =0; idle<16;idle++) {
servoController01.setPWM(idle, 0, 0); //if not working try (idle, 4096, 0)
}

Hope this helps,

Jon.

rorkijon
 
Posts: 1
Joined: Sun Jan 26, 2014 12:52 pm

Please be positive and constructive with your questions and comments.