A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by mway » Tue Apr 10, 2012 10:52 pm
I realised that I could solve my issue posted in my previous post if I could solve this problem.
Say you have a hinge joint. What would you need to do in order to make the joint harder (or easier) to open? Imagine a door with a rusty hinge compared to a new hinge, the rusty one would require more torque to open it. Is there any way to achieve this kind of effect in newton?
-
mway
-
- Posts: 6
- Joined: Sat Oct 08, 2011 11:29 am
by Julio Jerez » Wed Apr 11, 2012 7:37 am
the wai you do that is by setting a friction limit. then when you apply that torque if teh torque excced the friction limit, it will accelrate along thta degree of freedon.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by mway » Wed Apr 11, 2012 8:45 am
Thanks a lot. Any chance you could elaborate on setting a friction limit?
-
mway
-
- Posts: 6
- Joined: Sat Oct 08, 2011 11:29 am
by mway » Wed Apr 11, 2012 9:48 pm
Ok, I think I have it working by doing simply this to each degree of freedom:
// add an angular row with 0 error
NewtonUserJointAddAngularRow( m_joint, 0.0f, &matrix0.m_front[0] );
// set row friction values
float jointFriction = 5.0f;
NewtonUserJointSetRowMinimumFriction (m_joint, -jointFriction);
NewtonUserJointSetRowMaximumFriction( m_joint, jointFriction);
My problem is, while it works I don't understand the SetRowMin/MaxFriction functions at all. Why does it seem to only work if i call both functions with the same value (positive & negative)? Are you able to give a little more explanation of these functions, and also tell me if i'm doing this correctly?
-
mway
-
- Posts: 6
- Joined: Sat Oct 08, 2011 11:29 am
by Julio Jerez » Thu Apr 12, 2012 9:11 am
every degree of freedom have parameters,
acceleration, velocity, position, and friction and restriction
the functions like:
NewtonUserJointSetRowMinimumFriction (m_joint, -jointFriction);
NewtonUserJointSetRowMaximumFriction( m_joint, jointFriction);
and the others set what those parameter are, in the case of friction, there is positive and negative friction for each DOF, this is why there are two functions
In the case of contacts the engine set then all internally using the materials definitions and calling teh same functions.
in the case of joints the end user has to set those parameter eah frame, using the joint interface.
The parameters are set using the geometrical view of the joint to decide what DOF to restrict.
The engine does not calculate forces to be apply to the engine bodies, that is not how "Reduced coordinate system virtual displacement" works.
Basically the way is work is by saying, "of the 6 DOF that a rigid body can move how can I restricted the motion along some of those?
The restricted DOF and specified by Geometrical relation betwenn two rigid bodies, and the acceleration along that DOF is specified. The acceleration is what you specified, not the force.
The friction is the "Pool of force" that the engine can use to produce the desired acceleration. when the force exceeded the friction limit the, the force is clamped to the friction limit.
for this to work the DOF has to Orthogonal, (mutually independent at all time).
For what you say you want the opposite, you want to calculate the Force along one DOF that will achieve a desired acceleration. Those are called Parameterized coordinate systems methods like Featherstone
but Newton does not work like that. The two system are like Oil and water, they do not like each other.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests