-
1Get MK2 robotic manipulator
MK2 is a 3D printable robotic arm available in https://www.thingiverse.com/thing:1454048
-
2Set 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.
-
3Calibrate 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
-
4Print PLA gears, join nut in the center, and paint a circle
The nut will allow electromagnet in the robotic arm to pick up the gear and place it in the corresponding box.
Painting a circle centered to the gear is optional but desired as it will make easier for the cv.HoughCircles function to find its center.
-
5Connect the webcam to your computer and run the code
Once everything is assembled, upload the code to the Arduino and connect the camera to the PC. Run the three codes: the camera code, the arm code, and the serial communicator. The conveyor belt operates continuously but will only send a signal to the arm when a gear passes through the detection zone, which is delimited by the black box. After the gear passes, the arm will begin its task of moving it to the correct location based on the number of teeth. However, if desired, it is possible to modify and change this classification to diameter by modifying the last state of the MK2KINE.ino code.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.