Bird
Raised Fist0
3D Printingknowledge~20 mins

What is G-code in 3D Printing - Practice Questions & Exercises

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
G-code Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the Purpose of G-code

What is the main purpose of G-code in 3D printing?

AIt is a file format used to store 3D models.
BIt is a software used to slice 3D models into layers.
CIt is a set of instructions that controls the movements of the 3D printer.
DIt is a programming language used to design 3D models.
Attempts:
2 left
💡 Hint

Think about what tells the printer how to move and operate.

📋 Factual
intermediate
1:30remaining
G-code File Format

Which file extension is commonly used for G-code files in 3D printing?

A.gcode
B.stl
C.obj
D.3mf
Attempts:
2 left
💡 Hint

It usually matches the name of the language itself.

🚀 Application
advanced
2:30remaining
Interpreting a G-code Command

What does the G-code command G1 X50 Y25.3 E22.4 instruct the 3D printer to do?

AMove the print head to coordinates X=50, Y=25.3 while extruding 22.4 units of filament.
BSet the temperature to 50°C and extrude 22.4 units of filament.
CHome the print head to the origin coordinates.
DPause the print and wait for 22.4 seconds.
Attempts:
2 left
💡 Hint

G1 commands usually move the print head with optional extrusion.

🔍 Analysis
advanced
2:00remaining
Identifying Errors in G-code

Which of the following G-code lines will cause a syntax error when sent to a 3D printer?

AG1 X50 Y25.3 E22.4 F1500
BG28 ; Home all axes
CG1 X10 Y20 Z0.3 E0.5
DG1 X50 Y25.3 E22.4 F
Attempts:
2 left
💡 Hint

Look for incomplete or missing values in the commands.

Reasoning
expert
3:00remaining
Effect of G-code on Print Quality

How does modifying the extrusion amount (E value) in G-code affect the final 3D print?

ADecreasing E value speeds up the print without affecting filament flow.
BIncreasing E value results in more filament extruded, potentially causing over-extrusion and blobs.
CChanging E value only affects the print bed temperature.
DModifying E value changes the color of the filament used.
Attempts:
2 left
💡 Hint

Think about what happens if too much or too little filament is pushed out.

Practice

(1/5)
1. What is the primary purpose of G-code in 3D printing?
easy
A. To control the movements and actions of the 3D printer
B. To design 3D models visually
C. To slice 3D models into layers
D. To provide power to the printer

Solution

  1. Step 1: Understand what G-code controls

    G-code is a set of instructions that tells the 3D printer how to move and what actions to perform.
  2. Step 2: Differentiate from other 3D printing tasks

    Designing models and slicing are done by other software, not by G-code itself.
  3. Final Answer:

    To control the movements and actions of the 3D printer -> Option A
  4. Quick Check:

    G-code controls printer actions = D [OK]
Hint: G-code tells the printer what to do step-by-step [OK]
Common Mistakes:
  • Confusing G-code with 3D modeling software
  • Thinking G-code designs the model
  • Assuming G-code powers the printer
2. Which of the following is a correct example of a G-code command?
easy
A. MOVE TO 10 20
B. M3D PRINT START
C. G1 X50 Y25.3 E22.4
D. PRINT LAYER 5

Solution

  1. Step 1: Identify the format of G-code commands

    G-code commands usually start with a letter like G or M followed by numbers and parameters.
  2. Step 2: Check each option for correct syntax

    G1 X50 Y25.3 E22.4 starts with G1 and has coordinates and extrusion values, which is a valid G-code command.
  3. Final Answer:

    G1 X50 Y25.3 E22.4 -> Option C
  4. Quick Check:

    Valid G-code syntax = A [OK]
Hint: Look for commands starting with G or M followed by numbers [OK]
Common Mistakes:
  • Choosing commands that look like plain English
  • Ignoring the letter-number format of G-code
  • Confusing printer control commands with user instructions
3. Given the G-code command G1 X10 Y20 Z0.3 F1500, what does it instruct the printer to do?
medium
A. Move the print head to coordinates X=10, Y=20, Z=0.3 at speed 1500
B. Heat the nozzle to 1500 degrees
C. Pause the print for 1500 milliseconds
D. Start printing layer 1500

Solution

  1. Step 1: Understand the G1 command

    G1 is a move command that moves the print head to specified coordinates.
  2. Step 2: Interpret parameters X, Y, Z, and F

    X=10, Y=20, Z=0.3 specify position; F1500 sets the movement speed.
  3. Final Answer:

    Move the print head to coordinates X=10, Y=20, Z=0.3 at speed 1500 -> Option A
  4. Quick Check:

    G1 with coordinates and F speed = C [OK]
Hint: G1 moves; X,Y,Z are positions; F is speed [OK]
Common Mistakes:
  • Confusing F parameter as temperature
  • Thinking G1 pauses or heats printer
  • Ignoring coordinate values
4. A G-code file contains the line G1 X50 Y25.3 E22.4 but the printer ignores the extrusion (E) value. What is the likely cause?
medium
A. The printer firmware does not support extrusion commands
B. The E value is missing a unit like mm
C. The G1 command cannot include extrusion
D. The printer is out of filament

Solution

  1. Step 1: Understand the role of the E parameter

    E controls how much filament is pushed out (extruded) during movement.
  2. Step 2: Analyze why extrusion might be ignored

    If extrusion is ignored, a common reason is the printer has no filament loaded or it is jammed.
  3. Final Answer:

    The printer is out of filament -> Option D
  4. Quick Check:

    Extrusion ignored usually means no filament = A [OK]
Hint: No extrusion? Check filament supply first [OK]
Common Mistakes:
  • Assuming firmware lacks extrusion support
  • Thinking units are required for E value
  • Believing G1 cannot include extrusion
5. You want to customize a 3D print by slowing down the print speed only for the first layer using G-code. Which approach is correct?
hard
A. Change the model design to print slower
B. Insert a G1 F600 command before the first layer to set slower speed, then increase speed after
C. Use M104 S600 to slow down the print
D. Add G28 to slow the print speed

Solution

  1. Step 1: Identify how to control print speed in G-code

    The F parameter in G1 commands sets the movement speed in mm/min.
  2. Step 2: Apply speed change for the first layer

    Inserting G1 F600 before printing the first layer slows down the print speed; later commands can increase it.
  3. Final Answer:

    Insert a G1 F600 command before the first layer to set slower speed, then increase speed after -> Option B
  4. Quick Check:

    Use G1 F to set speed = B [OK]
Hint: Use G1 F command to set speed changes in G-code [OK]
Common Mistakes:
  • Confusing temperature commands (M104) with speed
  • Thinking model design controls speed directly
  • Using G28 which is for homing, not speed