While Loop Possible Bug(s)?
- Todd Zuercher
-
Topic Author
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
30 May 2019 17:04 #135403
by Todd Zuercher
Replied by Todd Zuercher on topic While Loop Possible Bug(s)?
No, the debug lines were not skipped, I just happened to have cleared them before taking the screen shot.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
Topic Author
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
30 May 2019 17:08 #135405
by Todd Zuercher
I was testing this in 2.7.14.
Replied by Todd Zuercher on topic While Loop Possible Bug(s)?
I tested the code in the first post on my milling machine it's running master. Can not replicate the error.
Tried with #5=25 and 26, the final circle gets done here.
I made a quick check in the code, and from what I can see it's all standard double-precision math internally.
I was testing this in 2.7.14.
Please Log in or Create an account to join the conversation.
30 May 2019 18:59 #135414
by MaHa
Replied by MaHa on topic While Loop Possible Bug(s)?
Passing here accidentally, as i am away from the forum anyway, but there is a spiralroutine.
forum.linuxcnc.org/20-g-code/35812-circu...lling-routine#123743
In the meantime a bit auotdated but working and inspiring. Big +++ is the constant feed for any dia.
Only need to modify the the leadinarc and add Z levelling. The recent version is metric only, so dont post it.
Bye for the next few month...
forum.linuxcnc.org/20-g-code/35812-circu...lling-routine#123743
In the meantime a bit auotdated but working and inspiring. Big +++ is the constant feed for any dia.
Only need to modify the the leadinarc and add Z levelling. The recent version is metric only, so dont post it.
Bye for the next few month...
Please Log in or Create an account to join the conversation.
02 Jun 2019 09:30 #135622
by Hakan
Replied by Hakan on topic While Loop Possible Bug(s)?
I think this is a bug actually. Nice exercise to learn about the code.
By switching on TP_DEBUG and recompile one can see in the output that the suggested angle for the failing arc is
"radius = 1.875781250000, angle = 0.000004591468" for the 25 case (that fails), and
"radius = 1.875487290044, angle = 6.283185125288" for the 28 case (that works).
The printout is in tp/blendmath.c, but the angle is not calulcated there.
I assume this is the reason for a very small arc being made instead of a full circle. On the other hand, it could be something else.
By switching on TP_DEBUG and recompile one can see in the output that the suggested angle for the failing arc is
"radius = 1.875781250000, angle = 0.000004591468" for the 25 case (that fails), and
"radius = 1.875487290044, angle = 6.283185125288" for the 28 case (that works).
The printout is in tp/blendmath.c, but the angle is not calulcated there.
I assume this is the reason for a very small arc being made instead of a full circle. On the other hand, it could be something else.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
Topic Author
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
02 Jun 2019 13:49 #135633
by Todd Zuercher
Replied by Todd Zuercher on topic While Loop Possible Bug(s)?
I think you hit the nail on the head. Because if you add a p2 to the failing arc it does 1 circle.
Please Log in or Create an account to join the conversation.
03 Jun 2019 06:40 #135700
by andypugh
Replied by andypugh on topic While Loop Possible Bug(s)?
I am still suspecting something funny happening with the sqrt.
I am away from my LinuxCNC machines at the moment (for several days). What happens if you (DEBUG, ...) the input expression to the SQRT. If that is propagating a NaN into the TP then all sorts of wierdness is likely to ensue.
I am away from my LinuxCNC machines at the moment (for several days). What happens if you (DEBUG, ...) the input expression to the SQRT. If that is propagating a NaN into the TP then all sorts of wierdness is likely to ensue.
Please Log in or Create an account to join the conversation.
03 Jun 2019 19:43 #135787
by Hakan
Replied by Hakan on topic While Loop Possible Bug(s)?
I wonder that. It should be sqrt of x^2 + y^2 and that should always be safe.
I am thinking that there is something due to the tool compensation that is in effect. Transitions from one circle to the next and need to make a small move and somethings go wrong (just guessing),
And the format you used "G3 I- J-" is used to program full circles. How can it then do zero circles (or a very small one)?
I didn't see this issue in master so maybe someone has been working on it?
I am thinking that there is something due to the tool compensation that is in effect. Transitions from one circle to the next and need to make a small move and somethings go wrong (just guessing),
And the format you used "G3 I- J-" is used to program full circles. How can it then do zero circles (or a very small one)?
I didn't see this issue in master so maybe someone has been working on it?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
Topic Author
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
03 Jun 2019 20:37 #135795
by Todd Zuercher
Replied by Todd Zuercher on topic While Loop Possible Bug(s)?
There was/is no tool compensation in effect.
Please Log in or Create an account to join the conversation.
Time to create page: 0.209 seconds