H1 / φ₁
Quadrature counts capture the first shell's accumulated rotation and rate. An index pulse provides a separate reference event.
/caster_encoder/H1/joint_states03 / Control & instrumentation
Wheel speed and turret heading close the motion loop. Independent encoders reveal how each supporting caster moves along the route.
01 / Motion architecture
The Raspberry Pi corrects position and heading. The drive ESP tracks wheel speeds and returns encoder and IMU measurements.
Blend waypoint corners and schedule a feasible velocity through each segment.
Combine reference velocity with position and heading feedback, then apply inverse kinematics.
Send wheel and turret commands to the ESP; return motion measurements to the Pi.
02 / Powered wheels
Quadrature encoders measure how fast the left and right wheels turn. The ESP compares these rates with their targets and adjusts motor PWM.
Feed-forward supplies the nominal effort; PID corrects the difference. Integral limits and output saturation keep the command bounded.
GPIO assignments below are defined in the current drive firmware. They document the software configuration; the installed harness still needs to be checked against the board and encoder hardware.
| Connection | Configured GPIO / interface | Signal handling |
|---|---|---|
| Left wheel encoder | A → GPIO14 · B → GPIO13 | Input pull-ups; both edges of A trigger counting, B determines direction |
| Right wheel encoder | A → GPIO1 · B → GPIO2 | Same acquisition; firmware reverses the right-wheel count sign |
| Turret encoder | A → GPIO5 · B → GPIO4 | Input pull-ups; relative rotation from A-edge quadrature counting |
| BNO055 IMU | SDA → GPIO33 · SCL → GPIO34 | IMU55 sens(33,34); I²C at 100 kHz, default address 0x28 |
| Motor driver outputs | Left PWM11 / DIR12 Right PWM41 / DIR42 Turret PWM7 / DIR6 | 5 kHz, 12-bit PWM configured by the drive ESP |
| Pi data link | Serial0 · 460800 baud | Binary bidirectional UART; RX/TX GPIOs use board defaults and are not explicitly assigned in this source |
| Programming / logs | USB CDC · 115200 baud | Separate from the binary data UART |
The Pi bridge publishes the three cumulative tick streams and /imu/data; wheel and turret rate targets travel back on the same UART. The firmware targets esp32-s2-saola-1. GPIO numbers refer to ESP pins, not connector positions.
Source files: HAMR_Controller/src/main.cpp, src/imu_55.cpp, src/imu_55.h, platformio.ini; host settings: hamr_control/hamr_bringup/config/hamr_uros_bridge.yaml. The explicit IMU constructor uses GPIO33/34; its adjacent GPIO4/5 comment is stale.
03 / Turret yaw
The Pi uses the turret's relative encoder angle and base orientation to estimate world heading. Its yaw correction coordinates turret rotation with the drive wheels.
The command travels through /turret/cmd_vel to the ESP. Encoder feedback returns through /turret/encoder_ticks and /HAMR_turret/odom.
In the ROS/UART firmware branch, turret rate is mapped to PWM with a deadband, static-friction compensation, and a slew limit. World-heading feedback closes on the Pi. A separate local angle-PID mode is also present in the firmware; its activation depends on the selected command mode.
04 / Ball caster measurement
H1 and H2 measure hemisphere rotation. CENTER measures the common rod. Each rotating module has its own ESP32-C6, battery, and wireless link.
Quadrature counts capture the first shell's accumulated rotation and rate. An index pulse provides a separate reference event.
/caster_encoder/H1/joint_statesThe same acquisition chain measures the second shell independently, revealing differences between the two contact motions.
/caster_encoder/H2/joint_statesA parity-checked absolute encoder measures single-turn rod angle. Continuous turns are reconstructed only when valid.
/caster_encoder/CENTER/joint_statesThese three boards measure the passive caster. They do not drive its hemispheres or command the robot.
| Channel | Acquisition | Interface |
|---|---|---|
| H1 / H2 | AMT132S-V, hardware x4 quadrature counting | SN74LVC244ADW at 3.3 V; A → D0/GPIO0, B → D1/GPIO1, Z → D2/GPIO2 |
| CENTER | AMT252B-V, 14-bit absolute single-turn position | CS → D3/GPIO21, SCLK → D8/GPIO19, MISO → D9/GPIO20, MOSI → D10/GPIO18 |
| Every module | 200 Hz default sampling; two samples per 100 Hz datagram | 2.4 GHz Wi-Fi / UDP to the configured receiver; independent 2S battery and 5 V UBEC |
| Reference calibration | Sign, zero, count scale, time alignment | 2048 PPR / 8192 x4 counts is the tentative H1/H2 configuration, pending physical verification |
Each ESP has its own boot clock. Raw packets preserve source timestamps, sequence numbers, and validity flags; ROS display headers use host receipt time. Resolution is distinct from measured angular accuracy.
05 / Wheelchair caster comparison
For the conventional caster, the swivel angle describes its orientation and axle rotation describes rolling. The paired experiment compares this motion with the ball caster's reconstructed coordinates.
Target instrumentation The diagram reserves an encoder at the swivel axis and an optional wheel-axle encoder. Simulation uses joint states; the physical sensor and wiring details can be filled in after the rig is finalized.
See encoder and vision reconstruction →From angles to evidence
Preserve raw measurements, align their clocks, and apply the calibrated model. Trajectory error, caster orientation, and disturbance response can then be evaluated together.
Explore the experiment template →