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

    Duet 2 Wifi Servo Control

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    2
    7
    369
    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.
    • TooG444undefined
      TooG444
      last edited by

      I'm having trouble getting a servo to work. I have a super small 1.5g ultra micro servo that is used in RC aircraft, usually for landing gear. It works with the standard Arduino servo library on a Leonardo, so I know it's both wired correctly (in the broadest sense) and functions as expected. I've also tried all of the below with a SG90 9g servo that I've seen others use with the same results.

      I have it plugged into a 5V and GND headers, with the signal wire run to E1Heater - I've tried both terminals, just in case I was reading the wiring diagram wrong.

      I'm running a Duet 2 Wifi v1.03 on RRF 3.1.1, WiFi server 1.23.

      I attempt to start the PWM signal with

      M950 S0 C"e1heat"
      

      and then command the servo position with

      M280 P0 Snn
      

      where 'nn' is... pretty much every number. I've tried both low numbers to command angle and high numbers to set the uS directly.

      I have also tried specifying the (standard, as far as I can tell) 50Hz frequency with

      M950 S0 C"e1heat" Q50
      

      I've also tried using exp1.heater3 with the same results.

      Unfortunately, none of these are having any effect at all. I must be missing something, probably something obvious, and am hoping someone here can help.

      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        Can you post your full config?

        You're not using M950 S0 for a BLTouch or something are you?

        If you send M98 P"config.g" do you get any syntax errors?

        Here's your pin name options

        https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names_for_Duet_2_WiFi_Ethernet

        And M950 for good measure.

        https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M950_Create_heater_fan_or_GPIO_servo_pin

        I wonder if your pin needs to be inverted.

        e1heat *
        Some pins (primarily heater pins) have an inversion between the processor and the corresponding output, RRF3 will automatically allow for this inversion. These pins are marked with a * after the pin name in the list below.

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • TooG444undefined
          TooG444
          last edited by

          I've made myself kind of a DIY BLTouch in form, functionally identical to the Tiny Touch (https://grabcad.com/library/tiny-touch-nmpg-1) but in a different form factor. Before I even got as far as configuring the rest of it, I was trying to get the servo working under manual control.

          I also just tried with M950 S0 C"!e1heat" and no luck.

          M98 P"config.g" returns:

          HTTP is enabled on port 80
          FTP is disabled
          TELNET is disabled
          Warning: Heater 0 appears to be over-powered. If left on at full power, its temperature is predicted to reach 365C
          Warning: Heater 0 appears to be over-powered. If left on at full power, its temperature is predicted to reach 237C
          Warning: Heater 1 appears to be over-powered. If left on at full power, its temperature is predicted to reach 1279C
          

          Full config.g:

          ; Configuration file for Duet WiFi (firmware version 3)
          ; executed by the firmware on start-up
          
          ; General preferences
          G90                                                       ; send absolute coordinates...
          M83                                                       ; ...but relative extruder moves
          M550 P"E-Bot"                                             ; set printer name
          M669 K1                                                   ; select CoreXY mode
          
          ; Network
          M552 S1                                                   ; enable network
          M586 P0 S1                                                ; enable HTTP
          M586 P1 S0                                                ; disable FTP
          M586 P2 S0                                                ; disable Telnet
          
          ; Drives
          M569 P0 S1                                                ; physical drive 0 goes forwards
          M569 P1 S1                                                ; physical drive 1 goes forwards
          M569 P2 S1                                                ; physical drive 2 goes forwards
          M569 P3 S1                                                ; physical drive 3 goes forwards
          M584 X0 Y1 Z2 E3                                          ; set drive mapping
          M350 X16 Y16 Z16 E16 I1                                   ; configure microstepping with interpolation
          M92 X200.00 Y200.00 Z800.00 E837.00                       ; set steps per mm
          M566 X900.00 Y900.00 Z12.00 E120.00                       ; set maximum instantaneous speed changes (mm/min)
          M203 X9000.00 Y9000.00 Z3000.00 E3600.00                  ; set maximum speeds (mm/min)
          M201 X500.00 Y500.00 Z250.00 E250.00                      ; set accelerations (mm/s^2)
          M906 X1200 Y1200 Z1200 E800 I30                           ; set motor currents (mA) and motor idle factor in per cent
          M84 S30                                                   ; Set idle timeout
          
          ; Axis Limits
          M208 X0 Y0 Z0 S1                                          ; set axis minima
          M208 X230 Y240 Z249 S0                                    ; set axis maxima
          
          ; Endstops
          M574 X2 S1 P"xstop"                                       ; configure active-high endstop for high end on X via pin xstop
          M574 Y1 S1 P"ystop"                                       ; configure active-high endstop for low end on Y via pin ystop
          M574 Z2 S1 P"zstop"                                       ; configure active-high endstop for high end on Z via pin zstop
          
          ; Z-Probe
          M950 S0 C"e1heat"                                         ; create servo pin on e1heat
          M558 P9 C"^zprobe.in" H5 F120 T6000                       ; set Z probe type to bltouch and the dive height + speeds
          G31 P500 X0 Y0 Z2.5                                       ; set Z probe trigger value, offset and trigger height
          M557 X15:215 Y15:225 S20                                  ; define mesh grid
          
          ; Heaters
          M308 S0 P"bedtemp" Y"thermistor" T100000 B3950            ; configure sensor 0 as thermistor on pin bedtemp
          M950 H0 C"bedheat" T0                                     ; create bed heater output on bedheat and map it to sensor 0
          M307 H0 B0 S1.00                                          ; disable bang-bang mode for the bed heater and set PWM limit
          M140 H0                                                   ; map heated bed to heater 0
          M143 H0 S120                                              ; set temperature limit for heater 0 to 120C
          M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.06e-8    ; configure sensor 1 as thermistor on pin e0temp
          M950 H1 C"e0heat" T1                                      ; create nozzle heater output on e0heat and map it to sensor 1
          M307 H1 B0 S1.00                                          ; disable bang-bang mode for heater  and set PWM limit
          M143 H1 S290                                              ; set temperature limit for heater 1 to 290C
          
          ; Fans
          M950 F0 C"fan0" Q500                                      ; create fan 0 on pin fan0 and set its frequency
          M106 P0 S0 H-1                                            ; set fan 0 value. Thermostatic control is turned off
          M950 F1 C"fan1" Q500                                      ; create fan 1 on pin fan1 and set its frequency
          M106 P1 S1 H-1                                            ; set fan 1 value. Thermostatic control is turned off
          
          ; Tools
          M563 P0 D0 H1 F0                                          ; define tool 0
          G10 P0 X0 Y0 Z0                                           ; set tool 0 axis offsets
          G10 P0 R0 S0                                              ; set initial tool 0 active and standby temperatures to 0C
          
          ; Heater PID values
          M307 H0 A212.9 C513.5 D1.1 S1.00 V24.3 B0
          M307 H1 A1254.6 C478.3 D4.7 S1.00 V24.2 B0
          
          ; Pressure advance - Calibrated with eSun/Inland PETG @ 240C
          M572 D0 S0.06
          
          ; Custom settings are not defined
          
          Phaedruxundefined 1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator @TooG444
            last edited by

            @TooG444 said in Duet 2 Wifi Servo Control:

            M950 S0 C"!e1heat"

            How bout with a C"!^e1heat" ?

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • TooG444undefined
              TooG444
              last edited by

              @Phaedrux said in Duet 2 Wifi Servo Control:

              C"!^e1heat"

              No joy. M280 P0 S10 and M280 P0 S100 both result in no movement, same with S1000 and S2000.

              1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator
                last edited by

                MAybe try one of the heater pins also used by the bltouch instead?

                on the expansion header you've got heater pin options that go by the names

                exp.heater3, exp.8, !duex.e2heat, !duex.pwm1
                exp.heater4, exp.13, !duex.e3heat, !duex.pwm2
                exp.heater5, exp.18, !duex.e4heat, !duex.pwm3
                exp.heater6, exp.23, !duex.e5heat, !duex.pwm4
                exp.heater7, exp.31, !duex.e6heat, !duex.pwm5
                

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • TooG444undefined
                  TooG444
                  last edited by

                  I could have sworn I had already tried C"exp.heater3" but this time around it's working. Not ideal for my current wire length but at least it's working!

                  Thank you @Phaedrux !

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