A teach-and-replay pick-and-place system for loading razor blades onto coating racks using the Rotrics DexArm robot arm.
-
Install Python 3.8+ if not already installed
-
Install dependencies:
pip install -r requirements.txt -
Connect DexArm via USB
python blade_loader_gui.py
- Select the correct COM port from the dropdown
- Click Connect
- The arm will be set to Pneumatic module (suction cup) automatically
- Use the Jog Controls to move the arm above your blade stack
- Click Set Approach (hover) - this is where the arm goes before/after picking
- Lower the arm to touch the top blade
- Click Set Pick (down) - this is where suction activates
- Use the Suction Test buttons to verify:
- GRAB picks up a blade
- RELEASE drops it
- Adjust Grab delay if suction isn't establishing (try 0.8-1.0s)
For each hook on your curved rack:
- Jog the arm above the hook
- Click Add Approach (hover position)
- Lower the arm so the blade slot aligns with the hook
- Click Add Hook (drop position)
- Repeat for all hooks
Tip: Go in order! Hook 0, then Hook 1, etc.
- Click START CYCLE
- Watch the magic happen!
- Use PAUSE to temporarily stop
- Use STOP to abort (arm returns home)
| File | Description |
|---|---|
blade_loader_gui.py |
Main GUI application |
dexarm_controller.py |
Core DexArm control class |
blade_positions.json |
Saved positions (auto-created) |
requirements.txt |
Python dependencies |
Positions are saved to blade_positions.json and loaded automatically. You can back this up or share it. Example structure:
{
"pick": {"x": 150.0, "y": 200.0, "z": -50.0},
"pick_approach": {"x": 150.0, "y": 200.0, "z": 0.0},
"hooks": [
{"x": -50.0, "y": 280.0, "z": -30.0},
{"x": -25.0, "y": 290.0, "z": -30.0},
{"x": 0.0, "y": 295.0, "z": -30.0},
{"x": 25.0, "y": 290.0, "z": -30.0}
],
"hook_approaches": [
{"x": -50.0, "y": 280.0, "z": 0.0},
...
]
}| Problem | Solution |
|---|---|
| Blade not picked up | Increase grab delay, check suction cup seal |
| Blade drops early | Increase grab delay, check for air leaks |
| Position drift | Re-home the arm, re-teach positions |
| Can't connect | Check COM port, try unplugging/replugging USB |
The controller uses these commands:
M888 P2- Set pneumatic moduleM1112- Go homeG1 F2000 X_ Y_ Z_- Move to positionM1000- Suction ON (pump in)M1002- Suction releaseM1003- Pump offM114- Get current position