Part 7 · Practice & exercises

Level 3 · Advanced

Engineering-grade projects. You will tune the machine's dynamics, design mechanisms that work straight off the bed, calculate instead of guess, script your CAD and read the G-code your slicer produces.

Advanced⏱ about 50 hours in total15 exercises

Prerequisites and mindset

Complete most of Level 2 first, in particular the temperature, flow and tolerance exercises (L2-1, L2-3, L2-6). Level 3 assumes you have a trustworthy profile for at least one filament, your own tolerance table and some CAD practice.

The mindset changes from "what setting works?" to "what is the physical reason, and can I predict it?". Many exercises therefore contain a short calculation you can check against a measurement. Keep the numbers in your print journal.

Machine tuning L3-1 Pressure advanceL3-2 RingingL3-3 Volumetric flowL3-13 Time vs strength Mechanical design L3-4 HingeL3-5 Snap-fitL3-6 ThreadsL3-11 GearsL3-12 Mechanism Materials and process L3-7 Filament profileL3-8 Low-waste multi-materialL3-9 AnnealingL3-14 Finishing Software L3-10 CAD scriptingL3-15 G-code Do the tracks in any order. Within a track the numbers rise in difficulty.
Figure 1. The fifteen exercises sorted into four skill tracks.

Overview of all fifteen exercises

#ExerciseCore skillTimeModel / file
L3-1Pressure advance tuningDynamics2 hslicer calibration
L3-2Input shaping and ringing analysisDynamics3 hringing_tower.scad
L3-3Volumetric flow testHotend limits2 hvase-mode tower
L3-4Print-in-place hingeDesign / clearance3 hhinge_test.scad
L3-5Snap-fit with strain calculationDesign / mechanics3 hsnap_fit_test.scad
L3-6Thread designDesign3 hCAD
L3-7Custom filament profileProcess4 hseveral tests
L3-8Multi-material with minimal wasteProcess3 htwo-color part
L3-9Annealing experimentMaterials4 htest bars
L3-10CAD scripting (OpenSCAD / CadQuery)Software4 hparametric_box.scad
L3-11Gear designDesign4 hCAD
L3-12Designing a mechanismDesign5 hfour-bar linkage
L3-13Optimizing print time vs strengthOptimization5 htest bars
L3-14Vapor smoothing / finishing projectPost-processing4 hany ABS/ASA part
L3-15G-code reading and custom start G-codeSoftware3 htext editor

🔧 Exercises

Level 3 · Hard

Exercise 1 — Pressure advance tuning

⏱ 2 h
Goal

Tune pressure advance (Bambu Studio calls the same effect flow dynamics, with a K value) so that corners are sharp and line width stays constant during acceleration and deceleration. Plastic in the nozzle is compressible; pressure advance pushes a little extra before a speed-up and relieves it before a slow-down.

You will need
  • The calibration function of your slicer (line or pattern test), or a manual test pattern
  • Dry filament with a tuned temperature (L2-1) and flow (L2-3)
  • A magnifier or macro photo
K too lowbulging corner,thin start of line K correctsharp corner,constant width K too highrounded corner,gaps in corners Top view of a corner, filament drawn as a thick line
Figure 2. Effect of pressure advance on a corner. Too little leaves a bulge, too much starves the corner.
Steps
  1. Write down the current K (or pressure advance) for the filament. Check the slicer's calibration help; typical values for direct-drive extruders are small (of the order of 0.02–0.1 in Marlin/Klipper units), but the unit and scale differ between firmwares.
  2. Run the calibration print (line pattern or tower) with acceleration and speed at your production values.
  3. Pick the best K from the pattern: the line where corner bulge and thin starts both disappear. Photograph it.
  4. Verify on a real part with sharp corners and long straights (a box with a 90° notch) at production speed. Compare with the old value.
  5. Test at a second speed. If K must change a lot when speed doubles, your flow ratio or temperature is probably wrong.
  6. Store K per filament and per nozzle. The auxiliary nozzle on the X2D is fed through a tube; do not assume the same value as for the main nozzle.
Success criteria
  • Calibration print photographed with the chosen K marked
  • Verification part shows sharp corners with no bulge and no gaps
  • K stored in the filament profile under a clear name
Hint

Pressure advance interacts with temperature, because hotter plastic is less viscous, and with flow ratio. Always calibrate flow first. If the best line is at the extreme end of the range, extend the range instead of accepting the edge value.

Worked solution / what good looks like

Example: PLA, direct drive, test range 0.00–0.06 in steps of 0.005. At K = 0 corners bulge; at 0.04 corners are crisp; at 0.06 the inside of corners shows gaps. Choose 0.04. Check: a 0.4 mm box shows constant 0.42 mm lines at 100 and 200 mm/s. If K differs strongly between two spools of the same plastic, one of them probably holds moisture. See Calibration playbook and Speed, cooling & quality.

Level 3 · Hard

Exercise 2 — Input shaping and ringing analysis

⏱ 3 h
Goal

Measure the ripple (ringing, ghosting) pattern next to sharp features, calculate the resonance frequency of your printer from the ripple spacing and see how acceleration and speed change it. Input shaping cancels that resonance in firmware and lets you print faster at the same quality.

You will need
  • ringing_tower.scad (30 × 30 × 50 mm block with a notch and X/Y letters)
  • Calipers or a ruler and a good light; the printer's acceleration and speed settings
  • Optional: the vibration compensation or resonance calibration your printer provides (check your model's documentation)
d notch ripples decay Reading the ripples f = v / d v = speed of the outer wall (mm/s) d = distance between ripple peaks (mm) Example: v = 200 mm/s, d = 2.5 mm f = 200 / 2.5 = 80 Hz Many desktop printers resonate between 30 and 100 Hz.
Figure 3. The distance between ripples, together with the speed at which the wall was printed, gives the resonance frequency.
Steps
  1. Print the tower at your normal outer-wall speed and acceleration. Note both values.
  2. Measure ripple spacing d on the X face and on the Y face with calipers across 5–6 ripples (divide the total by the count to improve accuracy).
  3. Calculate f = v / d for both axes. X and Y often differ because of different moving mass.
  4. Change one parameter: halve the acceleration, reprint and compare ripple height. Then halve the speed and check that ripple spacing shrinks in proportion (so f stays constant).
  5. Enable or run the resonance compensation of your printer if available and print again. Compare ripple amplitude with the first print.
  6. Record the highest acceleration at which ripples remain acceptable for each setting.
Success criteria
  • Ripple spacing measured on both axes, resonance frequencies calculated
  • Verified that frequency stays constant when speed changes while spacing does not
  • Before/after photos with and without compensation, and a chosen acceleration limit
Hint

Ripples that follow a feature are ringing; ripples that start at the bottom and exist on blank surfaces are something else (z-wobble, bad belts, loose parts). Make sure the printer sits on a firm surface, as a table that shakes lowers measured frequency and increases the amplitude.

Worked solution / what good looks like

Example: X face d = 2.4 mm at 200 mm/s → 83 Hz; Y face d = 3.1 mm → 65 Hz. At half speed the spacing is 1.2 and 1.55 mm, so the frequencies are unchanged, which proves a mechanical resonance. Ripple height drops with lower acceleration and drops further with input shaping; the allowed acceleration can then be raised, which reduces print time on small parts. Some printers (including the X2D) run an automatic resonance compensation, so the measured ripple may already be small; in that case compare different accelerations instead. See Speed, cooling & quality.

Level 3 · Hard

Exercise 3 — Volumetric flow test

⏱ 2 h
Goal

Find the maximum volumetric flow (mm³/s) your hotend can melt with a particular filament. Slicers limit speed with this number: print speed alone does not matter, only the volume of plastic per second.

You will need
  • A vase-mode (spiral) cylinder, or a slicer calibration for max flow, plus a speed ramp; or any wall tower sliced so that speed increases with height
  • Calipers, a camera, dry filament and the temperature you want to test (higher temperature allows higher flow)
smoothrough, mattegaps / skipping speed ↑ onset: height h Volumetric flow Q = layer_height × line_width × speed Example: 0.2 mm × 0.45 mm × 200 mm/s Q = 18 mm³/s Use ~80–85 % of the onset value as the limit in the filament profile (safety margin).
Figure 4. The speed ramps up with height. The first height where the walls turn rough or thin gives the maximum flow.
Steps
  1. Prepare the test: single wall, 0.2 mm layer height, line width 0.45 mm. Use a speed ramp from about 8 to 30 mm³/s, or use your slicer's max-flow calibration.
  2. Print it with cooling set to your normal value and observe: at high flow the extruder may click or skip steps.
  3. Find the onset height where under-extrusion becomes visible (rough, thin, matte). Convert the height to speed or flow using the ramp definition.
  4. Set the limit to about 80–85 % of that value in the filament's "max volumetric speed" field.
  5. Repeat at +10 °C to see how much temperature helps. Record the gain in mm³/s per 10 °C.
  6. Check a real print: a 0.4 mm-layer part will hit the limit at a much lower speed than a 0.12 mm part.
Success criteria
  • An onset value in mm³/s for two temperatures
  • A maximum flow set with a safety margin in the filament profile
  • A table that converts layer height and line width to the maximum speed
Hint

To convert back: speed = Q / (layer height × line width). With Q = 15 mm³/s, line 0.45 mm and layer 0.2 mm the speed limit is 15 / 0.09 = 167 mm/s. Using a 0.4 mm layer would allow only 83 mm/s. The nozzle size changes the limit too: a high-flow hotend or a larger nozzle melts more plastic per second.

Worked solution / what good looks like

Example: standard PLA, 0.4 mm nozzle, 220 °C. Walls are smooth up to 20 mm³/s, matte at 23 mm³/s, with gaps from 27. Limit = 0.85 × 23 ≈ 19.5 mm³/s. At 230 °C the onset moves to ~26 mm³/s. Table: 0.12 mm layer × 0.42 mm → 387 mm/s max; 0.20 × 0.45 → 217 mm/s; 0.28 × 0.45 → 155 mm/s. Real printers also limit by acceleration, so the slicer will not reach these speeds on short moves. See Speed, cooling & quality.

Level 3 · Hard

Exercise 4 — Print-in-place hinge

⏱ 3 h
Goal

Print a hinge that moves right off the bed, with no assembly. You will determine the clearance that separates the moving parts and design a hinge that fits your own printer and material.

You will need
  • hinge_test.scad: five knuckles, pin radius 2 mm, clearance 0.4 mm; edit clearance to 0.25, 0.3, 0.4, 0.5
  • Your tolerance table from L2-6, a thin spatula or a hobby knife (carefully) for loosening
clearance c leaf Hinge axis along Y (into the page) Printed lying flat: the pin circle is an overhang Design rules • Radial clearance 0.3–0.5 mm (test!) • Axial gap between knuckles equal to c • Pin diameter ≥ 4 mm for strength • Use a diamond or teardrop pin to avoid support in the bore (45° roof) • No supports inside the gap • Flex the hinge by hand to break the bonds
Figure 5. Cross section of a hinge. The clearance c must be large enough that neighboring surfaces do not fuse, and small enough that the hinge does not wobble.
Steps
  1. Print four hinges with clearance 0.25, 0.3, 0.4 and 0.5 mm on one plate, no supports, no brim touching the knuckles.
  2. Free the hinge: flex it back and forth gently 10–20 times. Record how much force was needed ("free", "stiff", "stuck").
  3. Check wobble: hold one leaf and move the other sideways. Measure the play at the leaf tip with calipers or a feeler gauge.
  4. Choose the smallest clearance that frees without a tool. Reprint your final hinge with that value.
  5. Cycle test: open and close 500 times and note any wear, noise or cracking.
  6. Improve: replace the round bore with a teardrop shape and check if you can print with a smaller clearance and better surface.
Success criteria
  • Four clearances tested with notes on freedom and play
  • A chosen clearance that frees by hand and passes the 500-cycle test
  • A note on which direction the hinge fails first (pin, knuckle or leaf)
Hint

Horizontal holes are always smaller and more oval than vertical holes. Printing the hinge with its axis along the bed's X or Y direction places the pin circle in the plane of the layers, and the pin's top and bottom are the weakest surfaces. A fast, cool first layer under the knuckles also reduces fusing: keep first-layer squish moderate.

Worked solution / what good looks like

Typical result for a 0.4 mm nozzle, 0.2 mm layers: 0.25 mm fused; 0.3 mm freed with force; 0.4 mm freed easily with 0.3 mm of play at a 25 mm leaf; 0.5 mm was sloppy. Choose 0.35 mm for a good compromise. A teardrop bore removed the rough roof in the bore. For a tighter hinge, print a pin with 45° flats and a cone-shaped end that self-centers. Read Design patterns & recipes and Joints & fasteners.

Level 3 · Hard

Exercise 5 — Snap-fit with strain calculation

⏱ 3 h
Goal

Design a cantilever snap-fit so that the maximum strain in the beam stays below a safe limit for the material, then print it and test it for 100 cycles. You will use a one-line formula to choose the beam dimensions instead of trial and error.

You will need
  • snap_fit_test.scad, which prints the strain with echo() for any beam values
  • PETG or nylon (PLA is brittle) and optionally PLA to compare
  • Calipers and a pen to record the number of cycles
h L Root strain (rectangular beam) ε = 1.5 · h · t / L² h = deflection (mm) t = thickness, L = free length (mm) PLAPETGPA Rough allowable strain, repeated use (a guide only) Example: h = 1 mm, t = 1.6 mm, L = 14 mm → ε = 1.5 × 1 × 1.6 / 196 = 1.2 %
Figure 6. A cantilever snap-fit and its strain formula. A longer or thinner beam lowers the strain; the hook height raises it.
Steps
  1. Choose the material and a permissible strain from a datasheet or the file comment (rough guide: PLA ~1.5 %, PETG ~3 %, nylon 4 %+; apply a safety factor of 2 for repeated use).
  2. Calculate the strain for the default beam using the formula, then change beam length L and thickness t in OpenSCAD until ε is below the limit. Remember the strength drops when layers cross the beam.
  3. Print the clip lying on its side so layer lines run along the beam. Print the socket at the same time.
  4. Cycle test: snap in and out 10 times, then 100 times. Note any whitening (stress), cracks or loosening.
  5. Break it on purpose with a design with ε about twice the limit and compare. This tells you how much margin you really have.
  6. Write down the allowed strain you validated for your material and printer.
Success criteria
  • Strain calculation for at least three beam variants, with the formula written out
  • 100 successful cycles for the chosen design
  • An over-strained variant that fails, proving the limit
Hint

The strain is linear in thickness and inverse to length squared. Doubling the beam length reduces the strain by a factor of four, which is by far the cheapest fix. Tapering the beam from root to tip spreads the strain better, and a fillet at the root removes the stress concentration.

Worked solution / what good looks like

Default beam: ε = 1.5 × 1.0 × 1.6 / 14² = 1.22 %. Safe for PETG (limit about 3 %, factor 2 gives 1.5 %), borderline for PLA. A PLA design with L = 20 mm and t = 1.6 mm has ε = 1.5 × 1.0 × 1.6 / 400 = 0.6 %, which survived 100 cycles in practice. With h = 2 mm and L = 14 mm the strain is 2.4 %: the PLA beam cracked after 3 cycles, PETG whitened at the root. See Joints & fasteners.

Level 3 · Hard

Exercise 6 — Thread design

⏱ 3 h
Goal

Design a printable screw thread pair (a jar-style lid or a bolt and nut) with a profile and clearance that work on your printer, and find the smallest pitch that prints reliably. ISO metric threads are too fine for most FDM printing at small sizes; coarse trapezoidal threads work much better.

You will need
  • A CAD tool that can make a helical sweep (Fusion coil, FreeCAD helix, OpenSCAD linear_extrude with twist)
  • Calipers, your tolerance table (L2-6), a 0.4 mm nozzle and 0.12–0.2 mm layers
60° ISO V-thread crests wear and overhang 30° fine pitch = poor print Trapezoidal / 45° buttress flanks ≤ 45°: no support needed pitch 2–4 mm for Ø 20–60 Square thread strong, but 90° overhang needs support or vertical print P
Figure 7. Thread profiles. A flank angle of 45° or less avoids supports; the coarser the pitch, the more forgiving the thread is to printing errors.
Steps
  1. Choose the profile: trapezoidal, 45° flanks, pitch about 3 mm for a 30 mm diameter lid. For a small bolt use the standard M8 × 1.25 only if you are going to print a dedicated test.
  2. Model both parts from the same parametric profile, and add a radial clearance c to the nut (try 0.2, 0.3 and 0.4 mm).
  3. Print vertically (the axis is Z) so the thread is made of full rings. Use 0.12–0.16 mm layers for small pitches.
  4. Test: Does the nut start by hand? Does it spin freely, with wobble, or bind? Count turns until fully seated.
  5. Torque test: tighten by hand with a lever until the thread strips and note whether the bolt or the nut fails.
  6. Add a lead-in chamfer and a thread start relief (the first half turn cut flat) so it does not cross-thread.
Success criteria
  • A bolt/nut or lid/jar pair that closes smoothly by hand
  • A table of clearance vs feel, with the best value highlighted
  • A minimum pitch for your printer and a design note (profile, clearance, orientation)
Hint

A vertical thread's accuracy depends on the XY accuracy of the printer, so keep the thread diameter large. If the nut binds only at one point, the thread is out of round because a seam sits in the thread; move the seam to the least visible position and print a few perimeter rings with "avoid crossing walls" off.

Worked solution / what good looks like

Example for a 30 mm lid in PETG: trapezoidal profile, pitch 3 mm, thread depth 1.5 mm, radial clearance 0.3 mm. With 0.2 mm the lid needed force, with 0.4 mm it wobbled slightly but sealed. Selected 0.3 mm, 3 turns to close. Also test the O-ring or rubber seal if you need waterproof behavior: printed threads are not watertight without a gasket. Rule: ISO threads below about M6 should be tapped or heat-set (see L2-14); above M12 or in custom coarse form they print well. More in Joints & fasteners.

Level 3 · Hard

Exercise 7 — Custom filament profile

⏱ 4 h
Goal

Create a complete, shareable filament profile for a spool that has no factory profile: temperature, flow, pressure advance, cooling, maximum volumetric speed, drying temperature and retraction, all validated by tests. Name it clearly and document the test results.

You will need
  • A spool of a filament without a ready-made profile (brand-specific PETG, a silk PLA, a matte PLA or a composite)
  • The results and models of exercises L2-1, L2-2, L2-3, L3-1 and L3-3
  • Your slicer's profile export function
Clone similar Dry & check Temperature Flow ratio Pressure adv. Max flow Cooling Retraction Validate Save & name Document & share Always change one group of values at a time and re-run the validation print at the end.
Figure 8. A profile is the end of a chain of small tests. Skipping a step usually forces you to repeat it later.
Steps
  1. Clone the closest existing profile (same polymer family) and rename it: Brand · Type · Color · Version.
  2. Run the tests in order (dry, temperature, flow, pressure advance, volumetric flow, cooling, retraction) and enter each result immediately.
  3. Check special properties: silk and metallic filaments want lower speed and higher temperature, matte filaments often prefer less cooling, CF and GF composites need a hardened nozzle (see Engineering plastics).
  4. Validate with a demanding part: bridges, fine text, a snap-fit or a large flat area, and compare with a print from the base profile.
  5. Document the spool (brand, lot, color, diameter measured at five points), the values, the test photos and the date in a short text file saved next to the exported profile.
  6. Export the profile and re-import it on a clean install to confirm nothing is missing.
Success criteria
  • A named profile with all values filled in and verified by a test for each
  • A validation print that equals or beats the base profile
  • An exported file and a one-page note describing the test results
Hint

Measure the real filament diameter (mean of 5 positions and 2 directions) and enter it. A 1.70 mm spool declared as 1.75 mm causes 5 % under-extrusion. Colors of the same brand can have different temperature requirements because pigments change flow and cooling behavior, so keep color in the profile name.

Worked solution / what good looks like

Example documentation entry: "Brand SilkPLA Gold v1, lot 25-03, Ø 1.74 ± 0.02. Nozzle 225 °C, bed 55 °C, flow 0.96, K 0.035, max flow 12 mm³/s, fan 60 %, retraction 0.8 mm at 30 mm/s, dry 50 °C for 6 h. Validated with a vase and a bridge test; strings: none; layer bond: weaker than standard PLA, avoid load-bearing parts." This level of detail enables a repeat later. See Bambu Studio settings & profiles.

Level 3 · Hard

Exercise 8 — Multi-material with minimal waste

⏱ 3 h
Goal

Reduce the waste of a multi-color print by at least 50 % without damaging quality, using color order, flush volume tuning, design changes and the ability of the printer to flush into infill or sacrificial objects.

You will need
  • A part with 3 colors that change many times (a logo tile with text and a border works), plus a baseline print from L2-15
  • A multi-filament system (AMS or AMS 2 Pro) and a kitchen scale (0.1 g)
051015 BaselineColor order + volumes+ design changes 17 g9 g4 g Waste reduction levers 1. Fewer color changes per layer 2. Light → dark order where possible 3. Lower flush volume for similar colors 4. Flush into infill or a sacrificial part 5. Merge small color regions by design 6. Smaller or no prime tower where allowed Bar values are example figures.
Figure 9. Waste can often be cut to a quarter of the default by combining several small measures.
Steps
  1. Measure the baseline: slice with default flush settings, note the slicer's waste estimate and the number of filament changes, print, and weigh the flushed material (or read it from the slicer's statistics).
  2. Reorder the colors in the slots and check the effect in the slicer's flush matrix. Pairs such as dark → light need more flush than light → dark.
  3. Edit the flush volumes for similar colors (e.g. two blues) lower, but never to zero when you can see color bleeding.
  4. Use "flush into infill" or "flush into objects" if your slicer offers it, so that purge material becomes part of hidden internal structure.
  5. Redesign the part: place color transitions at layer boundaries, make regions of one color tall instead of thin and widely separated.
  6. Print the optimized version and compare weight, time and appearance with the baseline.
X2D note

With two nozzles, each nozzle holds one filament, so assigning the two main colors to the two nozzles removes most changes of those colors. The remaining colors still need flushing. See Dual-nozzle printing for the rules for which material can go where.

Success criteria
  • Baseline and optimized waste in grams, with the percent reduction
  • A comparison photo showing no visible color contamination in the optimized print
  • A list of the measures that gave the biggest gains
Hint

The number of color changes is more important than the volume of one change. If your model has a color on every layer, the changes multiply with layer count: 200 layers × 2 changes is 400 flushes. A model where the color changes at only 10 layers needs about 10 flushes.

Worked solution / what good looks like

Example: logo tile with 3 colors, 60 layers. Baseline 17 g waste, 180 changes. Reordering colors cut 3 g, reducing flush volumes for two similar colors another 2 g, enabling "flush into infill" saved 3 g, redesigning the text as thick raised letters (fewer color layers) saved 5 g; final 4 g. Quality is equal. Rule: before touching settings, look at the model. Read Multi-color & multi-material.

Level 3 · Hard

Exercise 9 — Annealing experiment

⏱ 4 h
Goal

Anneal printed parts (heat them below the melting point so the polymer crystallizes more) and measure the change in heat resistance, stiffness and dimensions. The effect varies widely between materials and brands, so you test your own.

You will need
  • Four identical parts or bars of a crystallizable material (PLA of a type marked for annealing, PETG is not typically annealed, nylon or PA usually after drying); mark each with a number
  • An oven with a reliable thermometer (separate from the oven display), a baking tray and sand or salt for support, calipers
  • A kitchen oven is not suitable for food after use with plastic: use a dedicated one or a filament dryer that reaches the required temperature
glass transition Tg (PLA ≈ 60 °C) melting range ramphold 30–60 minslow cool anneal temperature (e.g. 80–100 °C) Record for every part • Length, width, height before / after (mm) • Warping or distortion (photo) • Hardness / stiffness: bend by hand • Heat test: temperature of first sag Typical findings (verify!) • 1–5 % shrinkage in some directions • Higher heat resistance • More brittle for some filaments
Figure 10. The annealing schedule: slow ramp, hold above Tg and well below the melting point, then cool slowly in the oven.
Steps
  1. Check the material data for the recommended annealing temperature. Never exceed it: parts soften and sag. Stay well below the melt temperature.
  2. Measure all parts in three directions and weigh them. Keep one part as an unannealed control.
  3. Embed parts in a tray of sand or salt to hold their shape (hollow parts need support).
  4. Heat as in Figure 10. Try two hold times (30 and 60 min) or two temperatures on different parts.
  5. Cool slowly by switching off the oven and leaving the door shut until the parts are near room temperature.
  6. Measure again and compare shrinkage. Test heat resistance on a control and an annealed bar in warm water or an oven at a set temperature, and a bend test as in L2-9.
Safety

Work in a ventilated space, do not use a food oven unless you accept the contamination, and never heat plastics near their decomposition range. Let hot sand cool before handling.

Success criteria
  • Dimension table before and after for each annealing condition
  • Heat resistance and bend result of annealed vs control
  • A conclusion on whether annealing helps your material, and a rule to compensate shrinkage in CAD
Hint

If a feature has to fit after annealing, print it larger by the measured shrinkage factor (scale in one direction only if the shrinkage is anisotropic). Annealing works best with thick, solid parts: thin-walled hollow parts distort and gain little.

Worked solution / what good looks like

Example: PLA bars annealed at 90 °C for 45 min in sand. Length change −0.8 %, height +0.3 %, sand-supported parts stay straight. Heat test: the control sagged in 60 °C water, the annealed bar kept its shape up to about 90 °C. Bend test: annealed bar failed at a slightly higher load with a more brittle break. Conclusion: use annealing only when heat resistance is the priority and scale holes by +0.8 %. For high-temperature use, engineering materials in the heated X2D chamber are an alternative (Engineering materials & chamber); see also Post-processing.

Level 3 · Hard

Exercise 10 — CAD scripting (OpenSCAD or CadQuery)

⏱ 4 h
Goal

Write a part as code, with parameters, loops and conditionals, so you can generate a whole family of parts (for example a screwdriver-bit holder with N slots) from one file and keep it under version control.

You will need
  • OpenSCAD (free) or Python with CadQuery
  • A text editor, a version-control tool (git) is recommended
  • The reference parametric_box.scad
// bit_holder.scad n = 6; pitch = 14; bit = 6.35; h = 20; wall = 3; clr = 0.25; difference() { cube([n*pitch+wall, 2*wall+bit, h]); for (i = [0:n-1]) translate([wall+pitch/2+i*pitch, wall+bit/2, wall]) cylinder(d=bit+clr, h=h, $fn=6); } Result: n = 6 holes change n and pitch: the block grows print: one file, any size CadQuery: same idea in Python cq.Workplane().rarray(14,1,6,1).polygon(6,6.6)
Figure 11. A loop replaces six copy-and-paste operations. The code is the design.
Steps
  1. Pick a part with repeated features: a bit holder, a battery organizer, a hex-key holder, a pegboard hook set or a gear tooth ring.
  2. Put every number at the top as a named parameter with units and a comment.
  3. Generate repeated features with a loop and conditionals (e.g. only add a label if label != "").
  4. Add input checks: assert(wall >= 1.2, "wall too thin").
  5. Export two or more variants by changing parameters from the command line (openscad -D n=8 -o out.stl file.scad) or by editing CadQuery variables.
  6. Commit the file with a message; tag the version you printed.
Success criteria
  • One script producing at least three different valid parts through parameters
  • Input checks that block invalid combinations
  • An STL printed from the script, and the script saved in version control
Hint

Test the extremes: n = 1, n = 20, the smallest wall and the largest diameter. If the preview works but the export fails with a non-manifold error, a shape probably touches another exactly on a face; extend one by 0.01 mm so they overlap. Keep each module small and name it after what it makes.

Worked solution / what good looks like

A good solution has: parameters at the top, a module bit_slot(), a loop over slots, a label text engraved on the front, an assertion that the wall is at least 1.2 mm and a comment block explaining each parameter. The loop in Figure 11 gives a six-slot holder; with n = 10 it automatically grows. Compare with the structure of parametric_box.scad. A CadQuery version uses a Workplane and rarray. Background: Parametric CAD workflow.

Level 3 · Hard

Exercise 11 — Gear design

⏱ 4 h
Goal

Design and print a pair of spur gears with a chosen ratio, correct center distance and enough backlash to run smoothly, then measure how well they mesh. Gears show every error in your printer's accuracy.

You will need
  • A gear generator or script: an OpenSCAD involute-gear module you write or any open-source library for your CAD tool (you may use libraries in your own work; this site's models use none)
  • Two M3 or M4 screws as axles and a baseplate with two holes at the calculated distance
a = center distance z₁ = 20z₂ = 12 Spur gear formulas (module m) pitch diameter d = m · z outside diameter da = m · (z + 2) root diameter df = m · (z − 2.5) center distance a = m · (z₁ + z₂) / 2 ratio i = z₂ / z₁ Example m = 2: z₁ = 20, z₂ = 12 → a = 32 mm, ratio 0.6 (output turns 1.67× faster).
Figure 12. Two meshing spur gears. The pitch circles (dashed) touch at the contact point; the center distance follows from the module and tooth counts.
Steps
  1. Choose the module m = 1.5 to 2 for a 0.4 mm nozzle (module 1 teeth are only 2.2 mm tall and small-detailed). Choose tooth counts for your ratio; avoid fewer than 12 teeth to avoid undercut.
  2. Calculate d, da and a with the formulas in Figure 12.
  3. Add backlash by increasing the center distance by 0.1–0.3 mm or by thinning teeth slightly. Print three baseplates with a = nominal, +0.15, +0.3 mm.
  4. Print gears flat so that the teeth are in the XY plane (best accuracy and strongest teeth).
  5. Test: turn by hand; feel for binding, count backlash by rocking one gear. Run for a few minutes and check for wear or noise.
  6. Try a variation: herringbone or helical gears for quieter running, or a rack and pinion.
Success criteria
  • A calculation sheet for both gears and the center distance
  • A baseplate that turns smoothly with small backlash
  • A note of the best center-distance addition for your printer
Hint

If the gears bind at some positions only, the bore is off-center or the gear is not round (check the first-layer squish). If they run smoothly but click, the center distance is too large. A bore with a clearance of 0.2–0.3 mm on an axle of known diameter is better than a press fit for the test.

Worked solution / what good looks like

Example: m = 2, z₁ = 20, z₂ = 12: d₁ = 40, d₂ = 24, a = 32 mm. The nominal plate bound slightly; a = 32.2 mm gave smooth running with about 1° of backlash; a = 32.4 mm was loud. Final choice 32.2 mm. Use PETG or nylon for wear resistance or add a small amount of lubricant (dry silicone or PTFE) suitable for plastics. See Design patterns & recipes for more mechanism recipes.

Level 3 · Hard

Exercise 12 — Designing a mechanism

⏱ 5 h
Goal

Design a working four-bar linkage (for example a gripper, a parallel clamp or a walking leg) starting from a sketch and angle calculation, print it with pins or print-in-place joints, and compare the motion with your simulation.

You will need
  • Graph paper or a 2D CAD sketch with constraints, or a free linkage simulator
  • 3 mm filament offcuts or M3 screws as pins, a drill for cleaning holes
  • Your clearance values from L3-4
d (ground)a (crank)b (coupler)c (rocker) Check before printing Grashof: s + l ≤ p + q (shortest + longest ≤ the other two) → at least one link can rotate fully. Example a = 30, b = 80, c = 60, d = 90: 30 + 90 = 120 ≤ 80 + 60 = 140 ✓ Also check: no singular position and transmission angle between 40° and 140°.
Figure 13. Four-bar linkage in two positions (solid and dashed). The Grashof rule predicts whether the shortest link can rotate completely.
Steps
  1. Define the motion you need (output angle range, force direction). Sketch the linkage and choose link lengths.
  2. Check the Grashof condition and the transmission angle at the extreme positions. Simulate in 2D CAD by dragging the constrained sketch.
  3. Design joints: pin joints with 0.2–0.3 mm clearance around a 3 mm pin, or print-in-place pins (L3-4). Add stops to limit the travel.
  4. Print one link at a time as a test to check hole sizes before the full assembly.
  5. Assemble and measure the real positions of the output at 5 input angles. Compare with the calculation.
  6. Iterate: if it binds at an extreme angle, the transmission angle there is too small; lengthen a link or move a pivot.
Success criteria
  • A sketch with link lengths and a Grashof check
  • A working mechanism that moves through its full intended range without binding
  • A table comparing predicted and measured output angles within a few degrees
Hint

Printed holes and links bend and flex: widen links in the plane of motion, and add a washer or spacer so links do not rub on each other in the Z direction. Keep joints in the same plane as the build plate so the pin holes print accurately.

Worked solution / what good looks like

The example 30 / 80 / 60 / 90 mm linkage meets Grashof (120 ≤ 140) so the 30 mm crank can rotate fully while the rocker oscillates about 70°. Predicted and measured output angles agreed within about 3° at five positions; the deviation came from 0.3 mm joint clearance. Add a 1 mm spacer between the layers of links to avoid rubbing. Design patterns for hinges and joints are in Design patterns & recipes.

Level 3 · Hard

Exercise 13 — Optimizing print time vs strength

⏱ 5 h
Goal

Find the best trade-off between print time and strength for one bracket by varying wall count, infill density and layer height, then show the results on a time-versus-strength chart (the Pareto front). You will learn which settings give a lot of strength per minute.

You will need
  • A simple test part: a 100 × 15 × 10 mm bar or the L-bracket from L2-12
  • The load rig from L2-9, a kitchen scale and your slicer's time estimate
  • Nine to twelve parts: three levels each of two variables, e.g. walls 2/4/6 and infill 10/25/50 % (a small DoE; see L4-6 for the full method)
print time (min) → failure load ↑ fast & weaksweet spotslow & strong How to read it Green: no other part is both faster and stronger (Pareto front). Gray: dominated; drop these settings. Typical finding: walls add strength more cheaply than infill, and infill above ~30 % has little effect. Illustrative data, not measurements.
Figure 14. Every test part is a point. Only the points on the green front are worth printing; all others are beaten by a faster or stronger one.
Steps
  1. Define the load case (bending across the bar) and the response (failure load).
  2. Make a table of nine setting combinations and record slicer time and weight for each.
  3. Print in random order on random plate positions to avoid systematic errors.
  4. Test every part and record the load at failure and the failure type.
  5. Plot time vs load as in Figure 14, mark the Pareto front, and compute strength per gram and per minute.
  6. Choose the settings for three situations: fastest acceptable, best compromise, strongest.
Success criteria
  • A complete table of settings, time, mass and load
  • A scatter plot with the Pareto front identified
  • Three named presets saved in your slicer (e.g. "Draft", "Standard", "Strong")
Hint

For a bar in bending, the outer walls carry the largest stresses, so each extra wall adds more strength than the same extra material put into infill. Check wall count before infill density. For tension along the part, solid infill matters more.

Worked solution / what good looks like
WallsInfillTimeMassLoad
210 %24 min8 g150 N
410 %29 min11 g290 N
425 %33 min13 g320 N
625 %41 min16 g440 N
650 %52 min21 g460 N

Example only. The 4 walls / 10 % row almost doubles the strength of 2 walls for 5 minutes more; going to 50 % infill costs 11 minutes for 4 % more load. "Standard" preset: 4 walls, 15 %. Read Strength & orientation.

Level 3 · Hard

Exercise 14 — Vapor smoothing and finishing project

⏱ 4 h
Goal

Take a printed part from rough to presentation-grade: sand, fill, prime and paint, or (for ABS and ASA only) vapor smooth. Document the surface quality at each stage with macro photos and measure the dimensional change.

You will need
  • An ABS or ASA print (or PLA if you choose the sand-and-paint route), 6–8 cm tall with curved and flat surfaces and a snap or press-fit feature to check dimensions
  • Sandpaper 120–800 grit, filler primer, putty, paint and clear coat; for vapor smoothing: acetone, a sealed glass or metal container and a way to hold the part above the liquid
  • Nitrile gloves, respirator rated for organic vapors, ventilation or outdoors, safety glasses
1 · As printedvisible layer steps 2 · Sanded120 → 400 grit 3 · Primedfiller primer fills grooves 4 · Smoothedvapor or paint + clear coat roughness decreases, size changes by ~0.05–0.3 mm per stage
Figure 15. Cross sections of a surface during finishing. Each stage removes or fills the layer steps further, but also changes dimensions.
Steps
  1. Measure and photograph the raw part: three critical dimensions, one macro photo of a curved surface.
  2. Sand through the grits wet or dry as the material allows; photograph again and measure again.
  3. Prime and fill: apply a thin coat, sand with 400 grit, repeat until the layer lines no longer show.
  4. Alternative for ABS/ASA: vapor smoothing: suspend the part above a small amount of acetone in a closed container for a short time (minutes, not hours; start with 5–10 min), then remove and let it dry in ventilated space for 24 h. The part is soft and easily damaged while wet.
  5. Paint and clear-coat, or leave the smoothed surface as is.
  6. Final inspection: compare dimensions at each stage and check if the snap or press-fit still works. Write down the dimension change you must add to the design next time.
Safety

Acetone is highly flammable and its vapor can ignite from a spark or a heater. Work outdoors or in a strongly ventilated space away from ignition sources, never use a heated chamber, wear protective gloves and eye protection, and keep quantities small. PLA and PETG do not smooth with acetone. Follow the safety data sheet of the chemical you use.

Success criteria
  • Photos and three measurements at each stage
  • A finished surface without visible layer lines at arm's length
  • A list of dimensional corrections for next time (e.g. "+0.1 mm on press-fit holes if primed")
Hint

Thick primer layers fill detail; thin and repeated coats keep it. Start sanding with the coarsest grit that does not leave scratches you cannot remove, and avoid sanding through the shell on thin-walled parts. For vapor smoothing, cleaner results come from a clean, dry part and a short exposure repeated twice rather than one long exposure.

Worked solution / what good looks like

Example: ASA vase, height 70 mm. After sanding to 400 grit the diameter dropped by 0.2 mm, primer added back 0.15 mm, and paint plus clear another 0.05 mm. The vapor-smoothed twin lost nearly all layer lines but rounded sharp edges by about 0.3 mm and shrank by 0.1 mm. Conclusion: design press-fit features after finishing allowances, mask them, or finish the mating faces separately. Details in Post-processing.

Level 3 · Hard

Exercise 15 — G-code reading and custom start G-code

⏱ 3 h
Goal

Open a G-code file in a text editor, identify what each command block does, calculate the filament use by hand for one line, and add a safe custom start or layer-change snippet (for example a message or a pause at a layer). G-code is the language your printer actually speaks.

You will need
  • A sliced file as plain G-code (for Bambu printers: extract the G-code from a .gcode.3mf project, which is a zip archive, or export plain G-code)
  • A text editor that opens large files (VS Code, Notepad++)
  • The G-code, firmware & ecosystem page for command references
; start of file M104 S220 G28 M109 S220 G92 E0 G1 Z0.2 F600 G1 X10 Y10 F6000 G1 X50 Y10 E1.6 F1800 G1 X50 Y50 E3.2 M106 S255 G1 Z0.4 F600 set nozzle 220 °C, continue (no wait) home all axes set 220 °C and wait until reached reset extruder position to 0 move nozzle to 0.2 mm height travel (no E value = no extrusion) print a 40 mm line, extrude 1.6 mm next 40 mm line, E now 3.2 (absolute) fan on at full speed next layer height Extrusion per move E = L · h · w / A L length, h layer height, w width, A = π·(d/2)² of the filament L = 40, h = 0.2, w = 0.42, d = 1.75: E = 40·0.2·0.42/2.405 = 1.40 mm The file says 1.6 mm → flow ratio ≈ 1.14
Figure 16. A tiny G-code excerpt, annotated. Every print is a long list of lines like these. The E value links line length to the plastic pushed through the nozzle.
Steps
  1. Find the structure: start block (heating, homing, bed leveling, purge), per-layer blocks (look for layer-change comments), end block (cool, park). Note the line numbers.
  2. Decode ten commands using the reference: M104/M109, M140/M190, G28, G90/G91, M82/M83, G92, G0/G1, M106/M107, M204 (acceleration). For each, write down its purpose.
  3. Calculate by hand the extrusion for one 20 mm outer-wall line and compare with the number in the file (as Figure 16). Explain differences with the flow ratio and line width.
  4. Customize: in the slicer's machine settings, add a harmless line to the start G-code, such as a status message or a short beep (for a printer that supports it), or a pause at a chosen layer through the slicer's layer-change field.
  5. Test on the printer with a short print. Check that the new command appears in the exported file and behaves as intended.
  6. Restore the original block afterwards if the change was only for the experiment and keep a copy of the original start G-code.
Careful with start G-code

Bambu and other modern printers use vendor-specific macros in the start and end blocks for calibration, filament handling and safety. Do not delete lines you do not understand; add your own lines after the existing ones, and test with the printer attended. A wrong temperature, move or missing homing command can damage the machine.

Success criteria
  • A commented list of at least ten commands from your file
  • A hand calculation of extrusion for one move with the comparison to the file
  • A custom snippet tested on a short print without problems
Hint

Absolute and relative extrusion differ: with M82 the E value is the total filament pushed since the last G92 E0; with M83 each E is a delta. Check which mode the file uses before computing. Search for comments such as ; LAYER_CHANGE or ;TYPE: to navigate quickly.

Worked solution / what good looks like

In Figure 16 the line length 40 mm at 0.2 mm × 0.42 mm needs 40 × 0.2 × 0.42 / 2.405 = 1.40 mm of filament. A file value of 1.6 mm indicates a flow ratio of about 1.14, or a wider line. Real files differ by a few percent from the ideal formula because of the flow ratio, line shape (rounded ends) and pressure advance. A harmless custom snippet: M117 My profile v3 (display message, if supported) at the end of the start block. A pause at layer 12 is typically inserted via the slicer's "custom G-code at layer change" with the printer's pause command; check your firmware's command first.

Key takeaways

Next steps

Level 4 · Expert

Capstone projects: compliant mechanisms, SPC, DoE, jigs, casting and open-source release.

Quizzes

Check what you have learned with instant feedback.

Test models

Ringing tower, hinge, snap-fit and other OpenSCAD files.