Appendix A : Matlab Codes for Collision Detection

Appendix A : Matlab Codes for Collision Detection
Appendix A : Matlab Codes for Collision
Detection
Collision.m
% this matlab file investigates if there are no problems concerning
% collisions between the laserhead and the developable surface.
clear all;
close all;
[filename,pathname]=uigetfile('*.dat','get dat-file with vertices data');
VERTICES=load(filename);
[dist,dist_1,dist_2,theta_scan,BA] = angles_surfaces(VERTICES);
% dist: volledige vector van de flenslengtes (in xy-vlak, niet in de hoogte)
% dist_1: de oneven punten uit voorgaande vector of de flenslengtes langs de
eerste zijde
% dist_2: de even punten uit dist of de flenslengtes langs de tweede zijde
% theta_scan: scanhoeken tussen de verschillende vlakken
% BA: bend allowance tussen de verschillende vlakken
for i = 1: length(theta_scan)
BA(i) = 0;
end
D= 135;
% D is the diameter of the laser scanning
head (190 met buitenste ring, 135mm zonder buitenring,maar
% wel nog met extra reflectie-shield en met
veiligheidsmarge van 5 mm langs beide kanten)
SOD= 29.7;
% SOD value in mm. S is the vertical
distance between the laser head and the sheet (Stand off distance).
S=SOD-5;
% verschil van 5 mm tussen de SOD en
S: 5 mm van de buitenste beschermkap
for l_input = 2:length(VERTICES)/2-1
l=l_input;
% de eerste en laatste rijen van de collisiematrix gelijk aan 2 stellen (zie
legende)
collisionfirstL(1)=2;
collisionfirstL(length(VERTICES)/2)=2;
collisionfirstR(1)=2;
collisionfirstR(length(VERTICES)/2)=2;
collisionsecondL(1)=2;
collisionsecondL(length(VERTICES)/2)=2;
collisionsecondR(1)=2;
collisionsecondR(length(VERTICES)/2)=2;
alpharad= theta_scan.*pi/180;
%alfarad is the bending angle in
radians per scan line.
sum_alpharad=cumsum(alpharad);
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE FIRST SIDE
% %---------------------------------------------1
Appendix A : Matlab Codes for Collision Detection
%---------------vectoren voor de inklemming
% vector van de hoeken voor de inklemming op l_input
dummy1_sum = fliplr(alpharad(1:l-1));
dummy2_sum = cumsum(dummy1_sum)-dummy1_sum(1)/2;
sum_before = fliplr(dummy2_sum);
sum_before_flipped = fliplr(sum_before);
% vector van de BA voor de inklemming op l_input
for i = 1:l-2
BA_before(i)=BA(i);
end
BA_before(l-1)=BA((l-1))/2;
BA_before_flipped = fliplr(BA_before);
% vector van de flenzen voor de inklemming op l_input
for i = 1:l-1
dist_1_before(i)=dist_1(i);
end
dist_1_before_flipped = fliplr(dist_1_before);
%--------------- vectoren na de inklemming
% vector van de hoeken na de inklemming op l_input
dummy3_sum = alpharad(l-1:length(alpharad));
sum_after = cumsum(dummy3_sum)-alpharad(l-1)/2;
% vector van de BA na de inklemming op l_input
for i = l_input:length(BA)
BA_after(i)=BA(i);
end
BA_after(l_input-1)=BA((l_input-1))/2;
BA_after=BA_after(l_input-1:length(BA));
% vector van de flenzen na de inklemming op l_input
for i = l_input:length(dist_1)
dist_1_after(i)=dist_1(i);
end
dist_1_after = dist_1_after(l_input:length(dist_1));
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE RIGHT SIDE
% %---------------------------------------------% horizontal displacement and put knot n_after correct: i.e. just in front of
% the laser head with radius D/2
%-------------------------------------------------------------------------coordX_1_after(1) = 0;
for i=2:length(VERTICES)/2-l_input+1
coordX_1_after(i)=coordX_1_after(i-1)+
(dist_1_after(i-1)+BA_after(i-1))*cos(sum_after(i-1));
end
% eerste dummy vector om te zoeken waar er een tekenwissel plaats vindt
dummy_1=sign(D/2-coordX_1_after);
% creation of second vector in which each element is the difference of 2
neighbour-elements of first dummy-vector
dummy_2=diff(dummy_1);
% find the position of knot with x-coordinate just in front of the end of the
laser head
index_first = find(dummy_2==-2);
nstart=index_first;
2
Appendix A : Matlab Codes for Collision Detection
n_after=nstart;
if coordX_1_after(n_after) > D/2
while coordX_1_after(n_after) > D/2
n_after = n_after-1;
end
end
%-------------------------------------------------------------------------%coordinates of all the y knots
%-------------------------------------------------------------------------coordY_1_after(1) = 0;
for i = 2:length(VERTICES)/2-l_input+1
coordY_1_after(i) = coordY_1_after(i-1)+
(dist_1_after(i-1)+BA_after(i-1))*sin(sum_after(i-1));
end
%---------------------------------------------------------------------------------% decision upon collision
%---------------------------------------------------------------------------------% --------------calculate the coefficient of direction
% 1. of (n;p)
codi_n_after_p_1 = (S-coordY_1_after(n_after))/(D/2coordX_1_after(n_after));
% 2. of (n;n+1)
codi_n_after_n_afterplus1_1 = (coordY_1_after(n_after+1)coordY_1_after(n_after))/(coordX_1_after(n_after+1)coordX_1_after(n_after));
k1R(l)=0;
if coordY_1_after(length(coordY_1_after)) < S
collisionfirstR(l_input)=0;
k1R(l)=1;
elseif (coordY_1_after(n_after)>S) & (coordY_1_after(n_after+1)) > S
k1R(l)=2;
collisionfirstR(l_input)=1;
elseif (coordY_1_after(n_after) < S) & (coordY_1_after(n_after+1) > S) &
(codi_n_after_p_1<codi_n_after_n_afterplus1_1)
k1R(l)=3;
collisionfirstR(l_input)=1;
elseif (isempty(n_after) & coordY_1_after(length(coordY_1_after))>S)
collisionfirstR(l_input)=1;
k1R(l)=4;
else
collisionfirstR(l_input)=0;
k1R(l)=5;
end
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE LEFT SIDE
% %---------------------------------------------% horizontal displacement and put knot n_before correct: i.e. just in front
% of the laser head with radius D/2
%-------------------------------------------------------------------------coordX_1_before(1) = 0;
for i=2:l_input
3
Appendix A : Matlab Codes for Collision Detection
coordX_1_before(i)=coordX_1_before(i-1)+
(dist_1_before_flipped(i-1)+BA_before_flipped(i-1))*cos(sum_before_flipped(i
-1));
end
% eerste dummy vector om te zoeken waar er een tekenwissel plaats vindt
dummy_1=sign(D/2-coordX_1_before);
% creation of second vector in which each element is the difference of 2
neighbour-elements of first dummy-vector
dummy_2=diff(dummy_1);
% find the position of knot with x-coordinate just in front of the end of the
laser head
index_first = find(dummy_2==-2);
nstart=index_first;
n_before=nstart;
if coordX_1_before(n_before) > D/2
while coordX_1_before(n_before) > D/2
n_before = n_before-1;
end
end
%-------------------------------------------------------------------------%coordinates of all the y knots
%-------------------------------------------------------------------------coordY_1_before(1) = 0;
for i = 2:l_input
coordY_1_before(i) = coordY_1_before(i-1)+
(dist_1_before_flipped(i-1)+BA_before_flipped(i-1))*sin(sum_before_flipped(i
-1));
end
%---------------------------------------------------------------------------------% decision upon collision
%---------------------------------------------------------------------------------% --------------calculate the coefficient of direction
% 1. of (n;p)
codi_n_before_p_1 = (S-coordY_1_before(n_before))/(D/2coordX_1_before(n_before));
% 2. of (n;n+1)
codi_n_before_n_beforeplus1_1 = (coordY_1_before(n_before+1)coordY_1_before(n_before))/(coordX_1_before(n_before+1)coordX_1_before(n_before));
k1L(l)=0;
if coordY_1_before(length(coordY_1_before)) < S
collisionfirstL(l_input)=0;
k1L(l)=1;
elseif (coordY_1_before(n_before)>S) & (coordY_1_before(n_before+1) > S)
collisionfirstL(l_input)=1;
k1L(l)=2;
elseif (coordY_1_before(n_before) < S) & (coordY_1_before(n_before+1) >
S) & (codi_n_before_p_1<codi_n_before_n_beforeplus1_1)
collisionfirstL(l_input)=1;
k1L(l)=3;
4
Appendix A : Matlab Codes for Collision Detection
elseif (isempty(n_before) & coordY_1_before(length(coordY_1_before))>S)
collisionfirstL(l_input)=1;
k1L(l)=4;
else
collisionfirstL(l_input)=0;
k1L(l)=5;
end
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE SECOND SIDE
% %--------------------------------------------%---------------vectoren voor de inklemming
% vector van de hoeken voor de inklemming op l_input
dummy1_sum = fliplr(alpharad(1:l-1));
dummy2_sum = cumsum(dummy1_sum)-dummy1_sum(1)/2;
sum_before = fliplr(dummy2_sum);
sum_before_flipped = fliplr(sum_before);
% vector van de BA voor de inklemming op l_input
for i = 1:l-2
BA_before(i)=BA(i);
end
BA_before(l-1)=BA((l-1))/2;
BA_before_flipped = fliplr(BA_before);
% vector van de flenzen voor de inklemming op l_input
for i = 1:l-1
dist_2_before(i)=dist_2(i);
end
dist_2_before_flipped = fliplr(dist_2_before);
%--------------- vectoren na de inklemming
% vector van de hoeken na de inklemming op l_input
dummy3_sum = alpharad(l-1:length(alpharad));
sum_after = cumsum(dummy3_sum)-alpharad(l-1)/2;
% vector van de BA na de inklemming op l_input
for i = l_input:length(BA)
BA_after(i)=BA(i);
end
BA_after(l_input-1)=BA((l_input-1))/2;
BA_after=BA_after(l_input-1:length(BA));
% vector van de flenzen na de inklemming op l_input
for i = l_input:length(dist_2)
dist_2_after(i)=dist_2(i);
end
dist_2_after = dist_2_after(l_input:length(dist_2));
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE RIGHT SIDE
% %---------------------------------------------%---------------------------------------------------------------------------------% horizontal displacement and put knot n_after correct: i.e. just in front of
% the laser head with radius D/2
%-------------------------------------------------------------------------coordX_2_after(1) = 0;
for i=2:length(VERTICES)/2-l_input+1
coordX_2_after(i)=coordX_2_after(i-1)+
5
Appendix A : Matlab Codes for Collision Detection
(dist_2_after(i-1)+BA_after(i-1))*cos(sum_after(i-1));
end
% eerste dummy vector om te zoeken waar er een tekenwissel plaats vindt
dummy_1=sign(D/2-coordX_2_after);
% creation of second vector in which each element is the difference of 2
neighbour-elements of first dummy-vector
dummy_2=diff(dummy_1);
% find the position of knot with x-coordinate just in front of the end of the
laser head
index_first = find(dummy_2==-2);
nstart=index_first;
n_after=nstart;
if coordX_2_after(n_after) > D/2
while coordX_2_after(n_after) > D/2
n_after = n_after-1;
end
end
%-------------------------------------------------------------------------%coordinates of all the y knots
%-------------------------------------------------------------------------coordY_2_after(1) = 0;
for i = 2:length(VERTICES)/2-l_input+1
coordY_2_after(i) = coordY_2_after(i-1)+
(dist_2_after(i-1)+BA_after(i-1))*sin(sum_after(i-1));
end
%---------------------------------------------------------------------------------% decision upon collision
%---------------------------------------------------------------------------------% --------------calculate the coefficient of direction
% 1. of (n;p)
codi_n_after_p_2 = (S-coordY_2_after(n_after))/(D/2coordX_2_after(n_after));
% 2. of (n;n+1)
codi_n_after_n_afterplus1_2 = (coordY_2_after(n_after+1)coordY_2_after(n_after))/(coordX_2_after(n_after+1)coordX_2_after(n_after));
k2R(l)=0;
if coordY_2_after(length(coordY_2_after)) < S
collisionsecondR(l_input)=0;
k2R(l)=1;
elseif (coordY_2_after(n_after)>S) & (coordY_2_after(n_after+1) > S)
collisionsecondR(l_input)=1;
k2R(l)=2;
elseif (coordY_2_after(n_after) < S) & (coordY_2_after(n_after+1) > S) &
(codi_n_after_p_2<codi_n_after_n_afterplus1_2)
collisionsecondR(l_input)=1;
k2R(l)=3;
elseif isempty(n_after) & coordY_2_after(length(coordY_2_after))>S
collisionsecondR(l_input)=1;
k2R(l)=4;
else
collisionsecondR(l_input)=0;
6
Appendix A : Matlab Codes for Collision Detection
k2R(l)=5;
end
% %---------------------------------------------% % PERFORM THE CALCULATION ON THE LEFT SIDE
% %---------------------------------------------%---------------------------------------------------------------------------------% horizontal displacement and put knot n_before correct: i.e. just in front
% of the laser head with radius D/2
%-------------------------------------------------------------------------coordX_2_before(1) = 0;
for i=2:l_input
coordX_2_before(i)=coordX_2_before(i-1)+
(dist_2_before_flipped(i-1)+BA_before_flipped(i-1))*cos(sum_before_flipped(i
-1));
end
% eerste dummy vector om te zoeken waar er een tekenwissel plaats vindt
dummy_1=sign(D/2-coordX_2_before);
% creation of second vector in which each element is the difference of 2
neighbour-elements of first dummy-vector
dummy_2=diff(dummy_1);
% find the position of knot with x-coordinate just in front of the end of the
laser head
index_first = find(dummy_2==-2);
nstart=index_first;
n_before=nstart;
if coordX_2_before(n_before) > D/2
while coordX_2_before(n_before) > D/2
n_before = n_before-1;
end
end
%-------------------------------------------------------------------------%coordinates of all the y knots
%-------------------------------------------------------------------------coordY_2_before(1) = 0;
for i = 2:l_input
coordY_2_before(i) = coordY_2_before(i-1)+
(dist_2_before_flipped(i-1)+BA_before_flipped(i-1))*sin(sum_before_flipped(i
-1));
end
%---------------------------------------------------------------------------------% decision upon collision
%---------------------------------------------------------------------------------% --------------calculate the coefficient of direction
% 1. of (n;p)
codi_n_before_p_2 = (S-coordY_2_before(n_before))/(D/2coordX_2_before(n_before));
% 2. of (n;n+1)
codi_n_before_n_beforeplus1_2 = (coordY_2_before(n_before+1)coordY_2_before(n_before))/(coordX_2_before(n_before+1)coordX_2_before(n_before));
k2L(l)=0;
if coordY_2_before(length(coordY_2_before)) < S
7
Appendix A : Matlab Codes for Collision Detection
collisionsecondL(l_input)=0;
k2L(l)=1;
elseif (coordY_2_before(n_before)>S) & (coordY_2_before(n_before+1) > S)
collisionsecondL(l_input)=1;
k2L(l)=2;
elseif (coordY_2_before(n_before) < S) & (coordY_2_before(n_before+1) >
S) & (codi_n_before_p_2<codi_n_before_n_beforeplus1_2)
collisionsecondL(l_input)=1;
k2L(l)=3;
elseif isempty(n_before) & coordY_2_before(length(coordY_2_before))>S
collisionsecondL(l_input)=1;
k2L(l)=4;
else
collisionsecondL(l_input)=0;
k2L(l)=5;
end
disp('
1L 1R 2L 2R')
disp([ collisionfirstL' collisionfirstR' collisionsecondL' collisionsecondR'])
disp('legend: 0 = no collision 1 = collision 2 = not possible')
%-------------------------------------------------------------------------% GRAPHICS
%-------------------------------------------------------------------------figure(l_input);
hold on;
HEADX_right = [0 D/2];
HEADY_right = [S S];
HEADX_left = [0 -D/2];
HEADY_left = [S S];
plot(D/2,S,'+','color','r','Linewidth',2);
plot(-D/2,S,'+','color','r','Linewidth',2);
xlabel('horizontal distance [mm]');
ylabel('vertical distance [mm]');
str_head = {l_input};
text(D,S+20,str_head,'color','k')
grid on;
line(HEADX_right,HEADY_right,'Color','r','Linewidth',2);
line(HEADX_left,HEADY_left,'Color','r','Linewidth',2);
% 2nd plot surface on first side to the right
for i=2:length(VERTICES)/2-l_input
i_iplus1X_after=[coordX_1_after(i) coordX_1_after(i+1)];
i_iplus1Y_after=[coordY_1_after(i) coordY_1_after(i+1)];
line(i_iplus1X_after,i_iplus1Y_after,'Color','b','Linewidth',1,'marker','+');
end
first_secX_after=[0 coordX_1_after(2)];
first_secY_after=[0 coordY_1_after(2)];
line(first_secX_after,first_secY_after,'Color','b','Linewidth',1,'marker','+');
% 2nd plot surface on first side to the left
for i=2:l_input-1
i_iplus1X_before=[-coordX_1_before(i) -coordX_1_before(i+1)];
i_iplus1Y_before=[coordY_1_before(i) coordY_1_before(i+1)];
line(i_iplus1X_before,i_iplus1Y_before,'Color','b','Linewidth',1,'marker','+');
end
8
Appendix A : Matlab Codes for Collision Detection
first_secX_before=[0 -coordX_1_before(2)];
first_secY_before=[0 coordY_1_before(2)];
line(first_secX_before,first_secY_before,'Color','b','Linewidth',1,'marker','+');
% 2nd plot surface on second side to the right
for i=2:length(VERTICES)/2-l_input
i_iplus1X_after_2=[coordX_2_after(i) coordX_2_after(i+1)];
i_iplus1Y_after_2=[coordY_2_after(i) coordY_2_after(i+1)];
line(i_iplus1X_after_2,i_iplus1Y_after_2,'Color','g','Linewidth',1,'marker','+');
end
first_secX_after_2=[0 coordX_2_after(2)];
first_secY_after_2=[0 coordY_2_after(2)];
line(first_secX_after_2,first_secY_after_2,'Color','g','Linewidth',1,'marker','+');
% 2nd plot surface on second side to the left
for i=2:l_input-1
i_iplus1X_before_2=[-coordX_2_before(i) -coordX_2_before(i+1)];
i_iplus1Y_before_2=[coordY_2_before(i) coordY_2_before(i+1)];
line(i_iplus1X_before_2,i_iplus1Y_before_2,'Color','g','Linewidth',1,'marker','
+');
end
first_secX_before_2=[0 -coordX_2_before(2)];
first_secY_before_2=[0 coordY_2_before(2)];
line(first_secX_before_2,first_secY_before_2,'Color','g','Linewidth',1,'mar
ker','+');
hold off;
end
DistancePoints3d
function dist = distancePoints3d(p1, p2, varargin)
%DISTANCEPOINTS3D compute euclidean distance between 3D Points
% D = distancePoints3d(P1, P2) return distance between points P1 and
% P2, given as [X Y Z].
% If P1 and P2 are two arrays of points, result is a N1*N2 array
% containing distance between each point of P1 and each point of P2.
% D = distancePoints3d(P1, P2, NOR)
% with NOR being 1, 2, or Inf, corresponfing to the norm used. Default is
% 2 (euclidean norm). 1 correspond to manhattan (or taxi driver) distance
% and Inf to maximum difference in each coordinate.
% See also :
%
distancePointsN, minDistancePoints
% author : David Legland
% INRA - TPV URPOI - BIA IMASTE
% created the 18/02/2005.
% HISTORY
% 21/02/2005 : add different norms
norm = 2;
if length(varargin)==1
norm = varargin{1};
end
% number of points of each array
n1 = size(p1, 1);
n2 = size(p2, 1);
9
Appendix A : Matlab Codes for Collision Detection
% compute difference of coordinate for each pair of point ([n1*n2] array)
dx = repmat(p1(:,1), [1 n2])-repmat(p2(:,1)', [n1 1]);
dy = repmat(p1(:,2), [1 n2])-repmat(p2(:,2)', [n1 1]);
dz = repmat(p1(:,3), [1 n2])-repmat(p2(:,3)', [n1 1]);
switch(norm)
case 1
dist = abs(dx) + abs(dy) + abs(dz);
case 2
dist = sqrt(dx.*dx + dy.*dy + dz.*dz);
case Inf
dist = max([abs(dx) abs(dy) abs(dz)], [], 2);
otherwise
dist = power(power(dx, norm) + power(dy, norm) + power(dz, norm),
1/norm);
end
normalize3d
function vn = normalize3d(v)
%NORMALIZE3D normalize a 3D vector
% V2 = normalize3d(V);
% return the normalization of vector V, such that ||V|| = 1. Vector V is
% given in vertical form.
% When V is a Nx3 array, normalization is performed for each row of the
% array.
% author : David Legland
% INRA - TPV URPOI - BIA IMASTE
% created the 29/11/2004.
% HISTORY
% 30/11/2005 : correct a bug
n = sqrt(v(:,1).*v(:,1) + v(:,2).*v(:,2) + v(:,3).*v(:,3));
vn = v./[n n n];
createPlane
function plane = createPlane(varargin)
%CREATEPLANE create a plane in parametrized form
% Create a plane in the following format :
% PLANE = [X0 Y0 Z0 DX1 DY1 DZ1 DX2 DY2 DZ2], where :
% - (X0, Y0, Z0) is a point belonging to the plane
% - (DX1, DY1, DZ1) is a first direction vector
% - (DX2, DY2, DZ2) is a second direction vector
% PLANE = createPlane(P1, P2, P3)
% create a plane containing the 3 points
% PLANE = createPlane(PTS)
% The 3 points are packed into a single 3x3 array.
% PLANE = createPlane(P0, N);
% create a plane from a point and from a normal to the plane.
% author : David Legland
% INRA - TPV URPOI - BIA IMASTE
% created the 18/02/2005.
% HISTORY :
10
Appendix A : Matlab Codes for Collision Detection
% 24/11/2005 : add possibility to pack points for plane creation
if length(varargin)==1
var = varargin{1};
if iscell(var)
plane = zeros([0 9]);
for i=1:length(var)
plane = [plane; createPlane(var{i})];
end
elseif size(var, 1)==3
% 3 points in a single array
p1 = var(1,:);
p2 = var(2,:);
p3 = var(3,:);
% create direction vectors
v1 = p2-p1;
v2 = p3-p1;
% create plane
plane = [p1 v1 v2];
return;
end
elseif length(varargin)==2
p0 = varargin{1};
var = varargin{2};
if size(var, 2)==2
n = sph2cart2([var repmat(1, [size(var, 1) 1])]);
elseif size(var, 2)==3
n = normalize3d(var);
else
error ('wrong number of parameters in createPlane');
end
% find a vector not colinear to the normal
v0 = repmat([1 0 0], [size(p0, 1) 1]);
if abs(cross(n, v0, 2))<1e-14
v0 = repmat([0 1 0], [size(p0, 1) 1]);
end
% create direction vectors
v1 = normalize3d(cross(n, v0, 2));
v2 = -normalize3d(cross(v1, n, 2));
plane = [p0 v1 v2];
return;
elseif length(varargin)==3
p1 = varargin{1};
p2 = varargin{2};
p3 = varargin{3};
% create direction vectors
v1 = p2-p1;
v2 = p3-p1;
plane = [p1 v1 v2];
return;
else
error('wrong number of arguments in "createPlane".');
end
11
Appendix A : Matlab Codes for Collision Detection
angles_surfaces
function [dist,dist_1,dist_2, theta_scan] = angles_surfaces(VERTICES)
% calculates the angles between the adjacent facettes of a developable
% surface. This developable surface exists of a certain number of control
% points.
%matrix of the VERTICES. Import from Rhinoceros, Nurbs modeling for
Windows
%Rhinoceros-file:
%The first value between the brackets +1 gives
%the number of knots in the U-direction. The second number between the
%brackets gives the number of knots in the V-direction.
% %-------------------------------------------------s=1;
r=1;
for s=1:2:size(VERTICES,1)-3
FACES(r,:)=[s s+1 s+3 s+2];
r=r+1;
end
%-------------------------------------------------k=1;
l=1;
m=2;
for t=1:2:size(VERTICES,1)-5
P1=VERTICES(t,:);
P2=VERTICES(t+1,:);
P3=VERTICES(t+2,:);
P4=VERTICES(t+3,:);
P5=VERTICES(t+4,:);
P6=VERTICES(t+5,:);
12
%
Create a plane in the following format :
%
PLANE = [X0 Y0 Z0 DX1 DY1 DZ1 DX2 DY2 DZ2], where :
%
- (X0, Y0, Z0) is a point belonging to the plane
%
- (DX1, DY1, DZ1) is a first direction vector
%
- (DX2, DY2, DZ2) is a second direction vector
Appendix A : Matlab Codes for Collision Detection
plane1 = createPlane(P1, P2, P3);
plane2 = createPlane(P3, P4, P5);
n1 = normalize3d(planeNormal(plane1));
n2 = normalize3d(planeNormal(plane2));
theta_rad(k) = pi-acos(dot(n1, n2, 2));
theta_deg_bend(k) = theta_rad(k)*180/pi;
theta_scan(k) = 180-theta_deg_bend(k);
%calculate flange length
dist(l) = distancePoints3d(P1,P3);
dist(m) = distancePoints3d(P2,P4);
k=k+1;
l=l+2;
m=m+2;
end
dist(l) = distancePoints3d(P3,P5);
dist(m) = distancePoints3d(P4,P6);
dist_1=dist(1:2:size(dist'));
dist_2=dist(2:2:size(dist'));
format('bank');
disp('the bending angles and the bend allowance is given by')
format('short');
%-------------------------------------------------%visualise the part
C=[0.8 0.8 0.8];
patch('vertices',VERTICES,'faces',FACES,'FaceColor',C)
grid on;
xlabel('x (mm)')
ylabel('y (mm)')
zlabel('z (mm)')
13
Appendix B : NC files 'CAD/CAM of developable surfaces'
Appendix B : NC files 'CAD/CAM of
developable surfaces'
Parabolic Cylinder
:1760(PARABOOL)
(V2-19-07-06)
#980=0(X-OFFSET)
#981=0(Y-OFFSET)
#982=4015(TECH-NR)
#983=1(AANTAL IN X)
#984=1(AANTAL IN Y)
#985=0(OFFSET FEATURE)
#986=0(OFFSET RECTANGLE)
#987=30(WACHTTIJD)
#988=180.06 (X-SHIFT 1765)
#989=11.5 (Y-SHIFT 1765)
#990=180.06 (X-SHIFT 1770)
#991=11.5 (Y-SHIFT 1770)
#992=180.06(X-SHIFT 1780)
#993=11.5 (Y-SHIFT 1780)
GOTO[#529*10]
N10M98P1765(CUTTING)
#529=#529+1
M00
N20M98P1770(BENDING)
#529=#529+1
M00
N30M98P1780(CUTTING)
M30
%
:1765(CUTTING)
(V-19-07-06)
G00G40
M98P8080
#512=1(MACH-MM)
#128=0(ENGRAVING)
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=260(Y-LENGHT PLATE)
15
Appendix B : NC files 'CAD/CAM of developable surfaces'
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P#982(TECH NR)
M98P8010
N100G920X[#980+#988]Y[#981+#989]
G65P9200S1766I100J100A#983B#984D20
M98P8047
IF[#129EQ-1]GOTO50
M98P8048
IF[#516EQ-1]GOTO100
N9997M98P8050
N9999M99
%
:1766(COORD)
#513=20 (Z-HEIGHT DISPLACEMENT)
M98 P8060
GOTO[#529*10]
N10 G0 G40 X0 Y0
M98 P8038
IF[#516GT0]GOTO18
G41
G1 Y5 E001
X-178.52
Y205
X-21.97
N18 G65 P8041 H#513 M0 D254.459
N11 G0 G40 X-15.97 Y210
M98 P8038
IF[#516GT0]GOTO19
G41
G1 Y205 E001
X61.14
Y5
X0
N19 G65 P8041 H#513 M0 D254.459
M98P8045
M99
%
:1770(BENDING)
(V2-19-07-06)
G00G40
M98P8080
#532=48.9(Z OFFSET BEND)
#512=1(MACH-MM)
#128=0(ENGRAVING)
16
Appendix B : NC files 'CAD/CAM of developable surfaces'
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=440(Y-LENGHT PLATE)
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P1060(TECH NR)
M98P8010
N100G920X[#980+#990]Y[#981+#991]
G0G40X[#980+#990+10]Y[#981+#991+11.5]
G13P0
G14
#518=#5023
G0Z[#518+#532-1]
M00
M76(BLOW ON)
G63P1
G65P9200S1771I100J100A#983B#984D20
M98P8047
M77
IF[#129EQ-1]GOTO50
M98P8048
IF[#516EQ-1]GOTO100
N9997M98P8050
N9999M99
%
:1771(BENDINGLINES)
G423 (0102)
#135=8000
#137=55
G400
G63 P1
N20 G0 G40 X-165.31 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (0218)
#135=7096
#137=100
G400
G63 P1
17
Appendix B : NC files 'CAD/CAM of developable surfaces'
N30 G0 G40 X48.03 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (0303)
#135=8000
#137=60
G400
G63 P1
N40 G0 G40 X-151.98 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (0418)
#135=7096
#137=100
G400
G63 P1
N30 G0 G40 X48.03 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (0504)
#135=8000
#137=65
G400
G63 P1
N30 G0 G40 X-138.81 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (0617)
#135=8000
#137=91
G400
G63 P1
18
Appendix B : NC files 'CAD/CAM of developable surfaces'
N30 G0 G40 X34.38 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (0705)
#135=8000
#137=71
G400
G63 P1
N30 G0 G40 X-125.45 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (0817)
#135=8000
#137=91
G400
G63 P1
N30 G0 G40 X34.38 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (0906)
#135=8000
#137=79
G400
G63 P1
N30 G0 G40 X-112.12 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (1017)
#135=8000
#137=91
G400
G63 P1
19
Appendix B : NC files 'CAD/CAM of developable surfaces'
N30 G0 G40 X34.38 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (1107)
#135=8000
#137=90
G400
G63 P1
N30 G0 G40 X-98.79 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1216)
#135=8000
#137=96
G400
G63 P1
N30 G0 G40 X20.97 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1308)
#135=7835
#137=100
G400
G63 P1
N30 G0 G40 X-85.31 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (1416)
#135=8000
#137=96
G400
G63 P1
20
Appendix B : NC files 'CAD/CAM of developable surfaces'
N30 G0 G40 X20.97 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1509)
#135=7049
#137=100
G400
G63 P1
N30 G0 G40 X-72.21 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1616)
#135=8000
#137=96
G400
G63 P1
N30 G0 G40 X20.97 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1710)
#135=8000
#137=76
G400
G63 P1
N30 G0 G40 X-58.93 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (1815)
#135=8000
#137=96
G400
G63 P1
21
Appendix B : NC files 'CAD/CAM of developable surfaces'
N30 G0 G40 X7.67 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (1910)
#135=8000
#137=76
G400
G63 P1
N30 G0 G40 X-58.93 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
G423 (2015)
#135=8000
#137=96
G400
G63 P1
N30 G0 G40 X7.67 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (2111)
#135=8000
#137=87
G400
G63 P1
N30 G0 G40 X-43.85 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (2215)
#135=8000
#137=96
G400
G63 P1
N30 G0 G40 X6.47 Y208
22
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (2311)
#135=8000
#137=87
G400
G63 P1
N30 G0 G40 X-45.62 Y2
G40
G1 Y208
G65 P8041
G420
G4 X#987
M01
G423 (2414)
#135=8000
#137=90
G400
G63 P1
N30 G0 G40 X-5.6 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (2512)
#135=7923
#137=100
G400
G63 P1
N30 G0 G40 X-32.27 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (2614)
#135=8000
#137=90
G400
G63 P1
N30 G0 G40 X-5.6 Y208
23
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
G423 (2712)
#135=7923
#137=100
G400
G63 P1
N30 G0 G40 X-32.27 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (2814)
#135=8000
#137=90
G400
G63 P1
N30 G0 G40 X-5.6 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (2913)
#135=8000
#137=82
G400
G63 P1
N30 G0 G40 X-18.97 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (3013)
#135=8000
#137=82
24
Appendix B : NC files 'CAD/CAM of developable surfaces'
G400
G63 P1
N30 G0 G40 X-18.97 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (3113)
#135=8000
#137=82
G400
G63 P1
N30 G0 G40 X-18.97 Y208
G40
G1 Y2
G65 P8041
G420
G4 X#987
M01
M98P8045
G53Z0
M99
%
:1780(CUTTING)
(V2-19-07-06)
G00G40
M98P8080
#512=1(MACH-MM)
#128=0(ENGRAVING)
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=260(Y-LENGHT PLATE)
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P#982(TECH NR)
M98P8010
N100G920X[#980+#992]Y[#981+#993]
G65P9200S1781I100J100A#983B#984D20
M98P8047
IF[#129EQ-1]GOTO50
M98P8048
25
Appendix B : NC files 'CAD/CAM of developable surfaces'
IF[#516EQ-1]GOTO100
N9997M98P8050
N9999M99
%
:1781( CUT 2 LINES)
#513=50
M98 P8060
N190 G0 G40 X-21.97 Y210
M98 P8038
IF[#516GT0]GOTO199
G41
G1 Y205 E001
X-15.97
N199 G65 P8041 H#513 M0 D254.459
M98P8045
N9999M99
%
Demo Part 2
:1760(DEMO2)
(V1-15-02-07)
#980=0(X-OFFSET)
#981=0(Y-OFFSET)
#982=4015(TECH-NR)
#983=1(AANTAL IN X)
#984=1(AANTAL IN Y)
#985=0(OFFSET FEATURE)
#986=0(OFFSET RECTANGLE)
#987=30(WACHTTIJD)
#988=129.933 (X-SHIFT 1765)
#989=13.405 (Y-SHIFT 1765)
#990=129.933 (X-SHIFT 1770)
#991=13.405 (Y-SHIFT 1770)
#992=129.933(X-SHIFT 1780)
#993=13.405 (Y-SHIFT 1780)
GOTO[#529*10]
N10M98P1765(CUTTING)
#529=#529+1
M00
N20M98P1770(BENDING)
#529=#529+1
M00
N30M98P1780(CUTTING)
M30
%
:1765(CUTTING)
(V2-15-02-07)
26
Appendix B : NC files 'CAD/CAM of developable surfaces'
G00G40
M98P8080
#512=1(MACH-MM)
#128=0(ENGRAVING)
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=260(Y-LENGHT PLATE)
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P#982(TECH NR)
M98P8010
N100G920X[#980+#988]Y[#981+#989]
G65P9200S1766I100J100A#983B#984D20
M98P8047
IF[#129EQ-1]GOTO50
M98P8048
IF[#516EQ-1]GOTO100
N9997M98P8050
N9999M99
%
:1766(COORD)
#513=20 (Z-HEIGHT DISPLACEMENT)
M98 P8060
GOTO[#529*10]
N10 G0 G40 X0 Y0
M98 P8038
IF[#516GT0]GOTO19
G42
G1 X0.26 Y5 E001
X79.81 Y0.93
X92.25 Y0.2
X104.45 Y-0.28
X117.15 Y-0.48
X129.26 Y-0.37
X142 Y0.12
X154.3 Y0.99
X166.63 Y2.3
X178.77 Y4.07
X190.87 Y6.38
X200.06 Y8.59
N19 G65 P8041 H#513 M0 D79.654
N20 G0 G40 X206.09 Y5.2
M98 P8038
IF[#516GT0]GOTO19
27
Appendix B : NC files 'CAD/CAM of developable surfaces'
G41
G1 X206.09 Y10.20 E001
X214.98 Y12.8
X226.7 Y16.79
X238.33 Y21.27
X249.76 Y26.14
X260.82 Y31.27
X271.75 Y36.72
X282.89 Y42.64
X293.64 Y48.68
X304.41 Y55
X477.61 Y155
X427.61 Y241.6
X384.31 Y216.6
X362.78 Y203.96
X341.28 Y191.89
X319.01 Y180.06
X297.13 Y169.14
X275.02 Y158.88
X252.15 Y149.14
X228.89 Y140.18
X205.46 Y132.21
X184.71 Y126.14
N29 G65 P8041 H#513 M0 D79.654
N30 G0 G40 X178.68 Y129.54
M98 P8038
IF[#516GT0]GOTO19
G41
G1 X178.68 Y124.54 E001
X157.24 Y119.37
X133.03 Y114.75
X108.75 Y111.21
X84.1 Y108.59
X59.49 Y106.85
X34.01 Y105.87
X9.8 Y105.64
X-15.6 Y106.05
X-40.01 Y107
X-64.89 Y108.46
X-114.82 Y111.02
X-119.93 Y11.15
X0.26 Y5
N39 G65 P8041 H#513 M0 D79.654
M98P8045
M99
%
:1770(BENDING)
(V1-15-02-07)
28
Appendix B : NC files 'CAD/CAM of developable surfaces'
G00G40
M98P8080
#532=29.6(Z OFFSET BEND)
#512=1(MACH-MM)
#128=0(ENGRAVING)
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=440(Y-LENGHT PLATE)
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P1060(TECH NR)
M98P8010
N100G920X[#980+#990]Y[#981+#991]
G0G40X[#980+#990+10]Y[#981+#991+11.5]
G13P0
G14
#518=#5023
G0Z[#518+#532-1]
M00
M76(BLOW ON)
G63P1
G65P9200S1771I100J100A#983B#984D20
M98P8047
M77
IF[#129EQ-1]GOTO50
M98P8048
IF[#516EQ-1]GOTO100
N9997M98P8050
N9999M99
%
:1771(BENDINGLINES)
G423 (0101)
#135=4368
#137=100
G400
G63 P1
N20 G0 G40 X79.81 Y-5
G40
G1 X79.81 Y0.93
X-64.89 Y108.46
X-64.89 Y113
G65 P8041
G420
G4 X#987
29
Appendix B : NC files 'CAD/CAM of developable surfaces'
M01
G423 (0220)
#135=4347
#137=100
G400
G63 P1
N30 G0 G40 X384.31 Y221
G40
G1 X384.31 Y216.6
X304.41 Y55
X304.41 Y50
G65 P8041
G420
G4 X#987
M01
G423 (0301)
#135=4368
#137=100
G400
G63 P1
N20 G0 G40 X79.81 Y-5
G40
G1 X79.81 Y0.93
X-64.89 Y108.46
X-64.89 Y113
G65 P8041
G420
G4 X#987
M01
G423 (0420)
#135=4347
#137=100
G400
G63 P1
N30 G0 G40 X384.31 Y221
G40
G1 X384.31 Y216.6
X304.41 Y55
X304.41 Y50
G65 P8041
G420
G4 X#987
M01
G423 (0501)
#135=4368
#137=100
G400
G63 P1
30
Appendix B : NC files 'CAD/CAM of developable surfaces'
N20 G0 G40 X79.81 Y-5
G40
G1 X79.81 Y0.93
X-64.89 Y108.46
X-64.89 Y113
G65 P8041
G420
G4 X#987
M01
G423 (0620)
#135=4347
#137=100
G400
G63 P1
N30 G0 G40 X384.31 Y221
G40
G1 X384.31 Y216.6
X304.41 Y55
X304.41 Y50
G65 P8041
G420
G4 X#987
M01
G423 (0702)
#135=4077
#137=100
G400
G63 P1
N40 G0 G40 X-40.01 Y112
G40
G1 X-40.01 Y107
X92.25 Y0.2
X92.25 Y-5
G65 P8041
G420
G4 X#987
M01
G423 (0819)
#135=4065
#137=100
G400
G63 P1
N50 G0 G40 X293.64 Y43
G40
G1 X293.64 Y48.68
X362.78 Y203.96
X362.78 Y208
G65 P8041
31
Appendix B : NC files 'CAD/CAM of developable surfaces'
G420
G4 X#987
M01
G423 (0902)
#135=4077
#137=100
G400
G63 P1
N40 G0 G40 X-40.01 Y112
G40
G1 X-40.01 Y107
X92.25 Y0.2
X92.25 Y-5
G65 P8041
G420
G4 X#987
M01
G423 (1019)
#135=4065
#137=100
G400
G63 P1
N50 G0 G40 X293.64 Y43
G40
G1 X293.64 Y48.68
X362.78 Y203.96
X362.78 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1102)
#135=4077
#137=100
G400
G63 P1
N40 G0 G40 X-40.01 Y112
G40
G1 X-40.01 Y107
X92.25 Y0.2
X92.25 Y-5
G65 P8041
G420
G4 X#987
M01
G423 (1219)
#135=4065
#137=100
32
Appendix B : NC files 'CAD/CAM of developable surfaces'
G400
G63 P1
N50 G0 G40 X293.64
G40
G1 X293.64 Y48.68
X362.78 Y203.96
X362.78 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1302)
#135=4077
#137=100
G400
G63 P1
N40 G0 G40 X-40.01
G40
G1 X-40.01 Y107
X92.25 Y0.2
X92.25 Y-5
G65 P8041
G420
G4 X#987
M01
G423 (1419)
#135=4065
#137=100
G400
G63 P1
N50 G0 G40 X293.64
G40
G1 X293.64 Y48.68
X362.78 Y203.96
X362.78 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1502)
#135=4077
#137=100
G400
G63 P1
N40 G0 G40 X-40.01
G40
G1 X-40.01 Y107
X92.25 Y0.2
Y43
Y112
Y43
Y112
33
Appendix B : NC files 'CAD/CAM of developable surfaces'
X92.25 Y-5
G65 P8041
G420
G4 X#987
M01
G423 (1619)
#135=4065
#137=100
G400
G63 P1
N50 G0 G40 X293.64 Y43
G40
G1 X293.64 Y48.68
X362.78 Y203.96
X362.78 Y208
G65 P8041
G420
G4 X#987
M01
G423 (1703)
#135=3741
#137=100
G400
G63 P1
N60 G0 G40 X104.45 Y-0.28
G40
G1 X-15.6 Y106.05
G65 P8041
G420
G4 X#987
M01
G423 (1818)
#135=3717
#137=100
G400
G63 P1
N70 G0 G40 X341.28 Y191.89
G40
G1 X282.89 Y42.64
G65 P8041
G420
G4 X#987
M01
G423 (1903)
#135=3741
#137=100
G400
G63 P1
34
Appendix B : NC files 'CAD/CAM of developable surfaces'
N60 G0 G40 X104.45
G40
G1 X-15.6 Y106.05
G65 P8041
G420
G4 X#987
M01
G423 (2018)
#135=3717
#137=100
G400
G63 P1
N70 G0 G40 X341.28
G40
G1 X282.89 Y42.64
G65 P8041
G420
G4 X#987
M01
G423 (2103)
#135=3741
#137=100
G400
G63 P1
N60 G0 G40 X104.45
G40
G1 X-15.6 Y106.05
G65 P8041
G420
G4 X#987
M01
G423 (2218)
#135=3717
#137=100
G400
G63 P1
N70 G0 G40 X341.28
G40
G1 X282.89 Y42.64
G65 P8041
G420
G4 X#987
M01
G423 (2303)
#135=3741
#137=100
G400
G63 P1
Y-0.28
Y191.89
Y-0.28
Y191.89
35
Appendix B : NC files 'CAD/CAM of developable surfaces'
N60 G0 G40 X104.45 Y-0.28
G40
G1 X-15.6 Y106.05
G65 P8041
G420
G4 X#987
G423 (2418)
#135=3717
#137=100
G400
G63 P1
N70 G0 G40 X341.28 Y191.89
G40
G1 X282.89 Y42.64
G65 P8041
G420
G4 X#987
M01
G423 (2504)
#135=3164
#137=100
G400
G63 P1
N80 G0 G40 X9.8 Y105.64
G40
G1 X117.15 Y-0.48
G65 P8041
G420
G4 X#987
M01
G423 (2617)
#135=3185
#137=100
G400
G63 P1
N90 G0 G40 X271.75 Y36.72
G40
G1 X319.01 Y180.06
G65 P8041
G420
G4 X#987
M01
G423 (2704)
#135=3164
#137=100
G400
G63 P1
N80 G0 G40 X9.8 Y105.64
36
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X117.15 Y-0.48
G65 P8041
G420
G4 X#987
M01
G423 (2817)
#135=3185
#137=100
G400
G63 P1
N90 G0 G40 X271.75 Y36.72
G40
G1 X319.01 Y180.06
G65 P8041
G420
G4 X#987
M01
G423 (2904)
#135=3164
#137=100
G400
G63 P1
N80 G0 G40 X9.8 Y105.64
G40
G1 X117.15 Y-0.48
G65 P8041
G420
G4 X#987
M01
G423 (3017)
#135=3185
#137=100
G400
G63 P1
N90 G0 G40 X271.75 Y36.72
G40
G1 X319.01 Y180.06
G65 P8041
G420
G4 X#987
M01
G423 (3105)
#135=3502
#137=100
G400
G63 P1
N100 G0 G40 X129.26 Y-0.37
37
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X34.01 Y105.87
G65 P8041
G420
G4 X#987
M01
G423 (3216)
#135=3570
#137=100
G400
G63 P1
N110 G0 G40 X297.13
G40
G1 X260.82 Y31.27
G65 P8041
G420
G4 X#987
M01
G423 (3305)
#135=3502
#137=100
G400
G63 P1
N100 G0 G40 X129.26
G40
G1 X34.01 Y105.87
G65 P8041
G420
G4 X#987
M01
G423 (3416)
#135=3570
#137=100
G400
G63 P1
N110 G0 G40 X297.13
G40
G1 X260.82 Y31.27
G65 P8041
G420
G4 X#987
M01
G423 (3505)
#135=3502
#137=100
G400
G63 P1
N100 G0 G40 X129.26
38
Y169.14
Y-0.37
Y169.14
Y-0.37
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X34.01 Y105.87
G65 P8041
G420
G4 X#987
M01
G423 (3616)
#135=3570
#137=100
G400
G63 P1
N110 G0 G40 X297.13 Y169.14
G40
G1 X260.82 Y31.27
G65 P8041
G420
G4 X#987
M01
G423 (3706)
#135=3845
#137=100
G400
G63 P1
N120 G0 G40 X59.49 Y106.85
G40
G1 X142 Y0.12
G65 P8041
G420
G4 X#987
M01
G423 (3815)
#135=3840
#137=100
G400
G63 P1
N130 G0 G40 X249.76 Y26.14
G40
G1 X275.02 Y158.88
G65 P8041
G420
G4 X#987
M01
G423 (3906)
#135=3845
#137=100
G400
G63 P1
N120 G0 G40 X59.49 Y106.85
39
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X142 Y0.12
G65 P8041
G420
G4 X#987
M01
G423 (4015)
#135=3840
#137=100
G400
G63 P1
N130 G0 G40 X249.76 Y26.14
G40
G1 X275.02 Y158.88
G65 P8041
G420
G4 X#987
M01
G423 (4106)
#135=3845
#137=100
G400
G63 P1
N120 G0 G40 X59.49 Y106.85
G40
G1 X142 Y0.12
G65 P8041
G420
G4 X#987
M01
G423 (4215)
#135=3840
#137=100
G400
G63 P1
N130 G0 G40 X249.76 Y26.14
G40
G1 X275.02 Y158.88
G65 P8041
G420
G4 X#987
M01
G423 (4307)
#135=4099
#137=100
G400
G63 P1
N140 G0 G40 X154.3 Y0.99
40
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X84.1 Y108.59
G65 P8041
G420
G4 X#987
M01
G423 (4414)
#135=4099
#137=100
G400
G63 P1
N150 G0 G40 X252.15 Y149.14
G40
G1 X238.33 Y21.27
G65 P8041
G420
G4 X#987
M01
G423 (4507)
#135=4099
#137=100
G400
G63 P1
N140 G0 G40 X154.3 Y0.99
G40
G1 X84.1 Y108.59
G65 P8041
G420
G4 X#987
M01
G423 (4614)
#135=4099
#137=100
G400
G63 P1
N150 G0 G40 X252.15 Y149.14
G40
G1 X238.33 Y21.27
G65 P8041
G420
G4 X#987
M01
G423 (4707)
#135=4099
#137=100
G400
G63 P1
N140 G0 G40 X154.3 Y0.99
41
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X84.1 Y108.59
G65 P8041
G420
G4 X#987
M01
G423 (4814)
#135=4099
#137=100
G400
G63 P1
N150 G0 G40 X252.15 Y149.14
G40
G1 X238.33 Y21.27
G65 P8041
G420
G4 X#987
M01
G423 (4908)
#135=3166
#137=100
G400
G63 P1
N160 G0 G40 X108.75 Y111.21
G40
G1 X166.63 Y2.3
G65 P8041
G420
G4 X#987
M01
G423 (5013)
#135=3150
#137=100
G400
G63 P1
N170 G0 G40 X226.7 Y16.79
G40
G1 X228.89 Y140.18
G65 P8041
G420
G4 X#987
M01
G423 (5108)
#135=3166
#137=100
G400
G63 P1
N160 G0 G40 X108.75 Y111.21
42
Appendix B : NC files 'CAD/CAM of developable surfaces'
G40
G1 X166.63 Y2.3
G65 P8041
G420
G4 X#987
M01
G423 (5213)
#135=3150
#137=100
G400
G63 P1
N170 G0 G40 X226.7 Y16.79
G40
G1 X228.89 Y140.18
G65 P8041
G420
G4 X#987
M01
G423 (5309)
#135=3317
#137=100
G400
G63 P1
N180 G0 G40 X178.77 Y4.07
G40
G1 X133.03 Y114.75
G65 P8041
G420
G4 X#987
G423 (5412)
#135=3309
#137=100
G400
G63 P1
N190 G0 G40 X205.46 Y132.21
G40
G1 X214.98 Y12.8
G65 P8041
G420
G4 X#987
M01
G423 (5509)
#135=3317
#137=100
G400
G63 P1
N180 G0 G40 X178.77 Y4.07
G40
43
Appendix B : NC files 'CAD/CAM of developable surfaces'
G1 X133.03 Y114.75
G65 P8041
G420
G4 X#987
M01
G423 (5612)
#135=3309
#137=100
G400
G63 P1
N190 G0 G40 X205.46 Y132.21
G40
G1 X214.98 Y12.8
G65 P8041
G420
G4 X#987
M01
G423 (5710)
#135=3348
#137=100
G400
G63 P1
N200 G0 G40 X157.24 Y119.37
G40
G1 X190.87 Y6.38
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (5810)
#135=3348
#137=100
G400
G63 P1
N200 G0 G40 X157.24 Y119.37
G40
G1 X190.87 Y6.38
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (5911)
#135=3388
#137=100
G400
G63 P1
44
Appendix B : NC files 'CAD/CAM of developable surfaces'
N210 G0 G40 X203.12 Y9.33
G40
G1 X181.74 Y125.27
G65 P8041
G420
G4 X#987
G4 X#987
M01
G423 (6011)
#135=3388
#137=100
G400
G63 P1
N210 G0 G40 X203.12 Y9.33
G40
G1 X181.74 Y125.27
G65 P8041
G420
G4 X#987
M01
M98P8045
G53Z0
M99
%
:1780(CUTTING)
(V1-15-02-07)
G00G40
M98P8080
#512=1(MACH-MM)
#128=0(ENGRAVING)
#129=0(SHEET CUTTING)
#514=20(Z-HEIGHT DISPLACEM.)
#516=0(SEPERATED PIERC.)
#517=0(MESURE Z-POS.)
#521=0(METH.REF.PLATE)
#515=260(Y-LENGHT PLATE)
#526=0(MAX G0-DIST)
#633=5(G0-G13 DIST)
(END)
N50M98P#982(TECH NR)
M98P8010
N100G920X[#980+#992]Y[#981+#993]
G65P9200S1781I100J100A#983B#984D20
M98P8047
IF[#129EQ-1]GOTO50
M98P8048
IF[#516EQ-1]GOTO100
45
Appendix B : NC files 'CAD/CAM of developable surfaces'
N9997M98P8050
N9999M99
%
:1781( CUTCOORDS)
#513=50
M98 P8060
GOTO[#529*10]
N190 G0 G40 X200.06 Y8.59
M98 P8038
IF[#516GT0]GOTO199
G42
G1 X206.09 Y10.2 E001
N199 G65 P8041 H#513 M0 D254.459
N200 G0 G40 X184.71 Y126.14
M98 P8038
IF[#516GT0]GOTO199
G42
G1 X178.68 Y124.54 E001
N209 G65 P8041 H#513 M0 D254.459
M98P8045
N9999M99
%
46
Appendix C: Different Influences on the Variance of Laser Forming
Appendix C: Different Influences on the
Variance of Laser Forming
Thomson [Thomson et al., 1997] presents an overview of parameters that can
not be controlled, but which contribute to the variance of the process, making
accurate, predictive forming difficult or even impossible. They can be
categorised into three groups:
1.
The laser system: a laser is composed of several subsystems: the
optical, electrical, gas and coolant circuits are all likely to influence the
laser performance. Dust and dirt on a lens will alter the power
distribution, while it also causes the heat to accumulate in the lens,
which will change the focus position of the lens (thermal lensing). In
the
laser
cavity,
a
certain
amount of
the
CO2-He-N2 gas is
continuously added. The reason for this is the occasional break up of
the gas molecules by the electron stream, causing new gases to enter
into the mixture (e.g. CO, NO2) which interfere with the lasing action
and diminish the efficiency of the machine [Powell, 1998]. The result
of this is a fluctuation in the power output.
A last source of laser variance is introduced by the cooling system: a
small water temperature or pressure altering will yield temperature
differences in the optical or electrical components and will again alter
the output.
2.
Material properties: material suppliers have a certain tolerance on
the sheet thickness of metal sheets in the same batch. Also small
fluctuations in composition are
possible
and between different
suppliers, another manufacturing process will also introduce slightly
different material properties. A change in carbon content will increase
strength and will lower the melting point. A non-homogeneous crystal
structure will lead to anisotropic properties into the material.
3.
CNC system: the exact positioning accuracy will vary between
different positioning systems, but it is assumed that this error is small
compared with the variability introduced by the laser and the material.
4.
Sheet metal surface: some sheets show a clear variation in surface
condition (oxidised, marker ink, scratches,...). In that case, it can be
expected that also the laser absorptivity will change.
47
Appendix D: Closed loop laser forming - state of the art
Appendix D: Closed loop laser forming state of the art
2D laser forming
Thomson [Thomson et al., 1997] used a linear variable differential transformer
(LVDT) attached to one side of the sample. The difference in actual and
wanted position created an error and based on this error, another scan
velocity has been used. The reason for this was to prevent overshoot.
Kim [Kim et al., 2005] has proposed a statistically based feed back method for
both single and multiple line scanning: as long as the difference between the
wanted and current bending angle is larger than the largest possible bending
angle plus three times the standard deviation, the scan velocity is set to aim
for this maximum bending angle. If the error is smaller, the bending angle
growth is set to the difference in wanted minus current bending angle minus
three times the standard deviation and an adapted scan velocity is used.
Edwardson [Edwardson, 2004] measured the height of the sample with a laser
probe. To avoid overshoot, the scan velocity was set based on the difference
between wanted and current bending angle.
Edwardson also performed some work on 3D laser forming.
3D laser forming
using the laser probe as a CMM, after each forming step (scan line), the
surface is measured at points from a grid with a preset density and
interpolated afterwards. This creates a height error between the current and
desired shape. A map with lines of equal height is then created and based on
the gradient vector magnitude of total strain requirements, the velocity is
altered along the scan line to provide the correct input energy. The system is
limited by the fact that during scanning of a line of constant height, it does not
take into account the influence on the rest of the plate: a forming line in the
centre of the sample will generate a deflection at the outer edges and vice
versa.
Hutterer et al. [Hutterer et al., 2003] have automated the removal of buckles
of car bodies. After each laser forming step, the workpiece is digitized by an
optical 3D sensor. Different approaches for scan strategies have been
proposed. It is proven that dents up to 2 mm could be removed to a remaining
0.1 mm.
49
Appendix D: Closed loop laser forming - state of the art
Reeves et al. [Reeves et al., 2003] have reported a transient 3D in-process
profile measurement system. The measurement system consists of a fibre
optic point source and binary phase grating interferometer which project
narrow-band parallel interference fringes on to the object surface. The binary
grating diffracts light into the +1 and -1 orders 1, which overlap and interfere.
Using this binary diffraction grating, no higher order diffraction effects and
aberrations occur and the fringes are contained only within +1 and -1 orders.
The fringe order, or phase, at each point on the surface is measured using the
Fourier transform method and unwrapping techniques. The fringe phase is
then converted to surface height using a phase-to-height mapping. The fringes
are captured by a CCD camera, which allows the transient behaviour of the
laser process to be measured. Measurement areas of 400x200 mm have been
reported and it is claimed that the set-up is also useful to measure unwanted
distortions in other-than-forming laser processes such as welding and drilling.
1
50
A +1 order represents a ridge in the interface fringe pattern, while a -1 order represents a
valley.