Week 2- 2R Robotic Arm Challenge
In the being of the program
Inputs values of link1 and link 2 are given with assumed values as 2mtrs and 2.5 mtrs.
afterthat,as we know one of the links is connected to statinory body and i consider the link1 to the surface,
to the link1 in 2D form we can calculate the angle upto 180degree and we dont know exact angle of the link so i made the asumtion of certain degreeof position with the variable='theta1'
theta1 is asigned with the values from the x axis to yaxis we all know that xaixs is consider as 'cos' and in the same way we consider the yaxis as 'sin' function
in this function,startung point of the link1 is consider as the origin(0,0) with x and y ordinates
and the place where the link2 join with the link1 is consider as the x1 and y1 cordinates to calculate the values of the x1 and y1 cordinates we used the position of the link1 and the length of the link1 as
x1=l1*cosd(theta1);y1=l1*sind(theta2)
this cordinates will act as the starting point of the link2 and the end point of the link 2 cordinates are consider as the x2 and y2 respectively,
the movement of link2 in 2D we consider and taken the direction in x and y cordinate form with the angle as 'theta2'
the x2 and y2 cordinates are calculated based on the x1 and y1 cordinates and
x2=x1+l2*cosd(theta2)
y2= y1+l2*sind(theta2)
but to do in a continous format we used the 'for loop' for the program and the theta1 and theta 2 values are calculated with each interval of degree by using the command 'linspace'
and in for loop we used the 'length' command to be exactly divide by the certain degree into equal parts
and used the counter command as 'ct' for adding the program to be done in continous manner
ploted the program with the link1 x cordinates and yi coridnates and the link 2 x cordinates and y cordinates
this helped us to do the animation of the graph as a video .
errors faced:
while doing the program in the ploting the graph i used the semicolon insteady of the commas in the middle of the coordinates
in the for loop using the theta insteady of theta1 or theta2 for that error in program at line x and y
forgot to metion the ct outside the loop has caused the program to the syntax error
while doing the program i took cos instead of cosd it doesnot show any error in program but while running it changed the graph to the negative degree
to over come:
it was explained in the coomand window to identify the unidentify the variable at the particular line
this is theta command also helped by the command window after detali checking of the variable asigned words i came to know the mistake and corrected
this ct command was helped from the skill lync class after listening to the class 2-3 times
degree command is also learned from the class if we dont use the d it will change into the radians,again revised from the class
pictures of the error

the youtube link of the animated robatic arm graph is listed below
https://www.youtube.com/watch?v=Azm_41owBCk