The G-Code is the language your 3D printer uses to execute print commands. It controls everything – from axis movement to filament extrusion to temperature regulation. In most cases, the G-Code is automatically generated by a slicer like Cura or Creality Slicer. However, it can be useful to manually adjust the G-Code to fix specific issues or optimize print quality. Manual adjustments allow for finer control of the printing process and can lead to significant improvements in print quality.

In this guide, you will learn how to manually adjust the G-Code of your Creality K1C (or another printer) to optimize print results.


Why manually adjust the G-Code?

Although most slicers optimize G-Code well, there are situations where manual interventions are beneficial:

  • Fine-tuning print parameters: Manual G-Code adjustments allow for more precise control of specific print settings than the slicer could automatically provide.
  • Troubleshoot printing issues: Certain printing problems, like stringing or uneven extrusions, can be better resolved through targeted changes in the G-Code.
  • Use special features: The G-Code offers advanced functions beyond the slicer settings, such as filament change during printing, temperature adjustments at layer transitions, or control over movement speed and extrusion.

Basic G-code commands you should know

Before making changes to the G-code, it is important to understand the basic commands that control the printer's behavior.

Important G-code commands:

  • G0 / G1: These commands control the movement of the print head.

    • G0: Rapid movement (without extrusion)
    • G1: Movements with extrusion (in combination with the E parameter)
    • Example: G1 X10 Y20 E30 moves the print head to the coordinates X10 Y20 and extrudes filament up to position E30.
  • G92: Resets the axis position or extrusion to a defined value.

    • Example: G92 E0 resets the extruder counter to 0.
  • M104 / M109: These commands control the extruder temperature.

    • M104: Sets the extruder temperature without waiting for it to be reached.
    • M109: Sets the extruder temperature and waits until the desired temperature is reached.
    • Example: M104 S200 sets the extruder temperature to 200°C while M109 S200 waits until 200°C is reached before continuing the print.
  • M140 / M190: These commands control the bed temperature.

    • Example: M140 S60 sets the heated bed to 60°C.
  • M106 / M107: These commands control the fan.

    • M106: Turns the fan on.
    • M107: Turns the fan off.
  • M82 / M83: These commands set the mode of extrusion.

    • M82: Absolute mode (extrusion values are absolute).
    • M83: Relative mode (extrusion values are relative to the last position).
  • G90 / G91: These commands set the mode of motion control.

    • G90: Absolute mode (all movements are relative to the zero position).
    • G91: Relative mode (movements are relative to the current position).

Manual G-code adjustments for better print results

Here are some common G-code adjustments you can make manually to optimize print quality:

1. Optimization of the first layer

The first layer is crucial for the adhesion and quality of the entire print. G-code adjustments can help create an even and well-adhering first layer.

  • G-code adjustment for Z-offset: If the first layer is too high or too low, you can adjust the Z-offset directly in the G-code.
    • Example: G1 Z0.2 sets the Z height to 0.2 mm for the first layer. If the first layer does not adhere properly, you can manually adjust this value.
  • Adjusting the extrusion rate for the first layer: To improve the adhesion of the first layer, you can slightly increase the extrusion amount to achieve a wider filament track.
    • Example: M221 S110 increases the extrusion rate to 110% for the first layer.

2. Temperature adjustment during printing

Different layers or filament types require different temperatures. You can control the temperature during printing via G-code.

  • Adjust temperature during printing: You can program the G-code to adjust the extruder temperature at a specific time.
    • Example: M104 S210 reduces the extruder temperature to 210°C after a certain layer.
  • Adjusting bed temperature after the first layer: Some materials require a hotter bed for the first layer, which can then be cooled down.
    • Example: M140 S60 sets the heated bed to 60°C, and M140 S50 reduces the temperature to 50°C after the first layer.

3. Fixing stringing

Stringing occurs when the filament pulls strings while moving the print head. This can often be fixed by adjusting the Retraction settings.

  • Adjusting retraction: You can manually optimize the retract length and speed in the G-Code to avoid stringing.
    • Example: G10 (Retract command) and G11 (Filament rebuild) can be added to stop extrusion during movements and resume after the movement. In combination with M207 (Set Retract Distance) allows setting the retract length.

    • Example of retract settings:

      M207 S3.0 F2400 ; Sets the retract length to 3 mm and the retract speed to 2400 mm/min

4. Insert pause or filament change in G-Code

A filament change during the printing process can be programmed via G-Code.

  • Manual filament change: You can pause the print and move the print head to change the filament.
    • Example: M600 inserts a pause for filament change. This command moves the print head away and waits until the new filament is inserted.
    • Alternatively, you can G1 X0 Y0 use to move the print head to a safe position, and then restart the print via the printer.

5. Adjusting the print speed

Certain print areas, such as small details or overhangs, require a slower print speed. You can control this through G-Code changes.

  • Adjust speed: Use G1 F commands to adjust the print speed for specific areas.
    • Example: G1 F1500 sets the print speed to 1500 mm/min.
  • Increase or decrease speed for specific layers: You can reduce the print speed for complicated areas of the model to increase precision.
    • Example: G1 F1200 slows down the print when fine details or overhangs are being printed.

6. Wipe and Coasting for clean prints

Wipe and Coasting are techniques that can help minimize stringing and make printed objects cleaner.

  • Wipe: This process pulls the nozzle back over the printed object to remove excess filament.

    • Example: G1 E-0.2 F2400 retracts the filament by 0.2 mm before the print head is lifted.
  • Coasting: Ends extrusion slightly before the end of a path to prevent too much filament from being extruded.

    • Example: You can make a manual coasting setting by stopping extrusion shortly before the end of the path (G1 E0).

Tips for working with G-Code

  • Back up your G-Code: Always create a backup copy of the original G-Code before making changes in case something goes wrong.
  • Simulate the print: Use G-Code viewers or simulations (e.g., in Cura or OctoPrint) to check the effects of your G-Code adjustments before the actual print.
  • Make small adjustments: Start with small changes and test the print. Too many G-Code changes at once can make the printing process complicated and error-prone.

Conclusion

Adjusting the G-Code gives you the ability to precisely control the 3D printing process and improve print quality. From fine-tuning the first layer to controlling extrusion and speed, the G-Code allows you to take full control of your printer. With some practice and patience, you can significantly optimize your print results and even meet specialized printing requirements.