Repository navigation
v1 Mantis: read the motors, the arm encoder and the pressure board; the v4 LED bar - #1621
Merged
Merged
Conversation
BioCam
force-pushed
the
mantis-v1-01-read-state
branch
from
November 12, 2026 19:00
38a9597 to
1724cdf
Compare
… the v4 LED bar The driver reads each motor's status, demand position, servo encoder position, following-error check, currents and configuration, and the arm motors' absolute encoders on board 11, read again until valid: each motor's first read after connecting is not. A pump feature is built when the pressure board answers. It measures each line's pressure and reads each controller's status, whether it is enabled, whether the pump runs and each feedback sensor's calibration. Setup reads the calibration into the device configuration at every setup; it is never written, saved nor declared, as the device re-zeroes its offsets between sessions. None of these reads changes the device. An LED bar feature is built on a v4 whose board 12 answers; a v3 has none. It shows one colour or one per LED, starts and stops a firmware animation, and turns off. Setup shows blue, green for a second, then the idle animation; stop turns it off; an LED fault only warns. show_actions=False shows only the idle animation. The LED count is a unit block, NumberOfLed, saved like the clamp levels. Each action's colour is an attribute of the bar, checked when it is set; each bar has its own. show_progress lights a share of the LEDs from the left and sends nothing when that many are lit already. The status display for later actions comes with it: nesting, the error colour and the dispense fill. The plate clamp shows none. The simulation answers above the wire. A declared file saved before a unit block or a non-fitted device field existed still loads: each value it lacks comes from the folder, else the generation's recording, with one warning. After the link is lost, stop and setup close it without sending, with one warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BioCam
force-pushed
the
mantis-v1-01-read-state
branch
from
November 12, 2026 21:05
1724cdf to
a79786b
Compare
BioCam
marked this pull request as ready for review
November 12, 2026 21:18
…test runner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Problem
#1612 connects to a Mantis, clamps the plate and reads the chip tags, but nothing else the device knows can be read: where each motor is, whether it is in fault, what the pressure lines read, whether the pump runs. Every later step (bringing the arm up, moving, priming, dispensing) has to check those first. The v4 also has an LED bar on the front that PyLabRobot cannot show anything on.
PR Content/Solution
request_motor_status,request_motor_position(the demand position, not a measurement),request_encoder_position,request_following_error_configuration,request_motor_currents,request_motor_configuration.request_absolute_encoder_positionreads board 11 again until the reading is valid (each motor's first read is not).mantis.pump, built when the pressure board answers:measure_pressure,request_controller_status,request_controller_enabled,request_pump_on,request_feedback_sensor_parameters, for the"bottle","chip"and"vacuum"lines. Setup reads the sensors' calibration from the device. None of these reads changes the device.mantis.led_bar(v4 only;Noneon a v3, likeplate_clamp):set_color(one colour, or one per LED),start_animation,stop_animation,turn_off. Whileshow_actionsis on (the default) the bar shows what the device is doing: blue during setup, green when done, then the idle wave; off at stop. Each colour is an attribute checked on assignment (setup_color,setup_done_color,error_color,dispense_progress_color; later PRs add their actions').show_progress(done=..., total=...)turns the bar into a progress bar, sending a frame only when the number of lit LEDs changes (each frame holds the link ~62 ms). An LED fault only warns; it never fails the action. The LED count is a unit value, saved like the clamp levels.Usage
On the device
A Mantis v4 on Windows (D2XX):
show_actions=Falseshow_progress🤖 Generated with Claude Code