Skip to content

Add NanoXRP board support + XRPLib 2.3.0#2

Closed
SaintSampo wants to merge 3 commits into
Open-STEM:mainfrom
SaintSampo:add-xrp-nano-board
Closed

Add NanoXRP board support + XRPLib 2.3.0#2
SaintSampo wants to merge 3 commits into
Open-STEM:mainfrom
SaintSampo:add-xrp-nano-board

Conversation

@SaintSampo

Copy link
Copy Markdown

Add NanoXRP board support + XRPLib 2.3.0

Summary

Adds the NanoXRP board to the firmware repo and introduces XRPLib 2.3.0, a
new library release that combines the NanoXRP support from the upstream
XRP_MicroPython main branch with the dashboard/puppet stack already shipping
in 2.2.1. The three MicroPython board projects are repointed at the new release.

What's included

1. NanoXRP board

  • boards/xrp-nano/ — MicroPython 1.28.0 firmware (firmware.uf2 + registry),
    board selector (boards/xrp-nano.json), and a micropython project.

2. XRPLib 2.3.0 (boards/XRPLib/2.3.0/)

Built from the 2.2.1 release as a base, then the NanoXRP + buzzer work was
layered on top. Net result vs 2.2.1:

Kept from 2.2.1 (unchanged): dashboard.py, puppet.py, the puppet/XPP-based
gamepad.py, ble/, phew/, and all shared modules/examples.

Brought in from XRP_MicroPython@main (NanoXRP support):
board.py, motor.py, imu.py, encoder.py, encoded_motor.py,
reflectance.py, differential_drive.py, defaults.py, plus new
XRPLib/buzzer.py and XRPExamples/buzzer_examples.py. This adds NanoXRP board
detection (motor direction, IMU axis remap, encoder gear ratio, wheel geometry
and per-board PID gains), a buzzer module, a middle reflectance sensor, and
board-attribute-gated 4th motor / 4 servos — all guarded so existing Beta/2350
boards are unaffected.

Hand-merged: resetbot.py — union of both lineages (keeps 2.2.1's
reset_dashboard, adds the buzzer reset and board-attribute-driven motor/servo
handling).

3. Gamepad architecture decision

The two source lineages had incompatible gamepad implementations (upstream
main: BLE UART; 2.2.1: puppet/XPP). 2.3.0 keeps the puppet-based gamepad so
the dashboard continues to work. The upstream BLE gamepad path is intentionally
not carried over.

Bug fixes (folded into 2.3.0)

Three pre-existing defects in upstream main were fixed while importing the code.
All three still exist upstream and should be fixed there too:

  1. differential_drive.pytrack_width never assigned. The "centralize
    defaults" refactor assigned self.wheel_track but the turn/heading math reads
    self.track_width, which was never set → AttributeError on encoder-based
    (no-IMU) straight()/turn(). Standardized on self.track_width.
  2. differential_drive.py — explicit wheel args dropped. wheel_diam/
    wheel_track were only assigned inside the == 0.0 sentinel branch, so passing
    an explicit non-zero value left the attribute unset → AttributeError. Added
    else branches so explicit values are honored and 0.0 still means auto-detect.
  3. encoded_motor.py — speed PID not reset on set_speed(). The persistent
    speed controller kept stale integral windup and a frozen prev_time across
    stop→restart, causing an effort kick / timestep spike on the first update after
    restart. set_speed() now calls clear_history() when starting control.

Project version references

Project xrplib before xrplib after
xrp-nano / micropython (new) xrplib-2.3.0
xrp-beta / micropython xrplib-2.2.1 xrplib-2.3.0
xrp-2350 / micropython xrplib-2.2.1 xrplib-2.3.0
xrp-2350 / sparkfun-red-vision xrplib-2.2.1 xrplib-2.2.1 (unchanged)
xrp-2350 / agxrp xrplib-2.1.3 xrplib-2.1.3 (unchanged)

xrplib-2.3.0 is registered as the newest entry in boards/XRPLib/index.json.

Generation & verification

  • files.json regenerated with the standard gen-firmware-manifests.mjs logic
    (verified byte-for-byte against the tool's output); xrplib.zip LSP stub bundle
    rebuilt to include buzzer.py and the fixes.
  • All XRPLib modules syntax-compile; JSON manifests validate; line endings kept
    CRLF-consistent with the rest of the repo.

SaintSampo and others added 3 commits July 1, 2026 23:34
Adds the xrp-nano board to the firmware loader tree: board-level
project list, MicroPython project manifest referencing the shared
XRPLib 2.2.1 release, firmware version registry, and the NanoXRP
UF2 build (MicroPython v1.28.0-preview, NanoXRP Controller RP2040).

Pairs with the XRPWeb nanoxrp-fw-support branch, which adds the
xrp-nano tile and NanoXRP wizard support in the IDE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add complete XRPLib 2.3.0 library with new features including puppet protocol support, improved buzzer library, gamepad integration, and enhanced dashboard. Update all board configurations (xrp-2350, xrp-beta, xrp-nano) to use the new library version. Includes example code, BLE support, and phew web framework.
Reset the speed controller's history when setting motor RPM to prevent stale integral windup and large timesteps from previous motor runs, ensuring consistent control behavior on restart.
@SaintSampo SaintSampo closed this Jul 6, 2026
@SaintSampo SaintSampo deleted the add-xrp-nano-board branch July 6, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant