%This function shows the simulation result of robot manipulator control
%bassed Fuzzy Bspline Net
global angl1k;%angle at time K;
global angl1k1;%angle at time K+1;
global angl2k;%angle at time K;
global angl2k1;%angle at time K+1;
global velo1k;
global velo1k1;
global velo2k;
global velo2k1;
global acce1k;
global acce1k1;
global acce2k;
global acce2k1;
global t;%sampling period
global x;
angl1k1=0;
angl2k1=0;
velo1k1=0;
velo2k1=0;
acce1k1=0;
acce2k1=0;
erro1k=0;
erro2k=0;
erro1k_1=0;
erro2k_1=0;
x=1;
t1k=0;%torque apply on link1 at time K;
t2k=0;%torque apply on link2 at time K;
rule=[-5 -5 -5 -5 -5 -5 -5 -4 -3 -2 0 0 0;
-5 -5 -5 -5 -5 -5 -5 -4 -3 -2 0 0 0;
-5 -5 -5 -5 -5 -5 -5 -3 -3 -2 0 0 0;
-4 -4 -4 -4 -4 -4 -4 -3 -2 -1 1 1 1;
-4 -4 -4 -4 -4 -4 -4 -2 -1 0 2 2 2;
-4 -4 -4 -3 -3 -3 -3 -1 2 2 3 3 3
-4 -4 -4 -3 -3 -1 0 1 3 3 4 4 4
-3 -3 -3 -2 -2 1 3 3 3 3 4 4 4
-2 -2 0 0 1 2 4 4 4 4 4 4 4
-1 -1 0 1 2 3 4 4 4 4 4 4 4
0 0 1 2 3 4 5 5 5 5 5 5 5
0 0 1 2 3 4 5 5 5 5 5 5 5
0 0 1 2 3 4 5 5 5 5 5 5 5];
ke1=200;
kec1=1;
kcw1=600;
ke2=200;
kec2=1;
kcw2=100;
A1=[];%angle1 matrix
A2=[];%angle2 matrix;
DA1=[];
DA2=[];
ERR1=[];
ERR2=[];
X=[];%x axis matrix
% % % % % % % % % % % % % % % % % % % % % % % %
ovectornum=[1 2 3
4 5 6];%????
tvectornum=[7 8 9;10 11 12];
load 'checkpoints