Start G-code affecting nozzle height

My Start G-Code stopped working after one of the firmware updates. I was getting an M112 error because one of the commands was supported. I’ve since tried a few Start G-codes from the forum but I’m not getting a good first layer. It looks like the tool head is ignoring UBL and\or the planing done prior to the print. The tool head will be too high on one side and too low on another. Can someone help? I’ve also already recalibrated my Z-offset several times. This is the G-Code I’m currently using. (I’m running my printer with no wiper pads so wiping is not necessary)

M73 P0 ; clear GLCD progress bar

M75 ; start GLCD timer

G26 ; clear potential ‘probe fail’ condition

M107 ; disable fans

M420 S0 ; disable leveling matrix

G90 ; absolute positioning

M82 ; set extruder to absolute mode

G92 E0 ; set extruder position to 0

M140 S{first_layer_bed_temperature[0]} ; start bed heating up

G28 XY ; home X and Y

G0 X-19 Y258 F1000 ; move to safe homing position

G28 Z ; home Z

M109 R{first_layer_temperature[0] - 60} ; wait for extruder to reach wiping and retract temp

G1 E-15 F100 ; retract filament

;;G0 X-16.5 Y100 F3000 ; move above wiper pad

;;G0 Z1 ; PushIntoPad

;;G3 Y94 R3 F1000 ; BeginWipe

;;G2 Y88 R3 F1000 ; CurveWipe

;;G3 Y82 R3 F2000 ; CurveWipe

;;G2 Y76 R3 F2000 ; CurveWipe

;;G3 Y70 R3 F1000 ; CurveWipe

;;G2 Y64 R3 F1000 ; CurveWipe

;;G3 Y58 R3 F2000 ; CurveWipe

;;G2 Y52 R3 F2000 ; CurveWipe

;;G3 Y46 R3 F1000 ; CurveWipe

;;G2 Y40 R3 F1000 ; CurveWipe

;;G3 Y34 R3 F2000 ; CurveWipe

;;G2 Y28 R3 F2000 ; CurveWipe

;;G3 Y22 R3 F1000 ; CurveWipe

;;G3 Y28 R3 F1000 ; CurveWipeTurnAround

;;G2 Y34 R3 F2000 ; CurveWipe

;;G3 Y40 R3 F2000 ; CurveWipe

;;G2 Y46 R3 F1000 ; CurveWipe

;;G3 Y52 R3 F1000 ; CurveWipe

;;G2 Y58 R3 F2000 ; CurveWipe

;;G3 Y64 R3 F2000 ; CurveWipe

;;G2 Y70 R3 F1000 ; CurveWipe

;;G3 Y76 R3 F1000 ; CurveWipe

;;G2 Y82 R3 F2000 ; CurveWipe

;;G3 Y88 R3 F2000 ; CurveWipe

;;G2 Y94 R3 F1000 ; CurveWipe

;;G3 Y100 R3 F1000 ; CurveWipe

;;G0 Z0.5 ; PushIntoFinalWipe

;;G3 Y94 R3 F300 ; FinalWipe

;;G3 Y100 R3 F300 ; FinalWipe

;;G3 Y94 R3 F300 ; FinalWipe

;;G3 Y100 R3 F300 ; FinalWipe

;;G0 Z10 ; raise extruder

M400 ; Finish Moves

M109 R{first_layer_temperature[0] - 60} ; wait for extruder to reach probe temp

M190 R{first_layer_bed_temperature[0]} ; wait for bed to reach printing temp

M155 S30 ; reduce temperature reporting rate to reduce output pollution

M204 S100 ; set probing acceleration

G29 P1 ; automatically populate mesh with all reachable points

G29 P2 ; manual probe unreachable areas

G29 P3 ; infer the rest of the mesh values

G29 P5 ; mean correction use c value to execute g29 p6 c(meanH) also

@BEDLEVELVISUALIZER ; tell the plugin to watch for reported mesh

M420 S1 V ; enabled leveling and report the new mesh

G29 F 10.0 ; Set Fade Height for correction at 10.0 mm.

G29 A ; Activate the UBL System.

G29 J3 ; PLANE LEVEL

M425 Z ; use measured Z backlash for compensation

M425 Z F0 ; turn off measured Z backlash compensation. (if activated in the quality settings, this command will automatically be ignored)

M204 S500 ; restore standard acceleration

G0 Z10 F5000 ; move up off last probe point

M400 ; wait for moves to finish

M117 Heating… ; progress indicator message on LCD

M109 R{first_layer_temperature[0]} ; wait for extruder to reach printing temp

M190 R{first_layer_bed_temperature[0]} ; wait for bed to reach printing temp

G1 Z2 E0 F75 ; prime tiny bit of filament into the nozzle

I normally don’t run G29 J3 so I am unsure if that may be invalidating the previous ubl mesh
Also see if commenting G29 P5 improves it, sometimes when the variance is too big it appears to cause problems.

M420 S1 V should come after all other ubl actions as well.

I think I would try moving the J3 to right after p5 and see if that fixes before digging deeper

Thank you! I didn’t think any of those commands would invalidate the mesh. turns out G29 P2 was causing the bed level issue. So I commented on that line, now my bed and extruder are not heating… They were before, not sure what is causing the issue. This is my new start code:

M73 P0 ; clear GLCD progress bar

M75 ; start GLCD timer

G26 ; clear potential ‘probe fail’ condition

M107 ; disable fans

M420 S0 ; disable leveling matrix

G90 ; absolute positioning

M82 ; set extruder to absolute mode

G92 E0 ; set extruder position to 0

M140 S{first_layer_bed_temperature[0]} ; start bed heating up

G28 XY ; home X and Y

G0 X-19 Y258 F1000 ; move to safe homing position

G28 Z ; home Z

M109 R{first_layer_temperature[0] - 60} ; wait for extruder to reach wiping and retract temp

G1 E-15 F100 ; retract filament

;;G0 X-16.5 Y100 F3000 ; move above wiper pad

;;G0 Z1 ; PushIntoPad

;;G3 Y94 R3 F1000 ; BeginWipe

;;G2 Y88 R3 F1000 ; CurveWipe

;;G3 Y82 R3 F2000 ; CurveWipe

;;G2 Y76 R3 F2000 ; CurveWipe

;;G3 Y70 R3 F1000 ; CurveWipe

;;G2 Y64 R3 F1000 ; CurveWipe

;;G3 Y58 R3 F2000 ; CurveWipe

;;G2 Y52 R3 F2000 ; CurveWipe

;;G3 Y46 R3 F1000 ; CurveWipe

;;G2 Y40 R3 F1000 ; CurveWipe

;;G3 Y34 R3 F2000 ; CurveWipe

;;G2 Y28 R3 F2000 ; CurveWipe

;;G3 Y22 R3 F1000 ; CurveWipe

;;G3 Y28 R3 F1000 ; CurveWipeTurnAround

;;G2 Y34 R3 F2000 ; CurveWipe

;;G3 Y40 R3 F2000 ; CurveWipe

;;G2 Y46 R3 F1000 ; CurveWipe

;;G3 Y52 R3 F1000 ; CurveWipe

;;G2 Y58 R3 F2000 ; CurveWipe

;;G3 Y64 R3 F2000 ; CurveWipe

;;G2 Y70 R3 F1000 ; CurveWipe

;;G3 Y76 R3 F1000 ; CurveWipe

;;G2 Y82 R3 F2000 ; CurveWipe

;;G3 Y88 R3 F2000 ; CurveWipe

;;G2 Y94 R3 F1000 ; CurveWipe

;;G3 Y100 R3 F1000 ; CurveWipe

;;G0 Z0.5 ; PushIntoFinalWipe

;;G3 Y94 R3 F300 ; FinalWipe

;;G3 Y100 R3 F300 ; FinalWipe

;;G3 Y94 R3 F300 ; FinalWipe

;;G3 Y100 R3 F300 ; FinalWipe

;;G0 Z10 ; raise extruder

M400 ; Finish Moves

M109 R{first_layer_temperature[0] - 60} ; wait for extruder to reach probe temp

M190 R{first_layer_bed_temperature[0]} ; wait for bed to reach printing temp

M155 S30 ; reduce temperature reporting rate to reduce output pollution

M204 S100 ; set probing acceleration

G29 P1 ; automatically populate mesh with all reachable points

;;G29 P2 ; manual probe unreachable areas

G29 P3 ; infer the rest of the mesh values

::G29 P5 ; mean correction use c value to execute g29 p6 c(meanH) also

@BEDLEVELVISUALIZER ; tell the plugin to watch for reported mesh

G29 F 10.0 ; Set Fade Height for correction at 10.0 mm.

G29 A ; Activate the UBL System.

::G29 J3 ; PLANE LEVEL

M420 S1 V ; enabled leveling and report the new mesh

M425 Z ; use measured Z backlash for compensation

M425 Z F0 ; turn off measured Z backlash compensation. (if activated in the quality settings, this command will automatically be ignored)

M204 S500 ; restore standard acceleration

G0 Z10 F5000 ; move up off last probe point

M400 ; wait for moves to finish

M117 Heating… ; progress indicator message on LCD

M109 R{first_layer_temperature[0]} ; wait for extruder to reach printing temp

M190 R{first_layer_bed_temperature[0]} ; wait for bed to reach printing temp

G1 Z2 E0 F75 ; prime tiny bit of filament into the nozzle

What mounting bracket are you using for the bltouch?
p2 only works if you can’t reach all points and have a graphical controller
I see some :: instead of ;; in your gcode this could cause problems

Here is my current relevant section:

G29 P1 ; automatically populate mesh with all reachable points
G29 P2 H0.75 ; manual probe unreachable areas
G29 P3 ; infer the rest of the mesh values
G29 P5 ; mean correction use c value to execute g29 p6 c(meanH) also
@BEDLEVELVISUALIZER ; tell the plugin to watch for reported mesh
M420 S1 V ; enabled leveling and report the new mesh

Thank you. I made some changes. Still having issues getting the start code to behave in setting probe temperature and first layer temp. It seems to be ignoring M109 & M190 or I have the command incorrect. It goes thru home and ABL as expected but never heats up the bed or the nozzle.

M73 P0 ; clear GLCD progress bar

M75 ; start GLCD timer

G26 ; clear potential ‘probe fail’ condition

M107 ; disable fans

M420 S0 ; disable leveling matrix

G90 ; absolute positioning

M82 ; set extruder to absolute mode

G92 E0 ; set extruder position to 0

M140 S{first_layer_bed_temperature} ; start bed heating up

G28 XY ; home X and Y

G0 X-19 Y258 F1000 ; move to safe homing position

G28 Z ; home Z

M109 S{first_layer_temperature} ; wait for extruder to reach wiping and retract temp

G1 E-15 F100 ; retract filament

M400 ; Finish Moves

M109 R{first_layer_temperature} ; wait for extruder to reach probe temp

M190 R{first_layer_bed_temperature} ; wait for bed to reach printing temp

M155 S30 ; reduce temperature reporting rate to reduce output pollution

M204 S100 ; set probing acceleration

G29 P1 ; automatically populate mesh with all reachable points

G29 P3 ; infer the rest of the mesh values

@BEDLEVELVISUALIZER ; tell the plugin to watch for reported mesh

G29 F 10.0 ; Set Fade Height for correction at 10.0 mm.

G29 A ; Activate the UBL System.

M420 S1 V ; enabled leveling and report the new mesh

M425 Z ; use measured Z backlash for compensation

M425 Z F0 ; turn off measured Z backlash compensation. (if activated in the quality settings, this command will automatically be ignored)

M204 S500 ; restore standard acceleration

G0 Z10 F5000 ; move up off last probe point

M400 ; wait for moves to finish

M117 Heating… ; progress indicator message on LCD

M109 R{first_layer_temperature} ; wait for extruder to reach printing temp

M190 R{first_layer_bed_temperature} ; wait for bed to reach printing temp

G1 Z2 E0 F75 ; prime tiny bit of filament into the nozzle

It does continue through the whole code and tries to print but no heat at all? I’m unsure I will take a look in more depth in a bit and see if anything stands out but first look I would figure SOME heating should take place on one of them? it shouldn’t move past the wait for cool/heat commands… interesting.

It wasn’t heating at all. I let it print through the first layer. I discovered the command was incorrect. I’ve made a couple changes and now it’s behaving. It might still have a couple extra commands it in, but at least it’s working now. The culprit was this
“{material_print_temperature_layer_0}” command.

Previously, it was in there as “First_Layer_temperature and First_Layer_Bed_Temperature” the printer wasn’t recognizing that command.

Here is my new code:

M73 P0 ; clear GLCD progress bar

M75 ; start GLCD timer

G26 ; clear potential ‘probe fail’ condition

M107 ; disable fans

M420 S0 ; disable leveling matrix

G90 ; absolute positioning

M82 ; set extruder to absolute mode

G92 E0 ; set extruder position to 0

M140 S{material_bed_temperature_layer_0} ; start bed heating up

M109 S

M104 S{material_wipe_temperature} ; start heating up extruder

M109 S{material_probe_temperature} ; wait for extruder to reach probe temp

M109

G28 XY ; home X and Y

G0 X-19 Y258 F1000 ; move to safe homing position

G28 Z ; home Z

M109 S{material_wipe_temperature} ; wait for extruder to reach wiping temp

G1 E-15 F100 ; retract filament

M400 ; Finish Moves

;; Removed Wiping

M109 S

M155 S30 ; reduce temperature reporting rate to reduce output pollution

M204 S100 ; set probing acceleration

G29 P1 ; automatically populate mesh with all reachable points

G29 P3 ; infer the rest of the mesh values

@BEDLEVELVISUALIZER ; tell the plugin to watch for reported mesh

G29 F 10.0 ; Set Fade Height for correction at 10.0 mm.

G29 A ; Activate the UBL System.

M420 S1 V ; enabled leveling and report the new mesh

M425 Z ; use measured Z backlash for compensation

M425 Z F0 ; turn off measured Z backlash compensation. (if activated in the quality settings, this command will automatically be ignored)

M204 S500 ; restore standard acceleration

G0 Z10 F5000 ; move up off last probe point

M400 ; wait for moves to finish

M117 Heating… ; progress indicator message on LCD

M109 S{material_print_temperature_layer_0} ; wait for extruder to reach printing temp

M190 S{material_bed_temperature_layer_0} ; wait for bed to reach printing temp

M109 S

G1 Z2 E0 F75 ; prime tiny bit of filament into the nozzle

Sounds good, I posted my current updated scrip to Startup Optimization and UBL re: Taz6Archim2AeroBLTouch as well.

I just realized it was your code I started with! Thank you for posting your code. It solved another previous error I was getting with my previous code.

Just FYI, for some reason this line:

‘G29 P2 ; manual probe unreachable areas’

was clearing out my mesh and causing no UBL to be used.

1 Like

That IS odd, I do have to do manual probing of the right side of my bed, I will check with a different mount if this happens to me. What mounting solution are you using?

It’s this one or something similar…. I found a thingiverse link in this forum somewhere. It’s just a right angle mounted to the X end stop on the right side of the aerostruder tool head. The probe offset is X=-52