Duet support for Digital Servos?
-
What voltage does the servo need on its control wire? The servo itself needs 6V minimum power according to Hitech, but I didn't find a specification of the voltage needed on the control wire. If you are running it near its maximum power voltage (7.4V) then it's possible that a 5V signal from the Duet isn't enough, if the digital circuitry inside it is implemented using standard CMOS logic. Try running the servo with 6V or 6.5V power.
-
The arduino is only supplying a measured peak-to-peak 500mV on the control wire when driving the digital servo, the duet is outputting a measured peak-to-peak 1.5V. Both the old analog servo and new digital one operate at 6V on the power, so that's where we're currently set to switch between either option, at least until we get the digital working.
What frequency is the PWM operated at?
-
@mkelly said in Duet support for Digital Servos?:
The arduino is only supplying a measured peak-to-peak 500mV on the control wire when driving the digital servo, the duet is outputting a measured peak-to-peak 1.5V.
That's not right at all. The servo shouldn't be drawing anything like that much current from the control wire. You should see 5V or very close to that, if you measure it while the servo has power applied. Either the servo is faulty, or you have wired it incorrectly.
The servo refresh frequency used by RRF is 50Hz.
-
There's too much noise on the scope to get a good reading, but I was just reporting the measurements from the control signal.
Again, the digital servo works fine on an Arduino, which also drives the Analog servo of similar form factor.
The wiring on the duet can drive the analog servo just fine, meaning there's no issues with the wiring from a conductivity standpoint.
The only variable I can't control right now is how the Duet is outputting the PWM signal to drive a digital servo, and I'm not able to confirm if anyone has been successful in driving a digital servo off of a duet.
-
@mkelly said in Duet support for Digital Servos?:
There's too much noise on the scope to get a good reading, but I was just reporting the measurements from the control signal.
If there is too much noise to read 5V, you have a big wiring issue.
-
Apologies, sorted out the issues with the measurement, now I'm getting a clean signal from the PWM. Here's a picture from the scope with only 500mV being measured on the square wave at 50Hz. I have isolated the wiring to such a degree that there is no chance of faulty wiring, if it was such a simple troubleshoot this wouldn't have taken so many steps to unravel.
This measurement is identical to the arduino controlled version. Which further increases the confusion why driving the servo off the Duet would have any impact on driving a digital servo.
Again here's the chart showing the operability of the servo using the exact same wiring:
I also found a servo catalog chart with something interesting. It specifies the Control circuit for the HS-645MG as "ANALOG" but the HS-7954SH specifies a "G2 DIGITAL" Control circuit. It is not clear if this is referring to the internal control circuit (likely) or something relating to the PWM (unlikely), but perhaps that means something to you.
The other options for the other digital servos in the chart are "G1 Digital", "G2.5 Digital", "HR Digital", "32bit Digital" and "EBL Digital"
At this point all I'd like to know is if anyone has successfully driven a digital servo off of the Duet? I'm thinking it's necessary to use an external circuit to drive the servo since it's taking so much effort to get the Duet to do it.
-
Are you using a x10 probe, and if so, does your scope know that you are? On my scope the probe type is an option on the channel menu. Your 500mV may in fact be 5V.
What are the pulse width and repetition frequency when you use your working Arduino sketch?
-
You were correct, x1 changed to x10 now I'm measuring 5.3V.
For the arduino output has a positive width of 1.78ms(~560Hz)(@ the full 5.3v) with a repetition frequency of 50Hz. Total Pulse width is 20ms
Here's the test code, intended to cycle the servo with a 2s pause:
#include <Servo.h>
Servo myservo; // create servo object
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(8); // attaches the servo on pin 8 to the servo object
}void loop() {
delay(2000);
// 120ms to travel 60 degrees
for (pos = 60; pos <= 120; pos += 5) { // travel 60 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 10ms for the servo to reach the position
} -
Have you tried using 1.78ms width pulses from the Duet?
-
I successfully drove a TowerPro MG996R, which is a digital servo. I mean, it has a digital internal closed-loop system, and is controlled the same way as analog ones.
Your servo, however, is smarter: it can be programmed through the control pin. It should work as any other servos work, by driving a 50Hz signal on the control pin, and it does with Arduino. There is something in the Duet signal messing up the internal electronic of your servo, but I don't see what.