Procedural Animating Question - Motor Movements

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Procedural Animating Question - Motor Movements // Archive: Tech Forum

1  |  

Post by tscorpio // Dec 26, 2007, 11:22am

tscorpio
Total Posts: 84
I've been working on an animation of a piston that turns a fly wheel.

I've got LE components that rotate the wheel and move the piston up and down, but I'm confused about the rod that connects the piston and wheel together - Since one end of it needs to follow the piston head movement and the other needs to follow the circular path of the wheel.

How do you set something like that up?


Thanks!

Post by jamesmc // Dec 26, 2007, 3:14pm

jamesmc
Total Posts: 2566
I've been working on an animation of a piston that turns a fly wheel.
I've got LE components that rotate the wheel and move the piston up and down, but I'm confused about the rod that connects the piston and wheel together - Since one end of it needs to follow the piston head movement and the other needs to follow the circular path of the wheel.
How do you set something like that up?

Thanks!


Understanding where your pivot points need to be is the key to understanding how to make this work.

The pivot point for the connection rod that is attached to the piston is the only pivot point that will be change.

It will be identical to the dead center mass pivot point of the piston.

The pivot point of the flywheel won't change (regardless of construction, mostly anyway.)

The far end of the rod arm that connects to the fly wheel will be placed on that portion of the fly wheel (depending on design) that actuates the rotation of that part of the arm that will pivot around the flywheel.

Here's a static image of the flash animation I made. of the piston (gray box) and the rod arm (red) and the fly wheel (black)

Notice in the animation the line connecting the text of the rod arm is black and changes angles depending on the piston. (angles are important if you want to design an accurate engineering of a piston set up.)

The fly wheel text line is green. Notice the Fly wheel angle never changes (except for that jump in the animation - sorry, too lazy to fix the jump.) :D

Notice the stroke end of the rod arm. It too also changes angles in relation to the fly wheel (again only important for accurate engineering)

The still image shows the assembly at top dead center. This is important in timing for combustion engines, like a car engine. Grease monkey auto mechanics will know what I mean.

Hope it's not too confusing, but I think the pivot point was confusing you. In the procedural part, I haven't worked that out as yet, but you definitely need to change the pivot points I imagine with the "Rock n' Roller Controller" as featured in tutorial video PACH11pt1 of the tutorial series.

I'll try to get back to you on the Procedural Animation part, but thought it was important to understand the concept of piston movement, just in case there was some confusion.

Post by stan // Dec 26, 2007, 4:30pm

stan
Total Posts: 1240
pic
http://forums1.caligari.com/truespace/showthread.php?t=1167 there is a piston and crank in this post that might help..

Post by tscorpio // Dec 26, 2007, 7:11pm

tscorpio
Total Posts: 84
I

m wondering if this would be a good canidate for IK linking and/or bones.

If it had a skeleton and I attach movement to the piston, would TS ripple movement through the rest of the objects?

Post by jamesmc // Dec 26, 2007, 7:26pm

jamesmc
Total Posts: 2566
You can use a skeleton to animate a piston/flywheel set up. However, you run across the problem with with constraints for the piston only moving up and down, the piston rod pointing at the right spot at the fly wheel and the pivot points not moving with the help of a "look at" object.

There was an example of how to do this on an old Animation Master Forum. Not sure if I can find that now though.

Post by jamesmc // Dec 26, 2007, 9:52pm

jamesmc
Total Posts: 2566
You can use a skeleton to animate a piston/flywheel set up. However, you run across the problem with with constraints for the piston only moving up and down, the piston rod pointing at the right spot at the fly wheel and the pivot points not moving with the help of a "look at" object.

There was an example of how to do this on an old Animation Master Forum. Not sure if I can find that now though.

A troubled attempt, will work on it when I have more sleep. :D

Post by stan // Dec 27, 2007, 6:31am

stan
Total Posts: 1240
pic
here is Norm's motor with one working piston, it will give you the stroke :D

it was shown at a scriptor's meeting awhile back..

Post by jamesmc // Dec 27, 2007, 7:08am

jamesmc
Total Posts: 2566
Ugh Stan, what was in Norm's script?

Had a copy of tS7.51 running after I did a new scene and exited trueSpace.

Then my system went to terminally slow, had to reboot. :confused:

Post by stan // Dec 27, 2007, 7:17am

stan
Total Posts: 1240
pic
nothing unusual..it doesn't cause any problems on my machine even closing ts7.51 with the script's timer running;)

Post by Norm // Dec 27, 2007, 8:11am

Norm
Total Posts: 862
pic
It is an expensive object cpu-wise. It takes 55% of my 3ghz. I have on my list of things-to-do, to reevaluate the scenario and try for a better way to script it.
Mostly the script is driven by sin and cos math. It was a wip at the time to see if it could be done. It comes close but is not perfect yet :)

Post by tscorpio // Dec 31, 2007, 4:01pm

tscorpio
Total Posts: 84
Hey Norn:

First of all, I *REALLY* like the model you did.


Secondly:

I have been dicecting your code and everything makes sense, but there are some constants in there that I can't figure out:


for example:

// create motion for connecting rod.

RodAngle = (Math.sin(inTime) * 10);//8);

conRod = daBoss + '/pistonAssy/connectingRod';

matrixR = Node.Value(conRod, 'Matrix');

matrixR.SetRoll(RodAngle);


How did you know that 10 should be used above for the rod angle calculation?

Post by Norm // Jan 2, 2008, 6:30am

Norm
Total Posts: 862
pic
That was trial and error to get the right number. You can see where I used 8 then commented it out and moved on to 10 as value. There is probably a better way to go about it but that scenario was as close as I could come at the time.

Post by jamesmc // Jan 2, 2008, 7:36am

jamesmc
Total Posts: 2566
Here's some scholarly articles on determining precise parameters of compression and hydraulic type piston driven devices.

Combustion engine formulae
http://hcs.harvard.edu/~jus/0303/kuo.pdf

Calculation of Piston Side Load on
Sanderson Pumps and Compressors


http://sandersonengine.com/Sanderson-CalculationOfPistonSideLoad.pdf

or in HTML

http://64.233.167.104/search?q=cache:fHDTW8C6cr8J:sandersonengine.com/Sanderson-CalculationOfPistonSideLoad.pdf+piston+rod+angle+c alculation&hl=en&ct=clnk&cd=9&gl=us&client=firefox-a


Kinematic Analysis of a Reciprocating Engine
http://www.rose-hulman.edu/Class/CalculusProbs/Problems/ENGINE/ENGINE.asc

Post by tscorpio // Jan 2, 2008, 12:08pm

tscorpio
Total Posts: 84
Over the Christmas break I tried to use the Law of Cosines to work out the angles. I gave it up though.

Now I'm thinking it must have been a error somewhere on my part. (And if you knew me you would wonder why I didn't think that sooner!!!)

I'm going to try to implement Law of Cosines again, probably this weekend. This time I'm sticking with VB scripting though.


The animation was just for practicing procedural animation, but now it's a programming challange for me!!!


And speaking of programming, could someone give an example of a procedure decliaration as it would appear in a library/module?

I tried "Public Sub SomeName(param1, param2)" but it didn't like it.

Post by tscorpio // Jan 6, 2008, 1:44pm

tscorpio
Total Posts: 84
Just an FYI If anybody is interested...


I got all my piston points worked out WhooHoo!!! It turns out I was wwwaaayyy over-complicating everything..


Here is a sample scene that uses it.

(be forwarned: It's messy)

Post by jamesmc // Jan 6, 2008, 2:04pm

jamesmc
Total Posts: 2566
I got an object inversion error and then a empty scene.

Post by GraySho // Jan 6, 2008, 11:42pm

GraySho
Total Posts: 695
pic
Load it from Model side and go to workspace, start timer in LE.


Nice work, might look into it in detail if I have need for it. Just one thing I see wrong. In a real engine, theres no joint in the con-rod, it's just one piece that's pivoted on the crankshaft and the piston.

Post by tscorpio // Jan 7, 2008, 5:01am

tscorpio
Total Posts: 84
Yea, I just modeled it that way because of the types of engines I like.

(Steam, Sterling, etc)


If you do look at it, the script computes various "x" and "y" positions because I worked everything out on paper (where x & y makes sense)

The way all the axis were orientated in TS, the numbers map to the XZ plane. In hindsight I sohuld have fixed my axis before doing any coding I guess.

Post by Norm // Jan 7, 2008, 8:07am

Norm
Total Posts: 862
pic
Very nice scenario :)
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn