Duet3D / RepRapFirmware

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

[Bug]: G28 X causes Z to crash into bed after X is homed #974

Closed NNygren closed 4 months ago

NNygren commented 4 months ago

Duet Forum Discussion Thread

https://forum.duet3d.com/topic/35418/3-5-0-rc-4-z-print-head-crashes-into-bed-at-end-of-print

Which Duet products are you using?

Firmware Version

3.5.0-rc.4

Duet Web Control Version

3.5.0-rc.4

Are you using a Single Board Computer (RaspberryPi) with your Duet?

Please upload the results of sending M122 in the gcode console.

M122
=== Diagnostics ===
RepRapFirmware for Duet 3 Mini 5+ version 3.5.0-rc.4 (2024-04-09 09:45:40) running on Duet 3 Mini5plus WiFi (standalone mode)
Board ID: AATGZ-U396U-D65J0-40KM4-NM03Z-HUQXW
Used output buffers: 17 of 40 (18 max)
=== RTOS ===
Static ram: 103232
Dynamic ram: 121344 of which 0 recycled
Never used RAM 16840, free system stack 208 words
Tasks: NETWORK(2,nWait 7,9.9%,241) HEAT(3,nWait 6,0.0%,351) Move(4,nWait 6,0.0%,355) CanReceiv(6,nWait 1,0.0%,940) CanSender(5,nWait 7,0.0%,336) CanClock(7,delaying,0.0%,336) TMC(4,nWait 6,0.8%,111) MAIN(1,running,87.3%,665) IDLE(0,ready,1.1%,30) AIN(4,delaying,0.8%,265), total 100.0%
Owned mutexes: WiFi(NETWORK)
=== Platform ===
Last reset 00:00:19 ago, cause: software
Last software reset at 2024-04-10 22:46, reason: User, Gcodes spinning, available RAM 12780, slot 0
Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00000000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
Error status: 0x00
MCU revision 3, ADC conversions started 19801, completed 19801, timed out 0, errs 0
MCU temperature: min 33.4, current 33.6, max 34.3
Supply voltage: min 24.2, current 24.3, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes
Heap OK, handles allocated/used 0/0, heap memory allocated/used/recyclable 0/0/0, gc cycles 0
Events: 0 queued, 0 completed
Driver 0: standstill, SG min 232, read errors 0, write errors 1, ifcnt 62, reads 1019, writes 10, timeouts 0, DMA errors 0, CC errors 0
Driver 1: standstill, SG min 40, read errors 0, write errors 1, ifcnt 58, reads 1019, writes 10, timeouts 0, DMA errors 0, CC errors 0
Driver 2: standstill, SG min 48, read errors 0, write errors 1, ifcnt 57, reads 1019, writes 10, timeouts 0, DMA errors 0, CC errors 0
Driver 3: standstill, SG min 0, read errors 0, write errors 1, ifcnt 36, reads 1019, writes 10, timeouts 0, DMA errors 0, CC errors 0
Driver 4: standstill, SG min 96, read errors 0, write errors 1, ifcnt 58, reads 1019, writes 10, timeouts 0, DMA errors 0, CC errors 0
Driver 5: not present
Driver 6: not present
Date/time: 2024-04-10 22:46:58
Cache data hit count 34818885
Slowest loop: 4.37ms; fastest: 0.16ms
=== Storage ===
Free file entries: 20
SD card 0 detected, interface speed: 22.5MBytes/sec
SD card longest read time 0.6ms, write time 0.0ms, max retries 0
=== Move ===
DMs created 83, segments created 0, maxWait 0ms, bed compensation in use: none, height map offset 0.000, max steps late 0, min interval 0, bad calcs 0, ebfmin 0.00, ebfmax 0.00
no step interrupt scheduled
Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0
=== DDARing 0 ===
Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
=== DDARing 1 ===
Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
=== Heat ===
Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
Heater 1 is on, I-accum = 0.0
=== GCodes ===
Movement locks held by null, 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
LCD is idle in state(s) 0
SBC is idle in state(s) 0
Daemon is idle in state(s) 0
Aux2 is idle in state(s) 0
Autopause is idle in state(s) 0
File2 is idle in state(s) 0
Queue2 is idle in state(s) 0
Q0 segments left 0, axes/extruders owned 0x0000803
Code queue 0 is empty
Q1 segments left 0, axes/extruders owned 0x0000000
Code queue 1 is empty
=== CAN ===
Messages queued 177, received 0, lost 0, errs 93845, boc 0
Longest wait 0ms for reply type 0, peak Tx sync delay 0, free buffers 26 (min 26), ts 99/0/0
Tx timeouts 0,0,98,0,0,77 last cancelled message type 4514 dest 127
=== Network ===
Slowest loop: 3.81ms; fastest: 0.00ms
Responder states: MQTT(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)
HTTP sessions: 1 of 8
=== WiFi ===
Interface state: active
Module is connected to access point 
Failed messages: pending 0, notrdy 0, noresp 0
Firmware version 2.1beta7
MAC address f4:cf:a2:6f:9a:ba
Module reset reason: Power up, Vcc 3.36, flash size 2097152, free heap 39656
WiFi IP address 192.168.1.12
Signal strength -58dBm, channel 9, mode 802.11n, reconnections 0
Clock register 00002001
Socket states: 0 0 0 0 0 0 0 0

Please upload the content of your config.g file.

; Configuration file for RepRapFirmware on Duet 3 Mini 5+ Ethernet
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.5.0-rc.3+2 on Fri Apr 05 2024 23:17:08 GMT-0500 (Central Daylight Time)

; General
G90 ; absolute coordinates
M83 ; relative extruder moves
M550 P"Prusa Bear" ; set hostname
M911 S19.8 R22 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss

; Accessories
;M918 P2 E4 F2000000 C30 R6 ; configure direct-connect display
;M150 X2 R255 U255 B255 S3   ; set all 3 LEDs to white

; Network
M552 S1 ; configure network
M586 P0 S1 ; enable HTTP

; Smart Drivers
M569 P0.0 S0 D3 V10 ; driver 0.0 goes backwards (X axis)
M915 P0.0 S6 ; set StallGuard threshold
M569 P0.1 S1 D3 V10 ; driver 0.1 goes forwards (Y axis)
M915 P0.1 S1 ; set StallGuard threshold
M569 P0.2 S0 D3 V38 ; driver 0.2 goes backwards (Z axis)
M569 P0.3 S1 D2 ; driver 0.3 goes forwards (extruder 0)
M569 P0.4 S0 D3 V38 ; driver 0.4 goes backwards (Z axis)

; Motor Idle Current Reduction
M906 I30 ; set motor current idle factor
M84 S30 ; set motor current idle timeout

; Axes
M584 X0.0 Y0.1 Z0.2:0.4 ; set axis mapping
M671 X-50:305 Y0:0 P2 S10 ; define dual driven z-axis with 8mm pitch for leadscrews
M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation
M906 X1200 Y1200 Z1200 ; set axis driver currents
M92 X100 Y100 Z400 ; configure steps per mm
M208 X-8:250 Y-8:210 Z0:210 ; set minimum and maximum axis limits
M566 X480 Y480 Z480 ; set maximum instantaneous speed changes (mm/min) X and Y can be 600
M203 X9000 Y9000 Z960 ; set maximum speeds (mm/min)
;M201 X500 Y500 Z20 ; set accelerations (mm/s^2)
M201 X500 Y500 Z250

; Extruders
M584 E0.3 ; set extruder mapping
M350 E16 I1 ; configure microstepping with interpolation
M906 E800 ; set extruder driver currents
M92 E140 ; configure steps per mm
M566 E360 ; set maximum instantaneous speed changes (mm/min)
M203 E3600 ; set maximum speeds (mm/min)
M201 E500 ; set accelerations (mm/s^2)

; Kinematics
M669 K0 ; configure Cartesian kinematics

; Probes
M558 P5 C"io3.in" H2 F800:300 T6000 A3 ; configure digital probe via slot #0
G31 P1000 X0 Y0 Z1.0966 ; set Z probe trigger value, offset and trigger height with steel TEXTURED sheet
;G31 P1000 X0 Y0 Z0.9003 ; set Z probe trigger value, offset and trigger height with steel SMOOTH sheet

; Endstops
M574 X1 S3 ; configure X axis endstop
M574 Y1 S3 ; configure Y axis endstop
M574 Z1 S2 ; configure Z axis endstop
M574 Z2 S3 ; top end Z ?

; sensorless homing
M915 X S6 F0 H112 R0                                   ; set X axis Sensitivity
M915 Y S1 F0 H112 R0                                   ; set Y axis Sensitivity

; Mesh Bed Compensation
M557 X13:217 Y1:198 P3 ; define grid for mesh bed compensation
M376 H2 ; Fade height 2mm

; Sensors
M308 S0 P"temp0" Y"thermistor" A"Bed" T100000 B4725 C7.06e-8 ; configure sensor #0
M308 S1 P"temp1" Y"thermistor" A"Nozzle" T100000 B4725 C7.06e-8 ; configure sensor #1

; Heaters
M950 H0 C"out0" T0 ; create heater #0
M143 H0 P0 T0 C0 S120 A0 ; configure heater monitor #0 for heater #0
;M307 H0 R2.43 D5.5 E1.35 K0.56 B1 ; configure model of heater #0
M950 H1 C"out1" T1 ; create heater #1
M143 H1 P0 T1 C0 S280 A0 ; configure heater monitor #0 for heater #1
;M307 H1 R2.43 D5.5 E1.35 K0.56 B0 ; configure model of heater #1
M307 H1 R2.203 K0.332:0.243 D6.51 E1.35 S1.00 B0 V24.2

; Heated beds
M140 P0 H0 ; configure heated bed #0

; Fans
M950 F0 C"out5" ; create fan #0
M106 P0 S0 L0 X1 B0.1 ; configure fan #0
M950 F1 C"out6" ; create fan #1
M106 P1 S0 B0.1 H1 T55 ; configure fan #1

; Tools
M563 P0 D0 H1 F0 ; create tool #0
M568 P0 R0 S0 ; set initial tool #0 active and standby temperatures to 0C

; Miscellaneous
M501 ; load saved parameters from non-volatile memory
T0 ; select first tool

; Accelerometer for Input Shaping
;M955 P0 C"spi.cs2+spi.cs1" ; all wires connected to temp DB connector

; Custom settings
M572 D0 S0.045       ; Pressure Advance
M207 S0.65 F2400 Z0  ; firmware retraction
M593 P"zvddd" F61    ; use input shaping to cancel ringing

Please upload the content of any other releveant macro files.

No response

Details specific to your printer.

Cartesian

Links to additional info.

No response

What happened?

Expected result At end of print, my GCODE is: ... G28 X ... G90 ;absolute positioning G1 Y200 ;move Y forward to present print

Observed result Console displayed "Error: G1: intermediate position outside machine limits Finished printing file 0:/gcodes/Shooter-Disc.gcode, print time was 0h 10m" G1 Y200 was never executed.

Steps to reproduce Type in G28 X into DWC command line produced same result

NNygren commented 4 months ago

The homex.g file generated by the RepRapFirmware Config tool ends with G1 H2 Z-2 F6000 ; lower Z again and commenting that out stopped the print head from crashing into the bed after homing.

dc42 commented 4 months ago

Did you forget to include G90/G91 around those lines? Assuming the homex.g file raised Z by 2mm earlier in the file.