USB Servo Controller
v0.4.1Drive 12 hobby servos on an open-hardware USB-C controller: moves, poses, sequences, rail current
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
board_status
Rail current/voltage, faults, protection limits, and every channel's name, mode, travel limits, speed and current position (0 = off).
move_servos
Move one or more servos and wait until they arrive. positions: {channel number or name: pulse width in us}, e.g. {"0": 1200}. duration_s: time for all to arrive together (0 = each channel's own speed). Positions are clamped to each channel's limits. Turns channels on if off.
| Parameter | Type | Description |
|---|---|---|
positions * | object | |
duration_s | number |
disable_servos
Stop driving the given channels (numbers or names); the servos go limp.
| Parameter | Type | Description |
|---|---|---|
channels * | array |
stop_all
Panic stop: every channel off immediately.
list_poses
Poses and the sequence saved from the GUI (servogui.json).
go_to_pose
Move to a saved pose (see list_poses) and wait until it arrives.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
duration_s | number |
play_sequence
Play the GUI's saved sequence of poses (move and hold times as saved), repeated `loops` times. Stops early on a fault; capped at 120 s.
| Parameter | Type | Description |
|---|---|---|
loops | integer |
read_analog
Read channel 0-7 as an analog input (0-4095 counts, 0-3.3 V).
| Parameter | Type | Description |
|---|---|---|
channel * | string |
measure_current
Sample the servo-rail current continuously; returns peak, mean and min mA.
| Parameter | Type | Description |
|---|---|---|
seconds | number |
set_protection
Set the rail trip limits (0 disables either). Overcurrent is capped at 7500 mA: the board's continuous budget is ~5 A. Resets at power-up.
| Parameter | Type | Description |
|---|---|---|
overcurrent_ma * | integer | |
undervoltage_mv | integer |
clear_faults
Clear a latched overcurrent/undervoltage fault so channels can move again.
upload_script
Compile a servo script and store it in the board's flash, where the firmware runs it without a PC (autorun: also start at every power-up). One statement per line; channels by number or name; times in ms or '1.5s': label: jump/loop target move <ch> <us> [<time>] ramp there; does not wait: moves on different channels run together, a repeat move of the same channel waits for the previous one pose <name> [<time>] move every channel of a GUI pose sync wait until all mo…
| Parameter | Type | Description |
|---|---|---|
script * | string | |
autorun | boolean | |
run | boolean |
script_status
What script is stored on the board, and whether it is running.
run_script
Start the stored script from the top.
stop_script
Stop the stored script; servos keep their positions (stop_all to let go).
release_port
Close the serial port now (servos keep holding) so the GUI or flash.py can use the board. It reopens automatically on the next tool call.