Stuart - Thank you for starting this thread and posting your kinematics
calculations.  I hadn't delved into the kinematics aspect of EMC2, but
reading through your calculations the proverbial light-bulb went on and how
positioning is computed and achieved makes a lot more sense to me now.  Once
again - something new is learned every day subscribing to this list - I'll
stow this for the unavoidable "I'll never use this stuff in life" argument
my daughter is starting to use in defense of her math grades (sure, she's
only in 8th grade and isn't exhibiting any interest in mechanical
engineering but I can make an analogy that works :).

Thanks again.

Greg

-----Original Message-----
From: Stuart Stevenson [mailto:stus...@gmail.com] 
Sent: Sunday, December 14, 2008 12:14 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] equations in kinematics

On Sat, Dec 13, 2008 at 11:05 PM, Stephen Wille Padnos
<spad...@sover.net> wrote:
> Chris Radek wrote:
>
>>On Sat, Dec 13, 2008 at 10:14:04PM -0600, Stuart Stevenson wrote:
>>
>>
>>>Gentlemen,
>>>   which style of computation would run faster in the kinematics file?
>>>
>>>
>>
>>If they are equivalent (and I sure as heck didn't check that),
>>
> I didn't check for correctness either.  I did notice one thing that
> seems like a bad choice, but it may be intentional:
>
> ...
> va2=atan(-bskew1)
> ....
> va8=va7*tan(va2)
> ...
>
> since tan(atan(x)) should equal x, it seems you should be able to just
> use "va8=-va7*bskew1".

it was intentional only in that I have variables in my macro call that
I use two different numbers
if the magnitude of the variable is less than 1 I use it as a per inch error
if the magnitude is GE 1 I use it as an angle
this necessitates the extra step for testing
when I write it for the kinematics I will only use the per inch error

>
>>it
>>will make little difference whether you split it up like #1 or have
>>huge statements like #2.  The compiler will do approximately the same
>>work
>>
> I was in the middle of writing a similar statement, with some general
> instructions on writing a test program, when I decided to just write the
> test program instead :)  I found that the first version runs 1,000,000
> loops in about 0.5 seconds (on a 2.2 GHz Core 2 Duo), whereas the second
> takes about 2 seconds.  By making my own "sqr" function, that was cut
> down to about 1.5 seconds (this surprised me because I would have
> expected common subexpression elimination to work there, but I suppose
> gcc can't know if any of the called math functions save some state and
> may therefore return different values from call to call).
>
>>.  The only concern is which one you can understand better when
>>you (or some other unlucky person?) come back to it later.
>>
>>
> That is a big concern, and the code runs pretty fast anyway.  Like I
> said, my 2.2GHz CPU can run the slower version 500,000 to 750,000 times
> a second, so even a 500 MHz CPU, that's not as well optimized for math,
> should be able to do it 100,000 times a second (or about 100 times as
> often as necessary)

speed was my main concern
thanks
Stuart
>
> - Steve
>
>
>
>
----------------------------------------------------------------------------
--
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
>

----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to