📄 generate_force_main.asv
字号:
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% Plan the Optimal Normal Clamping Force, and Clamping Position
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
global Cn_Lw Cn_cw Ct_Lw Ct_cw
global t
global Fg Side_L Set_Clamping_Force
global count
%===========================================================================================================
% set the weight of the workpiece
Fg = -50; % weight of the workpiece (Unit: Newton)
Side_L = 200; % side Side_L of the workpiece (Unit: mm)
Set_Clamping_Force = 81.6; % Newton
%=========================================================================================================
% static friction coefficient between the workpiece and locators/clamp(s)
miu = 0.35;
%=========================================================================================================
% Material Characteristics
%---------------------------------------------------------------------------------------------------------
% Modulus of Elasticity
EL = 207000; % for locator (N/square mm)
Ec = 207000; % for clamp (N/square mm)
Ew = 70300; % for workpiece (N/square mm)
% Poisson's Ratio
vL = 0.292; % for locator
vc = 0.292; % for clamp
vw = 0.354; % for workpiece
% Effective Modulus of Elasticity
ELw = ((1-vw*vw)/Ew+(1-vL*vL)/EL)^(-1); % between locators and workpiece
Ecw = ((1-vw*vw)/Ew+(1-vc*vc)/Ec)^(-1); % between locators and workpiece
% Effective Resultant Curvature Radius
RLw = 6.35; % between locators and workpiece (mm)
Rcw = 8.05; % between clamp and workpiece (mm)
% Influence Coefficient
Cn_Lw = (3/4)*(4/(3*RLw*ELw^2))^(1/3); % for normal direction between locators and workpiece
Cn_cw = (3/4)*(4/(3*Rcw*Ecw^2))^(1/3); % for normal direction between clamps and workpiece
ELw_ = (1+vL)*(2-vL)/EL+(1+vw)*(2-vw)/Ew;
Ecw_ = (1+vc)*(2-vc)/Ec+(1+vw)*(2-vw)/Ew;
Ct_Lw = (1/4)*ELw_*(4*ELw/(3*RLw))^(1/3); % for tangential direction between locators and workpiece
Ct_cw = (1/4)*Ecw_*(4*Ecw/(3*Rcw))^(1/3); % for tangential direction between clamps and workpiece
%===============================================================================================================
x0 = [0.0033,0.0038,0.0034,0.0028,0.0026,0.0036,0.0051,-0.00018,-0.00031,-0.00008,0.00014,0.00006,-0.000092,0.00005,-0.0004,-0.00057,-0.00062,-0.0005,-0.00021,0.00009,-0.000058]';
LB = [0,0,0,0,0,0,0,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025,-0.0025]';
UB = [0.0075,0.0075,0.0075,0.0075,0.0075,0.0075,0.0075,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035,0.0035]';
options = optimset('lsqnonlin');
options.MaxFunEvals = 20000;
options.TolFun = 1e-8;
options.MaxIter = 20000;
%options.TolX = 1.e-8;
%fd = fopen('contact_force.dat','w');
%fd1 = fopen('deformation.dat','w');
count = 0;
for time_step_number=0:36;
t = 1*time_step_number;
x = lsqnonlin('Objective_Funct', x0,LB,UB,options);
for i=1:6
Force(i) = (Cn_Lw^(-3/2))*x(i)^(3/2);
Force(i+7) = (Ct_Lw^(-1))*(Cn_Lw)^(-1/2)*x(i+7)*x(i)^(1/2);
Force(i+14) = (Ct_Lw^(-1))*(Cn_Lw)^(-1/2)*x(i+14)*x(i)^(1/2);
end
Force(7) = Set_Clamping_Force;
Force(14) = (Ct_cw^(-1))*(Cn_cw)^(-1/2)*x(14)*x(7)^(1/2);
Force(21) = (Ct_cw^(-1))*(Cn_cw)^(-1/2)*x(21)*x(7)^(1/2);
F1n(time_step_number+1) = Force(1);
F2n(time_step_number+1) = Force(2);
F3n(time_step_number+1) = Force(3);
F4n(time_step_number+1) = Force(4);
F5n(time_step_number+1) = Force(5);
F6n(time_step_number+1) = Force(6);
Fcn(time_step_number+1) = Force(7);
F1t(time_step_number+1) = sqrt(Force(8)^2+Force(15)^2);
F2t(time_step_number+1) = sqrt(Force(9)^2+Force(16)^2);
F3t(time_step_number+1) = sqrt(Force(10)^2+Force(17)^2);
F4t(time_step_number+1) = sqrt(Force(11)^2+Force(18)^2);
F5t(time_step_number+1) = sqrt(Force(12)^2+Force(19)^2);
F6t(time_step_number+1) = sqrt(Force(13)^2+Force(20)^2);
Fct(time_step_number+1) = sqrt(Force(14)^2+Force(21)^2);
Dlt_F1(time_step_number+1) = 0.4*F1n(time_step_number+1)-F1t(time_step_number+1)
Dlt_F2(time_step_number+1) = 0.4*F2n(time_step_number+1)-F2t(time_step_number+1)
Dlt_F3(time_step_number+1) = 0.4*F3n(time_step_number+1)-F3t(time_step_number+1)
Dlt_F4(time_step_number+1) = 0.4*F4n(time_step_number+1)-F4t(time_step_number+1)
Dlt_F5(time_step_number+1) = 0.4*F5n(time_step_number+1)-F5t(time_step_number+1)
Dlt_F6(time_step_number+1) = 0.4*F6n(time_step_number+1)-F6t(time_step_number+1)
Dlt_Fc(time_step_number+1) = 0.4*Fcn(time_step_number+1)-Fct(time_step_number+1)
%fprintf(fd, '\n%d %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f \n', 5*t, F1n, F1t, Dlt_F1,F2n, F2t, Dlt_F2,F3n, F3t, Dlt_F3,F4n, F4t, Dlt_F4,F5n, F5t, Dlt_F5,F6n, F6t, Dlt_F6,Fcn, Fct, Dlt_Fc);
%fprintf(fd1, '\n%d %f %f %f %f %f %f \n', 5*t, Dlt_X, Dlt_Y, Dlt_Z, Dlt_CT_X, Dlt_CT_Y, Dlt_CT_Z);
end
%fclose(fd);
%fclose(fd1);
close all;
figure(1);
hold on;
plot(0:5:180, F1n,'-*b' );
plot(0:5:180, F1t,'-ok');
plot(0:5:180, Dlt_F1, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 1st Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(2);
hold on;
plot(0:5:180, F2n,'-*b' );
plot(0:5:180, F2t,'-ok');
plot(0:5:180, Dlt_F2, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 2nd Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(3);
hold on;
plot(0:5:180, F3n,'-*b' );
plot(0:5:180, F3t,'-ok');
plot(0:5:180, Dlt_F3, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 3rd Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(4);
hold on;
plot(0:5:180, F4n,'-*b' );
plot(0:5:180, F4t,'-ok');
plot(0:5:180, Dlt_F4, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 4th Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(5);
hold on;
plot(0:5:180, F5n,'-*b' );
plot(0:5:180, F5t,'-ok');
plot(0:5:180, Dlt_F5, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 5th Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(6);
hold on;
plot(0:5:180, F6n,'-*b' );
plot(0:5:180, F6t,'-ok');
plot(0:5:180, Dlt_F6, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 6th Contact');
legend('Normal Force','Tangential Force','Sliding Index');
figure(7);
hold on;
plot(0:5:180, Fcn,'-*b' );
plot(0:5:180, Fct,'-ok');
plot(0:5:180, Dlt_Fc, '-xr');
grid on;
xlabel('Position of Cutter (mm)');
ylabel('Force (N)');
title('Forces at the 7th Contact');
legend('Normal Force','Tangential Force','Sliding Index');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -