endstop trigger and bangbang questions


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


  • Moderator

    If you are running 3.1.1 your M581 does require an S parameter.

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



  • M115
    FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.1.1 ELECTRONICS: Duet WiFi 1.02 or later + DueX5 FIRMWARE_DATE: 2020-05-19b2

    no errors on M98 other than my hotend sensor its not installed yet nor is the extruder motor.

    M122
    === Diagnostics ===
    RepRapFirmware for Duet 2 WiFi/Ethernet version 3.1.1 running on Duet WiFi 1.02 or later + DueX5
    Board ID: 08DLM-996RU-N8PS4-7J1F6-3SD6K-TUAZN
    Used output buffers: 3 of 24 (11 max)
    === RTOS ===
    Static ram: 27980
    Dynamic ram: 94324 of which 96 recycled
    Exception stack ram used: 264
    Never used ram: 8408
    Tasks: NETWORK(ready,368) HEAT(blocked,848) DUEX(suspended,160) MAIN(running,1656) IDLE(ready,80)
    Owned mutexes: WiFi(NETWORK)
    === Platform ===
    Last reset 00:03:01 ago, cause: power up
    Last software reset at 2020-06-20 13:22, reason: User, spinning module GCodes, available RAM 8252 bytes (slot 2)
    Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0441f000 BFAR 0xe000ed38 SP 0xffffffff Task MAIN
    Error status: 0
    MCU temperature: min 28.2, current 35.2, max 35.3
    Supply voltage: min 23.9, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes
    Driver 0: standstill, SG min/max not available
    Driver 1: standstill, SG min/max not available
    Driver 2: standstill, SG min/max not available
    Driver 3: standstill, SG min/max not available
    Driver 4: standstill, SG min/max not available
    Driver 5: standstill, SG min/max not available
    Driver 6: standstill, SG min/max not available
    Driver 7: standstill, SG min/max not available
    Driver 8: standstill, SG min/max not available
    Driver 9: standstill, SG min/max not available
    Date/time: 2020-06-23 22:07:08
    Cache data hit count 316873259
    Slowest loop: 11.95ms; fastest: 0.12ms
    I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
    === Storage ===
    Free file entries: 10
    SD card 0 detected, interface speed: 20.0MBytes/sec
    SD card longest read time 3.8ms, write time 6.0ms, max retries 0
    === Move ===
    Hiccups: 0(0), FreeDm: 169, MinFreeDm: 169, MaxWait: 0ms
    Bed compensation in use: none, comp offset 0.000
    === MainDDARing ===
    Scheduled moves: 0, completed moves: 0, StepErrors: 0, LaErrors: 0, Underruns: 0, 0 CDDA state: -1
    === AuxDDARing ===
    Scheduled moves: 0, completed moves: 0, StepErrors: 0, LaErrors: 0, Underruns: 0, 0 CDDA state: -1
    === Heat ===
    Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
    === GCodes ===
    Segments left: 0
    Movement lock held by null
    HTTP is idle in state(s) 0
    Telnet is idle in state(s) 0
    File is idle in state(s) 0
    USB is idle in state(s) 0
    Aux is idle in state(s) 0
    Trigger is idle in state(s) 0
    Queue is idle in state(s) 0
    Daemon is idle in state(s) 0
    Autopause is idle in state(s) 0
    Code queue is empty.
    === Network ===
    Slowest loop: 22.99ms; fastest: 0.00ms
    Responder states: HTTP(2) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
    HTTP sessions: 1 of 8

    • WiFi -
      Network state is active
      WiFi module is connected to access point
      Failed messages: pending 0, notready 0, noresp 0
      WiFi firmware version 1.23
      WiFi MAC address bc:dd:c2:2d:67:63
      WiFi Vcc 3.42, reset reason Unknown
      WiFi flash size 4194304, free heap 19864
      WiFi IP address 192.168.1.161
      WiFi signal strength -53dBm, reconnections 0, sleep mode modem
      Socket states: 0 4 0 0 0 0 0 0
      === DueX ===
      Read count 3, 0.99 reads/min


  • i tried

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

    still a no go. heres a picture, the red switch on top goes from white/green to two white wires down to the duex endstop. it has 3 wires for NC or NO, but i assume that doesn't really matter with the inversion capability. if feel like im missing something obvious.

    20200627_160514.jpg


  • Moderator

    It's hard to tell from the photo of the wiring bundle but have you followed the Duex wiring guide on connecting the grounds with a short piece of wire as shown here? https://duet3d.dozuki.com/Wiki/Duex2_and_Duex5_Features#Section_Wiring

    Can you send echo sensors.gpIn[1].value and report the results?



  • yes its wired the same.
    i get this back

    Error: meta command: array index out of bounds


  • Moderator

    @deltajegga said in endstop trigger and bangbang questions:

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

    You've uncommented these lines right?

    @deltajegga said in endstop trigger and bangbang questions:

    i get this back
    Error: meta command: array index out of bounds

    means gpIn[1] doesn't exist, so either the M950 J1 command wasn't run or it didn't work

    What do you get if you send just M950 J1 in the console?



  • hahaha, silly me. i guess it would help if i uncommented them.
    ok i get a value of 0 back.

    and if i send the m950 j1 i get back
    Pin !duex.e2stop, active: false


  • Moderator

    @deltajegga said in endstop trigger and bangbang questions:

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

    And with this? Does it work as expected?



  • no, it still resetes if i home


  • Moderator

    I wonder if having the wiring bundled like that is causing the e stop switch pick up the signal from the endstop.

    Usually when I'm making my looms I always twist the wires to try and prevent cross talk. Can you physically separate the wiring for the e stop from the bundle and test again?



  • ok, interesting. so that solved the triggering when it shouldent problem. (i allways thought that only pwm and data lines cared about twisting.)

    but it still wont trigger when i press the button. just a reminder im using a normally open switch.


  • Moderator

    @deltajegga said in endstop trigger and bangbang questions:

    just a reminder im using a normally open switch.

    Try changing it to normally closed. This should be configurable with the S0 S1 switch, but it's worth a shot.

    @deltajegga said in endstop trigger and bangbang questions:

    (i allways thought that only pwm and data lines cared about twisting.)

    I twist or braid everything when using cramped conduits. Just as a matter of habit.



  • yeah still nothing.


  • Moderator

    And you're sure the switch really works?
    Do you have a regular endstop microswitch you can connect in its place to test?



  • yeah i tested it with a multimeter at the plug on the duex.


  • Moderator

    @deltajegga In RRF 3.1.1, the 'C' parameter has changed to 'R'. See https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_RepRapFirmware_3_01RC2_and_later

    Try changing command to M581 P1 T0 R0 S1

    Ian



  • damn, got my hopes up. i tried that with !, ^, and !^ on the pin name but still nothing. here is a refresh of the config.

    ; 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 S0                              ; physical drive 1 goes forwards   RY
    M569 P2 S0                              ; physical drive 2 goes backwards  RZ
    M569 P3 S0                              ; 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 Z6:2 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 Y300:300 Z12:12 E120.00                     ; set maximum instantaneous speed changes (mm/min)
    
    M203 X4000.00 Y4000:4000 Z500:500 E1200.00               ; set maximum speeds (mm/min)
    
    M201 X150.00 Y150:150 Z20:20 E250.00                     ; set accelerations (mm/s^2)
      
    M906 X800 Y1100:1100 Z600:600 E800 I50                   ; set motor currents (mA) and motor idle factor in per cent
    M84 S90                                                  ; Set idle timeout
    
    
    
    
    ; Axis Limits
    M208 X0 Y0 Z0 S1                                   ; set axis min
    M208 X1400 Y880 Z900 S0                            ; set axis max
    
    ; 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" H10 F400 T8000      ; set Z probe type to bltouch and the dive height + speeds
    G31 P25 X28.3 Y0 Z1.3                             ; set Z probe trigger value, offset and trigger height    INCREASE Z TO MOVE CLOSER TO BED
    M557 X50:1380 Y50:870 S100                          ; 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 B0 S1.00 A137 D6.4 C1400                   ; enable PID 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 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
    
    M671 X50:1480 Y400:400 S10                         ; x gantry leveling
    
    
    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 R0 S1                              ;emergency stop
    
    

Log in to reply