Testing & Calibration

Power up, calibrate servos, and validate system operation

7 min read
45 min work

Testing Overview

This final phase brings Fabrica to life. You will power on the system, calibrate each servo to its 0° home position, attach the servo horns correctly, and test the motion sequences. If you have followed all previous steps carefully, this should go smoothly.

Safety & Preparation

⚠️ Before Powering On:

  • • Double-check ALL wiring connections (servo cables, I2C, power)
  • • Ensure power supply is set to 5V DC and can deliver at least 3A
  • • Verify polarity: Red = +5V, Black/Brown = GND
  • • Keep hands away from moving parts during servo tests
  • • Have emergency power disconnect ready

Testing Steps

1

Initial Power-On

  1. a.Plug in the 5V power supply to the PCA9685
  2. b.Connect USB cable to Raspberry Pi Pico 2W
  3. c.Observe the LED on the Pico—it should turn on
  4. d.The status LED on the button panel should also illuminate
  5. e.Listen for servo initialization (slight buzz or hum is normal)

💡 Expected Behavior: If code is uploaded correctly, servos will move to home position (0°) on startup. If servos do not move, verify code upload and I2C connection.

2

Servo Calibration (Critical!)

⚠️ IMPORTANT: Servo horns must be attached AFTER this calibration step, not before!

  1. a.Ensure code has run `servo_controller.py` calibration on startup
  2. b.All servos should now be at 0° position (neutral/home)
  3. c.Verify each servo by gently attempting to rotate by hand (should resist)
  4. d.If a servo rotates easily, check its PCA9685 connection
3

Attach Servo Horns

  1. a.With servos at 0°, attach the servo horn to Module 1 shaft
  2. b.Align horn so the panel arm is vertical (perpendicular to center panel)
  3. c.Secure with M2 screw (included with servo)
  4. d.Repeat for Modules 2, 3, and 4
  5. e.Verify all panels are aligned in the same vertical position

💡 Pro Tip: 0° = vertical (ready to fold). 180° = horizontal (fully folded). If panels are misaligned, remove horn and reposition.

4

Individual Servo Test

  1. a.Use the control buttons to test each servo individually (if your code supports this)
  2. b.Or, connect to REPL and manually move servos using commands like: `servo_controller.set_angle(0, 90)`
  3. c.Verify each servo rotates from 0° to 180° smoothly
  4. d.Check that follower modules (F1-F4) move in sync with motorized modules
5

Test Button Interface

  1. a.Press Button 1 (Enter) to start a motion sequence
  2. b.Press Button 2 (Up) and Button 3 (Down) to navigate sequences
  3. c.Press Button 4 (Config) to enter configuration mode
  4. d.Observe LED feedback (should blink or change state)
6

Full Motion Sequence Test

  1. a.Place a small piece of cloth (e.g., handkerchief) on the center panel
  2. b.Select a folding sequence and start execution
  3. c.Observe all 8 panels moving in coordinated motion
  4. d.Verify the cloth is folded according to the sequence
  5. e.Test multiple sequences to ensure repeatability

Common Issues

Servo does not respond
  • • Check cable connection to PCA9685 (correct channel?)
  • • Verify power supply (5V, sufficient current)
  • • Test with REPL command to isolate hardware vs. software issue
  • • Inspect servo for physical damage (gears stripped?)
Button presses not detected
  • • Verify button wiring to correct GPIO pins
  • • Check for loose connections or cold solder joints
  • • Test with multimeter (continuity check when pressed)
  • • Review `button.py` code for correct pin assignments
Panels misaligned after calibration
  • • Remove servo horns and reattach with servos at exact 0° position
  • • Verify calibration code in `servo_controller.py` uses correct pulse widths
  • • Check for mechanical binding (panels should rotate freely)
  • • Inspect servo bracket alignment on modules
I2C communication error
  • • Verify SDA and SCL connections between Pico and PCA9685
  • • Check for correct I2C address (default 0x40 for PCA9685)
  • • Test I2C scan in REPL: `from machine import I2C; i2c = I2C(0); i2c.scan()`
  • • Ensure pull-up resistors are present (usually built into PCA9685)

System Validation Checklist

Complete this checklist to confirm Fabrica is fully operational:

🎉 Fabrica is Ready!

Congratulations! You have successfully built and tested the Cloth Folding Robot. Fabrica is now ready to fold clothes automatically.

Next Steps:

  • • Experiment with custom folding sequences
  • • Adjust timing and angles for different fabric types
  • • Share your build on social media (tag #BuildAirAI)
  • • Explore advanced features in the documentation