Close
0%
0%

Gear selector

Gear selector with MK2 robotic manipulator, conveyor belt and webcam.
Using OpenCV and arduino.

Similar projects worth following
This project implements a Pick & Place routine using computer vision (openCV) with a MK2 robotic manipulator to select PLA printed gears according with their number of tooth.
The program also returns their diameter and location in real world coordinates, which are the input of the inverse kinematic of MK2 manipulator.
Image preprocessing is used, especifically morphological filters (dilate and erode), filter2D to eliminate noises and thresholding. The resulting image is used to count its tooth based on Research on Detection o fMicro Plastic Gear Tooth Based on Dummy Circle Scan Method paper by Zhang,Z.,Wang,K.,Yang,X.,&Chen,L.

Project improvement ideas

1) SET A PROPER LIGHTINING ENVIRONMENT

Initially, we applied a direct light source, which was reflected by the tape due to its brightness. We removed this light source, which led us to change the image preprocessing filters, using dilate, erode, filter2D, and thresholding. If you apply a non-direct light source, it is likely that the processing parameters and filters used will need to be changed. However, this is recommended regardless. 2) CHANGE YOUR COMPUTER VISION METHOD Thresholding the image between whites and blacks forced us to use white gears to achieve better results. However, due to the lighting, this doesn't seem to be the best option. In a new iteration, we propose applying masks that allow filtering gears of colors like orange or yellow, avoiding issues caused by lights and shadows. 3) SEPARATE GEARS ACCORDING TO THEIR MODULE

This time, we separated the gears based on their number of teeth. Since the applied function also provides an estimated diameter, we propose working with these parameters to calculate their module. This represents an improved use of this program as it would allow you to obtain groups of gears with the same module, which can form functional systems

4) USE AN ENCODER FOR YOUR CONVEYOR BELT

This time, we were unable to improve the encoder available on the conveyor belt, which would have allowed us to accurately estimate the moment when the arm should pick up the gear. This is because the encoder, by providing the speed of the belt and knowing the position of the gear (provided by the function), allows for the calculation of time. In this project, we had to estimate the moment to pick up the gear experimentally. 5) INCREASE THE NUMBER OF TEETH IN YOUR MK2 ARM GEARS

Increase the number of teeth on the gears of the Mk2 arm to have a higher number of steps, enabling more precise movements and reducing backlash.

Proyecto Selector de engranajes (2).txt

Explanation about the project documentation:

plain - 8.14 kB - 07/12/2023 at 01:43

Download

SerialControl.py

Code for serial communication between Python and Arduino

x-python - 1004.00 bytes - 07/12/2023 at 01:22

Download

Layout (5).pdf

Layout of component distribution on the pressed wood board."

Adobe Portable Document Format - 85.08 kB - 07/12/2023 at 01:20

Preview
Download

Gears v4.f3d

This file contains gear designs with a hexagonal center intended to be printed in PLA and allow for the insertion of an M4 nut. This enables the solenoid to effectively act on the gears.

fusion - 4.08 MB - 07/11/2023 at 23:45

Download

MK2KINE.ino

This file contains the kinematics code for the arm. With this code, the arm is capable of sorting the gears into the different compartments of the red box. Additionally, it processes the information from the camera and is responsible for synchronizing all the movements: Belt-Arm-Camera Signal.

ino - 12.50 kB - 07/11/2023 at 23:40

Download

View all 8 files

  • 1 × PLA printed gears It depends on what kind of gear you want to classify. In this ocation we used 12, 14 and 16 tooth, with different diameters.
  • 1 × Webcam There's no special requirements for this one, since you have to calibrated anyways.
  • 1 × Conveyor belt For this one we used a 810mm long and 100 mm wide, 12V DC motor and H bridge
  • 4 × Boxes We made a paperboard box in order to join the camera and some lights. Also, some little boxes to separeta classified gears
  • 1 × 5V Power supply To feed Arduino and electromagnet

View all 13 components

  • 1
    Get MK2 robotic manipulator

    MK2 is a 3D printable robotic arm available in https://www.thingiverse.com/thing:1454048

  • 2
    Set layout

    Locate conveyor belt, MK2 arm and camera following the CAD distribution.

    It's important to be precise with dimensions specified in order to use given inverse kinematic correctly.

  • 3
    Calibrate camera

    This project uses a webcam camera. The openCV code returns the center of the gear position as part of the tuple, so calibration is a fundamental step.

    As the frames are processed directly from streaming, we followed this tutorial to calibrate the webcam obtaining its camera matrix and distortion vector, which are the input of the function cv.getOptimalNewCameraMatrix along with the size of the frame captured by the camera (height and width). This new camera matrix is the calibrated camera which will undistort the processed frames. 

    You'll need to print a chessboard like this one

    If you see weird results (as we did) we recommend to visit this stackoverflow page.

    More information in openCV documentation

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates