Start sequence with KAMP for Elegoo OS Giga

Basic Information:

Printer Model: Elegoo OS Giga
klippy.log
klippy.zip (1.1 MB)

Describe your issue:

Hello all,

I’m trying to get KAMP to work properly, but I’m failing at simple tasks like getting the printer to start in the right sequence. Due to the printer being a Elegoo OS Giga (for those who aren’t familiar, it has 4 print beds acting as one but still controllable separately), the start sequence in the gcode file is not straight forward and I’m a bit lost in the documentation. I hoped that maybe someone with more knowledge then I have would be able to help me.

What I want, is for the printer to start the print in the following way:

  • Start heating to final temperature
  • In the meantime, home all axis
  • Wait for temperature of bed to reach desired threshold
  • Start adaptive meshing
  • Smart park the printhead
  • Purge a line
  • Start print

What I’m stuck at the moment and can’t figure out is how to pass the temperature settings to the gcode-macro for it to heat up and wait until it’s done. Which beds need to heat up is controlled by a start-gcode-macro in the slicer, but it makes it hard for me to understand how to pass them to my printers gcode-macro.

Start macro in the slicer:

EXTRUDER_TEMP={first_layer_temperature[initial_extruder]}

;;===== date: 20240520 =====================
;Machine_use_extruders:1
;TIME:
M400 ; wait for buffer to clear
;[printer_model]
;initial_filament:{filament_type[initial_extruder]}
;curr_bed_type={curr_bed_type}
M220 S100 ;Set the feed speed to 100%
M221 S100 ;Set the flow rate to 100%
;Giga zoned hot bed control

;Case 1
	M140 S0
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) < 402.5}
		M140 T0 S[bed_temperature_initial_layer_single]
		BED_TEMP = T0 S[bed_temperature_initial_layer_single]
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			M140 T1 S[bed_temperature_initial_layer_single]
			BED_TEMP = T1 S[bed_temperature_initial_layer_single]
		{endif}
		{if ((first_layer_print_max[1])) > 402.5}
			M140 T3 S[bed_temperature_initial_layer_single]
			BED_TEMP = T3 S[bed_temperature_initial_layer_single]
		{endif}
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405 && ((first_layer_print_max[1])) > 402.5}
			M140 T2 S[bed_temperature_initial_layer_single]
			BED_TEMP = T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 2
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) > 402.5}
		M140 T3 S[bed_temperature_initial_layer_single]
		BED_TEMP = T3 S[bed_temperature_initial_layer_single]
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			M140 T2 S[bed_temperature_initial_layer_single]
			BED_TEMP = T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 3
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) < 402.5}
		M140 T1 S[bed_temperature_initial_layer_single]
		BED_TEMP = T1 S[bed_temperature_initial_layer_single]
		{if ((first_layer_print_max[1])) > 402.5}
			M140 T2 S[bed_temperature_initial_layer_single]
			BED_TEMP = T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 4
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) > 402.5}
		M140 T2 S[bed_temperature_initial_layer_single]
		BED_TEMP = T2 S[bed_temperature_initial_layer_single]
		{endif}
	G90
;
;Giga zoned hot bed control

;Case 1
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) < 402.5}
		M190 T0 S[bed_temperature_initial_layer_single]
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			M190 T1 S[bed_temperature_initial_layer_single]
		{endif}
		{if ((first_layer_print_max[1])) > 402.5}
			M190 T3 S[bed_temperature_initial_layer_single]
		{endif}
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405 && ((first_layer_print_max[1])) > 402.5}
			M190 T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 2
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) > 402.5}
		M190 T3 S[bed_temperature_initial_layer_single]
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			M190 T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 3
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) < 402.5}
		M190 T1 S[bed_temperature_initial_layer_single]
		{if ((first_layer_print_max[1])) > 402.5}
			M190 T2 S[bed_temperature_initial_layer_single]
		{endif}
	{endif}

;Case 4
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) > 402.5}
		M190 T2 S[bed_temperature_initial_layer_single]
	{endif}

G1 Z0.4 F300
M109 S[nozzle_temperature_initial_layer]
G92 E0 ;Reset Extruder
G1 X{print_bed_max[0]*0.75+50} E30 F400 ;Draw the first line
G1 Z0.6 F120.0 ;Move to side a little
G1 X{print_bed_max[0]*0.75+47} F3000
G92 E0 ;Reset Extruder
;LAYER_COUNT:[total_layer_count]
;LAYER:0

And here is the Start gcode-macro on my printer (shamelessly stolen from K1 Helper Script) with a few things I tried to change:

[gcode_macro PRINT_START]
variable_prepare: 0
gcode:
  CLEAR_PAUSE
  {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %}
  {% set bed_temp = params.BED_TEMP %}
  {% endif %}
  {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %}
  {% set extruder_temp = params.EXTRUDER_TEMP %}
  {% endif %}
  {% if printer['gcode_macro PRINT_START'].prepare|int == 0 %}
    PRINT_PREPARE_CLEAR
    G28
    M140 {bed_temp}
    {% if printer['output_pin ADAPTIVE_BED_MESH'].value == 1 %}
      RESPOND TYPE=command MSG="Starting Adaptive Bed Mesh..."
      BED_MESH_CLEAR
      BED_MESH_CALIBRATE
      BED_MESH_PROFILE SAVE=adaptive
      BED_MESH_PROFILE LOAD=adaptive
    {% else %}
      {% if printer['output_pin FULL_BED_MESH'].value == 0 and (not printer['bed_mesh'].profile_name) %}
        RESPOND TYPE=command MSG="No bed mesh found. Starting Full Bed Mesh..."
        PRINT_LEVELING_CALIBRATION
      {% endif %}
      {% if printer['output_pin FULL_BED_MESH'].value == 1 %}
        RESPOND TYPE=command MSG="Starting Full Bed Mesh..."
        PRINT_LEVELING_CALIBRATION
      {% endif %}
        BED_MESH_PROFILE LOAD=default
    {% endif %}
  {% else %}
    PRINT_PREPARE_CLEAR
  {% endif %}
  {% if printer['output_pin ADAPTIVE_PURGE_LINE'].value == 1 %}
    SMART_PARK
    M109 S{extruder_temp}
    M190 S{bed_temp}
    RESPOND TYPE=command MSG="Starting Adaptive Purge Line..."
    LINE_PURGE
  {% else %}  
    RESPOND TYPE=command MSG="Starting Classic Purge Line..."
    PRINT_DRAW_ONE_LINE
  {% endif %}
  SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}

I ask kindly to not shame me for any obvious mistakes. I’m trying my best to not just simply rely on forums and do my own research, but I’m hopelessly lost here.

Sorry, but where is this gone?

1 Like

Very sorry for that. I assumed the log is not needed in this case, as it is about a macro, not a error by klipper itself. My assumption was wrong.
I will attache it to the post.

The MCU and host is not known to me and Elegoo doesn’t give me any information.

Is that your printer?

No, mine is in my home and this doesn’t look like my home. But it’s the same model as the one in the picture, yes.

…funny, (like so many others here?..)

A short +oo+le search for “elegoo orange storm giga” gave me


also

You may find

znp_mcu.cfg

znp_thr1.cfg

in above mentioned FW download link from

elegoo.

Never inspected the above mentioned files!

Trying to be funny while being heavily frustrated is never a good idea. I sincerely apologize for that.

Thanks for the help tho.
I inspected the files; they contain only this line about the mcu:

[mcu]
canbus_uuid: 7a3631bbf8aa

I’m not sure if that is what is actually requested by the mcu and host points in a post. Can you tell me if it is the case so I know for the future?

I have looked through all the infromation you’ve provided, but they don’t include any hint on how to get KAMP running properly. They are mainly about default konfiguration.

An other project I have looked at is this:

But again: no information I could use or helps.

I guess my post isn’t clear enough about what I need help with. May I ask what is unclear so I can phrase myself better?

Update:

I kinda fount a workaround for the issue. The printer.cfg from Elegoo uses a PRINT_START macro, that is executed without calling it for some reason. I didn’t figure out why yet.

This means, if you want to have a start macro which you call at a certain point in the beginning of the gcode, you need to call it something else. I’ve called it START_PRINT for lack of a better name.

[gcode_macro START_PRINT]
gcode:
  BED_MESH_CLEAR
  BED_MESH_CALIBRATE
  BED_MESH_PROFILE SAVE=adaptive
  BED_MESH_PROFILE Load=adaptive
  LINE_PURGE

There is still the issue of passing temperatures to the macro, as currently, at least to my knowledge, there is no way to set custom variables in Orca Slicer or any other Slic3r based slicers. This means there is no way to execute the macro to determine which bed to heat and then pass it on to the START_PRINT macro.
I have opened a discussion on the Orca Slicer GitHub page, but I’m not very confident that anyone will ever pick it up.
Orca Slicer | Discussion | Local variables

Regardless, by circumventing the macro and putting START_PRINT right before the actual printing gcode starts, the printer is creating the adaptive mesh and purging the line.

Only thing left to figure out the cause and fix is why he slams the nozzle into the bed when starting to print…small detail…it’s not like 2 beds and one print head got damaged due to it :sob:

This isn’t correct, at least as far as I understand your question. Almost any user-defined parameter in the slicer can be inserted into the gcode as a “placeholder.” Here are some examples for Orca Slicer: Placeholder List | Bambu Lab Wiki

I think you misunderstood. Before sending the command START_PRINT EXTRUDER_TEMP=[PLACEHOLDER] BED_TEMP={some variable} BED_TEMP1={some variable1}... I need to figure out what some variable is. So if its 60 (for example) or 0 (because the bed isn’t used).
There is a custom function doing that (see above), but i have no way of asining it to a variable to import it into the START_PRINT comand.

Hope that clears it up :slight_smile:

No, actually that makes it less clear. What do you mean by assigning it to a variable?

I’m sorry. I’m just a terrible explainer.

So the printer has 4 print beds acting as one, but controllable separately. Depending on where the model is, the following function determines which bed needs to be heated and which doesn’t:

;Giga zoned hot bed control
;Case 1
{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) < 402.5}
M190 T0 S[bed_temperature_initial_layer_single]
{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
M190 T1 S[bed_temperature_initial_layer_single]
{endif}
{if ((first_layer_print_max[1])) > 402.5}
M190 T3 S[bed_temperature_initial_layer_single]
{endif}
{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405 && ((first_layer_print_max[1])) > 402.5}
M190 T2 S[bed_temperature_initial_layer_single]
{endif}
{endif}

;Case 2
{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) > 402.5}
M190 T3 S[bed_temperature_initial_layer_single]
{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
M190 T2 S[bed_temperature_initial_layer_single]
{endif}
{endif}

;Case 3
{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) < 402.5}
M190 T1 S[bed_temperature_initial_layer_single]
{if ((first_layer_print_max[1])) > 402.5}
M190 T2 S[bed_temperature_initial_layer_single]
{endif}
{endif}

;Case 4
{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) > 402.5}
M190 T2 S[bed_temperature_initial_layer_single]
{endif}

If, for example, I want to print Benchy and place it on bed 1, the function only sends the command M190 T1 S(something), and the other 3 beds stay on 0.

Instead of sending the command M190 T? S??, I would like to save the temperature into a variable to send it to the START_PRINT macro.

I guess what @Gallo is refering to (and bugged me myself already) is that there is no way to add customized or user-defined variables.

There had been occassions where I’d loved to do something like the following in the slicer’s start code:

my_variable1 = 0.05
my_variable2 = "automatic"
my_variable3 = "none"

PRINT_START FUNC_A=my_variable1 FUNC_B=my_variable2 FUNC_C=my_variable3 EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single]    
1 Like

Okay, I think I got it. @Gallo, it sounds like you don’t want to save the temperature to a variable (since it is already represented by a variable). Rather, you want to save the active beds to a variable. You can do this by defining a variable in the macro itself and then setting the value during gcode execution. For example:

[gcode_macro START_PRINT]
variable_active_beds:0
gcode:
    [Your macro here]

Then instead of the M190 line in the slicer function, you would have it send Klipper a command like:

SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=active_beds VALUE='"[list of active beds]"'

Then in your START_PRINT macro, whenever you get to the point where you want to heat the beds, you would use a “for” loop to set each bed heater in the active_beds variable to the target bed temp.

I’m typing in my phone right now. I may be able to give you a more specific example later this afternoon. But maybe this is enough info to get you where you need to be.

Thanks a lot for the answer.

If you would be able to have a more specific example, that would be great.
From my understanding, which is limited at best, a for loop would work if the beds would be arranged in a row, but their arranged in a square.

2  3
0  1

and the beds would have to be populated one after another, like 0-1-2, or 0-1 or such.

But as I said: I probably don’t understand properly. Having a bit of a hard time trying to make sense of everything. Even worse so if the printer seems to be configured like ass from the factory.

I looked at your log. Your config already has overridden M140 and M190 commands that are designed to handle the multi-zone heater controls. Right now the slicer is figuring out which zones need to be heated and is then sending Klipper the commands directly to heat those zones and make sure the temps are stabilized before moving on. I gather that you are trying to relocate some of that functionality to the START_PRINT macro. Here is a way to do that.

First, we’re going to create a new macro called SET_BED_HEATERS:

[gcode_macro SET_BED_HEATERS]
variable_zone_0_active:False
variable_zone_1_active:False
variable_zone_2_active:False
variable_zone_3_active:False
gcode:
    {% set BED_TEMP = params.BED_TEMP|default(0)|float %}
    {% set zones = [zone_0_active, zone_1_active, zone_2_active, zone_3_active] %}

    {% set COMMAND = "M140" %}
    {% if params.WAIT|default(False)|bool %}
        {% set COMMAND = "M190" %}
    {% endif %}

    {% for n in range(4) %}
        {% if zones[n] %}
            {COMMAND} T{n} S{BED_TEMP}
        {% endif %}
    {% endfor %}

Note that this relies on the already overridden versions of M140 and M190 in your config file.

Now we’re going to add another macro to override TURN_OFF_HEATERS and add a step that resets those variables to False:

[gcode_macro TURN_OFF_HEATERS]
rename_existing: BASE_TURN_OFF_HEATERS
gcode:
    BASE_TURN_OFF_HEATERS
    {% for n in range(4) %}
        SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_{n}_active VALUE=False
    {% endfor %}

Now we can trim down the slicer function and have it simply tell the SET_BED_HEATERS macro which zones need to be heated when the time comes. This should replace both the “Giga zoned hot bed control” chunks that are there at the moment:

;Giga zoned hot bed control

;Case 1
	M140 S0
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) < 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_0_active VALUE=True
           	{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_1_active VALUE=True
		{endif}
		{if ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_3_active VALUE=True
		{endif}
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405 && ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=True
		{endif}
	{endif}

;Case 2
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) > 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_3_active VALUE=True
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=True
		{endif}
	{endif}

;Case 3
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) < 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_1_active VALUE=True
		{if ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=True
		{endif}
	{endif}

;Case 4
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) > 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=True
		{endif}
G90

This needs to be placed in your slicer’s custom start gcode before wherever you call START_PRINT.

Now in your START_PRINT macro you will need to add two lines, one to start heating up the necessary heaters, and one to make sure that the necessary heaters have stabilized at the target temps before moving on. To start heating the necessary heaters, find the spot in the START_PRINT macro where you want the bed to start heating and add the following line. (This assumes that you call your START_PRINT macro with a parameter called BED_TEMP that has the target bed temp as the argument):

SET_BED_HEATERS BED_TEMP={params.BED_TEMP}

That will start the heaters heating for the proper zones and then continue on with whatever comes next in the macro.

Now find the spot in the START_PRINT macro where you want the printer to stop and wait for the bed zone temps to stabilize before continuing on, and add this line:

SET_BED_HEATERS BED_TEMP={params.BED_TEMP} WAIT=True

That will pause further gcode execution until all the necessary zones have stabilized at the target temperature.

I think this should accomplish what you’re trying to do, but I haven’t tested it so there’s a chance it may need some tweaking.

I…I really appreciate the time you gift me. Thank you so so much! I’d buy you a drink if I could!

I have changed and added everything as you suggested and give it a go, but jinja2 doesn’t support bool. Neither does it boolean.

jinja2.exceptions.TemplateAssertionError: no filter named 'bool'

I’m not sure if that is due to me being forced to run an older version of Klipper (v7 something if I’m not mistaken; no way to check it as the .git directory got deleted when I tried to update🙄), but I found a post from a year ago which says the same.

Not having a boolean filter is a bit of a pain (especially when some might use 0 or 1 to indicate true/false). Jinja supports creating custom filters, but not inside templates: python - Embed custom filter definition into jinja2 template? - Stack Overflow

I thought about trying to add it manually, but decided against it as I will probably brake something.

I will try to swap the boolean operation with 0and 1 when I get to it and report back to finish the thread.

In the meantime I need to figure out a way to make adaptive meshing work properly, because right now, when loading the generated adaptive mesh, the printer adds the z-offset of the mesh to the z-offset from the limit switch to when the nozzle touches the bed (Elegoo proprietary klipper nonsense). So instead of going to -6.9, it goes to -12.1 and drives hard into the bed.
But that’s for a different thread.

In the meantime, I want to thank you once more for the help!

Right. So I have rewritten the boolean operation and it seems to be working fine. I can now finally have a proper START_PRINT macro and after finding a way to circumvent some of the z-offset troubles I had, the printer is ready to print some big stuff.
Regarding the issue with the z_offset, I will post my findings in a separate post, where I will also writing down all the findings and tweaks necessary. Might take a bit until I’m able to do that.

Regarding this posts topic, to finish it off, here are the necessary additions for macros and slicer start gcode:

printer.cfg:

[gcode_macro SET_BED_HEATERS]
variable_zone_0_active:0
variable_zone_1_active:0
variable_zone_2_active:0
variable_zone_3_active:0
gcode:
    {% set BED_TEMP = params.BED_TEMP|default(0)|float %}
    {% set zones = [zone_0_active, zone_1_active, zone_2_active, zone_3_active] %}

    {% set COMMAND = "M140" %}
    {% if params.WAIT|default(0)|int == 1 %}
      {% set COMMAND = "M190" %}
    {% endif %}

    {% for n in range(4) %}
      {% if zones[n] %}
        {COMMAND} T{n} S{BED_TEMP}
      {% endif %}
    {% endfor %}


[gcode_macro TURN_OFF_HEATERS]
rename_existing: BASE_TURN_OFF_HEATERS
gcode:
    BASE_TURN_OFF_HEATERS
    {% for n in range(4) %}
      SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_{n}_active VALUE=False
    {% endfor %}

Orca Slicer start gcode secion:

;Giga zoned hot bed control

;Case 1
	M140 S0
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) < 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_0_active VALUE=1
           	{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_1_active VALUE=1
		{endif}
		{if ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_3_active VALUE=1
		{endif}
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405 && ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=1
		{endif}
	{endif}

;Case 2
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) < 405 && (max(0, first_layer_print_min[1])) > 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_3_active VALUE=1
		{if ((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) > 405}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=1
		{endif}
	{endif}

;Case 3
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) < 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_1_active VALUE=1
		{if ((first_layer_print_max[1])) > 402.5}
			SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=1
		{endif}
	{endif}

;Case 4
	{if (min(print_bed_max[0], first_layer_print_min[0] + 32) - 32) > 405 && (max(0, first_layer_print_min[1])) > 402.5}
		SET_GCODE_VARIABLE MACRO=SET_BED_HEATERS VARIABLE=zone_2_active VALUE=1
		{endif}

START_PRINT BED_TEMP={bed_temperature_initial_layer[current_extruder]} EXTRUDER_TEMP={nozzle_temperature_initial_layer[current_extruder]}

Be aware, that this is not the whole start gcode section. Just deleting the old entry and pasting only this section, might lead to issues.

I would post my START_PRINT macro too, but it’s a full file and you need to have virtual pins installed for it to work. Virtual pins is not installed by default on the Elegoo OS Giga.

Thanks again to @theophile for the massive help with this!

1 Like