Solving redundant constraints for kinematic&dynamic analysis

Please don't post Bullet support questions here, use the above forums instead.
James Jung
Posts: 3
Joined: Wed Apr 01, 2009 2:54 am

Solving redundant constraints for kinematic&dynamic analysis

Post by James Jung »

Hello.

First, thanks very much for reading this message. This is the first post in this forum.
I respect this great work of Bullet. It is very happy to know this kind of work. I'm new at Bullet. And I'm newbie at computational dynamics.

I've posted similar question on ODE forum. And I hope I can get other opinions here.

I want to make a program that can analyze human motions in machines, for instance, with sport equipments. The purpose of this program is to design those equipments very well.
But as you know, most of current CAD systems do not support the function that I want to have.
The example of What I want to do is listed here.
http://lifemodeler.com/LM_Manual/T_rehab.shtml

I suppose that there should be three stages in my application.

Step1) Kinematics analysis of human-machine combined mechanism with motion data
Step2) Inverse dynamics analysis to calculate torques which are required to generate the motion referenced above
Step3) Forward dynamics analysis to validate whether the actuators(motors with torques calculated above) can generate the desired motion


So, because I don't know Bullet well, I'd like to make some questions in this forum.

Q1) Can 'Bullet' handle general, user-defined constraints, not only joint constraints? For instance, 'CAM-FOLLWER' joint can be one of them. And, a constraint which defines the trajectory of a point in a body can be also one. The trajectory can be defined as a function of time analytically. Finally, let's assume that two vectors of two bodies are parallel but those bodies are apart. This can be a constraint which can be called 'two parallel vectors'.

Q2) Can 'Bullet users' access some internal information? For instance, system of equation, jacobian matrix and constraints information which includes motion and joint constraints. Especially does 'Bullet' include those information in symbolic form?

Q3) If there are some redundant constraints, how does 'Bullet' solve those problems?


What I want to ask is whether Bullet can be used in kinematic analysis or not.
In fact, I started to study computational kinematics & dynamics by Nikravesh's book. From experts like you my theoretical level may seem very low.
According to his book, for kinematic analysis, number of DOF of all bodies(6*number of bodies) should be same as the sum of DOF which are removed by constraints. Constraints are composed of joint constraints, driving(motion) constraints and user-defined constraints those are referenced above.

And for proper kinematic analysis, I think I should try to avoid making redundant constraints because that can cause the singularity of the system matrix. This is the reason of quesion Q2.

I don't know how 'Bullet' solve this problem. But I think that for proper kinematic anlaysis, the function which shows some warnings for redundant constraints can be helpful.

Of course this is the responsiblity of Bullet users who build models badly. But if this function can be implemented, it can help users to perform the kinematic anaysis very well.

I think that in very complex model, it is difficult to know what constraints should be removed for eliminating singularity in system matrix. Because human structure with those equipments may
include many closed-loops. Because these closed-loops may remove DOFs in model, the number of joint motion input for kinematic analysis should be restricted. So the selection of input motion
may be another problem.

Thanks for reading this question again. I hope I can get some advices from experts like you :)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Solving redundant constraints for kinematic&dynamic analysis

Post by Erwin Coumans »

James Jung wrote: Q1) Can 'Bullet' handle general, user-defined constraints, not only joint constraints? For instance, 'CAM-FOLLWER' joint can be one of them. And, a constraint which defines the trajectory of a point in a body can be also one. The trajectory can be defined as a function of time analytically. Finally, let's assume that two vectors of two bodies are parallel but those bodies are apart. This can be a constraint which can be called 'two parallel vectors'.

Bullet is open source so you can modify and add any constraint solver, and constraint definition you like.
Q2) Can 'Bullet users' access some internal information? For instance, system of equation, jacobian matrix and constraints information which includes motion and joint constraints. Especially does 'Bullet' include those information in symbolic form?

No, Bullet doesn't use a symbolic representation, it uses a numerical method to solve the constraints, using Projected Gauss Seidel.
Q3) If there are some redundant constraints, how does 'Bullet' solve those problems?
What I want to ask is whether Bullet can be used in kinematic analysis or not.
The PGS iterative constraint solver used in Bullet iteratively solves a single individual constraint row at a time, eventually converging to a global approximate solution.
It is probably not suitable to the kind of exact analysis you are looking for.

What kind of formulation and solving methods do you plan to use for inverse kinematics and forward kinematics?
Thanks,
Erwin
James Jung
Posts: 3
Joined: Wed Apr 01, 2009 2:54 am

Re: Solving redundant constraints for kinematic&dynamic analysis

Post by James Jung »

First, thanks very much for replying my question.
I've started to study multibody dynamics with the book of which title is "Computer-Aided Analysis of Mechanical Systems". The author of that book is Parviz E.Nikravesh.

In his book, the generalized Cartesian coordinates and the Newton-Euler's approach are employed to obtain the equation of motion.
We can see his formulation in a recent paper, 'Multibody Systems Formulation'. The site address where we can download it is here: http://www.springerlink.com/content/82665j423l158740/

Code: Select all

?: A set of m algebraic kinematic independent holonomic constraints
(eq1)-> ?(q,t)=0 (q:the vector of generalized coordinates and t is the time variable)
The time derivative of above equation
(eq2)-> [?_q]q' = -[?_t] = ? ([?_q]: the Jacobian matrix of the constraint equations / q': the vector of genarlized velocities / ?: the right-hand side of velocity equations)
The time derivative of above equation again
(eq3)-> [?_q]q'' = -[(?_qq')_q]q'-2[?_qt]q'-[?_tt] = ? (q'': the acceleration vector / ?: the right-hand side of acceleration equation)
The step of kinematic analysis
1) Specify the initial conditions for positioning q0 and initialize the time counter t0
2) Evaluate the position constraint (eq1) and solve them for positions q
3) Evaluate the veloicty constraint (eq2) and solve them for velocities q'
4) Evaluate the acceleration constraint (eq3) and solve them for accelerations q''
5) Increment the time. If the time is smaller than the final time, go to step 2, otherwise stop the kinematic analysis
As you know, kinematic analysis is the study of the motion of a system independently of the forces that produce it.
Since in the kinematic analysis the forces are not considered, the motion of the system is specified by driving elements(motion constraints) that govern the moton of specific degrees of freedom of the system during the analysis.

I don't need to do 'inverse kinematics' because some motion data would be given to the system for analysis.
I want to do 'kinematic analysis by motion data', 'inverse dynamics for torque calculation', and 'forward dynamics for validation'.

The purpose of kinematic analysis is that I can check whether the mechanical system will move well according to motion input data or not.
But if there are redundant constraints in the system, I think it may cause problems during kinematic analysis.
So, before kinematic analysis, I hope to remove those redundant constraints of the system due to bad-modeling of mechanism.

So, with my low knowledge of multibody dynamics, I think that before kinematic analysis, we can check the rank of the jacobian matrix of constraints and find whether there is singularity in that matrix or not.
If there is singularity in the matrix, then we should check which rows of that matrix cause the singularity. And we can see which constraints cause conflicts. The we should remove of modify those constraints for kinematic analysis.
But in the Nikravesh's book, I couldn't find some helpful contents for that problem.

So, I've found two papers which may help to solve my problem.
"Stabilization Methods for the Integration of DAE in the Presence of Redundant Constraints" : http://www.springerlink.com/content/lwh5t2vp2500633r/
"Joint Reaction Forces in Multibody Systems with Redundant Constraints" : http://www.springerlink.com/content/x0g0123433826350/
But I think these two papers deal with the redundant constraints problem in dynamics analysis, not for kinematic analysis.

I think Bullet is a kind of dynamics engine. But if Bullet can be used in the kinematic analysis and I can check the jacobian matrix of constraints, then it may be helpful to me.

Thanks very much for reading this boring message. I'll hope some advices. :D
bone
Posts: 231
Joined: Tue Feb 20, 2007 4:56 pm

Re: Solving redundant constraints for kinematic&dynamic analysis

Post by bone »

James Jung wrote: I don't know how 'Bullet' solve this problem. But I think that for proper kinematic anlaysis, the function which shows some warnings for redundant constraints can be helpful.
With a PGS iterative solver, redundant constraints do not cause any issues. If I remember correctly (and someone please correct me if I am wrong), it usually converges to some sort of least squares answer. For example I think a symmetrical four-legged table resting on the ground has an infinite number of solutions, but PGS will probably converge to equal weights on each leg.

So in short, there's no 'analysis' done in Bullet for redundant constraints.

If you plan on using a more "exact" solver, the only solution I've ever heard of is to jiggle the system a little bit to make the singularities go away. I have no idea how that would help with the four-legged table example. Sounds like a PITA to me.
James Jung
Posts: 3
Joined: Wed Apr 01, 2009 2:54 am

Re: Solving redundant constraints for kinematic&dynamic analysis

Post by James Jung »

bone wrote:With a PGS iterative solver, redundant constraints do not cause any issues. If I remember correctly (and someone please correct me if I am wrong), it usually converges to some sort of least squares answer. For example I think a symmetrical four-legged table resting on the ground has an infinite number of solutions, but PGS will probably converge to equal weights on each leg.
Thanks very much, bone.
According to your explanation, I should study the PGS interative solver in detail.