ArmDynamic demo

[From Bruce Abbott (2014.03.18.1900 EDT)]

For those who may be interested in Bill’s muscle model, I’ve just uploaded a test program called ArmDynamic to my website, https://sites.google.com/site/perceptualcontroldemos/home . (Look under the page untitled “Other Demos”; the zip file is called “Armdynam.zip.” I’ve included the Delphi source code, the executable file (ArmDynamic.exe), and a brief paper in PDF format that explains the demo. You should be able to run the executable on a PC or a Mac running a suitable PC emulator.

This is the muscle model that was included in Bill’s “Arm2” (a.k.a. “Little Man 2) demo that was written in C. The demo was created by stripping out this bottom-level system from the Little Man 2 demo, converting it to Delphi code, and embedding it in a Main unit that handles all the user interfacing. (The ArmDynamic unit contains the muscle model and routines that set initial parameters for the model etc.)

Bill’s description of the Little Man 2 demo presented some calculus that would have to be converted to run as iterative numerical calculations when coded in a program. I’ve tried to understand the relevant code for the muscle model that was found in Little Man 2, but I must admit that I don’t understand how it works. Perhaps someone out there can enlighten me. For this purpose I’ve included in the zip file Bill’s 1999 paper that describes the model.

Bruce

[From Adam Matic 2014.03.19]

I’ve downloaded the code and the paper. I can’t find the function in question. Calculus converted to numerical calculations?

Adam

···

On Wed, Mar 19, 2014 at 12:06 AM, Bruce Abbott bbabbott@frontier.com wrote:

[From Bruce Abbott (2014.03.18.1900 EDT)]

For those who may be interested in Bill’s muscle model, I’ve just uploaded a test program called ArmDynamic to my website, https://sites.google.com/site/perceptualcontroldemos/home . (Look under the page untitled “Other Demos”; the zip file is called “Armdynam.zip.” I’ve included the Delphi source code, the executable file (ArmDynamic.exe), and a brief paper in PDF format that explains the demo. You should be able to run the executable on a PC or a Mac running a suitable PC emulator.

This is the muscle model that was included in Bill’s “Arm2” (a.k.a. “Little Man 2) demo that was written in C. The demo was created by stripping out this bottom-level system from the Little Man 2 demo, converting it to Delphi code, and embedding it in a Main unit that handles all the user interfacing. (The ArmDynamic unit contains the muscle model and routines that set initial parameters for the model etc.)

Bill’s description of the Little Man 2 demo presented some calculus that would have to be converted to run as iterative numerical calculations when coded in a program. I’ve tried to understand the relevant code for the muscle model that was found in Little Man 2, but I must admit that I don’t understand how it works. Perhaps someone out there can enlighten me. For this purpose I’ve included in the zip file Bill’s 1999 paper that describes the model.

Bruce

[From Bruce Abbott (2014.03.19.0840 EDT)]

Adam Matic 2014.03.19 –

AM: I’ve downloaded the code and the paper. I can’t find the function in question. Calculus converted to numerical calculations?

BA: They are in the ArmDynamic.pas unit. The major stumbling block for me are some of the computations in procedure Evaluate, which evaluates the effects of the three joint torques on the physical “plant”:

procedure evaluate(torque0,torque1,torque2: double);

var

co1,co2,co3,si1,si2,si3, c1c1,c1s3,c3c1,c3c3,s1c1,s1c3,s3c3: double;

a0,b0,a1,b1,c1,a2,b2,c2,denom: double;

begin // t0 = shoulder x

co1 := cos(t1); // t1 = shoulder y

co2 := cos(t2); // t2 = elbow y

si1 := sin(t1);

si2 := sin(t2);

si3 := si1co2 + co1si2;

co3 := co1co2 - si1si2;

c1c1 := co1 * co1;

c1s3 := co1 * si3;

c3c1 := co3 * co1;

c3c3 := co3 * co3;

s1c1 := si1 * co1;

s1c3 := si1 * co3;

s3c3 := si3 * co3;

// make coefficients*/

a0 := ( I0 + q1c1c1 + 2.0q2c3c1 + q3c3c3 ); //t0ddot

b0 := -2.0 * t0dot * ((q1s1c1 + q2s1c3 + q3s3c3) t1dot

+(q2c1s3 + q3s3c3) * t2dot);

a1 := q1 + 2.0q2co2 + q3;

b1 := q2*co2 + q3;

c1 := (q1s1c1 + q2(s1c3-c1s3) + q3*s3c3) * t0dot * t0dot

-q2si2t2dot*(t2dot + 2.0 * t1dot)

  • g1co1 + g2co3;

a2 := b1;

b2 := q3;

c2 := (q2c1s3 + q3s3c3) * t0dot*t0dot

  • q2 * si2 * t1dot * t1dot

  • g2*co3;

denom := (a1b2 - a2b1);

t0ddot := (torque0 - b0) / a0;

t0dot := t0dot + t0ddot*dt0;

t0 := t0 + t0dot*dt0;

t1ddot := ( (b2torque1 - b1torque2) - (b2c1 - b1c2) ) / denom;

t1dot := t1dot + t1ddot*dt0;

t1 := t1 + t1dot*dt0;

t2ddot := ( (a1torque2 - a2torque1) - (a1c2 - a2c1) ) / denom;

t2dot := t2dot + t2ddot*dt0;

t2 := t2 + t2dot*dt0;

//if (t2 < 0.0) then t2 := 0.0;

end;

BA: The three sets of lines at the end compute the angular acceleration, angular velocity, and angle for each of the three joints, that much I do understand. But I’m having trouble figuring out what all those constants represent in the model (a0, b0, etc.).

Bruce