On Mon, Dec 29, 2008 at 10:13 AM, Chris Radek <[email protected]> wrote: > 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
on this machine joints[3] and joints[4] will neither approach 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? i would say that is the problem - I expected something such as this just didn't know what - I will work on it the return of cos is not radians but atan2 is? thanks > > ------------------------------------------------------------------------------ > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users > > ------------------------------------------------------------------------------ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
