- Posts: 22
- Thank you received: 240
Arc Tolerance
- ArcEye
- Offline
- Junior Member
-
www.linuxcnc.org/index.php/english/forum...ounce?start=10#54172
trying to get the arcs generated by his CAM program accepted by Linuxcnc.
Anyone who has done any amount of work involving arcs will be familiar with the error message as per below
In this particular case the variation is pretty small, but enough to prevent usage of the code.
This started me looking at the code the interpreter uses to test if the divergence is within tolerances.
src/emc/rs274ngc/interp_internal.hh has the definition for tolerances
Immediate thought, why on earth is the tolerance for mm so much tighter than imperial?
Probable answer, programmer uses imperial and is not really interested in metric.
No wonder I have had so much difficulty in the past with some arcs ( especially on the lathe ), when it is not practical to use a simple R parameter
Next thought, why are the tolerances so tight overall?
5 thousandths of a mm = 0.000196850394 inch or 5 microns !
I can't machine to that spec, so why would I want calculations to be done to it?
Even the imperial tolerance is pretty tight at 12.7 microns.
So what if the tolerance could be varied, how much real effect would it have on quality and would it allow CAM code which currently fails to run.
Below same code run through a build with imperial tolerance set to 0.002"
Runs quite happily and given the arcs in question are used in script on a sign, is there actually any point in having the tolerances so tight that
3rd party code is not accepted?
Perhaps an .ini file setting for tolerances would be the way forward, not to mention a fix for the inch / metric conversion of 0.1!
This is just open for discussion, I have changed the development RIP I am using at present, but not an option for most users.
regards
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
-
- Posts: 3981
- Thank you received: 994
JT
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
-
- Posts: 3981
- Thank you received: 994
Hi JT,
I've attached a patch (against today's 2.7 commit 4fee078,
but it probably applies on master too)
It uses;
[RS274NGC]
TOLERANCE_INCH =
TOLERANCE_MM =
I'm not sure if [RS274NGC] is the right section.
I only tested with some prints in the code which are now gone of course
so it needs real testing.
I just changed the code mechanically -- like a typing monkey.
So -- i don't understand if:
1) it works like you want
2) what side-effects there are
So someone like cradek or seb should review.
It does seem you could do some stupid things by
making the tolerances too big -- maybe there should
be a sanity check on the values from the ini file too.
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
-
- Posts: 22
- Thank you received: 240
And like magic Dewey has come up with a patch for 2.7 that adds arc tolerance to the ini file.
Excellent, you were obviously hitting the IRC last night!
That was my project for this afternoon.
I'm not sure if [RS274NGC] is the right section.
I'm sure it is, it is that sections code that is changed and the interpreter behavior that is modified.
It does seem you could do some stupid things by
making the tolerances too big -- maybe there should
be a sanity check on the values from the ini file too.
There do need to be some basic top and bottom figures and sanity checks that the .ini file figure does no go outside them
As the hard coded #define needs changing anyway, I will look at adding further defined values.
Then the value can be a default or the ini file value, if that is within sane defined parameters.
Quick work JT and Dewey
regards
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
-
- Posts: 3981
- Thank you received: 994
Edit: I think the default of 0.0005" is ok but the metric should be the same at 0.0127mm IMHO.
JT
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
-
- Posts: 22
- Thank you received: 240
BigJohnT wrote: Well I emailed Dewey and asked him to look at it if he had time then found the patch this morning when I got up.
Edit: I think the default of 0.0005" is ok but the metric should be the same at 0.0127mm IMHO.
JT
Good man!
Yes our calculators obviously agree, that was the figure I had for metric too
regards
Please Log in or Create an account to join the conversation.