Hello Guest it is March 29, 2024, 09:31:16 AM

Author Topic: Setting cutter radius with G10?  (Read 19435 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Test programs to demonstrate sub failure of G41
« Reply #30 on: November 12, 2011, 07:24:39 PM »
Hi all

OK, I have appended here two programs to demonstrate when G41 breaks down in the latest release.
In essence they are 'identical', except that in V6 the four points of the star are created by calling a sub 4 times, while in V7 the code has been unrolled into an in-line form. But the instructions are identical.
The crucial point here is that this is a single layer of subroutine!

In V7 you will see a 4-point star being cut, and the cutter diameter is set by the G41 call. The white line is the actual path the cutter follows; the blue line is the required or programmed outline. This version works.

In V6 you will see the 4-point star, but the cutter does these huge loops back to one point at each corner. If you comment out the G41 call the program runs correctly (by way of confirmation).

This seems to mean that G41 cannot be used reliably with ANY subroutines? But it should not be that difficult to carry the state information across a sub call. Every computer programming language since Fortran manages to do that.

Cheers

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Setting cutter radius with G10?
« Reply #31 on: November 12, 2011, 08:10:09 PM »
We will just have to waite and see what V4 brings.



(;-)TP

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #32 on: November 12, 2011, 08:59:47 PM »
Hi TP

We will just have to waite and see what V4 brings.
Very true, but ...

I wonder whether I could ask you to check the two programs (V6 & V7) on your machine, to see whether the problem reproduces?
Be a bit sad if it only happens on mine!

Cheers

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Setting cutter radius with G10?
« Reply #33 on: November 12, 2011, 09:18:33 PM »
I did already V7 runs fine and V6 fails.

BUT not all subs fail with TC (;-) here is an example of one that runs fine with TC.  You are running the trifecta, Parametric,subs, & nested subs (;-)

N0090 T3 M06  G43 H3
N0100 G00 X3.7195 Y3.9437
N0110 G01 Z0.800 F60
G42 P.500
M98 P1 L2
G40
N0260 G1 X3.7195 Y3.9437
N0270 G00 Z0.0000
N0280 M05 M30
o1
N0120 X3.7026 Y2.9439
N0130 X3.6710 Y2.8073
N0140 X2.7719 Y-1.0715
N0150 X-0.0074 Y-1.7757
N0160 G03 X-0.0127 Y-1.8319 Z0.8000 I0.0074 J-0.0291 F60.0
N0170 G01 X2.7240 Y-3.1110 Z0.800 F60
N0180 X3.7942 Y-5.5192
N0190 G03 X3.8508 Y-5.5139 Z0.8000 I0.0274 J0.0122 F60.0
N0200 G01 X4.4768 Y-2.8848 Z0.800 F60
N0210 X7.2253 Y-1.9610
N0220 G03 X7.2241 Y-1.9037 Z0.8000 I-0.0096 J0.0284 F60.0
N0230 G01 X4.5004 Y-1.1174 Z0.800 F60
N0240 X3.7296 Y2.8064
N0250 X3.7026 Y2.9439
N0260 G1 X3.7195 Y3.9437
M99
%

Just a side note the normal fanuc standard(Peter Smid) calls for a max of 4 sub nests and MACH3 has a repetetion limit of 999 per sub call. I have seen MACH3 get flacky above 3 nest layers

Also IF I remember correctly Art warned that Variables may not be stable deeply nested as well

What version of MAch3 are you running. The latest versions are the quirkyest I normally run V.020.

SOmetimes you just have to go back to basics on programing. One standard I stick to is IF I plan to program an exotic version like you have I NEVER plan to use TC and they rarely fail to run properly(;-).

(;-) TP

« Last Edit: November 12, 2011, 09:20:51 PM by BR549 »

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #34 on: November 12, 2011, 10:12:19 PM »
I did already V7 runs fine and V6 fails.
OK, thanks. Reassuring.

Quote
BUT not all subs fail with TC (;-) here is an example of one that runs fine with TC.  You are running the trifecta, Parametric,subs, & nested subs (;-)
Hum ...
Not sure that parametric programming should affect the results - surely?

Quote
Just a side note the normal fanuc standard(Peter Smid) calls for a max of 4 sub nests and MACH3 has a repetetion limit of 999 per sub call. I have seen MACH3 get flacky above 3 nest layers
Oh. Hum ...

Mind you, Smid's comment is NOT indicative of what is theoretically possible for Mach3. Older CNC controllers were very crude things with very limited hardware and power, and a limit on sub layers was quite reasonable for the technology then available.
But this is 2011, and we have all the power of dual and quad processors and GBytes of memory to play with. Mainstream programming languages and compilers can handle more subroutine nesting than you could ever sanely contemplate, and a Basic interpreter (or Perl, HTML, etc) can do just the same. A g-code interpreter should be able to draw on all that computing knowledge and be equally adept. Program state (eg subroutine level) should not interact with either global variables or logic flags. The old limits due to primitive technology no longer apply.
Yeah, I am prepared to stick my neck out that far.

Quote
Also IF I remember correctly Art warned that Variables may not be stable deeply nested as well
?????? Huh ??????WHY????

Quote
What version of MAch3 are you running. The latest versions are the quirkyest I normally run V.020.
R3.043.022
Hum .... ?

Quote
IF I plan to program an exotic version like you have I NEVER plan to use TC and they rarely fail to run properly(;-).
Yeah, well, that's my normal programming style. Too many decades of mainstream programming, and I am not using CAM packages as I can't afford them. But also I think I can do some neat and tricky things by hand-coding for production purposes.
So far my style has never failed due to limitations in Mach3 - except for the TC problem. I am not wedded to TC and can live without it. I just thought it would be convenient. But I can manage.

Cheers

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Setting cutter radius with G10?
« Reply #35 on: November 12, 2011, 10:42:47 PM »
Quote
Mind you, Smid's comment is NOT indicative of what is theoretically possible for Mach3

But the comp in V4 is based on Smid's book, I believe.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #36 on: November 13, 2011, 12:32:08 AM »
But the comp in V4 is based on Smid's book, I believe.

Quite possibly, but totally irrelevant. Even though I have not been able to find a single copy of any of Smid's books in any public libary here in Australia (why???), I feel very confident in making two predictions about what Smid has written.

1) The compensation should produce a tool path which gives the required shape, which is pretty obvious to the user.
I think this one is perfectly obvious. How it is done is 'left as an exercise for the reader', but testing the result is very easy.

2) The level of subroutines involved in the program does not affect the required outline or path in any way.
After all, why should it?

To be sure, a practical implementation such as an old Fanuc controller might impose it's own limitations on what sort of program it can execute. That is quite different, and no problems there. But the idea that global variables such as the current position or direction might depend theoretically on the subroutine level - no way!.

If the gaming industry can write code which lets you fly around WoW or Halo or Second Life in full 3D, then a g-code program should be able to create a tool path for cutter compensation regardless of how many subroutine levels you have in your code.

Looking at the results from my test programs and TP's test programs, I have to say it lokks like an errant SR return or an errant pointer is causing a jump to the code for a spiral or similar (G2, g3 for instance) instead of the correct code. That is a bug. Period.

Cheers
PS: I have frequently been told in other venues that I am far too blunt for American sensibilities. This seems to be a failing common to many Australians. We are blunt. If anyone is offended by my bluntness, my apologies.

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Setting cutter radius with G10?
« Reply #37 on: November 13, 2011, 08:11:50 AM »
Graham........could you shed some light at a "high level" on this thread?
RICH

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Setting cutter radius with G10?
« Reply #38 on: November 13, 2011, 08:16:30 AM »
Quote
If the gaming industry can write code which lets you fly around WoW or Halo or Second Life in full 3D, then a g-code program should be able to create a tool path for cutter compensation regardless of how many subroutine levels you have in your code.

I do agree with what you're saying, but I think the issue has more to do with the 1 man development crew rather than what's theoretically possible. No offense to Brian's abilities, but he just doesn't have the time to develop Mach3 as it really needs to be developed.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Setting cutter radius with G10?
« Reply #39 on: November 13, 2011, 08:51:58 AM »
Interesting thread since it covers a lot of subject matter. Not a simple thread by any means........
Don't know the specifics of  different controller systems, level of developement or even the differences in application since
there are differences even within families of controllers. Smid eludes to this in his writings and to get the big picture one would need all three books,
ans a crasp of all the material . I don't have the Fanuc Macro Book and it's my bad to say that something follows something exactly since who knows exactly
how something is handled internaly within the controller software ( they are certainly not exact ). TP has touched on this somewhat.
Not trying to be defensive or negative on any of them.

FWIW,
RICH