XY shift after power fail
-
I'm working on resume print after a power fail. It all seems to work except that the XY is offset when the print is resumed. The image shows the little test triangle with a consistent offset of about -0.3 mm in X direction and -3.5 in Y. Any thoughts on what's happening?
My resurrect-prologue.g file:
M116 ; wait for temperatures
G28 X Y ; home X and Y
M83 ; relative extrusionMy M911 settings within config.g:
M911 S21.0 R30.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Power failure configurationMy ressurect.g file contents:
; File "0:/gcodes/rr_Macro tester 0.6n_0.25L_PLA_16m_6g.gcode" resume print after print paused at 2022-01-24 15:40
G21M140 P0 S60.0
G29 S1
T-1 P0
G92 X116.708 Y56.011 Z7.900
G60 S1
G10 P0 S220 R220
T0 P0
M98 P"resurrect-prologue.g"
M116
M290 X0.000 Y0.000 Z0.000 R0
T-1 P0
T0 P6
; Workplace coordinates
G10 L2 P1 X0.00 Y0.00 Z0.00
G10 L2 P2 X0.00 Y0.00 Z0.00
G10 L2 P3 X0.00 Y0.00 Z0.00
G10 L2 P4 X0.00 Y0.00 Z0.00
G10 L2 P5 X0.00 Y0.00 Z0.00
G10 L2 P6 X0.00 Y0.00 Z0.00
G10 L2 P7 X0.00 Y0.00 Z0.00
G10 L2 P8 X0.00 Y0.00 Z0.00
G10 L2 P9 X0.00 Y0.00 Z0.00
G54
M106 S1.00
M106 P1 S1.00
M116
G92 E9.01201
M82
M486 S0 A"Shape-Box id:0 copy 0"
M486 S0G17
M23 "0:/gcodes/rr_Macro tester 0.6n_0.25L_PLA_16m_6g.gcode"
M26 S89291
G0 F6000 Z9.900
G0 F6000 X116.708 Y56.011
G0 F6000 Z7.900
G1 F2621.0 P0
G21
M24 -
@tomf why not home X and Y as part of the resume?
-
@jay_s_uk said in XY shift after power fail:
@tomf why not home X and Y as part of the resume?
Homing XY is included the resurrect-prologue.g file. Once power is restored, I send command M916 to resume the print from where it stopped, as in the documentation.
Is there a better way? -
@tomf hmmm, ok. What type of endstops do you hav e?
-
@jay_s_uk said in XY shift after power fail:
@tomf hmmm, ok. What type of endstops do you hav e?
Microswitches. They have been consistent to date. The offset I'm seeing is also very consistent. I've checked that they are all secure.
-
@tomf said in XY shift after power fail:
Any thoughts on what's happening?
looking at your resurrect.g file, it seems that you use object cancellation to just print the triangle from a file with multiple objects. I have no solution at hand, but to pin down the problem, could you perhaps isolate the triangle into a file with nothing else in it?
Then, the two M486 gcodes should be missing from the resurrect.g - check that before you restart the print, and in case they are still there, remove these lines. The question is: is the triangle still not to scale?
-
Regarding the type of endstops, when I installed optical endstops in my corexy machine I ran a couple test prints. The first print was run normally- homing only at the start of the print, and the second print was the same gcode except that I had the machine home at every layer change.
The result was two prints that were so close to identical that if I didn't know which was which I probably would not have been able to tell.
https://drmrehorst.blogspot.com/2020/03/testing-ummds-xy-optical-endstops.html
I did not run a similar test when the machine had microswitch endstops, so I can't say if the result would have been the same.
The point is that optical endstops can provide very high precision, so resuming a print after a power interruption should not exhibit a layer shift.
-
Can you post your full config.g and homing files along with the results of M122 and M98 P"config.g" please?
-
@infiniteloop said in XY shift after power fail:
@tomf said in XY shift after power fail:
Any thoughts on what's happening?
looking at your resurrect.g file, it seems that you use object cancellation to just print the triangle from a file with multiple objects. I have no solution at hand, but to pin down the problem, could you perhaps isolate the triangle into a file with nothing else in it?
Then, the two M486 gcodes should be missing from the resurrect.g - check that before you restart the print, and in case they are still there, remove these lines. The question is: is the triangle still not to scale?
Interesting idea. The little triangle was created on Superslicer as a shape and modifier. To see if that has any effect, I created a one piece object on F360 to test that. The resulting print (image) exhibited the same offset:
The ressurect file still has M486 lines, as below. I commented these out but it didn't help.
M486 S0 A"Macro test 2 id:0 copy 0"
M486 S0G17 -
@infiniteloop I had another thought, which lead me to do a double power fail to see if the layer shift happened every time, but it only occurred at the first power fail. This test piece shows the updated test piece with a layer shift of the same magnitude (X-0.3, Y -3.5) for the first power fail, and aligned on the second power fail - a witness line shows where the restart happened.
-
@phaedrux said in XY shift after power fail:
Can you post your full config.g and homing files along with the results of M122 and M98 P"config.g" please?
Here you are:
config.g
; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"T-Rat" ; set printer name M669 K1 ; CoreXY G29 S1 ; Set Units to Millimeters ; Network M552 S1 ;TF - this sets the wifi or ethernet module to enabled. M552 P192.168.1.144 S1 ; enable network and acquire dynamic address via DHCP M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0.0 S0 D3 ; physical drive 0.0 goes forwards M569 P0.1 S0 D3 ; physical drive 0.1 goes forwards M569 P0.2 S0 D3 ; physical drive 0.2 goes forwards M569 P0.3 S1 D3 ; physical drive 0.3 goes forwards M569 P0.4 S1 D3 ; physical drive 0.4 goes forwards M569 P0.5 S0 D3 ; physical drive 0.5 goes forwards M584 X0.4 Y0.3 Z0.0:0.1:0.2 E0.5 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M911 S21.0 R30.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Power failure configuration M92 X80.00 Y80.00 Z800.00 ; set steps per mm M906 X1000 Y1000 Z800 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout M566 X600.00 Y600.00 Z60.0 E600.00 P1 ; set maximum instantaneous speed changes (mm/min) M203 X10800.00 Y10800.00 Z1000.00 E3600.00 ; set maximum speeds (mm/min) M201 X3000.00 Y3000.00 Z100.00 E3600.00 ; set accelerations (mm/s^2) ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X305 Y300 Z300 S0 ; set axis maxima ; Endstops M574 X1 S1 P"io1.in" ; configure active high endstops M574 Y2 S1 P"io0.in" ; configure active high endstops M574 Z1 S2 ; configure Z-probe endstop for low end on Z M671 X-4.5:150:304.5 Y-4.52:305:-4.52 S5 ; define positions of Z leadscrews or bed levelling screws M557 X25:270 Y35:270 P5 ; define 5x5 mesh grid ; Heaters M308 S0 P"temp0" Y"thermistor" T100000 B3950 A"Bed" ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out0" T0 ; create bed heater output on out5 and map it to sensor 0 M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S110 ; set temperature limit for heater 0 to 110C ;; Run Bed PID Tune ;; M307 H0 A303.1 C356.7 D1.4 S1.00 V24.0 B0 M307 H0 B0 R0.479 C511.2 D5.21 S1.00 V24.4 ; Fans M950 F0 C"out3" Q500 ; create fan 0 on pin out3 and set its frequency M106 P0 C"Hotend Fan" S0 H1 T45 L255 ; set fan 0 name and value. Thermostatic control turned on for Hotend M950 F1 C"out4" Q500 ; create fan 1 on pin out4 and set its frequency M106 P1 C"Layer Fan" S0 H-1 L255 ; set fan 1 name and value. Thermostatic control is turned off ; Tools M563 P0 D0 H1 F1 ; 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 M950 H1 C"out1" T1 ; create nozzle heater output on out2 and map it to sensor 1 M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit M143 H1 S280 ; set the maximum temperature in C for heater ; EVA 2 / BMG / Mosquito 300C thermistor M92 E830 ; set extruder steps per mm, 0.9 angle/step (LDO Pancake) M906 E800 ; set extruder motor current (mA) and idle factor in per cent M308 S1 P"temp1" Y"thermistor" T100000 B4680 C6.455513e-8 A"Hotend" ;; Run Heater PID Tune!! ;; M307 H1 A751.5 C196.6 D4.7 S1.00 V23.9 B0 ; Z-Probe ; BLTouch M950 S0 C"io2.out" ; Create a servo pin on io2 M558 P9 C"io2.in" H5 F240 T10800 A5 S0.04 ; set Z probe type to unmodulated and the dive height + speeds G31 P25 X-26.00 Y-18.00 Z3.1 ; set Z probe trigger value, offset and trigger height, more Z means closer to the bed M404 N1.75 D0.4 ; Filament width and nozzle diameter T0 ; Pressure Advance M572 D0 S0.04
homeall.g
; BLTouch M280 P0 S160 ; Precautionary alarm release M280 P0 S90 ; Ensure the pin is raised G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-625 Y605 F3600 ; move quickly to X and U axis endstops and stop there (first pass) G1 H1 X-625 F1800 ; move quickly to X and U axis endstops and stop there (first pass) G1 H1 Y605 F1800 ; move quickly to X and U axis endstops and stop there (first pass) G1 H2 X5 Y-5 F6000 ; go back a few mm G1 H1 X-625 Y605 F360 ; move slowly to X and U axis endstops once more (second pass) G1 H1 X-625 F360 ; move slowly to X and U axis endstops once more (second pass) G1 H1 Y605 F360 ; move slowly to X and U axis endstops once more (second pass) G90 ; absolute positioning G1 X150 Y150 F10000 ; go to first probe point G30 ; home Z by probing the bed G91 ; relative positioning G1 Z5 F100 ; lift Z relative to current position G90 ; absolute positioning
homex.g
G91 ; relative positioning ;G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-625 F1800 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X5 F6000 ; go back a few mm G1 H1 X-625 F360 ; move slowly to X axis endstop once more (second pass) ;G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning
homey.g
G91 ; relative positioning ;G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 Y605 F1800 ; move quickly to Y axis endstop and stop there (first pass) G1 Y-5 F6000 ; go back a few mm G1 H1 Y605 F360 ; move slowly to Y axis endstop once more (second pass) ;G1 H2 Z-5 F6000 ; lower Z again G90 ; absolute positioning
homez,g
; BLTouch M280 P0 S160 ; Precautionary alarm release M280 P0 S90 ; Ensure the pin is raised G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G90 ; absolute positioning G1 X150 Y150 F10000 ; go to first probe point 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
M122
M122 === Diagnostics === RepRapFirmware for Duet 3 Mini 5+ version 3.3 (2021-06-15 21:46:11) running on Duet 3 Mini5plus WiFi (standalone mode) Board ID: XZZAQ-X296U-D65J0-40KMQ-2Z03Z-ZFS7W Used output buffers: 3 of 40 (24 max) === RTOS === Static ram: 102724 Dynamic ram: 106620 of which 184 recycled Never used RAM 31320, free system stack 120 words Tasks: NETWORK(ready,15.7%,214) HEAT(notifyWait,0.0%,364) Move(notifyWait,0.1%,299) CanReceiv(notifyWait,0.0%,941) CanSender(notifyWait,0.0%,357) CanClock(delaying,0.0%,340) TMC(notifyWait,1.2%,115) MAIN(running,82.2%,394) IDLE(ready,0.0%,29) AIN(delaying,0.8%,264), total 100.0% Owned mutexes: WiFi(NETWORK) === Platform === Last reset 00:22:42 ago, cause: power up Last software reset at 2022-01-24 15:14, reason: User, GCodes spinning, available RAM 31144, 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 1362270, completed 1362270, timed out 0, errs 0 Step timer max interval 864 MCU temperature: min 30.1, current 31.4, max 32.2 Supply voltage: min 24.2, current 24.4, max 24.5, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 99/0, heap memory allocated/used/recyclable 2048/64/64, gc cycles 0 Driver 0: position 20000, standstill, SG min/max 0/16, read errors 0, write errors 0, ifcnt 13, reads 58255, writes 13, timeouts 0, DMA errors 0 Driver 1: position -12000, standstill, SG min/max 0/16, read errors 0, write errors 0, ifcnt 13, reads 58255, writes 13, timeouts 0, DMA errors 0 Driver 2: position 29693, standstill, SG min/max 0/16, read errors 0, write errors 0, ifcnt 13, reads 58254, writes 13, timeouts 0, DMA errors 0 Driver 3: position 0, standstill, SG min/max 0/10, read errors 0, write errors 0, ifcnt 13, reads 58254, writes 13, timeouts 0, DMA errors 0 Driver 4: position 0, standstill, SG min/max 0/16, read errors 0, write errors 0, ifcnt 13, reads 58255, writes 13, timeouts 0, DMA errors 0 Driver 5: position 0, standstill, SG min/max 0/278, read errors 0, write errors 0, ifcnt 13, reads 58255, writes 13, timeouts 0, DMA errors 0 Driver 6: position 0, standstill, SG min/max 0/0, read errors 0, write errors 0, ifcnt 9, reads 58258, writes 9, timeouts 0, DMA errors 0 Date/time: 2022-01-25 08:54:29 Cache data hit count 2500014546 Slowest loop: 191.04ms; fastest: 0.07ms === Storage === Free file entries: 10 SD card 0 detected, interface speed: 22.5MBytes/sec SD card longest read time 3.4ms, write time 10.4ms, max retries 0 === Move === DMs created 83, maxWait 71213ms, bed compensation in use: mesh, comp offset 0.000 === MainDDARing === Scheduled moves 381, completed moves 381, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters = 0 -1, chamberHeaters = -1 -1 Heater 0 is on, I-accum = 0.0 Heater 1 is on, I-accum = 0.4 === 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 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 Code queue is empty. === CAN === Messages queued 12261, received 0, lost 0, longest wait 0ms for reply type 0, peak Tx sync delay 0, free buffers 17 (min 17), ts 6811/0/0 Tx timeouts 0,3,6810,0,0,5445 last cancelled message type 30 dest 127 === Network === Slowest loop: 227.55ms; fastest: 0.00ms Responder states: HTTP(0) 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.26 WiFi MAC address d8:bf:c0:14:e7:f2 WiFi Vcc 3.33, reset reason Power up WiFi flash size 2097152, free heap 25288 WiFi IP address 192.168.1.144 WiFi signal strength -82dBm, mode 802.11n, reconnections 0, sleep mode modem Clock register 00002002 Socket states: 0 0 0 0 0 0 0 0
M98 P"config.g"
M98 P"config.g" Warning: the height map was loaded when the current Z=0 datum was not determined probing. This may result in a height offset. Error: in file macro line 10 column 7: M552: expected string expression HTTP is enabled on port 80 FTP is disabled TELNET is disabled Warning: Heater 0 appears to be over-powered. If left on at full power, its temperature is predicted to reach 269C
-
@tomf The result of your double power fail is interesting: seems that resurect.g shifts X and Y consistently. I propose to try this:
Comment-out any homing commands from your start.g and from the start section (if any) of your slicer. Instead, before starting the test print, home X/Y withG28 X Y
(home Z as usual, that doesn't matter here). If you still see the layer shift after power-off, we have to look where the origin of X/Y might eventually be re-defined. In case the layer shift is gone, we can focus on your homing macros. -
@infiniteloop said in XY shift after power fail:
@tomf The result of your double power fail is interesting: seems that resurect.g shifts X and Y consistently. I propose to try this:
Comment-out any homing commands from your start.g and from the start section (if any) of your slicer. Instead, before starting the test print, home X/Y withG28 X Y
(home Z as usual, that doesn't matter here). If you still see the layer shift after power-off, we have to look where the origin of X/Y might eventually be re-defined. In case the layer shift is gone, we can focus on your homing macros.That made a difference! There's still an offset, but this time X-1.7, Y-2.0 so it suggests something's going on there. I don't know what but I really appreciate your input!
I don't have a start.g, instead I have homng and bed levelling in the slicer start code. I will change that and move the homing commands to to a start.g. I'll run again and report the findings. -
Can you post your slicer start gcode or better yet the first 50 lines or so of your sliced gcode file?
I can see some oddities in your config.g but nothing I think would cause the offset.
-
@phaedrux said in XY shift after power fail:
Can you post your slicer start gcode or better yet the first 50 lines or so of your sliced gcode file?
I can see some oddities in your config.g but nothing I think would cause the offset.
I don't know how to see the code lines in the gcode file, but here is the sliced file of the updated test part. rr_Macro test 2.1 0.4n_0.2L_PLA_16m_6g.gcode
I would appreciate knowing any 'oddities' in my config.g as I'm fairly new at this and trying to get it running smoothly.
Here is the start code from my slicer. I'm not using a start.g file
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
G28; HOME ALL
G32 ; MESH BED LEVELLING
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
M572 D0 S0.04 ;set PRESSURE ADVANCE;;PRIME LINE
G4 P1000; Pause
M300 S500 P800; Beep and we're off!
G4 P1000; PauseM564 S0 ; allow movement outside boundary
G1 X190.0 Y-2.0 Z0.4 F1000.0 ; go outside print are
G92 E0.0 ; set extruder position
G1 X170.0 E9.0 F1000.0 ; intro line
G1 X120.0 E12.5 F1000.0 ; main prime
G92 E0.0; reset extruder
M564 S1 ; limit movement within axis boundaries -
@tomf said in XY shift after power fail:
Here is the start code from my slicer.
Looking at your slicer's start code, I suggest you to retry the procedure I proposed in a previous post - with one additional step:
Append this line from the slicer's start script to your resurrect-prologue.g:
M564 S0
I'm really curious what happensEdit: Another thing worth trying is to remove the priming block (enclosed by the
M564
gcodes) from the start code before you slice the test print. I still don't know from where the offset originates: from the initial setup or from the retry after power failure. -
@infiniteloop said in XY shift after power fail:
M564 S0
Sorry, that didn't make any difference.
Neither did moving the home & levelling routines from the slicer to a start.g file
Neither did changing the purge line on the slicer's start gcode to be entirely within the axis boundary.
EDIT: Neither did commenting out the prime line block of the slicer start code.All these give a consistent XY offset of (-0.3, -3.5).
Not sure what to do from here.
-
@tomf said in XY shift after power fail:
@infiniteloop said in XY shift after power fail:
M564 S0
Sorry, that didn't make any difference.
Neither did moving the home & levelling routines from the slicer to a start.g file
Neither did changing the purge line on the slicer's start gcode to be entirely within the axis boundary.
EDIT: Neither did commenting out the prime line block of the slicer start code.All these give a consistent XY offset of (-0.3, -3.5).
Not sure what to do from here.
If the offset is consistent as a temporary fix could you not add a relative G1 move somewhere to adjust for it?
Frederick
-
@fcwilt Yes I may end up doing that but I would much rather get to the root cause.
-
@tomf said in XY shift after power fail:
G32 ; MESH BED LEVELLING
Can you post your bed.g file as well?