2R Robotic arm
AIM: Write a program in Matlab to Simulate the forward kinematics of a 2R Robotic Arm
OBJECTIVE: Create an animation of file of a 2R Robotic Arm.
EXPLANATION:
TWO ARM ROBOTIC ARM
- It contains two links and two rotational joints
- First link which makes θ1 with respect to X axis and link two which makes θ2
- The length of link one is L1 and length of link two is L2.
If θ1 and θ2 is given What is the finite position of the manipulator
- Step 1:- Calculate position of link 1
- So link 1 has two end points ,starting point and end point , starting point is fixed to base end point is connected to link 2 , co ordinates of the starting point is (0,0). The co ordinates of the first kink is L cosθ , L sinθ is going equal to be θ1
- Step 2:- Calculate the position of the link 2
- We are going to draw link separately the end of the link is starting point of the link 2
We are going to assign a co ordinates (x1,y1) where (x2,y2) be the manipulator
Now ,
X2 = X1 + L2cos θ2
Y2 = Y1 + L1sin θ2
- Till now we determine the coordinates of three points they are origin point , the end point, the first link and also starting point of link two and finally end point of link two.
- Where the solution set is [x0 y0] [x1 y1] [x2 y2]
With these three coordinates we will able to plot the two links
PROGRAM 1:-This is the simple forward kinematics simulator program
OUTPUT:
PROGRAM 2:- Animate the 2R Robotic arm
Objective:- To have multiple values of θ1 and θ2 and for each value of θ1 and θ2 where are
going to creating a plot and we are going to striching plot together and make animation.
ERROR:-
The operation failed couple of times, I found the mistake was I am saving the frames and only one should i increment my counter. The value of ct initially set to because I increment before I saved the first frame and also reduced the number of frames. Command Should be corrected.
UPDATED PROGRAM:
OUTPUT:https://youtu.be/lUek8CJ8W7o