Ball and socket joint

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Ball and socket joint

Postby FSA » Sun Oct 21, 2012 4:18 pm

Hi. I'm trying to understand what the first parameter does mean in
Code: Select all
CreateCustomBallAndSocket(const dFloat* pinsAndPivotChildFrame, const NewtonBody* child, const NewtonBody* parent);

I found this thread: viewtopic.php?f=9&t=7302&p=50018&hilit=ball+socket
But it doesn't help me at all.
1. What is pivot and what is pin?
2. How must the matrix look like(pinsAndPivotChildFrame)?

I want to connect several body's by ball and socket joint. The body's all pointing up(positive y axis). Like a chain.

Thank you.
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Ball and socket joint

Postby FSA » Sun Oct 21, 2012 6:08 pm

Ok i get it.
But i have a new question: How can i set the friction of the joint? BTW: I use dJointLibary.
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Ball and socket joint

Postby JoeJ » Tue Oct 23, 2012 4:14 pm

What do you mean with friction?

Should the bodies 'want' to stay in the initial relaxed position of the joint,

or should they want to stay in their current resting position, so you need some larger force then usual to change them,
but after coming to rest thy are a happy and want to stay at that state again?

Both is possible but that's not easy. I see 2 ways:

1. Compute the rotation happening and add an additional angular row that works against that motion.
Prepare to learn how joint lib works to be able to modify it.
Advantage: More accurate becuase recalculated during substeps.

2. Do the same with a torque, outside the joint. To stay physical correct, torque must be added *1 to one body, and *-1 to the other ('equal opposite' torque).
I got an unsolved problem with that (http://newtondynamics.com/forum/viewtopic.php?f=9&t=6533), so i still cheat and use uniform inertias to use that method.

Can you give practical example of what you want to achieve?
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Ball and socket joint

Postby Julio Jerez » Tue Oct 23, 2012 4:48 pm

JoeJ wrote:2. Do the same with a torque, outside the joint. To stay physical correct, torque must be added *1 to one body, and *-1 to the other ('equal opposite' torque).


where do you get equal opposite torque, from? That's not a law of newtonian mechanics. The law says "equal and oppsite reactions"
this means for each force there is an equal and opposite force in the oppsite direction.
if you apply that rule to tourques you end up with inconsisten equations.

take for example toque bodies connected by a point to point joint. one point is at the center of mass of one body, the the at a corner.
The reaction force will apply a torque to one body but zero tourqe to the other.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ball and socket joint

Postby JoeJ » Tue Oct 23, 2012 5:22 pm

I think i have read exactly that term in a paper about powering ragdolls.
Note that my shool background in math and physics is... tiny :)
But i think what i mean is correct, example:
We have two Spheres, and we have a magic joint that links their orientation.
We can lift one up and carry it away, nothing happens to the other.
But then we rotate it, we see the the other sphere rotates exactly the same way.
Then we remove the magic joint, and observe that we need only half the torque for the same rotation.
That would be the proof that the join generated equal and opposite torques.

If that is true, i can leave the necessary work for a point 2 point to the joint lib and apply additional equal and opposite torques as i like,
if all i want is a rotational effect, which seems the case here. I know i work aginst the point to point by doing so, but newton catches up. It works well for me.

Personally i see no real difference between torques and forces, and thus i assume same laws for both, but different math methods to apply them.
But let me know if i'm wrong...
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Ball and socket joint

Postby Julio Jerez » Tue Oct 23, 2012 6:39 pm

Like I say the principle of action reaction is defined for forces.
In Fact Torques do not really exit, Torque are calculated quantities the express the effect of a force actin at one point on a body.
you are not going to find any matebaticla furmulation of teh equation of teh law of phyics that use Torque as independ quantities.

Maybe The example I gave you before was no clear, by thong of a wheelbarrow.
they are made by a wheel and a teh part that carry the load connected by a hinge

when the wheel is touching the ground, the wheel apply a force to the body and the pivot of the wheel.
the ody also apply a force down to the wheel, which is balanced by the normal force from the floor.
on the wheel the net torque is zero, because boath forces (the ground and and the for for the body) act on the centee of mass of the wheel.

one the body of the wheelbarrow, the force that wheel apply to the body is at one side of the body, generatin a torque that tend to pitch down.
This is the principle of levels and pulleys.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ball and socket joint

Postby JoeJ » Wed Oct 24, 2012 9:47 am

I understand, but i remember something similar where i have a problem.
It's about the famous formula:

AddGlobalForce (Force, Point)
{
R = Point - BodyMatrix.Position; // note: there's a typo in that line on the wiki page http://newtondynamics.com/wiki/index.php5?title=How_can_I_control_an_object_using_a_physics_engine%3F
Torque = CrossProduct (R, Force);
NewtonAddForce (Force)
NewtonAddTorque (Torque)
}

Example: A pencil resting in free space without gravity.
Case 1: We apply force at the pencil com so it begins to move with 20cm per second, no rotation.
Case 2: We apply the same force but at the pencils tip. If we use the same formula, the pencil moves 20cm/s like before, but it will rotate too.

So we have more 'output energy' in case 2 than in case 1 for the same 'input'?
I think this is wrong, and the pencil should not move, it should only rotate in case 2.
I assume the more torque is calculated, the less force should be calculated.
Why is that part missing in the formula, or is it me, who misses something?
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Ball and socket joint

Postby Julio Jerez » Wed Oct 24, 2012 11:10 am

actually not, the pencil gain the same energy regardless of where the force is applied.

you have to remember that the concept of a rigid body, is a pre-calculated value deduce by euler.
Basically he deduce the formulas to calculated the Inertia that a collection of rigidly connected particles offer to the action of a force.
Inertias and Torque are pre calculated values that only apply to rigid bodies when we know that the net internal force are zero because the particles do not move relative to each others.
These break down when you try to simulate very large objects of objects that deform.

In you example:
when the force act on the center of the pencil, all the particle in the pencil move in the same direction
The total angular momentum is zero.

when the force is not at the center some the pencil start to rotate, and also move lone the force
the momentum generate by the rotation is zero, because for each particle move in one direction there will be another particle move in the exact opposite, the is guarantee because of the inertia distribution.
so the total momentum is zero

take a look at some of the MIT videos in you tube, they do a lot of this demonstrations in Physics 101 for freshman.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ball and socket joint

Postby JoeJ » Wed Oct 24, 2012 11:33 am

Julio Jerez wrote:the momentum generate by the rotation is zero, because for each particle move in one direction there will be another particle move in the exact opposite, the is guarantee because of the inertia distribution.


That makes sense! So if i sum up all particle trajectorys, i get the same average 20cm/s velocity and that's right.
Thanks, i got that now :)
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Ball and socket joint

Postby JoeJ » Thu Oct 25, 2012 5:37 pm

@ letter123: If you don't wanna add, but remove friction, maybe this is for you:
http://newtondynamics.com/forum/viewtopic.php?f=26&t=7541
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron