Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated vial capper/decapper RS485 Python API implementation #123

Open
sgbaird opened this issue Nov 23, 2024 · 8 comments
Open

Automated vial capper/decapper RS485 Python API implementation #123

sgbaird opened this issue Nov 23, 2024 · 8 comments

Comments

@sgbaird
Copy link
Member

sgbaird commented Nov 23, 2024

At one point, I was able to verify that I could connected the RS485 to computer via USB, use one of their desktop apps, and control the state of one of the grippers (sort of a dummy check).

For a while, the plan has been to write a custom RS485 protocol that's written in Python or MicroPython using the https://www.waveshare.com/wiki/Pico-2CH-RS485. This seemed favorable over trying to hack the internals of the programmable logic circuit (PLC) or messing around with the touchscreen interface. Instead, just directly send RS485 commands with this module.

https://youtube.com/shorts/jQLtg0luPNc captures the need pretty well.

@sgbaird
Copy link
Member Author

sgbaird commented Dec 6, 2024

@evelynnesher could you provide links to the documentation for the various DH Robotics gripper/actuator components (the linear actuator, the rotating parallel gripper, and the regular parallel gripper)? The product numbers and some relevant snippets for the RS485 commands would be great.

Please include a screenshot of the settings page on the capper/decapper. This should give us an idea of what parameters we'll need to consider for capping/decapping workflow and how to implement that with the RS485 commands, especially given we need the rotating parallel gripper and the actuator to work together with each other (or at least be sure that the protocols have started within a short timeframe of each other).

We might consider using a https://www.pishop.ca/product/rs485-can-hat-for-raspberry-pi/ with an RPi Zero 2W, RPi 4B, or RPi 5, since this might be more robust (important for safety considerations since these grippers are relatively strong)

@sgbaird
Copy link
Member Author

sgbaird commented Dec 6, 2024

https://github.com/han-xudong/pyDHgripper will also likely be helpful, if not exactly what we want to use. See e.g., https://github.com/han-xudong/pyDHgripper/blob/main/pyDHgripper/AG95/Gripper.py. For this reason, we may want to go with an RPi single board computer (SBC) rather than the Pico W microcontroller.

Once we do get to testing with the physical equipment, I suggest we place things such that the grippers are guaranteed not to crash into each other.

@evelynnesher
Copy link

evelynnesher commented Dec 11, 2024

Documentation for parts used:

Slim-Type Electric Parallel Gripper (PGE-100-26-O-S-M1)
PGE-Series-Internal-Controller-Short-Manual_DH-Robotics_ENV3.1.pdf

Infinite Rotating Gripper (RGI-100-30-O-B-M1)
https://en.dh-robotics.com/wp-content/uploads/2022/12/RGI-Series-Short-Manual_V3.1_DH-Robotics.pdf

Miniature Electric Table-Type Cylinder (MCE-3WG-02-050-C-O-B)
Manufacturer #: ICM-B-D30

Startup Screen

First screen upon turning on the device.

  • Decap: Initiates decapping.

  • Cap: Initiates capping.

  • The three buttons (left to right) correspond to ID2, ID3, and ID4.

IMG_3670
ID2- Rotary Gripper
This debug screen provides detailed information about the rotary gripper's operational states and control options.

Table featuring Gripping and Rotating States:
Displays the current status of the gripper's gripping and rotating functionalities.

Controls:

  • Open/Close: Commands to open or close the gripper.

  • Initialize: Performs initialization to prepare the gripper for operation.

Rotation Directions:

  • Forward Rotation: Counterclockwise direction.
    One forward rotation ends at position/angle: 1800

  • Reverse Rotation: Clockwise direction

IMG_3671

ID3 - Parallel Gripper
This debug screen provides detailed information about the rotary gripper's operational states and control options.

Table featuring Gripping State:
Displays the current status of the parallel gripper's gripping functionalities.

Controls:

  • Open/Close: Commands to open or close the gripper.

  • Initialize: Performs initialization to prepare the gripper for operation.

IMG_3672
ID4- Electric Cylinder
This debug screen provides detailed information about the Electric cylinder.

Table featuring Gripping State:
Displays the current position and operational state of the cylinder.

Controls:

  • Up/Down: Moves the cylinder up and down.

    • While the cylinder is in motion, the state displays as In Motion.
    • When stationary, the state is In Place.
    • The position value starts at 0 and increases up to a maximum of slightly more than 5000 when moved.
  • Initialize: Performs initialization to prepare the cylinder for operation.

image

Screenshot of RGI series debugging interface, could help us understand basic workflow aswell (Page 7-9 of RGI series manual)
image

@evelynnesher
Copy link

From my experience with RS232, I think it’s best to start with the physical connection between the Raspberry Pi Pico, RS485 CAN Hat, and the grippers. Setting up the hardware first helps make sure everything’s stable and the signals are handled correctly, which makes debugging easier. Once the hardware is all set, I’ll move on to coding for communication and control.

https://socialcompare.com/en/comparison/raspberrypi-models-comparison
https://versus.com/en/raspberry-pi-4-model-b-vs-raspberry-pi-zero-2-w
https://versus.com/en/raspberry-pi-4-model-b-vs-raspberry-pi-5
https://versus.com/en/raspberry-pi-5-vs-raspberry-pi-zero-2-w
Based on the above sources, the RPi 4B or RPi 5 might be a better fit than the RPi Zero 2W.

@sgbaird
Copy link
Member Author

sgbaird commented Dec 19, 2024

Two RS485 CAN HAT units arrived (we just need one). There is a Pi Zero 2W (should be plenty for what's needed).

@Neil-YL could you solder header pins onto the Pi Zero 2W for @evelynnesher?

PXL_20241219_181708643 MP

@Neil-YL
Copy link
Contributor

Neil-YL commented Dec 19, 2024

Two RS485 CAN HAT units arrived (we just need one). There is a Pi Zero 2W (should be plenty for what's needed).

@Neil-YL could you solder header pins onto the Pi Zero 2W for @evelynnesher?

PXL_20241219_181708643 MP

No problem

@Neil-YL
Copy link
Contributor

Neil-YL commented Dec 19, 2024

Done.

image

You can find it on the table of the vial rack, in the anti-static bag. @evelynnesher

image

@evelynnesher
Copy link

@sgbaird You mentioned screenshotting a settings page for the capper/decapper. Both catalogs for the RGI and PGE series list detailed settings for various commands, such as rotation speed and other parameters. Could you clarify which specific settings you had in mind?

I've attached a screenshot of section 2 from the RGI series catalog to show the various types of settings I'm referring to.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants