Hello Guest it is May 08, 2021, 09:08:00 PM

Author Topic: Simple radius cutting - isn't !  (Read 617 times)

0 Members and 1 Guest are viewing this topic.

Offline JG

*
  •  50 50
    • View Profile
Simple radius cutting - isn't !
« on: July 19, 2020, 08:05:46 AM »
It all seems so simple when reading/watching various G-Code tutorials but the reality is far from 'simple'.

I had some issues when trying to cut a circle - well actually I was 'Drawing' a circle,  the 'simulation' in Mach3 using the standard layout I find difficult to read and changing that to show a larger image is fraught with many other issues needing a better knowledge of VB that I currently have. I found an easy solution though by making a spring loaded 'Pencil Holder' to use instead of a milling cutter and with that in place I have sussed what happens when you change the I & J  parameters.

Next I viewed a tutorial about simple radius profiling but no matter how I adjust the I & J parameters - to date I've only been able to 'draw' an outline with the corners reversed --  ie 'scalloped' instead of 'rounded' - see attached .PDF.

The program used is very basic :
Code: [Select]
%
O0000     (Radius test)
N100 G17 G21
N230 G00 X-100 Y50
N240 Z-27
N250 G01 Z-29 F250
N260 Y-70 F3000
N270 G02 X-80 Y-90 I0 J-20
N280 G01 X80
N290 G02 X90 Y-80 I10 J0
N300 G01 Y10
N310 G02 X50 Y50 I0 J40
N320 G01 X-100
N330 M05
N340 X200 Y100 Z0
N350 G40
N360 M30
%

I'm currently not too concerned about tool offsets - though I suspect that is the reason that the drawing produced has 'curves' instead of sharp points at each change of direction (witness the purple dashed line).   I would expect this code to follow the 'Red' Line so I'd be grateful if someone could point out what I'm missing.



Offline Graham Waterworth

*
  • *
  •  2,322 2,322
  • Yorkshire Dales, England
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #1 on: July 19, 2020, 09:49:46 AM »
Turn CV mode off and run it again, then turn it on and slow down the feed into the corners, its the feed verses CV mode that is doing this.
Without engineers the world stops

Offline JG

*
  •  50 50
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #2 on: July 19, 2020, 10:20:48 AM »
Turn CV mode off and run it again, then turn it on and slow down the feed into the corners, its the feed verses CV mode that is doing this.

Thanks for the input Graham.   --  It's a shame that I don't understand it :)

I presume that CV means Constant Velocity but I wasn't aware that I had CV 'on' and can't see a code or setting that turns it 'off' :(


I CAN understand your assertion regarding feed speed if you are talking about the 'rounding over' where I expected 'sharp' corners but that doesn't address the 'concave' (scalloped) corners.


I've since tried G03 instead of G02 on the off-chance that that was the issue but that puts a 'bulbus' curve with the centre of radius still at the corner. ...... This makes me think that Mach3 believes that the centre of radius is at the corner rather than 'offset' by the value of I or J and I can't (yet) get my head around why  -  and how to change it!    I do now think that G03 will be correct but still can't see how to specify I & J correctly.


On-line tutorials seem to be either short on detail or - much worse - have silly errors :(    Can you (anyone) point me to a worthwhile source that is not just a 'List' of G-Codes but a detailed exposition of what parameters need to be past along with each?   I also notice reference to non integer G-Codes (28.1, 54.1, 84.2 etc.)  but I've yet to find any further detail about what they are meant to do.

Offline JG

*
  •  50 50
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #3 on: July 19, 2020, 11:11:05 AM »
Well, after many more 'tests' I seem to have solved it.
New Code :
Code: [Select]
%
O0000     (Radius test)

N100 G17 G21 G54 G40  D0
N230 G00 X-100 Y50
N240 Z-27
N250 G01 Z-29 F250
N260 Y-70 F3000
N270 G03 X-80 Y-90 I20 J0
N280 G01 X80
N290 G03 X90 Y-80 I0 J10
N300 G01 Y10
N310 G03 X50 Y50 I-40 J0
N320 G01 X-100
N330 M05
N340 X200 Y100 Z0
N350 G40
N360 M30
%

Now all I have to do is figure out tool radius compensation :)

This exercise has at least taught me where to get the parameters for G54 etc.  but I'm still ignorant as far as 'CV' is concerned.



Offline Graham Waterworth

*
  • *
  •  2,322 2,322
  • Yorkshire Dales, England
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #4 on: July 19, 2020, 04:03:37 PM »
If you want sharp corners you have to turn off CV G61, this puts the control into exact stop mode.

G64 will turn CV back on but the faster that the cutter is entering the corner the bigger the radius will be to allow Mach3 to get around the corner without slowing the cut.

On some CAM systems you can tell it to output a G61 if the corner is less than a given angle or you can tell it to slow down on the corner and then go back to the programmed feed rate.

Using G61 all the time causes jerky movement on short moves so CV and slowing in tight corners is the best way to go.

-------------------------

Tool compensation is a way to allow for tool wear or to allow you to use a smaller tool than the code was originally programmed for.  It is not a quick fix to bad code.

You have to pre-plan for things to work right, select your tool, allowing for the smallest internal radius to be cut, the tool needs to be smaller than this.

If you wish to machine a square pocket of say 50 x 50mm with internal rads of 3mm then a 5mm cutter is a good choice. The datum is 0/0 in the centre of the square.

Pocket the hole leaving say 0.5mm under size for finishing.

Then you have to lead in to start your finish cut, this is a line followed by a radius that finishes tangent to the following line of cut, the rest of the profile is then machined and a lead out is performed that again is a rad followed by a line.

The finish profile is programmed as if the tool had a zero diameter (on the centre line) and the G41/G42 then allows for the tool diameter with the P word (cutter diameter) or D word (diameter offset number) on entry, which of G41/G42 is to be used depends on which side of the line you are on and the direction of travel, this example we are on the inside/left of the line and moving counter clockwise so its G41, G40 then cancels the compensation on the lead out.

The finish profile code would look something like this:-

O0001 (G41_5MM_ENDMILL_50X50_FINISH_PASS)

G21 G40 G80 G17

N1 (FINISH INNER PROFILE - FLAT  5MM)
T2 M6
G54 G00 G90 G43 X17.5 Y-2.5 Z25. S2000 M3
Z1.
G01 Z-2. F100.
G41 P2.49 X20. Y-5. F200.
G03 X25. Y0. I0. J5.
G01 Y22.
G03 X22. Y25. I-3.
G01 X-22.
G03 X-25. Y22. J-3.
G01 Y-22.
G03 X-22. Y-25. I3.
G01 X22.
G03 X25. Y-22. J3.
G01 Y0.
G03 X20. Y5. I-5.
G01 G40 X17.5 Y2.5
G00 Z25.
G91 G28 Y0 Z0 M5
M30

« Last Edit: July 21, 2020, 06:55:01 PM by Graham Waterworth »
Without engineers the world stops

Offline JG

*
  •  50 50
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #5 on: July 19, 2020, 05:31:48 PM »
Above and beyond with that response Graham  -- thanks.
As it happens I am familiar with the concepts of tool offset though I haven't previously handled it in G-Code -- I recently made a small box with M. C. Escher Lizards and some Initials inset but that was on a Roland MCX-20 which takes .DXF files. The letters and Lizards had to be cut out using an outside offset and the box lid with an Inside offset.

Using G-Code is a new experience for me but the concept of tool positioning is not.  There was no way you could second guess my past experience and your very good explanation is greatly appreciated.

How I hadn't noticed [ CV Mode ] is beyond me  :-[   but oddly enough - like so many options in Mach3 - when I click on it nothing seems to happen  ie. the green light doesn't change. It may well be that I'm in some state that precludes a change.  Notwithstanding that, you'll understand that I've done more testing and have been successful in 'drawing' the shape along with a second trace showing the offset. I also noticed that the feed-rate did change as the pencil approached each bend. From that I presume that CV is 'Off'.


I had a number of 'issues' which had to be addressed. Primarily to do with initial positioning of the second (offset) trace. My first attempt was to simply duplicate the code from N230 to N320

Code: [Select]
%
O0000     (Radius test)

N100 G17 G21 G54 G40 D0
N230 G00 X-100 Y50
N240 Z-32
N250 G01 Z-33.5 F250   (no tool Comp)
N255 S2000  M03
N260 Y-70 F3000
N270 G03 X-80 Y-90 I20 J0
N280 G01 X80
N290 G03 X90 Y-80 I0 J10
N300 G01 Y10
N310 G03 X50 Y50 I-40 J0
N320 G01 X-100

N330 G17 G21 G54
N335                                       (8Ø tool compensation)
N340 G00 X-104 Y54 Z-32
N350 G01 G42 P4 Z-33.6 F250
N360 X-100 Y-70 F3000
N370 G03 X-80 Y-90 I20 J0
N380 G01 X80
N390 G03 X90 Y-80 I0 J10
N400 G01 Y10
N410 G03 X50 Y50 I-40 J0
N420 G01 X-130

N530 M05
N540 G40
N550 X200 Y100 Z0

N560 M30
%

... but I soon found that I also needed most of N100 as well. I then found that the compensation didn't work correctly since I'd left N340 as X-100 Y50 and once I'd changed that to -104 and 54 line N360 needed X-100 (this wasn't needed in the first run because it was Modal).
I did try to insert G42 P4 at line 335 but that gave me other errors -- I still can't fathom why - or how to circumvent them, though I suspect that there is a way to account for a tool offset without manually specifying a new X and Y in line N340.


Offline Graham Waterworth

*
  • *
  •  2,322 2,322
  • Yorkshire Dales, England
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #6 on: July 19, 2020, 06:56:43 PM »
If you look at the code sample you can see how the start point has to be set to allow the tangent move to the work, its all based on the rad of the cutter the I words are incremental distances in the X axis the J is the same but in the Y axis.

So on a G03 line the X & Y is the absolute end point and the I & J are the incremental distance to the centre of the radius in X & Y or if not included its zero.

If you do not have CAM have a look at CAMBAM.
Without engineers the world stops

Offline JG

*
  •  50 50
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #7 on: July 19, 2020, 08:59:02 PM »
I understand most of that code Graham but to get a fuller understanding I've imported it into Mach3.

The simulation starts, but stops at line #8 giving an error "Tool radius not less than arc radius with comp..."  ---  I imagine that could be due to my copy of Mach3 having no entry for Tool 2 and although I have tried entries for the diameter of 5 and 10 it still  won't progress. 


There may need to be other entries needed but I haven't yet investigated the tool table so I'm 'flying blind' as it were :)


I do have CamBam installed but I'm initially looking at the very simple primitives of G-Code that can be done by hand to get a good grounding.  Ultimately I would like to get my head around the finer points, that's why I'm looking for pointers toward a fuller list of codes detailing what parameters are needed for each.


I have fathomed the fact that (normally)  I & J are incremental whilst X & Y are absolute  -- but that did take me a while :)
« Last Edit: July 19, 2020, 09:16:24 PM by JG »

Offline JG

*
  •  50 50
    • View Profile
Re: Simple radius cutting - isn't !
« Reply #8 on: July 20, 2020, 09:14:13 AM »
I'm not quite tearing my hair out but I am getting very confused at what Mach3 is telling me and how it 're-interprets' the same G-Code after very minor changes !

One error message this morning was "Tool radius greater than approach Line #19"  ??   Line 19 is G01 Z-34 ??

Removing that line - which was redundant due to the previous Z setting being Modal - cleared the error.

It also told me that the previously good reference to I-40  was wrong and would only accept I40  ??

Trying the use of G61 to turn CV on or off has caused all manner of weird effects such as the 20mm rad becoming a chamfer ??  -   the 10mm rad a ¼ ellipse, an 18mm rad or a 14mm chamfer -  and the 90º corner anything between 5mm rad and 70mm rad ?

I've resorted to closing and reopening Mach3 and even switching the Denford off and back on again  - all without regaining any 'consistency' !!

I'm beginning to think that 'Tool compensation' is not the way to handle 'Pocket' or 'External' cutting  :-\

Offline Tweakie.CNC

*
  • *
  •  8,706 8,706
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Simple radius cutting - isn't !
« Reply #9 on: July 20, 2020, 10:11:53 AM »

I'm beginning to think that 'Tool compensation' is not the way to handle 'Pocket' or 'External' cutting  :-\


Cutter radius compensation used to be the way all Gcode was used but things move on and affordable CAD / CAM software took over making it all so easy.

Tweakie.
KEEP SAFE !