Problem restoring Z height after tool change

Discussion in 'Getting Started' started by Nicholasav, Sep 14, 2020.

  1. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    Hello all, I know this is a bit of a novice question but I am having trouble restoring my Z height between tool changes.

    Right now I am keeping things very simple and just trying to get everything to work properly in sequence. I'm using a single process in Simplify3d and am using a Hemera + V6 and Hemera + Volcano (Volcano for supports, V6 for everything else).

    The issue is that when I call for the next tool (with a larger Z offset), and lower the bed in tpre, I don't know when/how to restore Z. I tried in tpost, but the tool offset does not apply until after, which would result in a tool crash. I'm sure it's obvious, and hopefully not too RTFM.

    Any help is appreciated.
     
  2. jannau

    jannau Member

    Joined:
    Aug 16, 2019
    Messages:
    6
    Likes Received:
    1
  3. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    In which case, my confusion continues.

    If I print with either tool individually I have no issues, and all offsets appear to be calibrated correctly. When I change tools doing a multi-tool print, the second tool hovers 10mm or so above the print bed.

    The pre/post are unchanged other than speeds/positioning from the public files.

    EDIT: https://duet3d.dozuki.com/Wiki/Gcode#Section_T_Select_Tool

    ^That is what I was going on. Am I missing something? According to this it seems to apply offsets after Post.
     
    #3 Nicholasav, Sep 14, 2020
    Last edited: Sep 14, 2020
  4. jannau

    jannau Member

    Joined:
    Aug 16, 2019
    Messages:
    6
    Likes Received:
    1
    Which firmware version are you running? Check in DuetWebControl (Settings, General or Machine Specific) or with M122. This was changed in RepRapFirmware 2.03 see the upgrade news in https://github.com/Duet3D/RepRapFirmware/blob/master/WHATS_NEW.md#version-203

    The Gcode page appears to document the old behavior.
     
  5. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
  6. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    160
    Likes Received:
    52
    Note that there are two things going on, the application of the offsets (which seem to be working for you since single tools work) but also the lowering and raising of the bed for safety which also happens in the tool changing macros.

    If you are running a Volcano I am surprised you haven’t had a crash yet if you haven’t adjusted at least your tpreX.g macro for that tool. That is where the bed is lowered enough to clear the tool (the macro has warning text referencing the need to change it for non-standard tools).

    Sounds like you’re using the off the shelf E3D firmware, so when changing a tool (assuming you have macros enabled) it will run tfree first, which will switch to relative mode and drop the bed (by 4mm in the shipped macro), it then switches back to absolute mode. The tpre will run during which the bed is dropped a further 10mm (and this should be increased for the Volcano) and finally tpost runs (with no change to the bed height.

    When your g-code resumes running the bed height should return to normal since absolute positioning will have resume. If you are just switching tools in the web interface the bed will not move back until you give it gcode to do so if I recall, however I haven’t paid attention to that for a while.
     
  7. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    Thanks for the response. I did update Pre to compensate for the additional bed drop and can run the toolchange script without any issues as a result.

    I am currently only having problems during a print. It runs the first layer fine, then calls T3, and never brings the bed back up. For posterity, I can run a single tool program without issues (IE, no fiddling with offsets or otherwise making adjustments after the print starts).

    So, process 1 runs fine, sends T2 back just fine, then calls for T3. T3 runs Pre which drops the bed 20mm, switches back to absolute... Then prints in the air as I never get back the Z drop. It really sounds like I have things setup correctly, but something is obviously wrong somewhere.
     
  8. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    160
    Likes Received:
    52
    Which slicer are you generating the g-code with? Does the next move after the tool change include a Z coordinate or just the XY?
     
  9. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    Simplify3d

    The next move does not include a Z coordinate -- it seems like that would fix things but am unsure how to make that happen.
     
  10. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    160
    Likes Received:
    52
    I'd have to look deeper but even then I vaguely recall that it was supposed to restore the Z height on the next move. I just exported G-code from the example factory E3D provide and for that one I am seeing the Z height getting set after each tool change.
     
  11. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    I am currently using T2 and T3 for this job. Attached are my config, and relevant tPre, tPost, and TFree files.

    Finally crashed a toolhead, RIP Hemera heat break.

    I'm starting to think this may be slicer related and am going to pour over the example files you mentioned to see where I may be off.

    Code:
    ; Configurat; Configuration file for Duet WiFi / Ethernet
    ; executed by the firmware on start-up
    
    ; General preferences
    M111 S0                         ; Debugging off
    G21                             ; Work in millimetres
    G90                             ; Send absolute coordinates...
    M83                             ; ...but relative extruder moves
    M555 P2                         ; Set firmware compatibility to look like Marlin
    
    ; Network
    M550 p"toolchanger"                     ; Set machine name
    M587 s"R&D" p"redbul71Az!"                ; WiFi Settings
    M552 s1
    M586 P0 S1                         ; Enable HTTP
    M586 P1 S0                         ; Disable FTP
    M586 P2 S0                         ; Disable Telnet
    
    M667 S1                         ; Select CoreXY mode 
    
    ; Endstops
    M574 X1 Y1 S3                         ; Set X / Y endstop stall detection
    M574 Z1 S2                         ; Set Z endstop probe
    M558 P7 X0 Y0 Z2 H3 F360 I0 T20000             ; Set Z probe type to switch, the axes for which it is used and the dive height + speeds
    G31 P200 X0 Y0 Z0                     ; Set Z probe trigger value, offset and trigger height
    M557 X10:290 Y20:180 S40                 ; Define mesh grid
    
    ; Drive direction
    M569 P0 S0                         ; Drive 0 X
    M569 P1 S0                         ; Drive 1 Y
    M569 P2 S1                         ; Drive 2 Z
    M569 P3 S0                         ; Drive 3 E0
    M569 P4 S0                         ; Drive 4 E1
    M569 P5 S1                         ; Drive 5 E2
    M569 P6 S1                         ; Drive 6 E3
    M569 P7 S0                         ; Drive 7 COUPLER
    M569 P8 S0                         ; Drive 8 UNUSED
    M569 P9 S0                         ; Drive 9 UNUSED
    
    M584 X0 Y1 Z2 C7 E3:4:5:6                 ; Apply custom drive mapping
    M208 X-35:328.5 Y-49:243 Z0:300 C0:500 S0         ; Set axis maxima & minima
    M350 E16:8:16:8 C8 I0                     ; Configure microstepping without interpolation
    M350 X16 Y16 Z16 I1                    ; Configure microstepping with interpolation
    M92 X100 Y100 Z1600 C100 E215:417:409:409        ; Set steps per mm
    M566 X400 Y400 Z8 C2 E2:2:2:2                ; Set maximum instantaneous speed changes (mm/min)
    M203 X35000 Y35000 Z1200 C5000 E5000:5000:5000:5000    ; Set maximum speeds (mm/min)
    M201 X6000 Y6000 Z400 C400 E2500:2500:2500:2500        ; Set accelerations (mm/s^2)
    M906 X2000 Y2000 Z1330 C400 E1680:1680:1680:1680 I30     ; Set motor currents (mA) and motor idle factor in percent
    M84 S120                                                 ; Set idle timeout
    
    ;Stall Detection
    M915 C S5 F0 H200 R4700                    ; Coupler
    
    ;Stall Detection
    M915 X Y S5 F0 H400 R4700                ; X / Y Axes
    
    ; Heaters
    M305 P0 T100000 B4138 C0       ; Set thermistor
    M307 H1 A570.6 C175.6 D2.9 S1.00 V19.4 B0     
    M143 H0 S225                         ; Set temperature limit for heater 0 to 225C
    
    M305 S"T0" P1 R4700 T100000 B4388             ; Set thermistor
    M143 H1 S300                         ; Set temperature limit for heater 1 to 300C
    
    M305 S"T1" P2 R4700 T100000 B4388            ; Set thermistor
    M143 H2 S400                         ; Set temperature limit for heater 2 to 300C
    
    M305 S"T2" P3 R4700 T100000 B4388            ;Set thermistor
    M143 H3 S400                         ; Set temperature limit for heater 3 to 300C
    
    M305 S"T3" P4 R4700 T100000 B4388             ; Set thermistor
    M307 H4 A175.0 C162.2 D5.9 S1.00 V22.1 B0
    M143 H4 S300                         ; Set temperature limit for heater 4 to 300C
    
    
    ; Tools
    M563 P0 S"T0" D0 H1                     ; Define tool 0
    G10 P0 X0 Y0 Z0                    ; Reset tool 0 axis offsets
    G10 P0 R0 S0                         ; Reset initial tool 0 active and standby temperatures to 0C
    
    M563 P1 S"T1" D1 H2                     ; Define tool 1
    G10 P1 X0 Y0 Z0                     ; Reset tool 1 axis offsets
    G10 P1 R0 S0                         ; Reset initial tool 1 active and standby temperatures to 0C
    
    M563 P2 S"T2" D2 H3
    G10 P2 X0 Y0 Z0                      ; Define tool 2                    ; Reset tool 2 axis offsets
    G10 P2 R220 S265                    ; Reset initial tool 2 active and standby temperatures to 0C
    
    M563 P3 S"T3" D3 H4                     ; Define tool 3
    G10 P3 X0 Y0 Z0                     ; Reset tool 3 axis offsets
    G10 P3 R210 S240                         ; Reset initial tool 3 active and standby temperatures to 0C
    
    ; Fans
    M106 P0 S0                        ; UNUSED
    M106 P1 S255 H1 T70                    ; T0 HE
    M106 P2 S0                        ; T0 PCF
    M106 P3 S255 H2 T70                     ; T1 HE
    M106 P4 S0                        ; T1 PCF
    M106 P5 S255 H3 T70                     ; T2 HE
    M106 P6 S0                         ; T2 PCF
    M106 P7 S255 H4 T70                    ; T3 HE
    M106 P8 S0                        ; T3 PCF
    
    
    M593 F50                        ; cancel ringing at 50Hz (https://forum.e3d-online.com/threads/accelerometer-and-resonance-measurements-of-the-motion-system.3445/)
    ;M376 H15                        ; bed compensation taper
    
    ;tool offsets
    G10 P0 X0 Y0 Z-52                    ; T0
    G10 P1 X-9 Y39 Z-5                    ; T1
    G10 P2 X21 Y43 Z-6.40                    ; T2
    G10 P3 X21 Y43 Z-14.8                    ; T3
    
    tPre2

    Code:
    ; tpre2.g
    ; called before tool 2 is selected
    
    ;Ensure no tool is selected
    ;T-1
    
    ;Unlock Coupler
    M98 P/macros/Coupler - Unlock
    
    ;Move to location
    G1 X212.80 Y200 F5000
    
    ;Move in
    G1 X212.80 Y220 F5000
    
    ;Collect
    G1 X212.80 Y227.60 F2500
    
    ;Close Coupler
    M98 P/macros/Coupler - Lock
    
    ;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
    ;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool!
    G91
    G1 Z10 F1000
    G90
    
    ;Move Out
    G1 X212.80 Y150 F4000
    tPre3
    Code:
    ; tpre3.g
    ; called before tool 3 is selected
    
    ;Ensure no tool is selected
    T-1
    
    ;Unlock Coupler
    M98 P/macros/Coupler - Unlock
    
    ;Move to location
    G1 X302.5 Y200 F5000
    
    ;Move in
    G1 X302.5 Y210 F5000
    
    ;Collect
    G1 X302.5 Y227 F2500
    
    ;Close Coupler
    M98 P/macros/Coupler - Lock
    
    ;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
    ;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool!
    G91
    G1 Z20 F1000
    G90
    
    ;Move Out
    G1 X302.5 Y150 F4000
    tPost2

    Code:
    ; tpost2.g
    ; called after tool 2 has been selected
    
    ;heatup
    M116 P2
    
    ;prime nozzle
    ;M98 Pprime.g
    
    ;mesh leveling on
    G29 S1
    
    ;PCF fan on
    M106 P6 S255
    
    tPost3

    Code:
    ; tpost3.g
    ; called after tool 3 has been selected
    
    ;heatup
    M116 P3
    
    ;prime nozzle
    ;M98 Pprime.g
    
    ;mesh levelling on
    G29 S1
    
    ;PCF fan on
    M106 P8 S255
    
    tFree2

    Code:
    ; tfree2.g
    ; called when tool 2 is freed
    
    ;Drop the bed
    G91
    G1 Z4 F1000
    G90
    
    ;mesh levelling off
    G29 S2
    
    ;Purge nozzle
    ;M98 Ppurge.g
    
    ;Move In
    G53 G1 X212.80 Y150 F5000
    G53 G1 X212.80 Y200 F5000
    G53 G1 X212.80 Y220 F5000
    G53 G1 X212.80 Y227.60 F5000
    
    ;Open Coupler
    M98 P/macros/Coupler - Unlock
    
    ;fan off
    ;M106 P6 S0
    
    ;Move Out
    G53 G1 X212.80 Y175 F50000
    Code:
    ; tfree3.g
    ; called when tool 3 is freed
    
    ;Drop the bed
    G91
    G1 Z4 F1000
    G90
    
    ;mesh levelling off
    G29 S2
    
    ;Purge nozzle
    ;M98 Ppurge.g
    
    ;Move In
    G53 G1 X302.5 Y150 F5000
    G53 G1 X302.5 Y200 F5000
    G53 G1 X302.5 Y210 F5000
    G53 G1 X302.5 Y228 F2500
    
    ;Open Coupler
    M98 P/macros/Coupler - Unlock
    
    ;fan off
    ;M106 P8 S0
    
    ;Move Out
    G53 G1 X302.5 Y175 F5000
     
  12. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    450
    Likes Received:
    204
    I suggest you upgrade to 2.05.1. After that you may wish to upgrade to 3.1.1 or even 3.2beta1, but that will require changes to your config.g file.
     
  13. Nicholasav

    Nicholasav Member

    Joined:
    Feb 13, 2020
    Messages:
    13
    Likes Received:
    15
    I upgraded to 2.05.1 with no change to this behavior.
     

Share This Page