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

    shutting down a servo?

    Scheduled Pinned Locked Moved
    General Discussion
    6
    15
    515
    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.
    • Tinchusundefined
      Tinchus
      last edited by

      Hi. I have a small servo connected to a duet3 (3.4.6, SBC mode, the servo open and close a smal lid, it is a 9g style servo, specifications are ok for the duet3 board)
      The servo is connected to its own 5V PSU (it uses 6.5 V ), just to avoid any potential problem of stall current or related things.

      Configuration on config.g:

      M950 S0 C"io5.out" Q285
      M280 P0 S1380

      The servo is a futaba SU-300. Acording to their tech support since it is a digital servo, the pwm frequenncy should be 285 and so I configured that on the M950 command

      The M280 P0 S1380 moves the servo ok in one direction,, M280 P0 S1450 moves it on the other direction.

      The problem is (may be it is not a problem jajajajaj): when I move the servo to M280 P0 S1450, the servo moves and then when it stops keeps doing a buzzing noise (small noise). Im guessiing, just guessing since electronics are not my field, that the noise comes is the servo trying to keep the position or maybe the servo is stall and trying to reach final position?

      To test this following the instructions here: https://docs.duet3d.com/User_manual/Connecting_hardware/Motors_servos, on the stall current section says:

      Servos that are commanded beyond their movement limits usually stall. This heats up both the servo and the Duet. The servo is likely to burn out if held in this state. So:

      Ensure that the Duet can supply the stall current. >>>> not my problem because Im using an independant power source for the servo?
      Either be very careful not to command the servo beyond its working range, or else command the servo to move, hold it for a short time, then use M280 P# S0 to stop commanding the servo (replace # by the pin number or GpOut number as usual).

      I used the command M280 P0 S0 and the noise is still there, and the servo is still being commanded because if I try to move it I can feel the servo applying torque and keeping its position

      Should the command M280 P0 S0 do this I mean "turn off" the servo"

      Thanks in advance for the help

      droftartsundefined zaptaundefined 2 Replies Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @Tinchus
        last edited by

        @Tinchus sending M42 P0 S0 should turn off the servo. M280 P0 S0 means 'set servo angle to 0 degrees', which often servos aren't capable of reaching, and maybe drawing a lot of current.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        Tinchusundefined 1 Reply Last reply Reply Quote 0
        • Tinchusundefined
          Tinchus @droftarts
          last edited by

          @droftarts that was my understanding, yes. But as I posted above, reading the documentation again on the link provided, says "then use M280 P# S0 to stop commanding the servo"

          To my understanding stop commanding meand stop sending command signal or something similar. An as stated on the documentation, that comand is an option in the case where the servo is may be neing prevented from reaching position, so the servo will start to draw a lot fo current. To avoid taht we can command the movement , and then send M280 P# S0.

          Then the information on docuemntation might need to be updated/corrected?

          Going back to my problem: any idea on how can I shut down the servo?

          droftartsundefined 1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @Tinchus
            last edited by

            @Tinchus The documentation is wrong, and I have updated it: https://docs.duet3d.com/en/User_manual/Connecting_hardware/Motors_servos#stall-current

            As I said before, M42 P0 S0 stops the servo. It sets the PWM on the servo control pin to zero. M280 always sets a PWM signal, so there's no way to turn the servo 'off' with M280. See the M280 notes here: https://docs.duet3d.com/User_manual/Reference/Gcodes#m280-set-servo-position

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            Tinchusundefined 1 Reply Last reply Reply Quote 0
            • Tinchusundefined
              Tinchus @droftarts
              last edited by

              @droftarts Sorry, I missread. You meant M42 and I read M280 jajaja. Sorry again.
              I intentionally moved the servo to a position that I know will create a stall situation. I can hear the buzzing sound on the servo. Then I executed M42 P0 S0, and the sound is still there and it is not possible to move the servo by hand, it is definitely having power and trying to reach the commanded position, so the M42 command seems to not have the effect Im looking for?

              jay_s_ukundefined droftartsundefined 2 Replies Last reply Reply Quote 0
              • jay_s_ukundefined
                jay_s_uk @Tinchus
                last edited by

                @Tinchus the servo will always have power unless you switch that power off. you would need a relay to do so

                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                Tinchusundefined 1 Reply Last reply Reply Quote 0
                • droftartsundefined
                  droftarts administrators @Tinchus
                  last edited by droftarts

                  @Tinchus Strange, it works for me, I've just tested it. I sent:
                  M280 P0 S100 > servo moves to 100 degrees
                  M42 P0 S0 > servo 'turns off', can be moved manually

                  M280 P0 S100 > servo moves to 100 degrees
                  M280 P0 S10 > servo moves to 10 degrees
                  M280 P0 S5 > servo tries to move to 5 degrees, but stalls, with noise
                  M42 P0 S0 > servo 'turns off', noise stops, can be moved manually

                  My servo is a Hitec HS-70MG 12.5g.

                  Ian

                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                  Tinchusundefined 1 Reply Last reply Reply Quote 1
                  • Tinchusundefined
                    Tinchus @jay_s_uk
                    last edited by

                    @jay_s_uk ok. My intentio is not to cut the power" but to achieve what in the documentatios is refered as away to avoid having the servo in a stall situation.
                    lets forget about the noise, if I execute m42 P0 S0 even if I have the noise I can trust no control signal is being sent to the servo?

                    1 Reply Last reply Reply Quote 0
                    • Tinchusundefined
                      Tinchus @droftarts
                      last edited by

                      @droftarts I remember having tried that servo, I changed it just becauso of it torque (the futaba one is almost double). And the other important differentce is that your servo is analog, mine is digital

                      droftartsundefined 1 Reply Last reply Reply Quote 0
                      • droftartsundefined
                        droftarts administrators @Tinchus
                        last edited by

                        @Tinchus I think if you still hear noise, it's still trying to get to position, so still stalling. If M42 isn't working, maybe digital servos need a different mechanism to turn off. I've asked @dc42. Is there any information on this in the futaba SU-300 data sheet?

                        Ian

                        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                        1 Reply Last reply Reply Quote 0
                        • o_lampeundefined
                          o_lampe
                          last edited by o_lampe

                          A humming servo is a regular thing, when it doesn't reach the desired angle.
                          It happens, even when the servo arm is within the boundaries of the internal gears, but it's no problem then. (unless your setup requires too much torque)
                          You could try one thing, for peace of mind:

                          • command the servo 5 degree or microsecond past the point you want to reach (whichever you prefer)
                          • wait a little while for the arm to reach the position (eg. G4 P200 ; waits 200milliseconds)
                          • move 5 back

                          With that trick, you'll overcome the backlash of the internal potmeter and it will be quiet
                          Maybe have to adapt to different angles/microseconds for your specific servo

                          1 Reply Last reply Reply Quote 0
                          • zaptaundefined
                            zapta @Tinchus
                            last edited by

                            @Tinchus, I have a non Duet project where a servo needs to be quiet between moves and I solved it by stopping the signal to the servo (PWM output stays at zero volts) instead of pulsating. Potentially you can do the same with the Duet. E.g. by reconfiguring the IO point.

                            1 Reply Last reply Reply Quote 1
                            • achrnundefined
                              achrn
                              last edited by achrn

                              @Tinchus your problems might be your choice of servo.

                              Futaba SU300 is a digital servo. It doesn't want to see PWM, it wants to see SBUS, which is serial data, 25 byte packets, at 100,000 baud, and the polarity is inverted.

                              I think that if it doesn't get SBUS, it 'falls back' to looking for 'normal' servo PWM, which is why it works at all.

                              I suspect (but this is speculation) that M42 doesn't work as expected because when the servo doesn't see either SBUS or PWM it holds position. Possibly you can program what it does in that situation if you put it on a programmer (you want a CIU-3 programmer, I believe), but that's about 50 quid. I'd buy a 'normal' PWM servo instead.

                              Alternatively, there's a reasonably straightforward SBUS arduino library by Bolder Flight Systems - possibly you could lash together something where your Duet talks to an arduino and the arduino talks to the servo. Still, I'd buy a 'normal' PWM servo instead.

                              Tinchusundefined 1 Reply Last reply Reply Quote 2
                              • Tinchusundefined
                                Tinchus @achrn
                                last edited by

                                @achrn I think you nare oin the righht truck. I was suspecting something about this and ttalking to futaba support about it. I will try to get a non pwm servo, any recommendations about it?

                                droftartsundefined 1 Reply Last reply Reply Quote 0
                                • droftartsundefined
                                  droftarts administrators @Tinchus
                                  last edited by

                                  @Tinchus You may be able to get the Duet to send the correct SBUS commands, similar to how @DonStauffer did it with the NeoDriver LED board: https://forum.duet3d.com/topic/35384/neopixel-driver-results

                                  Ian

                                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

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