🔒 Locked
Hinge physics
Advertisement
Original Post
I'm trying to understand how a physics engine would handle something like an impulse on one end of a frictionless hinge that causes the hinge to slowly open. Like if you fling open a pair of scissors, how they "lock" when they open as far as they can, and some of your opening force causes them to want to fly out of your hands. Hope that makes sense. At first a force would cause one end of the hinge to rotate, before the hinge "locks" at its max angle. I'm guessing that the force would also be applied to the hinge's center of mass to impart translational momentum(?). Would it impart any rotation to the hinge as a whole? Or is the hinge as a whole not considered a rigid body until it "locks"? A few time steps later, the hinge "locks" as the angle gets too large. The energy from the relative movement of one side of the hinge needs to go somewhere. Depending on the nature of the materials, the hinge either "bounces", causing the hinge to slowly close again (which side of the hinge starts rotating again? My intuition tells me the opposite side that was moving before), or it totally freezes, like an inelastic collision. If it freezes, then I'm thinking the energy gets imparted to the hinge as a whole, causing it to rotate (and maybe translate?). I'd like someone who understand these things to run through the different reactions going on and the (kinematic) math behind them.
If you flick open a pair of scissors, several things happen.
#1 the scissors are given linear momentum.
#2 the free arm of the scissors is given an angular momentum
While the arm is moving:
#3: Heat is lost due to friction
When the arm stops:
#4: Heat is lost due to the collision
#5: Momentum is transferred to the fixed arm (the one you're holding) which is lost due to resistance from the person holding it. (Not really lost, but effectively lost to the system-known-as-scissors.)
Friction tends to be significant with scissors, because it provides better control. Also, many pairs seem to be more resistant to motion towards their maximum angle; this is why you get locking.
When the scissors stop:
#6: A linear momentum is introduced opposite to the direction of motion
#7: Because overall motion is resisted by the person holding the scissors, much of the momentum that is left after the scissors stop moving will translate into an angular momentum in the free arm.
#8: Unless you have cheap or loose scissors, the resulting motion will be fairly minimal due to friction.
#9: Time to cut snowflakes.
#1 the scissors are given linear momentum.
#2 the free arm of the scissors is given an angular momentum
While the arm is moving:
#3: Heat is lost due to friction
When the arm stops:
#4: Heat is lost due to the collision
#5: Momentum is transferred to the fixed arm (the one you're holding) which is lost due to resistance from the person holding it. (Not really lost, but effectively lost to the system-known-as-scissors.)
Friction tends to be significant with scissors, because it provides better control. Also, many pairs seem to be more resistant to motion towards their maximum angle; this is why you get locking.
When the scissors stop:
#6: A linear momentum is introduced opposite to the direction of motion
#7: Because overall motion is resisted by the person holding the scissors, much of the momentum that is left after the scissors stop moving will translate into an angular momentum in the free arm.
#8: Unless you have cheap or loose scissors, the resulting motion will be fairly minimal due to friction.
#9: Time to cut snowflakes.
That sounds about right. Would you mind running over the math involved? Especially in the case where there isn't anyone holding the scissors and they're just free floating. And doubly especially in the case where the hinge joint isn't at the center of mass.
[Edited by - Numsgil on June 20, 2007 9:37:40 AM]
[Edited by - Numsgil on June 20, 2007 9:37:40 AM]
Okay, I have some pictures. Let's suppose I have two rigid bodies connected by a hinge at their far ends, aligned parallel. My physics engine doesn't store any information about this system as a whole, it just remembers the linear and angular momentum and positions/orientations of the two bodes. Suppose a force is applied to the blue body so that it'll be given maximum torque to open the hinge. It looks like this:

First, I think you apply the force to the linear momentum of both bodies, regardless of where the force was actually applied. Is this right? I'm thinking that the hinge joint forces the bodies to remain in close contact, so it'll translate any linear forces to any connected bodies.
Second you apply torque to the blue body about its center of mass (let's assume its center of mass is its geometric center). I don't know if any torque gets applied to the red body by the hinge trying to maintain the position between them.
After rotating for a while, the blue body extends as far as the hinge allows, and causes the jointto "lock". It looks something like this:

I don't really know where different forces end up being applied. Untuitively, if the hinge's locking is elastic, I imagine all the rotational momentum of the blue body would get transfered to the red body. If the locking is inelastic, the two body's angular rotation is equalized, so they rotate at the same speed. In this regard the hinge acts as something like a collision point. I can't figure out if any change in the linear momentum would occur.
I'd really appreciate a physics guru working out where and what forces are at work in something like this.
[Edited by - Numsgil on June 21, 2007 12:54:04 PM]

First, I think you apply the force to the linear momentum of both bodies, regardless of where the force was actually applied. Is this right? I'm thinking that the hinge joint forces the bodies to remain in close contact, so it'll translate any linear forces to any connected bodies.
Second you apply torque to the blue body about its center of mass (let's assume its center of mass is its geometric center). I don't know if any torque gets applied to the red body by the hinge trying to maintain the position between them.
After rotating for a while, the blue body extends as far as the hinge allows, and causes the jointto "lock". It looks something like this:

I don't really know where different forces end up being applied. Untuitively, if the hinge's locking is elastic, I imagine all the rotational momentum of the blue body would get transfered to the red body. If the locking is inelastic, the two body's angular rotation is equalized, so they rotate at the same speed. In this regard the hinge acts as something like a collision point. I can't figure out if any change in the linear momentum would occur.
I'd really appreciate a physics guru working out where and what forces are at work in something like this.
[Edited by - Numsgil on June 21, 2007 12:54:04 PM]
A force applied to the blue body will cause a change in momentum. If you take a vector R that points from the center of mass of the blue body to the point where the force is applied to the blue body, then you can find the angular and linear components of the momentum.
The vector F proj R will be the force that changes linear momentum. Everything else will become angular momentum.
Now the new motion of the blue body will pull on the hinge. and through that the red body. It's the same process as before, except the point of force is at the axis of rotation for the hinge.
This inverse vector of this force will also be applied to the blue body, from the same point. Equal-and-opposite and all.
Lastly, the hinge may or may not have constraints, friction, or a spring effect. After you calculate how the red and blue bodies have moved, it's time to act on those.
And, unless I'm missing something glaring, that should be it. Maybe there's collision forces, or gravity, or whatever else you want to apply, be this is the basic idea.
The vector F proj R will be the force that changes linear momentum. Everything else will become angular momentum.
Now the new motion of the blue body will pull on the hinge. and through that the red body. It's the same process as before, except the point of force is at the axis of rotation for the hinge.
This inverse vector of this force will also be applied to the blue body, from the same point. Equal-and-opposite and all.
Lastly, the hinge may or may not have constraints, friction, or a spring effect. After you calculate how the red and blue bodies have moved, it's time to act on those.
And, unless I'm missing something glaring, that should be it. Maybe there's collision forces, or gravity, or whatever else you want to apply, be this is the basic idea.
Quote:
Original post by erissian
The vector F proj R will be the force that changes linear momentum. Everything else will become angular momentum.
I've seen this said alot recently, but everything I read says that this idea is wrong. If this is indeed the right way to do it, I'd really appreciate someone explaining to me why all the literature says something different. To quote from Chris Hecker's rigid body introduction, part 1, page 5 last paragraph (clicky):
Quote:
...we can treat all the forces acting on our rigid body as if their vector sum is acting on a point at the center of mass with the mass of the entire body. We divide a force (say, gravity) by M to find the acceleration of the center of mass, and then we integrate that acceleration over time to get the velocity and position of our body. Note that Eq. 11 doesn't contain any information about where the forces were applied to the body. That information drops out when dealing with linear momentum and the center of mass, and we just apply all forces to the CM to find its acceleration.
(bolds added for emphasis).
Quote:
Now the new motion of the blue body will pull on the hinge. and through that the red body. It's the same process as before, except the point of force is at the axis of rotation for the hinge.
I've been thinking about it; tell me if this would work. If I model the hinge as an inelastic collision occurring every frame between the two points connected by the hinge, that should keep the velocities of points connected by the hinge in-sync. I'd still probably need to constrain the positions due to numerical issues, but let's ignore that for a moment. Let's also assume that forces get integrated before any constraints or collisions occur.
Would this way of modelling the hinge produce correct results without skipping over any details? Would it accurately handle both the linear and angular changes in momentum for both bodies? It's obviously missing details on how to handle what happens when the hinge locks, but I feel like it should neatly handle the initial movement of the hinge as it opens.
Of course, it's probably not the best way, because you're allowing the hinge constraint to be violated as you integrate the force, and then later go back and correct it. A better solution would to be apply the force intelligently as both linear force and angular torque to both bodies during the integration step, so that only minimal post integration touch-ups need to be used. But I could see this method maybe getting out of hand as the number of bodies joined together increases. Imagine a force being applied to a body that's part of a 50 hinge system. The program would need to explore some sort of connectivity graph to distribute the force before integrating it.
Still, I'd appreciate it if someone would show me the math behind this sort of method.
Quote:
This inverse vector of this force will also be applied to the blue body, from the same point. Equal-and-opposite and all.
This doesn't make any sense to me. If you apply the opposite force to the blue body at the same point as well, the two cancel each other out and you get no net movement whatsoever. Surely you meant that there's an equal-but-opposite force applied to the agent causing the force in the first place? But then, that's not really part of the hinge system, so we don't have to worry about it, right?
------------------------------------------
I think I see how to handle the initial opening of the hinge. But the locking still baffles me. Untuitively I sense that I could model the locking as a collision in some way, or something similar to a collision.
After some research, I've found references to a cheap method that uses an invisible rope placed between the two ends of the hinge so that when the hinge opens too far, the rope stretches taut. But this method requires you to recalculate the length of the rope when your hinge length changes. It also doesn't handle the case where the hinge opens so fast its managed to come back around the far side (that is, it locks at 290 degrees instead of 70 degrees).
Maybe taking the simple equations for linear collision with no angular momentum, and using them as angular equations. The angular distance becomes analagous to displacement, with angular distance causing a collision if it crosses a threshold. Restorative forces would act directly on the angular reference frames of both bodies, entirely sidestepping issues of torque.
That should fix the issue that the invisible rope has with potentially locking at two different angles, but I'll need to check over the math to see if it's right.
Quote:
Original post by Numsgil Quote:
Original post by erissian
The vector F proj R will be the force that changes linear momentum. Everything else will become angular momentum.
I've seen this said alot recently, but everything I read says that this idea is wrong. If this is indeed the right way to do it, I'd really appreciate someone explaining to me why all the literature says something different. To quote from Chris Hecker's rigid body introduction, part 1, page 5 last paragraph (clicky):Quote:
...we can treat all the forces acting on our rigid body as if their vector sum is acting on a point at the center of mass with the mass of the entire body. We divide a force (say, gravity) by M to find the acceleration of the center of mass, and then we integrate that acceleration over time to get the velocity and position of our body. Note that Eq. 11 doesn't contain any information about where the forces were applied to the body. That information drops out when dealing with linear momentum and the center of mass, and we just apply all forces to the CM to find its acceleration.
(bolds added for emphasis).
I'll address this first and then get to reading the rest of your post.
What I suggested is not applying the force to the center of mass, but applying the force to some point on the body - any point. You can then discriminate between what causes angular motion and what causes linear motion by projecting the force vector onto the vector that is the defined by the difference between said point and the center of mass.
Center of mass works in, but is not what I meant when I was describing vector R.
Okay, I think I have a workable solution, but I'd still like to work out "best" solution I outlined above.
When not locked, the hinge acts as an inelastic collision point between the bodies every frame. This keeps the angular and linear velocities of the bodies agreeing with each other enough to keep the bodies mostly together. A position constraint also exists to keep the bodies from drifting apart.
When the hinge locks, it acts like a simple linear momentum collision except using angular velocity instead of linear velocity. We can use equations like those presented here (except with the linear velocities replaced with angular velocities, and masses replaced by angular inertia) to kinematically change the angular momentum of the joined bodies.
My reasoning for the correctness of this step:
1. The equations for collisions using only linear momentum are based on the conservation of linear momentum and conservation of energy. Both principles hold for the angular cases as well.
2. No linear momentum changes happen when the hinge locks.
I'd really appreciate someone commenting on the correctness of this algorithm. I'd also appreciate any hints on solving the application of the initial force so that the hinge's position and velocity constraints aren't violated during the integration step.
When not locked, the hinge acts as an inelastic collision point between the bodies every frame. This keeps the angular and linear velocities of the bodies agreeing with each other enough to keep the bodies mostly together. A position constraint also exists to keep the bodies from drifting apart.
When the hinge locks, it acts like a simple linear momentum collision except using angular velocity instead of linear velocity. We can use equations like those presented here (except with the linear velocities replaced with angular velocities, and masses replaced by angular inertia) to kinematically change the angular momentum of the joined bodies.
My reasoning for the correctness of this step:
1. The equations for collisions using only linear momentum are based on the conservation of linear momentum and conservation of energy. Both principles hold for the angular cases as well.
2. No linear momentum changes happen when the hinge locks.
I'd really appreciate someone commenting on the correctness of this algorithm. I'd also appreciate any hints on solving the application of the initial force so that the hinge's position and velocity constraints aren't violated during the integration step.
Quote:
Original post by erissian
What I suggested is not applying the force to the center of mass, but applying the force to some point on the body - any point. You can then discriminate between what causes angular motion and what causes linear motion by projecting the force vector onto the vector that is the defined by the difference between said point and the center of mass.
What Hecker's article says is that it doesn't even matter where you apply the force, because it never factors into the equations for the linear frame of reference. That is, applying a force to the objects center of mass and applying a force to its furthest away point are exactly the same for the object. No projecting the force onto any vectors. They cause different angular accelerations, but not different linear ones. You just take the raw force and apply it to the center of mass.
Ok, that was point 1.
Point 2, in regards to intelligently applying forces:
Everything is done in steps. That's just our problem here; we know what needs to happen, but in what order? How do you calculate it? Can we break down several things happening at once in order to simulate it accurately? My quip with this method is that it doesn't really integrate anything smoothly; it assumes a constant acceleration throughout the frame. I tend to use an iterative process to come closer to the right answer, but I would rather get all the way through this and then find places to make it nicer.
Point 3 (equal-and-opposite):
The objects do not separate from the hinge, ever. Therefore, no force can be exerted which could cause that, so no forces can be exerted through the hinge. Except we need that to happen; or else nothing happens to the red body. That means that whatever force we use on the red body, through the hinge, we need to exert (in the opposite direction) against the blue body, also through the hinge. The net effect is that the two bodies do not translate away from the hinge; although the may both rotation around it.
Point 4 (locking) :
Locking is either a mechanical process or due to extreme friction at certain angles intrinsic to the type of hinge. When you calculate the frictional force of the hinge, or try to allow any rotation of the hinge, you would implement this.
Point 2, in regards to intelligently applying forces:
Everything is done in steps. That's just our problem here; we know what needs to happen, but in what order? How do you calculate it? Can we break down several things happening at once in order to simulate it accurately? My quip with this method is that it doesn't really integrate anything smoothly; it assumes a constant acceleration throughout the frame. I tend to use an iterative process to come closer to the right answer, but I would rather get all the way through this and then find places to make it nicer.
Point 3 (equal-and-opposite):
The objects do not separate from the hinge, ever. Therefore, no force can be exerted which could cause that, so no forces can be exerted through the hinge. Except we need that to happen; or else nothing happens to the red body. That means that whatever force we use on the red body, through the hinge, we need to exert (in the opposite direction) against the blue body, also through the hinge. The net effect is that the two bodies do not translate away from the hinge; although the may both rotation around it.
Point 4 (locking) :
Locking is either a mechanical process or due to extreme friction at certain angles intrinsic to the type of hinge. When you calculate the frictional force of the hinge, or try to allow any rotation of the hinge, you would implement this.
Quote:
Original post by Numsgil Quote:
Original post by erissian
What I suggested is not applying the force to the center of mass, but applying the force to some point on the body - any point. You can then discriminate between what causes angular motion and what causes linear motion by projecting the force vector onto the vector that is the defined by the difference between said point and the center of mass.
What Hecker's article says is that it doesn't even matter where you apply the force, because it never factors into the equations for the linear frame of reference. That is, applying a force to the objects center of mass and applying a force to its furthest away point are exactly the same for the object. No projecting the force onto any vectors. They cause different angular accelerations, but not different linear ones. You just take the raw force and apply it to the center of mass.
So how then, do you propose to determine the angular component of the force?
Quote:
Original post by erissian Quote:
Original post by Numsgil Quote:
Original post by erissian
What I suggested is not applying the force to the center of mass, but applying the force to some point on the body - any point. You can then discriminate between what causes angular motion and what causes linear motion by projecting the force vector onto the vector that is the defined by the difference between said point and the center of mass.
What Hecker's article says is that it doesn't even matter where you apply the force, because it never factors into the equations for the linear frame of reference. That is, applying a force to the objects center of mass and applying a force to its furthest away point are exactly the same for the object. No projecting the force onto any vectors. They cause different angular accelerations, but not different linear ones. You just take the raw force and apply it to the center of mass.
So how then, do you propose to determine the angular component of the force?
Again, pulling from Hecker's site clicky (check out page 7, "The Dynamics Algorithm")
Quote:
3. Figure out all of the forces on
the body, including their points of
application.
4. Sum all the forces and divide by
the total mass to find the CM’s linear
acceleration (Eq. 5).
5. For each force, form the perpdot
product from the CM to the point of
force application and add the value into
the total torque at the CM
So the torque from a force is simply F dot perpdot(r) where r is a vector from the center of mass to the point of application (or alternatively, F cross r in 3 dimensions).
edit:
Here's another source that's saying the same thing. Check out "Thrust Force".
[Edited by - Numsgil on June 22, 2007 11:41:07 AM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement