PDA

View Full Version : Ball - Ball Collisions

Isshin
01-22-2008, 09:21 AM
Hello, I am a pretty big pool fan and as I have some time off I have been attempting to code a pool simulation. I am currently at the hardest point, ball to ball collisions. There is a lot of information around this subject however most of it deals with only one moving ball or no ball - ball friction or only in 1D. I am trying to write it generally to allow for 2D movement (no jump shots) and 3D angular velocity.

I have been going over Marlow's book again and again which is good but not terribly useful for a practical implementation. There is a section on general collision but there was one thing that feels like it should be simple but I just can't seem to workout. He has listed the collision force as F_0 (where _ represents subscript) and as we know from Newton's third law of motion is equal and opposite on the two balls. How would I find this force?

Also, if anyone does know of any good resources for dealing with collisions and the resultant linear and angular velocities that looks into more than just a simple case that would be fantastic.

Sorry for the long winded request, any help is much appreciated.

Jal
01-22-2008, 01:02 PM
Welcome Isshin,

You can find just about everything you need at Dr. Dave's website. Dr. Dave is a professor of mechanical engineering and a regular poster to this forum. His website is here:

http://billiards.colostate.edu/

Look in his technical proofs section. Several of them deal with ball/ball collision. He also has links to more info in his physics resources section, which is the last entry on his opening page. The following deals with the ball/ball force, but it may be more than you need or want to know:

http://www.oxfordcroquet.com/tech/gugan/index.asp

Putting some of this together for the purpose of programming a simulation was discussed here (http://www.billiardsdigest.com/ccboard/showflat.php?Cat=&amp;Board=ccb&amp;Number=224305&amp;page=&amp;vi ew=&amp;sb=&amp;o=&amp;fpart=1&amp;vc=1)

That's a lot of material to go through. If you have a specific question, perhaps someone can answer it directly.

Jim

Isshin
01-22-2008, 03:35 PM
Wow, that thread looks absolutely amazing. Tailuge even went about it in the same way as I am doing, using an event based system that works with quartic equations. I'm gooing to give it a good look through, I can't thank you enough. Incidently, when you say in that thread that you can't understand c++ it is the opposite for me, I can understand c++ fine it's just understanding all these maths papers that just assume you know everything is impossible for me.

It's a shame it seems that the thread came to an end.

Bob_Jewett
01-22-2008, 04:32 PM
<blockquote><font class="small">Quote Isshin:</font><hr> Hello, I am a pretty big pool fan and as I have some time off I have been attempting to code a pool simulation. I am currently at the hardest point, ball to ball collisions. ...<hr /></blockquote>
Ball-ball collisions are slightly complicated, but not nearly as hard to simulate as ball-cushion.

I urge you to get a copy of Virtual Pool or one of it's versions. They have done a very good job of getting the physics right, including such things as throw, squirt and jump shots. You can contact the lead developer through celeris.com.

BTW, VP models ball-ball collisions as instantaneous. That means that in general the "ten times fuller" system, which applies when three balls are in contact simultaneously, will not be simulated correctly. I think that to be fully accurate, you need to implement Hertz's law with fine time steps.

VP also models ball-rail collisions as instantaneous and non-penetrating. That means that some standard trick shots can't be simulated accurately.

Isshin
01-22-2008, 05:55 PM
I have Virtual Pool 3, it's pretty amazing (even with the faults you list)

Nice to know that what I thought would be hardest isn't... Have cushions to look forward to!

I realize that collisions are not instantaneous, but I can't think of any easy way of dealing with that fact. It is probably beyond my abilities. I mean after all if a professional games development company decided it wasn't feasable I'm not sure what chance I have really.

Jal
01-22-2008, 07:46 PM
<blockquote><font class="small">Quote Isshin:</font><hr> Wow, that thread looks absolutely amazing. Tailuge even went about it in the same way as I am doing, using an event based system that works with quartic equations. I'm gooing to give it a good look through, I can't thank you enough. Incidently, when you say in that thread that you can't understand c++ it is the opposite for me, I can understand c++ fine it's just understanding all these maths papers that just assume you know everything is impossible for me.

It's a shame it seems that the thread came to an end. <hr /></blockquote>Isshin, I've learned a little bit more since that thread. Some of it needs to be revised; the correction for the inelasticity of the stick/ball collision, for instance. I don't know how realistic a simulation you're shooting for, but if you want to include stick/ball inelasticity for any reason, see Dr. Dave's TP A.30.

I've done some more work on how an actual physical point on a ball changes latitude (latitude relative to a pole of its spin axis) under the influence of a spin changing torque. But it is not a simple formula and you would only need to include something like this for cosmetic purposes; it doesn't matter as far as the physics of ball trajectories and spins are concerned.

I also have a better math model for a cushion collision. But I never actually fired the program up and tested it against measurements. There are more things to be learned, particularly the degree of cushion "throwback" which is caused by an uneven distribution of pressures in the rubber.

For ball/ball collisions, a poster here, "Cushioncrawler", has data on how the coefficient of restitution changes with the collision speed. He's shared it with me and may not object to sharing it with you.

Good luck and don't hesitate to inquire about anything. But you could get swamped with endless detail if you listen to us too much. /ccboard/images/graemlins/smile.gif

Jim

Bob_Jewett
01-23-2008, 12:19 PM
<blockquote><font class="small">Quote Isshin:</font><hr> ... I realize that collisions are not instantaneous, but I can't think of any easy way of dealing with that fact. ... <hr /></blockquote>
The method is fairly simple but it is a lot of work. Just keep track of all the forces on the balls and do the time integral of those forces to find the torque and acceleration of the balls. The result is the instantaneous spin and velocity of each ball at each time step and that gives the location as a function of time. Ball-ball collisions can be handled in the same way but the time steps must be a lot smaller during those collisions, since the contact takes place in about 200 microseconds.

wolfdancer
01-23-2008, 12:35 PM
At least the ball/pin collisions there are not governed by any laws of physics, and the big concern is striking in the beer frame.

BigRigTom
01-23-2008, 01:34 PM
At least the ball/pin collisions there are not governed by any laws of physics, and the big concern is striking in the beer frame. <hr /></blockquote>

Not really but it might seem that way.

AAAAHHHHHH the memories of those beer frames (but then again I don't remember them all only a few and I don't rightly know if it is because of the number of beers or the number of years!).

When I lived in the Chicago area I bowled a lot!

At one time I was on 4 different leagues then watched bowling on TV on the weekends and usually practiced at least once per week. I belonged to 3 mixed and 1 mens leagues, I got so burned out that on the last night of the last league of that season I left my bag (shoes, glove, towel and all) at the end of the bar and never went back for it.

Several years later I bought everything new but have never got totally obsessed with the game again. My wife says I am that way with everything and that it is pool right now. I don't see losing my interest in pool though, I love the game too much!

wolfdancer
01-23-2008, 01:48 PM
I bowled for years,but doubt I would enjoy it today...I'd rather play pool. I remembered that a local legend was Allie Brandt (Allie/Alley, and easy mnemonic) and just Googled him. Also now remember from the mention in the article that I saw Glenn Allison roll a perfect game on an old TV show...first one I had ever seen.
I mentioned this before, but i bought my first bowling ball, in Cleveland at Newman-Sterns...on credit, at \$2 a week payments. Newman was Paul Newman's Dad, and I think Paul came home from Hollywood to drill the ball for me
/ccboard/images/graemlins/grin.gif /ccboard/images/graemlins/grin.gif

Isshin
01-23-2008, 02:31 PM
<blockquote><font class="small">Quote Jal:</font><hr>
I don't know how realistic a simulation you're shooting for, but if you want to include stick/ball inelasticity for any reason, see Dr. Dave's TP A.30.
<hr /></blockquote>

Ultimately the level of realism depends on how quickly I can get through things. In a couple of months I will be too busy to work on it anymore and so this is very much a short term project. But even if I can't include it I'd love to hear about what you have worked on, if you have the time.

<blockquote><font class="small">Quote Bob_Jewett:</font><hr>
The method is fairly simple but it is a lot of work. Just keep track of all the forces on the balls and do the time integral of those forces to find the torque and acceleration of the balls. The result is the instantaneous spin and velocity of each ball at each time step and that gives the location as a function of time. Ball-ball collisions can be handled in the same way but the time steps must be a lot smaller during those collisions, since the contact takes place in about 200 microseconds. <hr /></blockquote>

The way I am doing it at the moment is by precalculation. The entire shot is calculated and stored as a list of events which is played back afterwards. This means that when it is played back the collision would have to be treated as instantaneous. I think it would be possible to modify the current system a bit to allow for proper collisions but I am not sure I have enough time to implement it.

dr_dave
01-23-2008, 04:11 PM
<blockquote><font class="small">Quote BigRigTom:</font><hr> <blockquote><font class="small">Quote wolfdancer:</font><hr> Jim, after reading this thread.....I have a headache, plan to pawn my cue, and take up bowling instead.
At least the ball/pin collisions there are not governed by any laws of physics, and the big concern is striking in the beer frame. <hr /></blockquote>

Not really but it might seem that way.

AAAAHHHHHH the memories of those beer frames (but then again I don't remember them all only a few and I don't rightly know if it is because of the number of beers or the number of years!).

When I lived in the Chicago area I bowled a lot!

At one time I was on 4 different leagues then watched bowling on TV on the weekends and usually practiced at least once per week. I belonged to 3 mixed and 1 mens leagues, I got so burned out that on the last night of the last league of that season I left my bag (shoes, glove, towel and all) at the end of the bar and never went back for it.

Several years later I bought everything new but have never got totally obsessed with the game again. My wife says I am that way with everything and that it is pool right now. I don't see losing my interest in pool though, I love the game too much! <hr /></blockquote>I love both pool and bowling. I've bowled in leagues since I was about 6. I must admit that bowling at a top level is much easier than pool at a top level. Bowling is much more forgiving; and, unlike with pool, equipment can make a huge difference.

Regards,
Dave

Jal
01-24-2008, 05:46 PM
<blockquote><font class="small">Quote Bob_Jewett:</font><hr> ...BTW, VP models ball-ball collisions as instantaneous. That means that in general the "ten times fuller" system, which applies when three balls are in contact simultaneously, will not be simulated correctly. I think that to be fully accurate, you need to implement Hertz's law with fine time steps.<hr /></blockquote>I'm not sure how using Hertz law and doing a numerical integration would gain you anything. The 10X fuller system works the way it does because there is more energy loss associated with the 1-(2,3) collision than with the (1,2)-3 collision, where (i,j) means treating balls i and j as a unit system. (I don't mean treating it as sequential collisions.) If a program assumed no energy loss with either aspect of the combined collision, then it should report that ball 2 heads off at 90 degrees to the line of centers between balls 2 and 3. How would you know what to assign for the respective losses, or how to compute it, other than using measurements?

In general, ie, collisions involving just two balls, measured values of the coefficient of restitution as a function of velocity along the impact line should be sufficient to yield pretty accurate simulations. No?

Jim

Bob_Jewett
01-24-2008, 05:59 PM
<blockquote><font class="small">Quote Jal:</font><hr> ... I'm not sure how using Hertz law and doing a numerical integration would gain you anything. The 10X fuller system works the way it does because there is more energy loss associated with the 1-(2,3) collision than with the (1,2)-3 collision, where (i,j) means treating balls i and j as a unit system. ... <hr /></blockquote>
No.

If you do the integration of three balls colliding in-line with two of them frozen, and with no energy loss, you do not get the obvious result of the last ball emerging with all the energy and momentum. Instead, the middle ball ends up moving forward and the cue ball ends up bouncing back. This result is, as I said, for no energy loss and occurs for using either Hooke's Law or Hertz's Law for the force between the balls during the collision.

This result is not intuitive.

mikepage
01-25-2008, 07:17 AM
<blockquote><font class="small">Quote Bob_Jewett:</font><hr> <blockquote><font class="small">Quote Jal:</font><hr> ... I'm not sure how using Hertz law and doing a numerical integration would gain you anything. The 10X fuller system works the way it does because there is more energy loss associated with the 1-(2,3) collision than with the (1,2)-3 collision, where (i,j) means treating balls i and j as a unit system. ... <hr /></blockquote>
No.

If you do the integration of three balls colliding in-line with two of them frozen, and with no energy loss, you do not get the obvious result of the last ball emerging with all the energy and momentum. Instead, the middle ball ends up moving forward and the cue ball ends up bouncing back. This result is, as I said, for no energy loss and occurs for using either Hooke's Law or Hertz's Law for the force between the balls during the collision.

This result is not intuitive. <hr /></blockquote>

All right, now this discussion is getting downright creepy

Jal
01-25-2008, 11:34 AM
<blockquote><font class="small">Quote mikepage:</font><hr> <blockquote><font class="small">Quote Bob_Jewett:</font><hr> <blockquote><font class="small">Quote Jal:</font><hr> ... I'm not sure how using Hertz law and doing a numerical integration would gain you anything. The 10X fuller system works the way it does because there is more energy loss associated with the 1-(2,3) collision than with the (1,2)-3 collision, where (i,j) means treating balls i and j as a unit system. ... <hr /></blockquote>
No.

If you do the integration of three balls colliding in-line with two of them frozen, and with no energy loss, you do not get the obvious result of the last ball emerging with all the energy and momentum. Instead, the middle ball ends up moving forward and the cue ball ends up bouncing back. This result is, as I said, for no energy loss and occurs for using either Hooke's Law or Hertz's Law for the force between the balls during the collision.

This result is not intuitive. <hr /></blockquote>

All right, now this discussion is getting downright creepy <hr /></blockquote>You can say that again. In fact, I have no idea why I made those assertions, especially since I did do the numeric integration a few years ago, and some math just before making those statements that in no way suggests that it's the result of energy loss. I'll have to see what my exorcist has to say about all of this.

But what do you mean by "creepy".

Jim