Duet 2 on RRF3: Servos not working



  • Hi there

    For some reason I can't get any servos (BLToucha and a cutting servo) running on the new beta firmware. It works just finde on the last RRF2. I get no error message, it is just not executed. Please tell me if you have any idea why executing M280 is not working. Here you find my config.g:

    ; above are only drive and endstop settings...
    
    ; Z-Probe (BLTouch)
    
    M558 P9 C"zprobe.in" H5 F120 T3000 ; BLTouch connected to Z probe IN pin
    M950 S0 C"exp.heater3" ; create servo/gpio 0 on heater 3 pin on expansion connector
    M280 P0 S10 ; send control signal to BLTouch through servo/gpio 0
    
    ; Heaters
    
    M308 S1 P"spi.cs1" Y"thermocouple-max31856" K"K"; define H2 temperature sensor
    M950 H1 C"e1heat" T1; define H1 heater for Tool 0
    
    ; Cutting Servo
    M950 S4 C"exp.heater4"
    
    ; Tools
    
    M563 P0 S"Printing Nozzle" D0 H1            ; Define tool 0
    M563 P1 S"Touch Probe"                            ; Define tool 1
    
    ; Define offset between Tool 0 and 1
    
    G10 P1 X0 Y0 Z5.75
    G10 P0 X14 Y-32 Z5.75 B-90 P25
    G10 P0 R0 S0
    
    ; Small last settings
    
    M302 P1           		 ; Enable Cold Extrusion
    G92 Z0				 ; Set Z to 0
    
    ; Automatic saving after power loss is not enabled
    
    

  • administrators

    Thanks for your report. We also have reports that BLTouch deployment and retraction doesn't work reliably on the 2.04RC3 release. These may be related. I will investigate.



  • Hi dc42,

    unfortunately servos also don't work on the newly updated firmware. They move slightly on M950 P... (500Hz) but not on M950 S... (50Hz). Also using the Q command makes no difference.
    This is the code I use to move a servo on the new RRF 3:

    ; The next two lines are in config.g:
    M950 P4 C"nil"
    M950 S4 C"exp.heater4"
    ; The next two lines are in a macro gcode:
    ;cutting code
    M280 P4 S20;reset
    G4 P10;wait
    M280 P4 S170;cutting
    G4 P800;wait
    M280 P4 S20;reset
    G4 P300;wait
    ;cutting code end
    

    Would be great to here if you have any idea why that is? Thanks!


  • administrators

    @felix9t said in Duet 2 on RRF3: Servos not working:

    Hi dc42,

    unfortunately servos also don't work on the newly updated firmware. They move slightly on M950 P... (500Hz) but not on M950 S... (50Hz). Also using the Q command makes no difference.
    This is the code I use to move a servo on the new RRF 3:

    ; The next two lines are in config.g:
    M950 P4 C"nil"
    M950 S4 C"exp.heater4"
    ; The next two lines are in a macro gcode:
    ;cutting code
    M280 P4 S20;reset
    G4 P10;wait
    M280 P4 S170;cutting
    G4 P800;wait
    M280 P4 S20;reset
    G4 P300;wait
    ;cutting code end
    

    Would be great to here if you have any idea why that is? Thanks!

    I just tested that on a Duet WiFi. After M280 P4 I get 750us positive going pulses on exp.heater4 (measured on the expansion connector), frequency 59.9Hz according to my 'scope. After M280 P4 S170 I get 2.3us pulses, same frequency.

    The formula used by RRF in computing the pulse width is as follows (originally copied from Marlin):

    microseconds = (min<float>(S, 180.0) * ((MaxServoPulseWidth - MinServoPulseWidth) / 180.0)) + MinServoPulseWidth

    where the min and max pulse widths are 544 and 2400.

    So I conclude that it is working correctly, and I don't understand why it isn't working for you.

    PS - if I send M950 P5 Q100 then the next time I send a M280 P4 command, the pulse frequency increases to 100Hz.



  • @dc42 Having seen your post I also checked the frequency on a multimeter and indeed it shows 49.9Hz when using S4 or P4 Q50 resp. 499.8Hz when using P4. However, I can't get the servo running with the new firmware. Sometimes it moves once but doesn't execute the other commands. It works perfectly fine on RRF2 though.
    I'm going to borrow an oscilloscope and I'll tell you when I find sth interesting. But I'm quite certain the issue must be software related..


  • administrators

    Which Duet are you using?



  • @dc42 Duet Ethernet 1.02 or later + DueX5



  • @dc42 Do you have any news regarding the issue resp. could you replicate it?


  • administrators

    @felix9t said in Duet 2 on RRF3: Servos not working:

    @dc42 Do you have any news regarding the issue resp. could you replicate it?

    I fixed this several days ago and posted about it in another thread. Have you tried the latest firmware at https://www.dropbox.com/sh/3azy1njy3ayjsbp/AACquxr2m00eV568RZg5QG5wa?dl=0 ?


  • administrators

    PS - in the latest RRF3, for BLTouch v3 you must enable the pullup resistor on the Z probe input pin in the M558 command. I updated the documentation in several places to cover this.



  • @dc42 Thanks for the last update. It solved one issue with the BLTouch v3.
    The biggest problem I had was that I needed to invert both pins from:

    M950 S4 C"exp.heater4"
    ...
    M950 S0 C"exp.heater3"
    

    to

    M950 S4 C"!exp.heater4"
    ...
    M950 S0 C"!exp.heater3"
    

    That solved all issues. I've just discovered that they needed to be inverted for PWM.. 🙂


Log in to reply