Update!

Hey folks! I have completed the stepper control updates. The code has been completely rewritten. Here are the primary improvements:

  • Three stepper control devices: cone_stepper (relative spin), spout_stepper (absolute arc), and both_steppers for synchronized motion. both_steppers has the motors start in the same Arduino loop tick so the cone/spout choreography stays tightly locked.

  • Motion-complete events from firmware: The legacy firmware only ack’d when commands hit its queue, with no way to know when a move actually finished. The new firmware emits cone_motion_complete / spout_motion_complete when AccelStepper reports the motor stopped.

  • One move_complete per synchronized move: A both_steppers move fires one event once both moves finish, so recipe step transitions stay clean.

  • Per-motor busy tracking with cross-stepper safety: Solo cone or spout commands during a both_steppers move get rejected with a clear "stepper busy" message. No stray command can de-sync a choreographed pour.

  • Async-first transport: New ArduinoTransport uses asyncio plus a new custom CmdMessenger codec instead of the unmaintained PyCmdMessenger lib we used previously.

  • E-stop integrated: force_stop sends pause_steppers to the firmware and motors halt in place, with move targets preserved. The firmware suppresses motion complete events while paused so a halted move can't act as a real completion.

  • Cleaner protocol: Dropped the redundant direction field, the sign of steps or position_degrees carries directional information. New home action for spout zeroing. Rules are enforced at the dispatcher level with clear invalid_command messages instead of wonky firmware errors.

  • Per-stepper speed bounds in hardware.toml: Out of range speeds are rejected with named limits, matching the pump’s pattern.

  • 30 new unit tests: ArduinoTransport, stepper devices (including cross-device busy and concurrency), dispatcher validation for the new fields, and settings parsing. All of them can be run on your dev machine with no pi hardware running.

Now that this is wrapped I will be releasing this refactored Operator in the next week or so. This week I will have new demos out running the updated code. I’m like 50/50 on DECAF being completed this week as well.

Ok, that is all for now, look forward to sharing more this weekend.

Cheers!

MComment