On Mon, Dec 29, 2008 at 09:59:47AM -0600, Stuart Stevenson wrote:
> Gentlemen,
> there is a file www.mpm1.com:8080/cinci/comps/cincikins_work.c
> this file compiles, emc2 starts but when I change to mdi mode I get
> nan for each of XYZAB
> obviously there is a problem :)
> I cannot see the problem
> would someone look at it and enlighten me a little?
Beware I didn't compile or run it, but I see a couple things. The
most common reason for NaN is dividing by zero. Here
double fva14 = fva11 / cos(d2r(joints[4]));
you can get a zero if joints[4] is 90
Here fva2 is in radians
double fva2 = atan2(-(haldata->bskew),1);
but later you call d2r on that value
double fva25 = fva12 / cos(d2r(fva2));
and there are lots of other places where you use d2r on atan2's
output. Maybe this is the root cause?
------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users