Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

PiCrawler / Architecture & Command Safety

Architecture & Command Safety

From Python intent to servo PWM; one future motion owner and honest stopping semantics.

Source-defined control chain · conceptual, not a wiring diagram
  1. Python behavior / sensor decisions
  2. PiCrawler local toe targets → inverse kinematics → gait frames
  3. Robot HAT interpolation → Linux I²C / GPIO
  4. HAT MCU timer groups → twelve servo setpoints
  5. Servos attempt commanded positions · no measured joint feedback

Camera → Picamera2 / Vilib → behavior; ultrasonic echo → behavior. Neither establishes world pose.

PiCrawler as an engineering system

The club's PiCrawler is a small quadruped with four three-joint legs. Twelve hobby servos provide the twelve actuated degrees of freedom. A Raspberry Pi 5 runs Linux and the Python programs; the Robot HAT supplies power conversion, a microcontroller-based PWM/ADC interface, connector access and speaker output. A forward-looking camera and ultrasonic ranger provide environmental observations. This combination is a practical laboratory for geometry, timing, power, state machines, vision and networked control. It is not a robot that already knows its joint positions or location in a room.

The kit identity, CN0488D, manufacture label 2025-12-03, purchase date 2026-03-19, Pi 5 with 4 GB RAM, SanDisk 32 GB card, twelve Metal Gear Pro servos and 7.4 V / 2000 mAh battery are user-confirmed physical facts supplied in the work request. They have not been re-inspected in this cloud session. The Robot HAT is V4 — visually confirmed by club owner, inspected October 24 and reported October 25, 2026; MCU marking and electrical revision remain unresolved. An official camera page identifies a 5 MP OV5647 product family; the actual installed sensor and lens are still unresolved. The supplied September inventory photos show general club electronics, not the historical Pi screen or a readable PiCrawler HAT. They cannot upgrade these identity states.

The complete control chain

See the system diagram on the Architecture page.

The Pi decides where feet should go. PiCrawler converts each desired foot coordinate to joint angles and chooses the next coordinate frame in a gait. Robot HAT's Python layer interpolates angles and sends pulse-width commands to its MCU. The MCU generates periodic servo signals without asking a Linux thread to time every pulse edge. Servo internal electronics attempt to reach the commanded position. None of this chain reports the actual foot location back to PiCrawler.

A camera behavior takes a separate path. Picamera2 provides image frames; Vilib applies selected algorithms and publishes detection results. A user program reads those results and chooses an action. Color detection is therefore perception; deciding whether to turn is behavior logic; moving a leg is actuation. Keeping these boundaries visible makes debugging tractable.

Three independent meanings of “works”

Source inspection can establish that a function exists, its arguments and its implementation. An offline test can establish its mathematical or software behavior under controlled inputs. A bench test establishes what the assembled machine actually does. This package records the first two and does not claim the third. All current physical function fields remain NOT_TESTED. A past photograph of the calibration helper is a historical observation, not proof that it still launches or that calibration was saved.

Where to begin

Read PHYSICAL_RECOVERY_PLAN.md before connecting to the actual machine. Preserve the card and local modifications before applying installation instructions. After a controlled recovery, proceed through calibration, sit/stand and one forward gait cycle. Then choose a focused flagship project in ENGINEERING_CLUB_PROJECT_ROADMAP.md. A useful first research question is whether a gait produces repeatable motion at different speeds and battery voltages, with measured outcomes rather than assumed step distances.

Source evidence: user-evidence, club-inventory, pc-core, hat-robot, hat-pwm, hat-servo, vi-core. See SOURCE_LEDGER.md for pinned source URLs and verification limits.

Raspberry Pi 5: computer, not servo controller firmware

The user-confirmed Pi 5 has 4 GB RAM. Its quad-core application processor runs Linux processes, networking, Python and image processing; the microSD stores the operating system and files. The official Pi 5 specification identifies a 2.4 GHz quad-core Cortex-A76 processor, Wi-Fi, Ethernet, USB and two camera/display connectors. Those capabilities are useful for concurrent development and perception. They do not establish a deterministic deadline for a Python gait loop under load.

Where the program runs

When a Windows laptop opens ~/picrawler through Remote SSH, the editor interface is on Windows, but its remote terminal and Python execution are on the Pi. Saving changes edits Pi-side files. Python imports libraries from that Pi interpreter's search path, which can differ from the repository directory open in the editor. An installed egg under a Python 3.13 directory may take precedence over the local checkout. This explains why “I edited the file” does not always mean “the program ran my edit.”

The Pi simultaneously runs an SSH server, the user program, possibly camera and streaming threads, and normal OS services. A program blocked in movement cannot immediately process every new browser or sensor request unless its architecture gives those tasks separate paths. A faster CPU helps throughput but does not turn Linux and blocking Python calls into a real-time servo controller. The HAT MCU already handles periodic PWM timing.

Comparison where it affects projects

Pi Zero 2 W's lower memory and compute headroom makes simultaneous neural speech, vision and an agent stack less practical. Pi 3 and Pi 4 can run ordinary crawler tasks, but the user's Pi 5 provides more headroom for camera processing, development tools and logging. Exact achievable model size, frame rate or speech latency must be measured on the chosen OS and model. This package supplies no invented tokens-per-second figure. Four GB is shared by the OS, model, camera buffers, VS Code Server and other processes.

Pi 5 works with Bookworm-era and later supported Raspberry Pi OS images; an older pre-Pi-5 image is not a recovery solution. The current SunFounder OS guide recommends the Imager's Raspberry Pi OS 64-bit choice, rather than a fully pinned OS/Python combination. On a fresh spare card, choose a supported OS against the required camera/vision dependencies; on the old card, discover its actual OS first. The historical Python 3.13 observation is not enough to prove Trixie or a particular installation date.

Compute versus energy

Camera processing, neural TTS, model inference and cooling consume power in addition to servo work. Pi 5's official USB supply capability and the owner-confirmed V4's documented shared 5 V / 3 A output are not interchangeable specifications. Repeated resets during simultaneous motion/vision can be a power-system symptom. Monitor undervoltage/throttling, temperature and action timestamps before blaming geometry. Adding an NVMe HAT or another heavy peripheral changes mass, packaging and power as well as software.

Source evidence: user-evidence, pi-five, pi-hardware, pc-os-doc, vi-install, hat-v4-features.

A small command boundary worth building once

A structured command layer is worth building when two inputs share motion, such as keyboard plus vision or browser plus voice. A tiny one-shot experiment can use direct API calls. Do not begin by creating a giant robotics framework. The future boundary should express actions the real platform can support, with one owner responsible for initialization, trajectory execution and completion.

Proposed command vocabulary

IntentAllowed dataTranslation / qualification
MOVE_FORWARD / BACKWARDfinite reviewed speed, small positive integer cycle countApproved gait, not metres or seconds; rear clearance is not sensed stock
TURN_LEFT / RIGHTbounded cycle count or named qualified turn presetNo promised world degrees; measured conversion belongs in a later calibrated model
POSE / EXPRESSapproved pose/trajectory IDValidated entry/exit path and bounded duration
LOOKapproved body-pose presetNo independent stock head/camera pan claim
SAYbounded text or sound IDAudio worker; never block motion priority
TAKE_PHOTOapproved media destination policyCapture manager, file result and quota
STOPno motion parametersLatch no-new-motion, invalidate pending commands, request bounded current cancellation if implemented
ARM / CLEAR_FAULTexplicit operator action after preflightNever supplied autonomously by LLM/QR; restart stays unarmed

Every envelope should carry schema version, unique command ID, source/session ID, monotonic receipt time, expiry/age budget and payload. Reject unknown fields/versions, NaN/infinity, oversized strings/lists, negative or huge repeat counts and raw code/servo arrays from untrusted inputs. Limits come from the qualified robot profile. Do not fabricate one universal max speed or coordinate box as safe. A proposed transport example is {type: POSE, poseId: stand-approved, commandId: ..., sessionId: ...}; these names are an interface design, not a shipped API.

One motion owner

Inputs submit intent. The supervisor checks operator lease, stop/arm state, command age, sensor freshness, permitted action/trajectory, and queue capacity. A bounded worker emits accepted/start/finish/fault events. Queue.empty() does not tell whether the worker has already taken and is executing a command. Track the active command and explicit completion; when using queue task accounting, pair get/task_done and join correctly rather than observing emptiness. Future cancellation must also report whether pending work was removed or an active segment has returned.

Use short approved action segments and reobserve between them. A separate sensing thread does not make stock do_action interruptible. Wrapping a call in a timed thread or killing the caller does not establish that PWM output is disabled. Expose measured worst-observed software stop delay and the actual blocking boundary. A cooperative cancellation check inside the interpolation loop requires a pinned driver patch or replacement with meaningful final-target/state tests. An independent physical cutoff remains separate from all software requests.

Fault policy

ConditionProposed responseWhat it cannot guarantee
Client disconnect / deadman expiryClear queued intent, latch permission off, record active commandCurrent stock blocking interpolation may continue
Invalid/stale critical rangeRefuse further forward segments, preserve invalid reasonSide/rear/edge safety is still unobserved
Camera timeout / target lostRevoke approach, idle or reviewed bounded searchA frozen latest result is not fresh perception
Suspected jam/brownout/tiltNo-new-motion, alert/log; operator uses cutoff as neededCommanded angles do not measure stall, torque or contact
Python exceptionRecord cause, stop dispatch, leave recovery explicitfinally: sit() may create another hazardous movement
Config/model missingPassive error status before construction where possibleExisting vendor import/constructor side effects must be isolated deliberately
RestartNew session, no old queue/lease/armed stateA service manager cannot infer a safe physical pose

Test failure paths with an inert adapter and recorded inputs first. Bench only a small supported sequence after the normal recovery gates. No current upstream code is claimed to implement this entire architecture. Source evidence: pc-core, hat-robot, pc-voice, vi-core; V1 SAFETY_AND_STOP_STRATEGY.

Which feedback loops does the stock crawler have?

The Pi sends desired hobby-servo pulse widths. A typical hobby servo uses an internal position mechanism to try to achieve its target, but this kit's Pi-side APIs do not read actual shaft position. PiCrawler's servo_positions and current_coord are software command state. They cannot tell whether a leg physically reached its intended angle or toe coordinate.

QuestionEstablished stock answerConsequence
Actual joint-angle feedback to the Pi?No such path established in wiring/sourceCommanded pose must not be labeled measured pose
Foot-contact sensing?No stock sensor establishedSupport polygon is assumed, not observed
Body orientation measurement?No stock IMU establishedNo measured roll/pitch stabilization
Servo torque or per-servo current?No stock measurement establishedStall/current cannot be inferred from API state
Pack voltage?HAT ADC divider pathUseful power telemetry, not actuator feedback
Closed-loop gait stabilization?Not present in inspected gait/control pathSurface, assembly and load strongly affect outcomes

This is a statement about the documented stock system and inspected source, not a claim that no one has ever attached an undocumented extra sensor to this particular machine. The physical recovery must inspect actual additions. An accelerometer driver in a library, human-pose estimation in Vilib or an LLM saying “balance” does not establish the missing body feedback loop.

In open-loop locomotion, calibration sets an assumed reference, the planned foot trajectory is issued and the program trusts the result. Backlash, compliance, battery sag, friction and timing can make the physical outcome diverge. There is limited disturbance rejection: the program has no automatic measurement of the toe slipping or the body tipping unless an added observation path is designed.

Adding an IMU makes orientation observable, but stabilization also needs frame alignment, bias estimation, sampling/timestamps, a control law, bounded corrections, latency management and a tested response to bad data. Measuring body pitch without changing commands is telemetry. Changing commands using that measurement closes a loop, but the result may oscillate or saturate unless the dynamics and limits are handled.

For projects, label commanded_joint_angles, estimated_body_orientation and measured_range separately. Log validity and uncertainty. A commanded-joint-state ROS topic can be useful for visualization, but it must not masquerade as encoder data. Physical video, toe measurements or an IMU can provide independent evidence of motion when used with their own limitations.

Source evidence: pc-core, hat-robot, hat-servo, hat-adc, hat-device, user-evidence.

Continue

Meeting checklist · Source library · Modification atlas · All project proposals