All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
https://drive.google.com/file/d/1-GcCwFRvbTAoJwIGBa2n4gyboFUC35D9/view?usp=sharing clc close all l1=1; l2=0.5; theta1=linspace(0,75,10); theta2=linspace(0,75,10); ct=1; for i=1:length(theta1) THETA1=theta1(i); for j=1:length(theta2) THETA2=theta2(j); x0=0; y0=0; x1=l1*cosd(THETA1); y1=l1*sind(THETA1); x2=x1+l2*cosd(THETA2);…
Mukesh Kanna S
updated on 29 Apr 2022
https://drive.google.com/file/d/1-GcCwFRvbTAoJwIGBa2n4gyboFUC35D9/view?usp=sharing
clc
close all
l1=1;
l2=0.5;
theta1=linspace(0,75,10);
theta2=linspace(0,75,10);
ct=1;
for i=1:length(theta1)
THETA1=theta1(i);
for j=1:length(theta2)
THETA2=theta2(j);
x0=0;
y0=0;
x1=l1*cosd(THETA1);
y1=l1*sind(THETA1);
x2=x1+l2*cosd(THETA2);
y2=y1+l2*sind(THETA2);
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',5)
axis([0 1.5 0 1.5])
pause(0.03)
M(ct)=getframe(gcf);
ct=ct+1;
end
end
movie(M)
videofile=VideoWriter('twor_robotic_arm.m','Uncompressed AVI')
open(videofile)
writeVideo(videofile,M)
close(videofile)
AIM
To stimulate the forward kinematics of a 2R robotic arm.The objective here is to have multiple values of theta1 and theta2 and for each value of theta1 and theta2, we are going to make a plot and going to stick it all together and make an animation
GOVERNING EQUATION
x0=0
y0=0
x1=L1*cosd(THETA1)
y1=L1*sind(THETA1)
x2=x1+L2*cosd(THETA2)
y2=y1+L2*sind(THETA2)
CODE EXPLANATION
To stimulate the robotic arm, first we need to find the position of the links
Considering the base as (x0,y0)=(0,0),length of link1(l1=1)&link2(l2=0.5).theta1and theta2 are array of size [1*10].
To repeat the calculation for each value of theta1 and theta2 ,we use FOR LOOP.
As the value of “i” changes, we get the value from original array theta1 i:e if i=1 ,we assign the first value of array theta1 to the variable THETA1 and same for inner loop and assign the values to THETA2 until loop ends.
Here for each position of link1, the link2 takes multiple positions.Plot command is used to plot the frame. Axis is specified.
Command”pause” is used to pause each and every frame.counter is going to start with one, for each time for loop is getting executed I am incrementing counter by one.Ct represent each and every frame.
Save an individual frames in an array M.
command “getframe(gcf)” is for getting particular plot and save it in M.
Command “movie(M)” is to generate a movie with all frames.
And create a new AVI file to dump out all those frames.
Open the file and write the frames in Videofile.
CONCLUSION
So, we stimulate the robotic arm by using multiple values of THETA1 and THETA2
Attached the screenshots of error. i haven't typed the apostrophe for file name and a square bracket for plotting line command. Clear these errors by typing them.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Underbody Coating
Underbody Coating is a sprayable coating, which protects the under surface of the vehicle from corrosion. Underbody coating provides long term protection from corrosion to car's underbody. It also protects parts like internal body panels, frame rails and other inner cavities that are not physically accessible…
13 Jan 2023 02:52 PM IST
Benchmarking
Aim: To expain about Benchmarking and finding a good car for Mr.D.S.Pughazhyendhii by comparing the cars. Benchmarking :- Benchmarking is a process of measuring the performance of a company’s products, services, or processes…
13 Jan 2023 07:25 AM IST
Project - Analysis of a practical automotive wiring circuit
1) a) Genarator b) Battery c) Starter d) Ignition coil e) Ammeter f) Foot selector switch g) Breaker i) Fuse j) Current and voltage regulator k) Distributor 2) Genarator: A generator is a device that transforms mechanical energy into electrical energy, typically by electromagnetic induction via Faraday's Law.An electric…
28 Nov 2022 01:22 PM IST
Week 10- Assembly Workbench
AIM :- To create assemblies of Quick return mechanism and CV joint and to also create 2D drawing of the given assemblies in CATIA. ASSEMBLY :- Assembly modeling is a technology and method used by computer-aided design and product visualization computer software systems to handle multiple files that represent components…
30 Sep 2022 05:10 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.