treat muscles pairwise.
for each pair, read FSR value from each side of pair calculate new delta for output value apply positive delta to one side, negative to the other. if delta is less than threshold, increment sleep counter. if sleep counter is higher than threshhold, set muscle output to 0, go to sleep.
for each pair read FSR value if value is higher than threshold, wake up / otherwise, set muscle output to 0 (if it isn't already).
delta depends on four values:
Mx==
0 is maximum extension
Mx==
1 is maximum retraction
Fx==
0 is no force
Fx==
1 is maxumum force
delta consists of three components which are added to M1 (and subtracted from M2) )
d1 = (F1-F2) increase M1 (back off) proportionally if F1 is greater than F2
d2 = (0.5-M1) increase M1 proportionally if M1 is less than 0.5
d3 = ((1-M2)-M1) increase M1 proportionally if M1 is less than 1-M2
the three delta components are multiplied by three coefficients and applied to M1 and M2:
M1 and M2 are clipped to [0,1] and stored as 'current output value'.
before sending as output values, M1 and M2 are scaled to [0,100].
if c1 is too high, the muscles will bounce away when touched, when it is too low the muscles will be hard to move.
c2 should affect how firm the surface is. if it is high, it will be hard to move the musles beyond the midpoint. if it is low, impressions will fade away very slowly.
so..
M = M + (d1*c1 + d2*c2)
M = fmin(fmax(M,0),1);
M1 is set to M*100;
M2 is set to (1-M)*100;
i think the force effect of the membrane can generally be ignored. if the membrane is exerting a big force, then reduce c2. if the force is very strong, perhaps making c2 slightly negative to compensate, but this is very risky. probably better to increase c1 to make users artificially stronger.
delta_x = (s1 - s2) * (delta_t / tau)
where
y = y0 + dy + (T_Samp / T_Relax) * (0.5 - y0)
where
–pix - 09 Apr 2005