first measurements
This commit is contained in:
		@@ -1,4 +1,64 @@
 | 
			
		||||
%% Remove first second
 | 
			
		||||
Ts = t(2)-t(1);
 | 
			
		||||
t = t(ceil(1/Ts):end);
 | 
			
		||||
d = d(ceil(1/Ts):end);
 | 
			
		||||
dp = dp(ceil(1/Ts):end);
 | 
			
		||||
F = F(ceil(1/Ts):end);
 | 
			
		||||
 | 
			
		||||
t = t - t(1);
 | 
			
		||||
F = F - F(1);
 | 
			
		||||
 | 
			
		||||
%% LPf
 | 
			
		||||
s = tf('s');
 | 
			
		||||
G_lpf = 1/(1+s/2/pi/10);
 | 
			
		||||
F = lsim(G_lpf, F, t);
 | 
			
		||||
d = lsim(G_lpf, d, t);
 | 
			
		||||
dp = lsim(G_lpf, dp, t);
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
figure;
 | 
			
		||||
plot(F, d);
 | 
			
		||||
plot(t, F);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(t, d, 'DisplayName', 'Encoder');
 | 
			
		||||
plot(t, dp, 'DisplayName', 'Mahr')
 | 
			
		||||
hold off;
 | 
			
		||||
legend;
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
t_start = 0.05;
 | 
			
		||||
t_end = 0.12;
 | 
			
		||||
d = d(t < t_end & t > t_start);
 | 
			
		||||
dp = dp(t < t_end & t > t_start);
 | 
			
		||||
F = F(t < t_end & t > t_start);
 | 
			
		||||
 | 
			
		||||
d = d - d(1);
 | 
			
		||||
dp = dp - dp(1);
 | 
			
		||||
F = F - F(1);
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
figure;
 | 
			
		||||
plot(F, dp);
 | 
			
		||||
xlabel('Measured Force [N]');
 | 
			
		||||
ylabel('Measured Displacement [um]');
 | 
			
		||||
ylabel('Measured Displacement [m]');
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
sprintf('Stiffness is %.3f [N/mm]', abs(1e-3*(d\F)))
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(F, d);
 | 
			
		||||
plot(F, F/(d\F));
 | 
			
		||||
hold off;
 | 
			
		||||
xlabel('Measured Force [N]');
 | 
			
		||||
ylabel('Measured Displacement [m]');
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(dp, d);
 | 
			
		||||
hold off;
 | 
			
		||||
xlabel('Probe [m]');
 | 
			
		||||
ylabel('Encoder [m]');
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								matlab/mat/meas_probe_against_encoder.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								matlab/mat/meas_probe_against_encoder.mat
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								matlab/mat/meas_stiff_probe.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								matlab/mat/meas_stiff_probe.mat
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -10,7 +10,8 @@ data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data;
 | 
			
		||||
 | 
			
		||||
d = data(:, 1);
 | 
			
		||||
F = data(:, 2);
 | 
			
		||||
dp = data(:, 3);
 | 
			
		||||
t = data(:, end);
 | 
			
		||||
 | 
			
		||||
%% Save
 | 
			
		||||
save('mat/flex_1_x.mat', 't', 'd', 'F');
 | 
			
		||||
save('mat/meas_stiff_probe.mat', 't', 'd', 'dp', 'F');
 | 
			
		||||
 
 | 
			
		||||
@@ -2,5 +2,5 @@ Fs = 20e3; % [Hz]
 | 
			
		||||
Ts = 1/Fs; % [s]
 | 
			
		||||
 | 
			
		||||
%% Gains
 | 
			
		||||
Gf = 10; % [N/V]
 | 
			
		||||
Gd = 10e-6; % [m/V]
 | 
			
		||||
Gf = 50/4; % [N/V]
 | 
			
		||||
Gd = 1000e-6/3.333; % [m/V]
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user