endstop trigger and bangbang questions



  • i want to add an emergency stop switch, i read the firmware 3 page and as i understand it i need to put M581 P"duex.e2stop" T0 C0 and connect to the far right endstop on the duex with the two outer pins? it does not seem to do anything.

    second , is there a way to adjust the bangbang "allowable temperature range"? right now it triggers when its just .1 deg off, and its just flickering the lights a lot, i even have a zero crossing SSR and its on a 33x55 inch 1kw heater. can you use PWM with an SSR?





  • v3.1.1

    i read this page, it says S is no longer used.
    https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_M581


  • Moderator

    I'm not sure about the trigger, but for your bed heater question, you should do a PID tuning for the bed and use PWM control rather than bang-bang.



  • @Phaedrux ok, thanks. should i repost the trigger question somewhere else?


  • Moderator

    No, here is fine.

    Make sure the endstop pin you're using matches the pin name you're using in the command.



  • yeah... duex.e2stop is the far right endstop on the duex. it does nothing. ive also tried the other endstops with respective names.


  • Moderator

    Can you post your entire config.g?

    Did you specify the pin with M950 J?

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_RepRapFirmware_3_01RC2_and_later



  • no i did not. it seems to be missing from here.
    https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_M950_Create_heater_fan_or_GPIO_servo_port

    i dont quite understand it. i tried J6 but that didnt work. is there a page that shows the pin numbers and names? or do i also need to add C to M950?

    ; Configuration file for Duet WiFi (firmware version 3)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:40 GMT-0700 (Pacific Daylight Time)
    
    ; General preferences
    G90                                                ; send absolute coordinates...
    M83                                                ; ...but relative extruder moves
    M550 P"1M"                                         ; set printer name
    
    
    
    ; Network
    M552 S1                                            ; enable network
    M586 P0 S1                                         ; enable HTTP
    M586 P1 S0                                         ; disable FTP
    M586 P2 S0                                         ; disable Telnet
    M587 S"MTS" P"Judy1985"
    
    
    
    ; Drives
    M569 P0 S0                              ; physical drive 0 goes backwards  X
    M569 P1 S1                              ; physical drive 1 goes forwards   RY
    M569 P2 S0                              ; physical drive 2 goes backwards  RZ
    M569 P3 S1                              ; physical drive 3 goes forwards   E
    M569 P5 S1                              ; physical drive 5 goes forwards   LY
    M569 P6 S0                              ; physical drive 6 goes backwards  LZ
    
    M584 X0 Y1:5 Z2:6 E3                                     ; set drive mapping
    
    M350 X16 Y16:16 Z16:16 E16 I1                            ; configure microstepping with interpolation
    
    M92 X114.29 Y114.29:114.29 Z400.00:400.00 E420.00        ; set steps per mm
    
    M566 X300.00 Y100:100 Z12:12 E120.00                     ; set maximum instantaneous speed changes (mm/min)
    
    M203 X2600.00 Y2600:2600 Z500:500 E1200.00               ; set maximum speeds (mm/min)
    
    M201 X100.00 Y50:50 Z20:20 E250.00                       ; set accelerations (mm/s^2)
      
    M906 X800 Y1100:1100 Z600:600 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 X1400 Y800 Z900 S0                            ; set axis maxima
    
    ; Endstops
    M574 X1 S1 P"xstop"                                ; configure active-high endstop for low end on X via pin xstop
    M574 Y1 S1 P"ystop"                                ; configure active-high endstop for low end on Y via pin ystop
    M574 Z1 S2                                         ; configure Z-probe endstop for low end on Z
    
    ; Z-Probe
    M950 S0 C"duex.e2heat"                             ; create servo pin 0 for BLTouch
    M558 P9 C"zprobe.in+zprobe.mod" H5 F120 T6000      ; set Z probe type to bltouch and the dive height + speeds
    G31 P500 X28.3 Y0 Z2.5                             ; set Z probe trigger value, offset and trigger height
    M557 X15:1350 Y50:750 S75                          ; define mesh grid
    
    
    ; Heaters
    M308 S0 P"bedtemp" Y"thermistor" T100000 B4138     ; 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 B1 S1.00                                   ; enable bang-bang mode for the bed heater and set PWM limit
    M140 H0                                            ; map heated bed to heater 0
    M307 H0 A46.7 C538.0 D3.3 V24.0                    ; bed tuning parameters
    
    M143 H0 S120                                       ; set temperature limit for heater 0 to 120C
    M308 S1 P"e0temp" Y"thermistor" T100000 B4138      ; 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
    
    
    
    ; 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
    
    ; 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
    
    
    
    ; Miscellaneous
    M911 S22 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss
    T0                                                 ; select first tool
    
    
    M950 J6
    M581 P"duex.e2stop" T0 C0                               ;emergency stop
    
    


  • oh i found this, do i just add M950 J1 C"duex.e2stop"?
    how many values are there for J?
    https://duet3d.dozuki.com/Wiki/Connecting_an_Emergency_Stop


  • Moderator

    My understanding is that J is just the index number. The pin being attached to that index is the actual physical pin name being used. "duex.e2heat" for example.

    From the M950 wiki entry example: M950 J1 C"!^e1stop" ; Input 1 uses e1Stop pin, inverted, pullup enabled

    Then in the M581 P you'd reference the J number from the M950.

    M950 J1 C"e1stop"

    M581 P1 T0 C0

    J1 = P1

    At least I think that's how it's working.



  • that would make sense, but i tried it and still no dice.



  • Not sure, but if i remember correctly what i readed other day, you have to enable pull-up for duex endstops. So your M950 should looks like :
    M950 J1 C"^duex.e2stop"



  • just tried that. still nothing. i wish all the RRF V3 information was more centrally contained.



  • so is there anything else i can try?



  • @deltajegga said in endstop trigger and bangbang questions:

    so is there anything else i can try?

    Yes. Firstly make sure the switch you've connected is actually working as it should. If you go to the web interface you should find a tab that shows the end stops and their trigger states. I think it's "settings - machine specific" or some such. The end stops are listed in numerical order from 0 so it might not be obvious which is which. But no matter. Activate your switch while observing that page. One of those end stops should change state.

    If the switch shows triggered when it isn't and vice versa, then you'll need to invert things so that it detects a falling edge rather than a rising edge (or vice versa). That is done by using either S0 or S1 in your M581 (can't remember which is which - try them both and see which one works).



  • @deckingman wouldent the led also turn on or off?



  • a new development, apparently

    ;M950 J1 C"!^duex.e2stop"
    ;M581 P1 T0 C0

    makes it reset when i home the Y axis...


  • Moderator

    What is the switch and how is it wired?



  • @Phaedrux just a bare switch wired normally closed. after i commented that bit out, it homed all just fine. also if i just pushed the switch by hand it wouldn't reset, only when i ran home y or home all


  • Moderator

    @deltajegga said in endstop trigger and bangbang questions:

    also if i just pushed the switch by hand it wouldn't reset, only when i ran home y or home all

    Can you post your homing files? I have to admit, I'm having a hard time following along. Do you think you could summarize what exactly you have hooked up and how it's configured?



  • the X and Y endstops are NC switches wired to the duets endstops outer two pins. the emergency stop switch is a NO red push button, wired to the duexe2stop outer two pins. and the Z is a bltouch.

    im in the process of building the printer, so i just recently was able to test the homing. when i did, it homed X just fine, but when i homed Y, i would lose wifi connection. so i commented that estop code out as a random guess and it homed just fine. so i uncommented it again and just pressed the switch by hand in various ways as to trigger a rising or falling signal, but it did not reset. BUT when i ran "home all", it would make it to the homing Y part and reset, or if i just ran home Y.

    (i think it has to do with the way and timing of the quick move to endstop and the second pass that made it trigger, idk)

    ; homeall.g
    ; called to home all axes
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:41 GMT-0700 (Pacific Daylight Time)
    G91                      ; relative positioning
    G1 H2 Z5 F6000           ; lift Z relative to current position
    G1 H1 X-1405 Y-805 F4000 ; move quickly to X and Y axis endstops and stop there (first pass)
    G1 H2 X5 Y5 F3000        ; go back a few mm
    G1 H1 X-1405 Y-805 F360  ; move slowly to X and Y axis endstops once more (second pass)
    G90                      ; absolute positioning
    G1 X50 Y50 F6000      ; go to first bed probe point and home Z
    G30                      ; home Z by probing the bed
    
    ; Uncomment the following lines to lift Z after probing
    ;G91                     ; relative positioning
    ;G1 Z5 F100              ; lift Z relative to current position
    ;G90                     ; absolute positioning
    
    
    ; homex.g
    ; called to home the X axis
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:41 GMT-0700 (Pacific Daylight Time)
    G91                ; relative positioning
    G1 H2 Z5 F6000     ; lift Z relative to current position
    G1 H1 X-1405 F6000 ; move quickly to X axis endstop and stop there (first pass)
    G1 H2 X5 F3000     ; go back a few mm
    G1 H1 X-1405 F360  ; move slowly to X axis endstop once more (second pass)
    G1 H2 Z-5 F6000    ; lower Z again
    G90                ; absolute positioning
    
    
    
    ; homey.g
    ; called to home the Y axis
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:41 GMT-0700 (Pacific Daylight Time)
    G91               ; relative positioning
    G1 H2 Z5 F6000    ; lift Z relative to current position
    G1 H1 Y-805 F4000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Y5 F2000    ; go back a few mm
    G1 H1 Y-805 F360  ; move slowly to Y axis endstop once more (second pass)
    G1 H2 Z-5 F6000   ; lower Z again
    G90               ; absolute positioning
    
    
    
    ; homez.g
    ; called to home the Z axis
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:41 GMT-0700 (Pacific Daylight Time)
    G91                 ; relative positioning
    G1 H2 Z5 F6000      ; lift Z relative to current position
    G90                 ; absolute positioning
    G1 X50 Y50 F6000 ; go to first probe point    used to be -13.3
    G30                 ; home Z by probing the bed
    
    ; Uncomment the following lines to lift Z after probing
    ;G91                ; relative positioning
    ;G1 Z5 F100         ; lift Z relative to current position
    ;G90                ; absolute positioning
    
    
    
    ; Configuration file for Duet WiFi (firmware version 3)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v3.1.1 on Sun May 31 2020 21:54:40 GMT-0700 (Pacific Daylight Time)
     
    ; General preferences
    G90                                                ; send absolute coordinates...
    M83                                                ; ...but relative extruder moves
    M550 P"1M"                                         ; set printer name
     
     
     
    ; Network
    M552 S1                                            ; enable network
    M586 P0 S1                                         ; enable HTTP
    M586 P1 S0                                         ; disable FTP
    M586 P2 S0                                         ; disable Telnet
    M587 S"MTS" P"Judy1985"
     
     
     
    ; Drives
    M569 P0 S0                              ; physical drive 0 goes backwards  X
    M569 P1 S1                              ; physical drive 1 goes forwards   RY
    M569 P2 S0                              ; physical drive 2 goes backwards  RZ
    M569 P3 S1                              ; physical drive 3 goes forwards   E
    M569 P5 S1                              ; physical drive 5 goes forwards   LY
    M569 P6 S0                              ; physical drive 6 goes backwards  LZ
     
    M584 X0 Y1:5 Z2:6 E3                                     ; set drive mapping
     
    M350 X16 Y16:16 Z16:16 E16 I1                            ; configure microstepping with interpolation
     
    M92 X114.29 Y114.29:114.29 Z400.00:400.00 E420.00        ; set steps per mm
     
    M566 X300.00 Y100:100 Z12:12 E120.00                     ; set maximum instantaneous speed changes (mm/min)
     
    M203 X2600.00 Y2600:2600 Z500:500 E1200.00               ; set maximum speeds (mm/min)
     
    M201 X100.00 Y50:50 Z20:20 E250.00                       ; set accelerations (mm/s^2)
      
    M906 X800 Y1100:1100 Z600:600 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 X1400 Y800 Z900 S0                            ; set axis maxima
     
    ; Endstops
    M574 X1 S1 P"xstop"                                ; configure active-high endstop for low end on X via pin xstop
    M574 Y1 S1 P"ystop"                                ; configure active-high endstop for low end on Y via pin ystop
    M574 Z1 S2                                         ; configure Z-probe endstop for low end on Z
     
    ; Z-Probe
    M950 S0 C"duex.e2heat"                             ; create servo pin 0 for BLTouch
    M558 P9 C"zprobe.in+zprobe.mod" H5 F120 T6000      ; set Z probe type to bltouch and the dive height + speeds
    G31 P500 X28.3 Y0 Z2.5                             ; set Z probe trigger value, offset and trigger height
    M557 X15:1350 Y50:750 S75                          ; define mesh grid
     
     
    ; Heaters
    M308 S0 P"bedtemp" Y"thermistor" T100000 B4138     ; 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 B1 S1.00                                   ; enable bang-bang mode for the bed heater and set PWM limit
    M140 H0                                            ; map heated bed to heater 0
    M307 H0 A46.7 C538.0 D3.3 V24.0                    ; bed tuning parameters
     
    M143 H0 S120                                       ; set temperature limit for heater 0 to 120C
    M308 S1 P"e0temp" Y"thermistor" T100000 B4138      ; 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
     
     
     
    ; 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
     
    ; 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
     
     
     
    ; Miscellaneous
    M911 S22 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss
    T0                                                 ; select first tool
     
     
    ;M950 J1 C"!^duex.e2stop"
    ;M581 P1 T0 C0
    

  • Moderator

    @deltajegga Can you include your current config.g?



  • its still the same as up top except the last lines are

    ;M950 J1 C"!^duex.e2stop"
    ;M581 P1 T0 C0


  • Moderator

    Can you send M115 and verify that you're actually running 3.1.1?
    Also, can you send M98 Pconfig.g and report any errors?
    Also the content of M122 report please.


Log in to reply