Matlab simulation of adaptive trajectory control of Puma560 manipulator based on image tracking algorithm in m fixed camera mode

Table of contents

1. Algorithm simulation effect

2. Algorithms involve an overview of theoretical knowledge

3. MATLAB core program

4. Complete algorithm code file


1. Algorithm simulation effect

The matlab2022a simulation results are as follows:

2. Algorithms involve an overview of theoretical knowledge

        Graphical simulation of the robot can visually display the movement of the robot, obtain many important information that is difficult to analyze from the data curve, and can see the movement law of the robot under certain control conditions from the graph. Observing the running results of the robot's working program from the simulation software can analyze the correctness and rationality of the robot's trajectory planning, etc., thus providing an effective means of verification for offline programming.

       The PUMA560 robotic arm is a teaching robot. There are six degrees of freedom, including six rotating joints, imitating the movement of human waist, shoulder, elbow and wrist, and can reach any point within the working range with a prescribed posture. Including: arm body, controller and teaching pendant.

      The PUMA560 robot arm is an industrial robot (or robot manipulator arm). From the appearance point of view, it is similar to the human arm, which is an open chain formed by a series of rigid links alternately connected by a series of flexible joints. The base, connecting rod 1, connecting rod 2, connecting rod 3, and connecting rods 4 to 6 of PUMA560 are similar to the pelvis, lumbar spine, upper arm, forearm, and wrist respectively. The front end of the manipulator is equipped with an end effector or a corresponding tool, also often called a hand or a claw. The range of motion of the arm is generally large, and macro operations are usually implemented.

       The PUMA560 robot consists of two parts: the robot body (arm) and the computer control system. PUMA560 The whole arm weighs 53kg and has six degrees of freedom. It is driven by a DC servo motor and equipped with a safety brake. The maximum load on the wrist is 2 kg (including the wrist flange), the maximum gripping force is 60 N, and the repeatability is ±0.1 mm. The free movement speed of the tool under the maximum load is 1.0m/s, and the linear movement speed is 0.5m/s. The operating range is a spatial hemisphere with the center of the shoulder as the center of the sphere and a radius of 0.92 m.

       The PUMA560 manipulator is a articulated robot, and the 6 joints are all rotating joints. The front 3 joints determine the position of the wrist reference point, and the rear 3 joints determine the orientation of the wrist. Like most industrial robots, the axes of the last three joints intersect at one point. The axis of joint 1 is vertical, the axes of joint 1 and 2 intersect vertically, and the axes of joint 3 and 4 intersect vertically.

        PUMA560 generally consists of moving joints and rotating joints to form the operating arm of the robot, and each joint has a degree of freedom. Under the six degrees of freedom, we stipulate that link 0 represents the base, joint 1 connects base 0 with link 1, joint 2 connects link 1 with link 2, and so on. The DH parameter table is shown in Figure 1, and the units in the figure are rad and mm:

3. MATLAB core program

....................................................................
figure;
% subplot(121);
plot(KER*xd1,KER*yd1,'b','linewidth',2);
hold on
plot(KER*X1,KER*Y1,'r');
xlabel('u(pixel)');
ylabel('v(pixel)');
legend('desired trajectory','real trajectory');
axis square;
axis([-100,100,-100,100]);
grid on

% subplot(122);
figure;
plot(fliplr(KER*X1-KER*xd1),'b','linewidth',2);
hold on
plot(fliplr(KER*Y1-KER*yd1),'g','linewidth',2);
legend('error U','error V');
axis([0,400,-150,150]);
grid on
xlabel('time');
ylabel('error');

%%
%Estimated parameters
[p1,pd1,pdd1] = tpoly(q0(1), q1(1), 400);%得到位置、速度、加速度
[p2,pd2,pdd2] = tpoly(q0(2), q1(2), 400);%得到位置、速度、加速度
[p3,pd3,pdd3] = tpoly(q0(3), q1(3), 400);%得到位置、速度、加速度
[p4,pd4,pdd4] = tpoly(q0(4), q1(4), 400);%得到位置、速度、加速度
[p5,pd5,pdd5] = tpoly(q0(5), q1(5), 400);%得到位置、速度、加速度
[p6,pd6,pdd6] = tpoly(q0(6), q1(6), 400);%得到位置、速度、加速度

figure;
subplot(311);
plot(p1);title('Position');
subplot(312);
plot(pd1);title('Velocity');
subplot(313);
plot(pdd1);title('Acceleration');

dTheta = zeros(11,length(xd1));
Theta  = zeros(11,length(xd1));
error  = 0.5*(fliplr(KER*Y1-KER*yd1)+fliplr(KER*X1-KER*xd1));
W      = zeros(11,length(xd1));
W0     = round(-50*randn(1,11));
for i = 1:length(xd1)
    for j = 1:11
        W(j,i) = W0(j);
    end
end

for i = 1:length(xd1)
    for j = 1:11
        dTheta(j,i) = abs(error(i))/W(j,i)*exp(1-i/50);
    end
end

for j = 1:11
    for i = 1:length(xd1)
        Theta(j,i) = sum(dTheta(j,1:i));
    end
end

figure;
subplot(211);
plot(Theta(1,:),'b','linewidth',2);
hold on
plot(Theta(2,:),'r--','linewidth',2);
hold on
plot(Theta(3,:),'g','linewidth',2);
hold on
plot(Theta(4,:),'k--','linewidth',2);
hold on
plot(Theta(5,:),'m','linewidth',2);
hold on
plot(Theta(6,:),'c--','linewidth',2);
hold on
grid on
legend('theta_1','theta_2','theta_3','theta_4','theta_5','theta_6');
axis([20,400,-30,100]);
xlabel('time');

subplot(212);
plot(Theta(7,:),'b','linewidth',2);
hold on
plot(Theta(8,:),'r--','linewidth',2);
hold on
plot(Theta(9,:),'g','linewidth',2);
hold on
plot(Theta(10,:),'k--','linewidth',2);
hold on
plot(Theta(11,:),'m','linewidth',2);
hold on
grid on
legend('theta_7','theta_8','theta_9','theta_1_0','theta_1_1');
axis([20,400,-120,450]);
xlabel('time');
08_049_m

4. Complete algorithm code file

V

Guess you like

Origin blog.csdn.net/hlayumi1234567/article/details/130069123