← Schemat montażuPlik .md ↓

Guided servo test

Open the lesson in a browser. It works offline. No installation is required.

This is the first calibration lesson. It records a supervised test of one servo. It does not control the hardware.

Select the correct test

Select node 0 or node 1. Select pan or tilt. Record the part labels for this test.

Use USB as the XIAO's only positive supply. Use a verified regulated bench supply for the servo. Leave LiPo packs disconnected. Follow the single-servo wiring in BOM.md. This page does not replace the wiring guide.

Follow the lesson

  1. Disconnect power. Identify the circuit and test type.
  2. Measure the unloaded servo supply. The setup range is 4.9–5.1 V.
  3. Disconnect power before wiring. Check polarity, common GND, resistors, and capacitor polarity.
  4. Upload ServoTest. Set SERVO_PIN to 1 for XIAO D0/pan or 2 for D1/tilt.
  5. Open Serial Monitor at 115200 baud. Enable servo power. Send c once.
  6. Wait for movement to stop. For an image test, save the first camera image.
  7. Send + once. The pulse changes from 1500 to 1510 µs.
  8. Observe movement. Record the lowest meter display reading during movement. The screening range is 4.8–5.2 V.
  9. For an image test, wait for movement to stop. Save the second image.
  10. Send x. Switch off and disconnect all power, including USB and camera power.
  11. Measure the servo rail. Wait until it is below 0.1 V before touching the wiring.
  12. Complete the image step, if selected. Export the record.

A centre command can cause a large initial movement. Stop for binding, heavy buzzing, resets, or abnormal heating. The Stop and record shutdown button opens shutdown instructions. It cannot stop a physical motor. Do not deliberately stall a servo.

The meter can miss short voltage dips. These limits are screening rules from the existing assembly guide. They do not prove supply transient performance or fault protection.

Measure image movement

Use two saved PNG, JPEG, or WebP images from the same camera and test. Each file must be below 15 MB and at most 24 megapixels. Images must have the same dimensions.

Keep the target and node base stationary. Keep image size, crop, and flip settings unchanged. The app cannot verify these conditions. Mark the same target point in both images. Use a sharp corner rather than a changing detection-box centre.

Click the target or enter its pixel coordinates. Coordinates use the original image dimensions, even when the preview is smaller. The top-left pixel is (0, 0). X increases rightward. Y increases downward.

The result contains:

The target's image direction is not the servo shaft direction. The result applies only to this command change and setup. A displacement below 2 pixels is marked inconclusive. This threshold is a practical screening choice, not a measured error bound. Do not automatically increase travel when the result is inconclusive.

This lesson does not calculate shaft angle, lens calibration, mechanical play, or 3D position uncertainty. These need more measurements. A repeated movement test in both directions is a later step. Automatic target detection and live camera capture are also outside this first lesson.

Keep the evidence

The browser saves accepted steps with timestamps. It saves image names, dimensions, and marked coordinates, but not image files. Keep the source images with the exported JSON if you need to review the result later.

Reloading never resumes a powered test. The previous record is available for export. A new test starts with empty checks. Export before starting another test: browser storage holds only the current record. The immediately previous record remains available in memory until the page closes. If browser storage fails, the page reports this; JSON export still works.

Use Stop and record shutdown for a failed test. Record the reason and the discharged voltage. A stopped test cannot receive a completed result. Resolve the cause before a fresh test. Changing a circuit requires fresh measurements.

Developer verification

Run node --test Hardware/Assembly/tests/*.test.cjs from the repository root. The calibration tests cover missing evidence, voltage boundaries, decimal commas, sequencing, invalidated later steps, aborted tests, and image geometry.

An optional integration check uses an installed Chromium browser. Set CHROME_PATH to its executable, then run node Hardware/Assembly/tests/calibration-browser.cjs. It checks the real page, both lesson paths, image uploads, rejected inputs, reload behavior, stopped tests, and mobile width. It uses a temporary browser profile and does not access hardware.