MyCobot 280 Pi SEM automation: MQTT-controlled sample handling paths #486
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.
Tracking PR for MyCobot 280 Pi robot arm integration with SEM workflow via MQTT. The arm performs autonomous sample pickup from loading area, placement into SEM chamber, and button press for imaging initiation.
Architecture
robot_agent.py) runs on Pi Zero attached to arm, subscribes tosem/robot/cmdHOME,LOAD(pickup → place),UNLOAD(retrieve sample)Current Status
✅ Wireless MQTT control operational
✅ Joint angle paths calibrated for pickup/dropoff/button press
✅ Gripper API corrected (grab/release were inverted)
✅ Cycle time: ~1 min (down from 3 min)
✅ Mechanical securing improved
Outstanding Issues
System Diagram
Sequence: Light sensor triggers → Actuator opens SEM → Arm loads sample → Arm presses button → Actuator closes → SEM imaging → Arm returns home
Original prompt
This section details on the original issue you should resolve
<issue_title>Programming Homing, Sample Pickup, Sample Dropoff, and Button Press Path on MyCobot 280 Pi for SEM Automation</issue_title>
<issue_description>Need to create automated paths for the robot arm for automating the SEM fully using MQTT.</issue_description>
<agent_instructions>Do nothing. Just open a new PR. No commits/new files, etc. I just need a copilot-friendly PR</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@pranshu-ui ### Progress so far:TL;DR - Have connected the arm to MQTT over common hotspot "AC_TRAINING_LAB" (as a 2.4 GHz network is necessary). It can take commands from the brain (Common RPi Zero) wirelessly to either HOME, or LOAD to specific coordinates.
1. Prepare MyCobot
2. Create MQTT Agent
nano ~/robot_agent.py3. Run Agent
Should mention a blank for the next line- it's now subscribed and waiting for command.
Ensure that the IP is right within robot_agent.py and that all devices are connecting to TRAINING_LAB_A (common hotspot).
From SEM-brain terminal:
While moving it will say BUSY on screen and block you from entering another command. </comment_new>
<comment_new>@pranshu-ui
https://github.com/user-attachments/assets/154a5923-eb93-4e55-bcdd-095854e51af9
Next Step is to configure the bot to pick up a sample and load it into the open SEM.</comment_new>
<comment_new>@pranshu-ui
Config was completed yesterday. The general diagram for order of events is attached. (apologies for the messiness, hope it's clear)
Also here is the video of the robot in 2x speed. It moves precisely but it needs some improvements still. The arm still moves super slow, the gripper API for grab and let go were flipped, and some clearances need to be fixed- all on the software side. Mechanically, I need a better way to secure the arm and tighten the base as whenever it moves a bit faster it displaces itself. I'm also facing issues with the second joint sagging over multiple cycles- have to see if that's a mechanical or software error.
https://...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.