Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Duet support for Digital Servos?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    3
    17
    2.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mkellyundefined
      mkelly
      last edited by

      Forgot to upload the config first time. I'm shutting off all the heaters on the Duex just to be safe:
      0_1548440073786_config.g

      Tested two different analog servos, a little 9g one and the HS-645MG listed in the OP. Both worked without issue.

      Still can't get the digital one to trigger.

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        Are you sure that the angles you are sending (0deg and 50deg) are within the range supported by your servo? Have you tried larger values?

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • mkellyundefined
          mkelly
          last edited by mkelly

          Good call, Just tried doing 20 degrees to see, no difference. Looking at the servo datasheet I'm seeing

          Operating Travel: 40±5°/ONE SIDE PULSE TRAVELING 400usec
          Direction: CLOCK WISE/PULSE TRAVELING 1500 TO 1900 usec

          To try and eliminate variables I've also been using an Arduino driving a servo from 0-60°, it did seem to be driving the servo 60 degrees. I recreated the wiring diagram using an external variable power supply and confirmed I am able to drive the digital servo successfully using the voltage regulator and a relay. I confirmed this was true with analogs as well.

          Meaning I only had the PWM pin connected to the arduino, and the voltage being driven elsewhere. Grounds were tied together for reference on a breadboard.

          Again, with an arduino the digital servo and analogs commanded the correct move position every time

          However, when I took this identical wiring arrangement, and only changing the PWM pin going into the PWM on the Duex, I am ONLY able to drive analog servos. The digital one continues to not move.

          The only thing I can think of is the PWM frequency between the two devices is different. I'll probably hook it up to an osciloscope to see if I can see the frequency, but at this point I'm pretty compelled of the origin of the issue, and would be willing to go so far as to ship you a digital servo if necessary.

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by

            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.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • mkellyundefined
              mkelly
              last edited by mkelly

              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?

              dc42undefined 1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @mkelly
                last edited by dc42

                @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.

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

                mkellyundefined 1 Reply Last reply Reply Quote 0
                • mkellyundefined
                  mkelly @dc42
                  last edited by

                  @dc42

                  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.

                  dc42undefined 1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators @mkelly
                    last edited by

                    @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.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • mkellyundefined
                      mkelly
                      last edited by

                      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.

                      Scope

                      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:
                      0_1548702745052_5cc5cfd9-3b87-413a-8059-04dcdc018b24-image.png

                      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.

                      1 Reply Last reply Reply Quote 0
                      • dc42undefined
                        dc42 administrators
                        last edited by dc42

                        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?

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                        mkellyundefined 1 Reply Last reply Reply Quote 0
                        • mkellyundefined
                          mkelly @dc42
                          last edited by mkelly

                          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
                          }

                          1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators
                            last edited by

                            Have you tried using 1.78ms width pulses from the Duet?

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            1 Reply Last reply Reply Quote 0
                            • fmaundefined
                              fma
                              last edited by

                              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.

                              Frédéric

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA