Mechanical Design

From Bespoke Robot Society
Jump to navigation Jump to search
Mechanical Design
Competency Mechanics
Difficulty Beginner
Time Required 3-5 hours (split across multiple sessions)
Prerequisites Basic familiarity with 3D printing and CAD software
Materials Needed Calipers ($15-30), CAD software (FreeCAD or Fusion 360), ruler, existing robot parts to measure
Next Steps Design custom parts for your robot, study SimpleBot CAD files, Gear Ratio Calculation

Mechanical Design is your introduction to designing 3D-printable robot parts using CAD (Computer-Aided Design) software. This tutorial covers the essential skills for creating mounts, brackets, and structural parts for robots like SimpleBot.

By the end of this tutorial, you'll understand:

  • How to measure existing components with calipers
  • How to design parts that fit together (tolerances)
  • How to design mounting holes and fastener clearances
  • How to create assemblies with multiple parts
  • How to design for 3D printing (overhangs, bridges, support)

This tutorial is hands-on. You'll design a sensor mount for SimpleBot as a practical example.

Part 1: CAD Software Setup

Choosing CAD Software

For robotics, you need parametric CAD software that can create precise mechanical parts:

  • FreeCAD (Free, open-source)
    • Pros: Completely free, runs on Linux/Mac/Windows, extensible
    • Cons: Steeper learning curve, less polished UI
    • Best for: Open-source advocates, Linux users, learning fundamentals
  • Fusion 360 (Free for hobbyists, students, startups under $100k)
    • Pros: Professional-grade, excellent tutorials, cloud storage
    • Cons: Requires account, online-only, subscription after trial
    • Best for: Beginners, professional workflow, collaboration
  • OnShape (Free for public projects)
    • Pros: Browser-based, collaborative, parametric
    • Cons: Projects are public unless you pay
    • Best for: Collaboration, Chromebook users

This tutorial uses FreeCAD (works on all platforms), but concepts apply to any CAD software.

Installing FreeCAD

  1. Download from FreeCAD.org
  2. Install (Linux: use package manager, Windows/Mac: run installer)
  3. Launch FreeCAD and create a new document (File → New)
  4. Select Part Design workbench (dropdown at top)

Key FreeCAD concepts:

  • Sketch - 2D drawing on a plane (constrained shapes)
  • Pad - Extrude sketch into 3D solid (add material)
  • Pocket - Cut sketch from 3D solid (remove material)
  • Body - Container for features (one part = one body)

Part 2: Measuring with Calipers

Before designing parts, you need accurate measurements. Digital calipers are essential.

Caliper Basics

Calipers measure:

  • Outside dimensions - Outer diameter, width (large jaws)
  • Inside dimensions - Inner diameter, hole size (small jaws)
  • Depth - How deep a hole or recess is (depth probe)
  • Step height - Difference in height between surfaces

Accuracy: Digital calipers measure to 0.01mm (0.0005 inches)

Measuring Technique

  1. Zero the calipers - Close jaws and press "zero" button
  2. Place part squarely - Jaws perpendicular to surface
  3. Gentle pressure - Don't squeeze too hard (deforms plastic)
  4. Read display - Switch between mm and inches with "mm/inch" button

Exercise: Measure these dimensions on your Infrared Line Detector sensor:

  • Width of PCB
  • Height of PCB
  • Mounting hole diameter
  • Distance between mounting holes (center-to-center)
  • Height of sensor above PCB bottom

Write down measurements - you'll use them to design a mount!

Common Measurement Mistakes

  • Tilted calipers - Jaws not perpendicular gives false reading
  • Measuring over obstacles - Measure at narrowest point (not over screw heads)
  • Forgetting to zero - Calipers drift; re-zero before each measurement
  • Confusing inside/outside - Check which jaws you're using
  • Rounding too aggressively - Keep 0.1mm precision, don't round to whole mm

Part 3: Designing a Sensor Mount

Let's design a mount for an Infrared Line Detector sensor. This mount will:

  • Hold the sensor at correct height (3-5mm from ground)
  • Attach to SimpleBot chassis with M3 screws
  • Keep sensor level and aligned

Step 1: Create a Sketch (Base Plate)

In FreeCAD Part Design workbench:

  1. Create a new Body (right-click Body in tree, select "Create body")
  2. Create a Sketch on XY plane
  3. Draw a rectangle - 30mm × 20mm (base plate for mount)
  4. Constrain dimensions - Select each edge, press "C" (constrain), enter value
  5. Close sketch (click "Close" in toolbar)

Tip: Press "V" then "F" to fit sketch to screen.

Step 2: Extrude Base Plate (Pad)

  1. Select the closed sketch
  2. Click Pad tool (extrude icon)
  3. Set length to 2mm (base plate thickness)
  4. Click OK

You now have a 30mm × 20mm × 2mm base plate!

Step 3: Add Mounting Holes for Chassis

The base plate needs holes to attach to the robot chassis with M3 screws.

  1. Select top face of base plate
  2. Create new Sketch on that face
  3. Draw two circles - 3.2mm diameter, 20mm apart horizontally, centered vertically
  4. Close sketch
  5. Select sketch and click Pocket tool (cut icon)
  6. Set depth to "Through All"
  7. Click OK

Why 3.2mm holes for M3 screws?

  • M3 screw is 3.0mm diameter
  • 0.2mm clearance (3D printing tolerance) = 3.2mm hole
  • This allows screws to pass through freely (clearance hole)

Step 4: Add Vertical Wall for Sensor

The sensor mounts vertically on a wall:

  1. Select front face of base plate
  2. Create new Sketch on that face
  3. Draw a rectangle - 25mm wide × 15mm tall
  4. Close sketch
  5. Pad forward 2mm (wall thickness)

Now you have a base plate with a vertical wall!

Step 5: Add Sensor Mounting Holes

The sensor PCB attaches to the wall with two M3 screws:

  1. Select front face of vertical wall
  2. Create new Sketch
  3. Measure your sensor: holes are (example) 20mm apart, 8mm from bottom
  4. Draw two circles - 2.8mm diameter, positioned to match sensor holes
  5. Close sketch
  6. Pocket depth "Through All"

Why 2.8mm holes for M3 screws in plastic?

  • M3 screw is 3.0mm diameter
  • Thread-forming screws cut threads in plastic as they're screwed in
  • 2.8mm hole (0.2mm undersized) allows screw to cut threads tightly
  • Alternative: Use 3.2mm holes and M3 nuts on backside

Step 6: Add Chamfers (Optional)

Chamfers are angled edges that improve appearance and printability:

  1. Select top edges of base plate
  2. Click Chamfer tool
  3. Set distance to 0.5mm
  4. Click OK

This removes sharp corners and helps the print look professional.

Part 4: Design for 3D Printing

Not all CAD designs can be 3D printed successfully. Follow these rules:

Overhang Rule: 45-Degree Maximum

FDM printers struggle with overhangs steeper than 45 degrees:

  • OK: Walls at 90 degrees (vertical), floors at 0 degrees (horizontal)
  • OK: 45-degree chamfers and slopes
  • NOT OK: Upside-down 45-degree slopes (use support)
  • NOT OK: Horizontal holes (print vertically or use support)

Fix: Orient part so overhangs are under 45 degrees, or add supports.

Bridging Rule: Short Gaps Only

Printers can bridge gaps (print unsupported horizontal lines) up to ~20mm:

  • OK: 10mm horizontal hole (bridges nicely)
  • NOT OK: 50mm horizontal hole (sags in middle)

Fix: Keep bridged gaps under 20mm, or use support.

Minimum Feature Size

FDM printers have limits on small features:

  • Minimum wall thickness: 1.2mm (2× nozzle diameter for 0.6mm nozzle)
  • Minimum hole diameter: 2mm (smaller holes often close up)
  • Minimum gap: 0.4mm (smaller gaps fuse together)

Fix: Make features at least 2mm thick for reliability.

Tolerances for Fit

3D printed parts shrink slightly and have rough surfaces. Add clearance:

  • Press fit: 0.0 to 0.1mm clearance (tight, may need force)
  • Sliding fit: 0.2 to 0.3mm clearance (moves smoothly)
  • Loose fit: 0.5mm+ clearance (rattles slightly)

For our sensor mount:

  • Chassis mounting holes: 3.2mm (clearance fit for M3 screws)
  • Sensor mounting holes: 2.8mm (thread-forming fit)

Part 5: Assemblies (Multiple Parts)

Real robots have many parts. CAD software can show how they fit together:

Creating an Assembly in FreeCAD

  1. Create new document
  2. Insert parts: File → Insert → Part (select your sensor mount .FCStd file)
  3. Insert sensor model (if available) or create a simple box to represent it
  4. Use Transform tool to position parts
  5. Add Constraints to lock parts in place

Assembly shows:

  • Do parts collide or interfere?
  • Are mounting holes aligned?
  • Is sensor at correct height?

Common Assembly Mistakes

  • Over-constrained: Too many screws in slotted holes (thermal expansion causes binding)
  • Under-constrained: Part wobbles or shifts (add more screws or pins)
  • Interference: Parts overlap (check clearances)
  • Wire routing: No space for wires (leave gaps and channels)

Part 6: Practical Design Exercise

Let's design a motor mount bracket for SimpleBot:

Requirements

  • Mount a DC motor to acrylic chassis
  • Motor diameter: 24mm (measure with calipers)
  • Motor shaft length: 12mm (protrudes from motor)
  • Chassis mounting: Two M3 screws, 20mm apart
  • Motor output: Wheel must attach to shaft

Design Steps

  1. Sketch base plate - 30mm × 30mm × 3mm thick (stronger for motor vibration)
  2. Add motor clamp - Half-circle cutout 24.2mm diameter (0.2mm clearance)
    1. Pad walls on both sides to clamp motor
    2. Add M3 screw hole through walls to tighten clamp
  3. Add chassis mounting holes - Two 3.2mm holes, 20mm apart
  4. Add wire routing - Small channel for motor wires to exit
  5. Check clearances - Wheel must not hit chassis (leave 2mm gap)

Design Checklist

Before printing, verify:

  • ☐ All holes are correct size (calipers + tolerance)
  • ☐ Mounting points are spaced correctly (measure chassis)
  • ☐ No overhangs steeper than 45 degrees (or add supports)
  • ☐ Minimum wall thickness 1.2mm
  • ☐ Clearance for moving parts (wheels, gears)
  • ☐ Space for wires to route through
  • ☐ Chamfers on sharp edges (optional, looks better)

Part 7: Exporting for 3D Printing

Export STL File

  1. Select the Body in FreeCAD tree
  2. File → Export → Select "STL Mesh" format
  3. Save as "sensor_mount.stl"

STL (STereoLithography) is the universal format for 3D printing - it stores the outer shell as triangles.

Slicing (Preparing for Print)

Use slicer software (Cura, PrusaSlicer, etc.):

  1. Import STL file
  2. Orient part (flat side down, minimize supports)
  3. Set print settings:
    1. Layer height: 0.2mm (good balance of speed and quality)
    2. Infill: 20% (functional parts), 10% (decorative)
    3. Supports: Enable if overhangs exceed 45 degrees
    4. Material: PLA (easy), PETG (strong), ABS (heat-resistant)
  4. Slice and generate G-code
  5. Send to printer or save to SD card

Print Orientation

Orientation affects strength and quality:

  • Best strength: Forces perpendicular to layers (layers resist shear poorly)
  • Best quality: Curved surfaces horizontal (layers follow curve)
  • Minimize supports: Flat side down, overhangs under 45 degrees

For sensor mount: Print base plate down (vertical wall prints nicely, no supports needed).

Part 8: Iteration and Testing

First prints rarely fit perfectly. Iterate:

Test Fit

  1. Print part
  2. Test fit with real components (sensor, screws, chassis)
  3. Check for issues:
    1. Holes too tight? Increase diameter by 0.1-0.2mm
    2. Holes too loose? Decrease diameter by 0.1-0.2mm
    3. Part warps? Add thicker base or print slower

Common Print Issues and Fixes

Issue Cause Fix
Warping (corners lift) Uneven cooling Add brim or raft, lower bed temp
Holes too small Printer over-extrudes Increase hole diameter by 0.2mm
Weak parts Under-extruding Increase flow rate or check filament
Rough surface Too fast, too hot Slow down print, lower nozzle temp
Supports stuck Too close to part Increase support gap in slicer

Design Iteration Loop

  1. Design part in CAD
  2. Export STL and slice
  3. Print part
  4. Test fit and identify issues
  5. Modify CAD design (change dimensions)
  6. Repeat until perfect fit

Tip: Print small test sections first (just one mounting hole) to check fit before printing the entire part.

Part 9: Advanced Techniques

Once you're comfortable with basic design:

Parametric Design

Parameters are variables you can change to update the entire design:

  • Create a parameter "motor_diameter = 24mm"
  • Use "motor_diameter + 0.2mm" for clamp hole size
  • Change motor_diameter to 20mm → entire mount resizes!

In FreeCAD: Use Spreadsheet workbench to create parameters.

Fillets vs Chamfers

  • Chamfer - Angled edge (45 degrees typical), easier to print
  • Fillet - Rounded edge, stronger, looks better, slower to print

Use fillets for stress concentration areas (corners that bear load).

Threaded Holes

Instead of thread-forming screws, design threads into plastic:

  • M3 thread = 3.0mm outer diameter, 0.5mm pitch
  • Add Helix feature (spiral) and Subtract to cut threads
  • Requires high resolution (0.1mm layers) to print clearly

Easier alternative: Use heat-set inserts (metal threaded inserts melted into plastic).

Assemblies with Motion

Design parts that move (hinges, gears, linkages):

  • Add clearance for rotation (0.3mm radial clearance for shafts)
  • Use Snap fits - flexible tabs that lock parts together
  • Use Living hinges - thin flexible sections (0.3-0.5mm thick)

Library of Standard Parts

Don't redesign screws and nuts - import models:

  • GrabCAD - Free CAD library
  • McMaster-Carr - CAD models for every fastener
  • FreeCAD Fasteners Workbench - Built-in screw library

Part 10: Studying Existing Designs

Learn from SimpleBot CAD files:

  1. Download SimpleBot repository (symlinked at ./simplebot/)
  2. Open FreeCAD files (.FCStd) in CAD software
  3. Study how parts fit together
  4. Measure features with Measure tool
  5. Modify and remix designs for your own robot

What to Look For

  • Hole placements - How are mounting holes spaced?
  • Tolerances - What clearances are used for screws and shafts?
  • Wall thicknesses - How thick are structural parts?
  • Assembly method - How do multiple parts attach?
  • Wire routing - Where do wires pass through?

Part 11: Design Principles for Robotics

Minimize Part Count

Fewer parts = faster assembly, fewer failures:

  • Combine multiple features into one part (mount + bracket = one piece)
  • Use snap fits instead of screws where appropriate
  • Design parts to be 3D printable in one piece

Design for Assembly

Make parts easy to put together:

  • Use alignment pins or tabs to position parts correctly
  • Add chamfers to screw holes (guide screws in)
  • Leave clearance for screwdriver or hex key access
  • Print assembly instructions into parts (arrows, labels)

Design for Serviceability

Robots need maintenance and upgrades:

  • Don't trap components inside (leave access holes)
  • Use standard fasteners (M3 screws are common)
  • Make fragile parts replaceable (separate wheel mounts from chassis)
  • Route wires through channels or clips (prevent tangling)

Design for Strength

Identify stress points and reinforce them:

  • Thin sections break easily (use minimum 2mm thickness)
  • Sharp corners concentrate stress (add fillets)
  • Cantilever beams need support (add ribs or gussets)
  • Print orientation affects strength (layers are weak in shear)

Part 12: Resources and Next Steps

Learn More CAD

Practice Projects

  1. Design a custom sensor mount for your robot
  2. Design a battery holder for 4× AA batteries
  3. Design a motor mount with gear reduction
  4. Design a robot arm with 2 servos
  5. Study and remix SimpleBot chassis

Advanced Topics

Related Competencies

Troubleshooting

CAD Issues

  • Sketch won't close? Check for gaps or overlapping lines
  • Can't pad sketch? Sketch must be fully constrained
  • Part disappeared? Check if hidden (press "Space" to toggle visibility)
  • Changes don't update? Press "F5" to recompute all features

Print Issues

  • Parts don't fit? Add 0.2mm clearance for sliding fits
  • Screw holes too tight? Increase diameter by 0.2mm
  • Parts warp? Increase bed adhesion (brim, glue stick, hairspray)
  • Supports won't remove? Increase support gap to 0.2mm

Design Issues

  • Part too weak? Increase wall thickness or add ribs
  • Motor vibration causes loosening? Add threadlocker or locknut
  • Wires tangled? Add wire routing channels or clips
  • Parts misaligned? Add alignment pins or reference surfaces

Summary Checklist

By now, you should be able to:

  • ☐ Measure parts accurately with calipers
  • ☐ Create sketches and extrude them into 3D parts
  • ☐ Design mounting holes with correct clearances
  • ☐ Add chamfers and fillets to edges
  • ☐ Export STL files for 3D printing
  • ☐ Design for printability (overhangs, bridging, supports)
  • ☐ Test fit parts and iterate designs
  • ☐ Create assemblies with multiple parts
  • ☐ Design for strength and serviceability

If you can check most of these boxes, you're ready to design custom parts for your robot!

See Also