This blog explains the basic working of a robotic arm under vision system using matlab
For this you need to know basic programming in matlab and arduino.
Items Used:
Dexter ER-2 Heavy duty robotic arm
For this you need to know basic programming in matlab and arduino.
Items Used:
Dexter ER-2 Heavy duty robotic arm
Webcam
Arduino Uno
custom made arduino shield used to mount servos
Plastic ball (plain in color)
Flex sheet with polar and rectangular coordinate systems
SMPS for the robotic arm
USB Cable
Dexter ER-2 Heavy Duty Robotic Arm is a 5 Axis robotic Arm + Servo Gripper. It uses seven metal gear servo motors with 15Kg/cm torque and two servo motors with 7Kg/cm torque. Robot Arm has 5 degrees of freedom which includes Base rotation, Shoulder rotation, Elbow rotation, Wrist pitch and roll. Out of which Shoulder rotation, Elbow rotation, Wrist pitch has two 15Kg/cm torque servo motors in parallel for enhancing the performance of the robotic arm.
The servos of the arm are controlled using arduino pwm(pulse width modulation) signals and the main power supply is commonly distributed for all the servos using a shield which is powered by SMPS. Here we are using arduino for easy interface with matlab and plain colored plastic ball for easy processing of the image, note to choose ball color distinct from its background. You can find RGB values of the ball by image analysis in matlab and can apply basic thresholding technique to threshold the ball from the background and can find one in my code and lighting in the room place a major role when you are taking RGB reading and make sure light does not change much in the room. Then apply a high pass filter mask on the image to find edged image from which finding circles is easy using an inbuilt command imfindcircles in matlab. The concept behind the command can be found in matlab blogs. This command returns the center location of the found circle.
Now comes the inverse kinematics in action, we can find desired angles for the arm to reach the ball by placing center pixel value of the ball in inverse kinematics equations. Matlab serially transmits the angles to arduino using serial communication and arduino does the rest of the work in giving required pwm signals to arm servos to pick the ball.
I used Giampiero Campa's code to interface Arduino and matlab, you can get the code here
For more information on inverse kinematics using matlab visit http://www-iri.upc.es/people/thomas/papers/PROBLEMS.pdf
Matlab codes:
https://github.com/Akhilkumar1307/Vision-based-pick-and-place-robotic-arm
Matlab codes:
https://github.com/Akhilkumar1307/Vision-based-pick-and-place-robotic-arm
Working video
comment below for any enquiries
Good work
ReplyDeleteis there need to program on UNO arduino board?
ReplyDeleteI have updated the page, now you can download the interface code and I guess the code works only for 2013 and earlier versions of matlab.
ReplyDeleteAnd for latest version of matlab check out this link
http://www.mathworks.com/hardware-support/arduino-matlab.html
I executed the startup_rvc.m code first, then I executed the Pickandplace.m code taken from your github page. And I am getting this shown in the command window:-
ReplyDelete>> Pickandplace
Robotics, Vision & Control: (c) Peter Corke 1992-2011 http://www.petercorke.com
Attempting connection .............
Motor Shield Script detected !
Arduino successfully connected !
Undefined function or variable 'isvec'.
Error in SerialLink/set.gravity (line 620)
if isvec(v, 3)
Error in SerialLink (line 253)
r.gravity = [0; 0; 9.81];
Error in Pickandplace (line 41)
ThreeLink = SerialLink(L); %---------------------------------------------
>>
Please tell me what should I do to remove these errors.
I am using R2016a version of Matlab and I have already installed arduino hardware support toolbox.
please download latest RVC toolbox from this link http://www.petercorke.com/RTB/index.php
Deletefill your details and you can download and run the startup_rvc.m file
Can I make this with any robotic arm ?
ReplyDeleteOfcourse for any 3 link arm. If it's not a 3 link arm you should change code for inverse kinematics.
Delete