A complete mechatronic design manual for the 3D printed and fabricated parts of the Skittles sorting robot. Covers fastener calibration standards, NEMA-17 stepper geometry, Design for Additive Manufacturing (DFAM), and step-by-step CAD breakdowns for every functional subassembly.
4
Subsystems
±0.2mm
FDM Tolerance
M3 / M2.5
Insert Standards
PETG / PLA
Material Matrix
Standard 01
Threaded Fasteners & Heat-Set Inserts
3D printed plastics cannot reliably hold fine machine threads when screwed into directly—threads strip easily after 2–3 assembly cycles. This machine uses brass heat-set threaded inserts for all structural and motor-facing joints.
Fastener Standard
Insert Pilot Hole ∅
Pilot Depth
Standoff Outer ∅ (OD)
Through Clearance ∅
Counterbore ∅ / Depth
M3 Brass Insert (M3×4.5mm)
3.2 mm (0.32 cm)
4.5 mm (0.45 cm)
6.5 mm (min 1.65mm wall)
3.2–3.4 mm (close/free fit)
6.0 mm ∅ / 3.2 mm depth (for M3 cap screw)
M2.5 Brass Insert (M2.5×4.0mm)
2.8 mm (0.28 cm)
3.8 mm (0.38 cm)
5.5 mm (min 1.35mm wall)
2.7–2.9 mm
5.0 mm ∅ / 2.6 mm depth
M4 Extrusion / Frame Bolt
Direct tap / T-nut
Through-hole
10.0–12.0 mm boss
4.3–4.5 mm clearance
7.5 mm ∅ / 4.2 mm depth
Figure 1.1: Standardized heat-set boss geometry vs counterbored clearance joint.
Heat-Set Practice Coupon & Slicer Wall Enforcement
Before installing inserts into large structural parts (like base.stl or plate_stepper.stl), students should print a small 10-minute calibration coupon ($40\times20\times8\,\text{mm}$) containing three test holes ($\varnothing 3.0\,\text{mm}$, $\varnothing 3.2\,\text{mm}$, and $\varnothing 3.4\,\text{mm}$).
Slicer Perimeter Walls: Enforce 4 solid perimeter walls (min 1.6mm thickness) in your slicer around all screw bosses. If printed with only 2 walls, the brass insert will crush the infill and blow out the outer wall under torque.
Soldering Iron Temperature: Set soldering station to exactly $260^\circ\text{C}$ for PLA ($280^\circ\text{C}$ for PETG). Higher temperatures char the plastic into brittle carbon residue.
Dwell Time & Quench: Apply gentle downward pressure for $2\text{–}3\text{ seconds}$ until the top flange sits flush with the surface. Remove the iron tip immediately and allow $15\text{ seconds}$ to solidify before threading in an M3 bolt.
Standard 02
NEMA-17 Stepper Motors & 5mm D-Shafts
Both the inspector wheel and the sorting slide are driven directly by NEMA-17 stepper motors. Proper mechanical interface requires precise alignment to the motor's center pilot boss and zero-slip shaft couplings.
NEMA-17 Mounting Pattern
The motor flange has four M3 threaded holes on a 31.0 mm square bolt circle with a raised cylindrical registration boss.
Center Pilot Boss:22.0 mm diameter × 2.0 mm height. Model the mating pocket at 22.6–22.8 mm (0.3–0.4mm radial clearance).
Hole Pitch:31.0 mm × 31.0 mm square.
Clearance Slots: Model mounting holes as 3.4 mm × 8.0 mm stadium slots to allow belt or gear engagement adjustment.
5.0 mm D-Shaft Positive Coupling
Standard NEMA-17 shafts have a 5.0 mm outer diameter with a machined flat.
Shaft Bore:5.15 mm (0.15mm total clearance for slip fit).
Flat Offset: Flat edge at 4.5 mm diameter (0.5 mm cut depth).
Grub Screw Set: Radial M3 heat-set insert hole perpendicular to the D-flat. The grub screw clamps firmly onto the flat surface, preventing angular slip.
Collar Wall: Minimum 3.5 mm collar radial thickness around the bore.
Figure 2.1: NEMA-17 mounting dimensions and positive D-shaft hub coupling.
Why does an automated sorting machine need a homing switch, and why is it shaped like an eccentric rotary cam instead of a hard mechanical stop?
1. Why Homing is Mandatory (Open-Loop Actuators)
Stepper motors and continuous-rotation actuators execute relative step pulses (e.g., 50 steps = 90°), but they possess zero absolute position memory:
Boot State Uncertainty: When powered on, the Pi cannot know if Pocket #1 is under the sensor, under the chute, or at a random 37° angle.
Cumulative Step Drift: Over thousands of candy indexing moves, micro-slips or inertia spikes can cause small step loss. Without periodic homing, the nests drift out of alignment with the optical shroud.
The Physical Datum ($0.00^\circ$): The limit switch provides an absolute, unchangeable electrical ground truth.
2. Why a Cam Lobe (`cam.stl`) vs. Hard Stops
In linear mechanisms (like 3D printers), a carriage hits an endstop at the end of travel. But in a rotary candy sorter:
Continuous Unidirectional Flow: The wheel must rotate forward 360° continuously. A hard pin would block rotation, forcing the motor to reverse 360° every cycle.
Impact & Fatigue Elimination: Hitting a hard stop shocks the motor shaft, skips steps violently, and fractures 3D-printed brackets.
Smooth Tangential Ramp: The eccentric cam lobe provides a gentle 25° incline that pushes the microswitch roller smoothly without impact or bounce.
Figure 3.1: Rotary cam profile (`cam.stl`) interacting tangentially with the roller microswitch arm.
Parametric CAD Equations for cam.stl in Fusion 360
When modeling the homing cam in Fusion 360:
r_base = 12.0 mm (Base cylinder radius — clears switch roller by 1.5mm).
lobe_lift = 3.5 mm (Radial rise — sufficient to fully depress switch arm with 1.2mm overtravel safety margin).
rise_angle = 25.0 deg (Smooth tangent ramp with $R=4.0\text{mm}$ blend fillets to eliminate impact shock).
hub_bore = 5.15 mm (D-shaft bore with $4.5\text{mm}$ flat and M3 heat-set insert grub screw clamp).
Standard 04
Design for Additive Manufacturing (DFAM)
FDM 3D printing builds parts layer by layer. Designing functional mechanical components requires accounting for anisotropic layer strength, overhang limits, thermal creep, and slicer toolpaths.
1. Layer Orientation vs. Mechanical Shear
3D printed parts have ~60% lower tensile strength across the Z-axis (inter-layer adhesion) than along the X-Y print plane.
Motor Shafts & Hubs: Print shafts vertically so rotational torque stresses the strong X-Y continuous perimeters, not the layer bonds.
Mounting Ears & Brackets: Orient so screw clamping forces compress layer lines together rather than pulling them apart in tension.
2. Overhangs, Chamfers & Horizontal Holes
FDM cannot extrude plastic into empty air without supports.
The 45° Overhang Rule: Slopes up to 45° from vertical print cleanly without support structures.
Teardrop Holes: Horizontal circular holes larger than 6mm sag at the top apex. Model horizontal holes with a 45° peaked "teardrop" or diamond profile.
Base Chamfers: Add a 0.5mm × 45° chamfer to the bottom edge of parts to eliminate the "elephant's foot" brim squish.
3. Wall Thickness > Infill Percentage
Mechanical rigidity is determined primarily by the outer perimeters (shells), not the internal infill.
For structural brackets (`plate_stepper`, `base_for_slide`): Use 4 perimeters / walls (1.6–2.0mm solid perimeter) and 25–30% Gyroid infill.
Adding walls increases torsion and bending resistance by 250% compared to just increasing infill from 20% to 80%.
4. Material Matrix: PLA vs. PETG
Select filament based on operating environment and thermal exposure.
PLA: High tensile stiffness, low thermal shrinkage (±0.1mm accuracy), easy bridging. Perfect for the wheel.stl, inspection.stl optical darkroom, and chassis panels.
PETG: Higher heat deflection temp (75°C vs PLA's 52°C) and impact ductility. Mandatory for plate_stepper.stl (stepper motor bodies frequently reach 50–60°C during continuous operation).
Engineering Deep-Dive 05
The 4 Core Subassemblies in 3D Files/
Deconstructing the engineering intent, critical dimensions, and assembly interfaces of the actual project files.
Subsystem 1: Chassis, Motor Mounts & Electronics Enclosures
Stepper Plate: Mounts the NEMA-17 stepper to 2020 aluminium extrusion. Uses slotted M4 clearance holes for tension adjustment and an M3 heat-set standoff array for the limit switch.
Raspberry Pi Zero 2 W Carrier: Standoff pattern matches Pi Zero mounting holes (58.0 mm × 23.0 mm pitch with M2.5 inserts). Elevated 4mm above the plate to allow ventilation and prevent shorting against conductive frames.
TFT Bonnet Screen Bezel (`screen_holder.stl`): Angled 30° upward toward the operator for ergonomic visibility. Includes clearance channels for the 40-pin ribbon cable breakout.
Subsystem 2: The Inspector Subassembly (Wheel, Cam & Optical Darkroom)
Parametric Nest Pockets: Sized for standard candy dimensions (∅ 13.5 mm × 7.0 mm depth) with a 7° draft angle to prevent wedging during gravity ejection.
Retaining Ring Lip: A 1.2mm circumferential lip retains the Skittle against centrifugal displacement during high-speed 90° indexing moves.
Optical Isolation Darkroom (`inspection.stl`): The AS7341 spectral sensor requires absolute control over photon illumination. Ambient light bleeding from room lamps or windows skews spectral ratios. The printed darkroom hood shrouds the sensor at a calibrated 8.0 mm focal distance directly above the candy nest, with interior light-trap baffles to eliminate internal reflections.
Homing Cam (`cam.stl`): Radial eccentric lobe designed to depress the VMA327 limit switch roller smoothly over 15° of rotation without bounce.
Subsystem 3: Kinematic Sorting Slide & Distribution Chute
Gravity Slide Angle: The chute slope is set to 32° from horizontal. Candy sugar coatings have a static friction coefficient of μ ≈ 0.45 against smooth PLA; a 32° pitch guarantees rapid candy acceleration (>0.5g) without stalling.
Curved Transition Radius: The candy entry throat uses a 12mm fillet radius to smoothly redirect vertical drops from the wheel into horizontal radial flow.
Rotational Inertia Minimization: The chute's wall thickness is optimized to 1.6mm (4 perimeters) with hollow ribbing to keep rotational mass low, allowing the NEMA-17 stepper to accelerate at 2000 rad/s² between bucket positions without missing steps.
Particulate Bridging & Hopper Geometry: Bulk Skittles jam when hopper funnel walls are too shallow (<50°), creating structural candy arches (bridging). The hopper cone is modeled with steep 65° funnel walls.
Singulation Throat: The exit aperture narrows to 15.0 mm × 10.0 mm—wide enough for exactly one Skittle to pass flat, but physically too narrow for two Skittles to enter side-by-side.
Cam-Driven Agitator Paddle (`agitator.stl`): Oscillates with each rotation cycle to break nascent particulate arches at the funnel base and maintain continuous single-file feed flow into the wheel nests.
Workflow 06
Parametric Modeling Master Table in Fusion 360
Never hardcode numbers into sketches. Set up a global User Parameters Table (Modify → Change Parameters) before sketching any geometry.
Parameter Name
Expression
Value
Design Purpose
d_shaft
5.0 mm
5.0 mm
NEMA-17 motor shaft nominal diameter
clearance_fit
0.2 mm
0.2 mm
Standard 3D print sliding tolerance margin
m3_insert_pilot
3.2 mm
3.2 mm
Pilot hole diameter for M3 heat-set inserts
m3_clearance
3.4 mm
3.4 mm
Free through-hole for M3 bolts
wall_thick
3.0 mm
3.0 mm
Nominal structural shell wall thickness
skittle_diam
13.5 mm
13.5 mm
Caliper-measured maximum candy diameter
skittle_thick
7.0 mm
7.0 mm
Caliper-measured maximum candy thickness
n_pockets
4
4
Number of indexing pockets on inspector wheel
chute_angle
32 deg
32°
Gravity slope angle of sorting chute
Fusion 360 Assembly Joint Best Practice
When assembling the full machine in Fusion 360 (referencing full_design.f3z):
Ground the primary base plate (Right click → Ground) so it cannot move in 3D space.
Create Revolute Joints between the NEMA-17 motor shafts and the `wheel.stl` and `slide_v1.stl` hubs.
Use Motion Links (Assemble → Motion Link) to link stepper rotation to cam switch actuation.
Run Inspect → Interference between the rotating wheel and the stationary optical shroud before sending parts to the 3D printer.
Visual Catalog 07
3D Parts Catalog & Interactive STL Inspector
Explore the physical geometries of all 16 core STL files in the project. Drag and drop any .stl file from the 3D Files/ folder directly into the WebGL inspector below to orbit, zoom, inspect internal bores, and check slicing orientation.
Interactive 3D STL Inspector
Drag & drop any .stl file from the 3D Files folder here, or click to browse
filename.stl
WebGL 3D Engine · Orbit: Left Click + Drag · Pan: Right Click + Drag · Zoom: Scroll Wheel
Figure 7.1 · Complete Machine CAD Assembly in Autodesk Fusion 360 (Source: 3D Files/full_design.f3z)