Start sequence with KAMP for Elegoo OS Giga

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