Duet3D / RepRapFirmware

OO C++ RepRap Firmware
GNU General Public License v3.0
940 stars 534 forks source link

Tool changer incorrect tool Z position after change #420

Closed Moonlight63 closed 1 year ago

Moonlight63 commented 4 years ago

I'm having a really strange issue in rrf3 that is causing tool offsets in the z axis to revert to the last machine coordinate without physically moving the bed, such that when any other axis is updated, the bed moves to that position in the new tool coordinate system. This is extremely bad as it can easily result in tools ramming into a the bed or printed part because the machine doesn't seem to know where the z axis actually is.

I've made this video showing it happen in DWC and I try to explain it in a little more detail. I don't have a clue what is causing this and it has had me stumped for a few days. I haven't seen anyone else with this problem, but I can't imagine this isn't an issue on an e3d toolchanger as well?

https://youtu.be/tvf8z429y_o

Thank you!

Config.g:

; Configuration file for Duet 3 (firmware version 3)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.1.3 on Sun Jun 28 2020 21:43:52 GMT-0700 (Pacific Daylight Time)

; General preferences
G90                                            ; send absolute coordinates...
M83                                            ; ...but relative extruder moves
M550 P"Duet 3"                                 ; set printer name
M669 K1                                        ; select CoreXY mode

; Drives
M569 P0.0 S1                                   ; physical drive 0.0 goes forwards
M569 P0.1 S1                                   ; physical drive 0.1 goes forwards

M569 P0.2 S1                                   ; physical drive 0.2 goes backwards
M569 P0.3 S1                                   ; physical drive 0.3 goes backwards
M569 P0.4 S1                                   ; physical drive 0.4 goes backwards

M569 P20.0 S1                                   ; physical drive 1.0 goes forwards

M584 X0.0 Y0.1 Z0.2:0.3:0.4 E20.0                       ; set drive mapping
M350 X16 Y16 Z16 E16 I1                        ; configure microstepping with interpolation
M92 X80.00 Y80.00 Z414.4 E420.00               ; set steps per mm
M566 X900.00 Y900.00 Z400.00 E120.00            ; set maximum instantaneous speed changes (mm/min)
M203 X6000.00 Y6000.00 Z3000.00 E1200.00        ; set maximum speeds (mm/min)
M201 X500.00 Y500.00 Z500.00 E250.00            ; set accelerations (mm/s^2)
M906 X800 Y800 Z800 E800 I30                   ; set motor currents (mA) and motor idle factor in per cent
M84 S30                                        ; Set idle timeout

M671 X297:297:8.5 Y-16.8:291.2:137.2 S100        ; Z leadscrews are at (382,3.2), (382,311.2) and (93.5,157.2)

; Axis Limits
M208 X-85 Y-20 Z-50 S1                             ; set axis minima
M208 X365 Y425 Z400 S0                         ; set axis maxima

; Endstops
M574 X1 S1 P"^io0.in"                         ; configure active-high endstop for low end on X via pin !^io0.in
M574 Y1 S1 P"^io1.in"                         ; configure active-high endstop for low end on Y via pin !^io1.in

; Z-Probe
M950 S0 C"io7.out"                             ; create servo pin 0 for BLTouch
M558 P9 C"^io7.in" H25 F600 T5000              ; set Z probe type to bltouch and the dive height + speeds
G31 P500 X0 Y0 Z0                           ; set Z probe trigger value, offset and trigger height
M557 X39:247 Y33:241 S50                     ; define mesh grid

; Heaters
M308 S0 P"temp0" Y"thermistor" T100000 B4138   ; configure sensor 0 as thermistor on pin temp0
M950 H0 C"out1" T0                             ; create bed heater output on out1 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
M143 H0 S120                                   ; set temperature limit for heater 0 to 120C
M308 S1 P"20.temp0" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin 1.temp0
M950 H1 C"20.out0" T1                           ; create nozzle heater output on 1.out0 and map it to sensor 1
M307 H1 B0 S1.00 A975 C346 D5.5                 ; disable bang-bang mode for heater  and set PWM limit

; Fans
M950 F0 C"20.out1" Q500                         ; create fan 0 on pin 1.out1 and set its frequency
M106 P0 S0 H-1                                 ; set fan 0 value. Thermostatic control is turned off
M950 F1 C"20.out2" Q500                         ; create fan 1 on pin 1.out2 and set its frequency
M106 P1 S1 H1 T45                              ; set fan 1 value. Thermostatic control is turned on

; Tools
M563 P0 S"Tool 0" D0 H1 F0                     ; 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

;G10 P0 X12 Y99 Z-46                                ; set tool 0 axis offsets
;G10 P0 R0 S0                                   ; set initial tool 0 active and standby temperatures to 0C
M563 P1 S"Fake Tool 1" F-1                     ; define tool 1
G10 P1 X0 Y0 Z0                                ; set tool 1 axis offsets
G10 P1 R0 S0                                   ; set initial tool 1 active and standby temperatures to 0C

M950 S1 C"out9"                                ; create servo pin 1 for toolchanger

G10 P0 X-11.10 Y-95.478 Z-22                               ; set tool 0 axis offsets12 Y99 Z-46

T-1

; Custom settings are not defined

; Miscellaneous
M501                                           ; load saved parameters from non-volatile memory

tfree0.g:

; tfree0.g
; called when tool 0 is freed
;
; generated by RepRapFirmware Configuration Tool v3.1.3 on Sun Jun 28 2020 21:43:54 GMT-0700 (Pacific Daylight Time)

G91          ; Relative
G1 Z50       ; Drop Bed
G1 Y25       ; Move Y out for safety
G90          ; absolute

G29 S2       ; mesh leveling off

; Reset Offset
;G10 P0 X0 Y0 Z0                                ; set tool 0 axis offsets

G53 G1 X0 F9000  ; Line up X
G53 G1 Y40        ; Line up Y

G53 G1 Y-16 F3000    ; Push In
M280 P1 S199    ; Release Servo
G4 P1500         ; Wait 3 Seconds

G53 G1 Y40 F3000    ; Pull out

tpre0.g

; tpre0.g
; called before tool 0 is selected
;
; generated by RepRapFirmware Configuration Tool v3.1.3 on Sun Jun 28 2020 21:43:54 GMT-0700 (Pacific Daylight Time)

;T-1 P0 ; Deselect all tools

G91          ; Relative
;G1 Z50       ; Drop Bed
G1 Y25       ; Move Y out for safety
G90          ; absolute

;G29 S2       ; mesh leveling off

G53 G1 X0 F9000  ; Line up X
G53 G1 Y40        ; Line up Y

M280 P1 S199    ; Release Servo
G4 P1500
G53 G1 Y-16 F3000    ; Push In
M280 P1 S0    ; Grab Servo
G4 P1500          ; Wait 3 Seconds

G53 G1 Y40 F3000    ; Pull out

; Set Offsets
;G10 P0 X12 Y99 Z-46                                ; set tool 0 axis offsets12 Y99 Z-46
;G10 P0 X-11.10 Y-95.478 Z-22.632                                ; set tool 0 axis offsets12 Y99 Z-46

tpost0.g

; tpost0.g
; called after tool 0 has been selected
;
; generated by RepRapFirmware Configuration Tool v3.1.3 on Sun Jun 28 2020 21:43:54 GMT-0700 (Pacific Daylight Time)
; Wait for set temperatures to be reached
M116 P0

;mesh levelling on
;G29 S1
StephenRC commented 4 years ago

Go to the forum https://forum.duet3d.com for help and also post your config.g and tool change files when you do.

On Thu, 30 Jul 2020 01:07:00 -0700, Moonlight63 notifications@github.com had a flock of green cheek conures squawk out:

I'm having a really strange issue in rrf3 that is causing tool offsets in the z axis to revert to the last machine coordinate without physically moving the bed, such that when any other axis is updated, the bed moves to that position in the new tool coordinate system. This is extremely bad as it can easily result in tools ramming into a the bed or printed part because the machine doesn't seem to know where the z axis actually is.

I've made this video showing it happen in DWC and I try to explain it in a little more detail. I don't have a clue what is causing this and it has had me stumped for a few days. I haven't seen anyone else with this problem, but I can't imagine this isn't an issue on an e3d toolchanger as well?

https://youtu.be/tvf8z429y_o

Thank you!