Difference between revisions of "Ltf matlab source"

From DIDEAS Wiki
Jump to: navigation, search
m
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{pf_top_nav}}
 +
 
=potential function=
 
=potential function=
 +
==ltf_pf-2009_12_16.m==
 
<pre>
 
<pre>
 
fname = 'static_test_experiment_log-20091216_1.txt';
 
fname = 'static_test_experiment_log-20091216_1.txt';
Line 31: Line 34:
 
ylabel('Ak motor rotations')
 
ylabel('Ak motor rotations')
 
</pre>
 
</pre>
=test2=
+
 
 +
=ltf_bd_dep-121509.m=
 +
 
 +
<pre>
 +
fname = 'static_test_experiment_log-121509.txt';
 +
s = importdata(fname);
 +
 
 +
% compute the JR3 DC offset from the first 2 log entries which are +-0.2 amps
 +
dc = (s.data(1,:) + s.data(2,:) )/2;
 +
 
 +
ndx = 1:length(s.data);
 +
 
 +
 
 +
bd_pos = s.data(ndx,1);
 +
current = s.data(ndx,2);
 +
qiq = s.data(ndx,3);
 +
ank_pos = s.data(ndx,4);
 +
lw = s.data(ndx,5);
 +
jr3z = s.data(ndx,8) - dc(8);  % apply DC correction, grab the Fz component
 +
jr3x = s.data(ndx,6) - dc(6); 
 +
jr3y = s.data(ndx,7) - dc(7); 
 +
whos
 +
 
 +
 
 +
 
 +
% sift the data, find the index positions where the current is a specific value
 +
ndx = find( current == 9.0);
 +
ndx2 = find( current == -9.0);
 +
 
 +
subplot(2,1,1);
 +
plot( bd_pos(ndx) , [jr3z(ndx), jr3z(ndx2)],'.'); grid on;
 +
legend('+9amps)','-9amps');
 +
title('Dependence of JR3 force on backdrive position (exp 121509)')
 +
ylabel('newtons')
 +
xlabel('back drive motor position');
 +
 
 +
 
 +
subplot(2,1,2);
 +
plot( bd_pos(ndx) , [lw(ndx), lw(ndx2)],'.'); grid on;
 +
legend('+9amps)','-9amps');
 +
title('Dependence of LW force on backdrive position (exp 121509)')
 +
ylabel('newtons')
 +
xlabel('back drive motor position');
 +
 
 +
 
 +
saveas(gcf, 'force_dependence_on_bd_posion_121509.png')
 +
</pre>

Latest revision as of 16:01, 17 December 2009

PF Users Navigation:

Edit

potential function

ltf_pf-2009_12_16.m

fname = 'static_test_experiment_log-20091216_1.txt';
s = importdata(fname);

% compute the JR3 DC offset from the first 2 log entries which are +-0.2 amps
dc = (s.data(1,:) + s.data(2,:) )/2;

ndx = 1:length(s.data);   % use full data set
bd_pos = s.data(ndx,1);
current = s.data(ndx,2);
qiq = s.data(ndx,3);
ank_pos = s.data(ndx,4);
lw = s.data(ndx,5);
jr3z = s.data(ndx,8) - dc(8);  % apply DC correction, grab the Fz component
jr3x = s.data(ndx,6) - dc(6);  
jr3y = s.data(ndx,7) - dc(7);  


ndx = find( bd_pos == -11000)
subplot(2,1,1);
plot(jr3z(ndx), ank_pos(ndx)/2048,'.'); grid on
title('Ak motor rotations, vs JR3 force at Bw=-11000, Imot=-9 : 9 amps')
ylabel('Ak motor rotations')
xlabel('JR3z force N')

subplot(2,1,2);
plot(lw(ndx), ank_pos(ndx)/2048,'.'); grid on
title('Ak motor rotations, vs LW force at Bw=-11000, Imot=-9 : 9 amps')
xlabel('LW force N (over 12 hrs)')
ylabel('Ak motor rotations')

ltf_bd_dep-121509.m

fname = 'static_test_experiment_log-121509.txt';
s = importdata(fname);

% compute the JR3 DC offset from the first 2 log entries which are +-0.2 amps
dc = (s.data(1,:) + s.data(2,:) )/2;

ndx = 1:length(s.data);


bd_pos = s.data(ndx,1);
current = s.data(ndx,2);
qiq = s.data(ndx,3);
ank_pos = s.data(ndx,4);
lw = s.data(ndx,5);
jr3z = s.data(ndx,8) - dc(8);  % apply DC correction, grab the Fz component
jr3x = s.data(ndx,6) - dc(6);  
jr3y = s.data(ndx,7) - dc(7);  
whos



% sift the data, find the index positions where the current is a specific value
ndx = find( current == 9.0);
ndx2 = find( current == -9.0);

subplot(2,1,1);
plot( bd_pos(ndx) , [jr3z(ndx), jr3z(ndx2)],'.'); grid on;
legend('+9amps)','-9amps');
title('Dependence of JR3 force on backdrive position (exp 121509)')
ylabel('newtons')
xlabel('back drive motor position');


subplot(2,1,2);
plot( bd_pos(ndx) , [lw(ndx), lw(ndx2)],'.'); grid on;
legend('+9amps)','-9amps');
title('Dependence of LW force on backdrive position (exp 121509)')
ylabel('newtons')
xlabel('back drive motor position');


saveas(gcf, 'force_dependence_on_bd_posion_121509.png')