Challenge

Week 2- 2R Robotic Arm Challenge

Aim;

Write a program to Matlab application and simulate for given forward kinematics of a 2R robotic arm and show the video.

Eplanation;

A robotic arm is a links of manipulator is called end effector and manipulator connects by joints to allow rotational motion.

  1. (x0, y0) = Start point
  2. (x1, y1) = Start point to end point
  3. (x2, y2) = End point
  4. (L1, L2) = Length of links
  5. (theta1) = angle of x-axis
  6. (theta2) = angle of y-axis

Procedure;

Step 1: Start

Step 2: OPen the Matlab application

Step 3: Open editor window to type the program

Step 4: Then run program to command window

Step 5: Display the output and plot diagram

Step 6: Stop

Program;

%Forward robotic_arm
l1 = 2;
l2 = 1;

theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10);

ct = 1
for i = 1:length(theta1)
    THETA1 = theta1(i);

    for j = 1:length(theta2)
        THETA2 = theta2(j);

        %start point
        x0 = 0;
        y0 = 0;
        %start point to end point
        x1 = 1*cosd(THETA1)
        y1 = 1*sind(THETA1)
        %end point
        x2 = x1 + l2*cosd(THETA2)
        y2 = y1 + l2*sind(THETA2)

        %plotting
        plot([x0 x1],[y0 y1],[x1 x2], [y1 y2],'linewidth',3)
        pause(0.1)
        m(ct) = getframe(gcf);
        ct=ct+1;
    end
end
%movie
movie(m)
videofile = VideoWriter('forward_kinematicsrobotic_arm','uncompressed AVI')
open(videofile)
writeVideo(videofile,m)
close(videofile)

Output link;

https://drive.google.com/file/d/1mDUmoKM4Pxt8J9652CgnGv7jgqXFDxNp/view?usp=sharing

Conclusion;

The given program to simulate forward kinematics of a 2R robotic arm is executed successfully.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.