Can I use G32 to call bed.g and run G29 in it?
printerguy3d last edited by
I am struggling to try and combine some commands.
Can I use G32 to call bed.g and inside my bed.g file call G29 to get the bed mesh?
Is this creating a recursive loop and kicking it out?
Here is the start of my sequence.
; reset filament monitor
M42 P63 S0
M42 P63 S1
M104 S0 ;cancel S3D set temp
G21 ; set units to mm
G90 ; use absolute coordinates
T0 ; select tool 0
G92 E0.0 ; reset e count
M220 S100 ; reset speed multiplier
M140 S45 ; set bed temp and do not wait
G32 ; probe bed
M190 S45 ; set bed temperature and wait
M109 S230 ; set print head temperature and wait
; === pause for heating ===
But it seems that when G32 runs, nothing happens.
Here is the bed.g file called by G32
M83 ; set extruder to relative mode
G29 S2 ; clear any existing height map
M557 X7:353 Y11:354 P2:2 ; Define G29 grid. Done here so we don't have to modify config.g
; heat and home
M104 S260 ; set head temperature and do not wait
G28 ; home all axes
G28 Z ; home Z again in case it was bottomed out
M109 S260 ; set head temperature and wait
; Probe sequence
G29 ; probe bed
G1 X1 Y1 Z10 F4000 ; move to home position
Is there a better way to do this?
@printerguy3d G32 basically just calls bed.g. G29 is a pretty normal part of bed.g, so no problem there; you just wouldn't put G32 in bed.g.
The sequence in your code is:
- Your gcode sets the bed temperature, then does not wait to call bed.g
- bed.g sets the hot end temperature, then homes without waiting
- It then sets the hot end temperature and waits to get to temperature
- Then probes the bed to create and save the bed mesh, returns to start gcode
- Sets hot end and bed temps, waits to get to them
So you're probing while the hot end and bed are still warming up. Unless your bed is changing all the time, and needs calibrating between every print, it's better to just load a saved bed mesh heightmap. I do it by having a bed.g macro that:
- heats the bed to the operating temperature
- homes the axes (I have X0 Y0 in the middle of my bed)
- probe the bed with G29, saving the results
Then each time you print, home and probe the bed once at the centre to set the Z height, and load the bed mesh. Generate a new bed mesh with G32 if you notice it needs it.