PDA

View Full Version : No pi for me?



wingnut
05-06-2011, 06:54 AM
Hello,
I am using ShopBot Control Software 3.6.36 and I am incorporating some angled cuts into a program. In order to do the Radian to Degree - Degree to Radian conversion within the part file I am trying to use pi per the Calculated_Functions.pdf documentation. I have been testing expressions via the ShopBot Calculator and have not been able to get it to recognize pi. Depending on the expression I will get an error stating PI is an undefined variable. I know I could define this within the part file, but I was wondering if I am missing something or this is not defined per the documentation.

In the Calculator when I test expressions pi returns pi and (pi) returns undefined variable. Just wondering if anyone else is having this issue or if I am just missing something.

Any help would be greatly appreciated. Thanks.

dana_swift
05-06-2011, 09:18 AM
Mike- Pi is available.. it is just "hidden".

If you look under "ACOS" you will see the code "ACOS(-1)" produces PI to the accuracy of the computer. The ACOS trick is the best way to get PI on any computer. What you can do is:

&Pi = acos(-1)
&Degrees = &Radians * 180.0 / &Pi

Or as an alternative define:

&RadiansToDegrees = 180.0 / acos(-1)
&Degrees = &Radians * &RadiansToDegrees

Hope that helps!

curtiss
05-06-2011, 11:29 AM
You guys have gone a bit past my math but this is handy sometimes...

http://joshmadison.com/convert-for-windows/

Not sure if it does pi to 20,000 places...

wingnut
05-09-2011, 06:06 PM
Dana,
Thanks. I figured it was in there somewhere. Also thanks for responding so quickly.

One additional question that you may be able to help with - Can the ShopBot handle past 3 decimal places? I have a calculation that results in .46875 and even though the variable shows that it has taken on this value, the move is only .469. Is the precision something that can be set? I understand that there are limits to the motors themselves, but can they handle this level of precision with microstepping? Thanks in advance.

Curtiss,
I appreciate you response as well, but I am trying to accomplish this within a part file that is calculated on the fly based on responses from the user.

Gary Campbell
05-09-2011, 08:07 PM
Mike...
Pi is also always in there as a variable. Look at the current system variables and the variable "&PI" is always there. Good to 6 decimal places. The only one that you cant remove.

Try using "&PI" (without quotes, of course) in your formula.

Software does handle above 3 places, but display doesnt. I am not sure what the current rounding is set at, my guess around 6. However if the result is going to become a move, then you have to settle for the closest increment based on your unit value/or step. Calculations can go to double digit exponents, but why would you run them on a machine with .002 repeatable accuracy?

wingnut
05-09-2011, 08:33 PM
Gary,
Thank you. I am using 3.6.36 and it is listed in system variables (which I should have looked at a long time ago) except it is listed as "&_PI" (no quotes). I had been trying every variation without the underscore.

You said that a move would be limited to the "closest increment based on your unit value/or step". Where can I find this info and can I alter this to accomplish moves to 5 places? I guess another question is would I want to? I think I read somewhere on the forum about keeping track of rounding "errors" until they become large enough to include, maybe that is another option. Thanks again.

Mike

Gary Campbell
05-09-2011, 08:58 PM
Mike...
I didnt relaize there was an underscore til just now.

The current resolution is a setting based on the number of steps available per revolution, and the gear/pinion reduction into inches. Others may have more info, as most of this is over my pay grade. I am much more likely to find a way to cut 10ips to .010 tolerance than to cut at 1ips to .001 tolerance.

Cant see any reason to try and increase the resolution. You would have to add reduction of 10 to 1 to gain 1 decimal place. 90% reduction in speed. Maybe NASA will let you borrow one of their machines. What are you trying to accomplish?