Solved Job.Layer not working anymore with 3.3rc2
-
Hi,
Did i have something overlooked? I use this Macro to calibrate PA and it was Working with RFF3.2
;Increase pressure advance by 0.005 every 5 layers echo "Layer " ^ job.layer if job.layer == 1 M572 D0 S0.00 ; starting value echo "Layer " ^ job.layer ^ " started" echo "Pressure advance reset to " ^ {move.extruders[0].pressureAdvance + 0.000} elif mod(job.layer, 25) == 0 ; no. of layers M572 D0 S{move.extruders[0].pressureAdvance + 0.01} ; increment echo "Layer " ^ job.layer ^ " started" echo "Pressure advance = " ^ {move.extruders[0].pressureAdvance + 0.000}
The same script Throws with 3.3rc 2 the following error:
16.5.2021, 15:56:02 M98 P"0:/macros/pa-calibrate" Layer null Error: in file macro line 3 column 15: meta command: expected an expression
Here is The problem that the Value of job.layer is NULL and not 0 so i have tried to fix it with the following change:
;Increase pressure advance by 0.005 every 5 layers echo "Layer " ^ job.layer if job.layer != null if job.layer == 1 M572 D0 S0.00 ; starting value echo "Layer " ^ job.layer ^ " started" echo "Pressure advance reset to " ^ {move.extruders[0].pressureAdvance + 0.000} elif mod(job.layer, 25) == 0 ; no. of layers M572 D0 S{move.extruders[0].pressureAdvance + 0.01} ; increment echo "Layer " ^ job.layer ^ " started" echo "Pressure advance = " ^ {move.extruders[0].pressureAdvance + 0.000}
The good thing the error is gone but the bad thing job.layer will never updated and stays on NULL I have looked in the object model Browser and here is this message:
Selected node: job.layer Summary Number of the current layer or null not available
Did i something make wrong here? was here a change which i have overlooked?
-
@siam as from 3.3beta2 RRF no longer attempts to work out the layer number from changes in the Z coordinate. It often got it wrong and modern slicer features such as variable layer height confused it. RRF does now recognise layer number comments in the GCode files generated by most slicers. See https://github.com/Duet3D/RepRapFirmware/wiki/Changelog-RRF-3.x-Beta-&-RC#reprapfirmware-33beta2.
-
@dc42 Ok that makes sense thanks !
-
@siam if someone have the same issue add the following line (in Prusaslicer) to the G-Code before layer change:
; layer [layer_num], Z = [layer_z]
And use this Script
;Increase pressure advance by 0.005 every 5 layers echo "Layer " ^ job.layer if job.layer != null if job.layer == 1 M572 D0 S0.00 ; starting value echo "Layer " ^ job.layer ^ " started" echo "Pressure advance reset to " ^ {move.extruders[0].pressureAdvance + 0.000} elif mod(job.layer, 25) == 0 ; no. of layers M572 D0 S{move.extruders[0].pressureAdvance + 0.01} ; increment echo "Layer " ^ job.layer ^ " started" echo "Pressure advance = " ^ {move.extruders[0].pressureAdvance + 0.000}
-
I was also wondering why I no longer so layer number. Glad I found this thread. Can I ask what model you use with your pressure advance script?
Do you call your script at end of start gcode? -
@nurooi use a 100mm cube, 1 bottom layer, 1 perimeters, and no infill. the Script will called on layer change in the slicer
-