Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: JG on July 22, 2020, 11:42:32 AM

Title: Cutting a Circle - Figures don't add up!
Post by: JG on July 22, 2020, 11:42:32 AM
Trying to get my head around G2 arc cutting, but the simulation shows that the circle diameter is not as designed.
Using an 8mm dia cutter - and therefore allowing a 4mm adjustment to the radius - the simulation shows that rather than cutting a 96.75mm dia pocket it will cut a 185.5mm dia ??? ?  whose radius is 92.75 --  so it's not even cutting 'double size'.

This is the code :
Code: [Select]
%
O0000  (Bore large shallow hole.NC)

N10 (Author - JG  - 22 July 2020)
N20 (for Denford MicroRouter Compact under Mach3 V2)
N30 (Thread Milling Ø100 x 3mm    -   bore = 96.75 - R= 48.375)
N40 ()
N45 (T3 D=8  Flat end-mill)
N50 (units mm)
N60 (X & Y 0 in MACHINE centre)
        (X min = -200, X max +200)
        (Y min = -100, Y Max = +100)
        (Z 0 at top)

N100 G17 G21 G00                   (set up XY Plane & Metric - fast traverse)
N110 X44.375 Y0 Z-50              (move XY & Z  Determine Z by reference to work)
N120 S8000 M3                         (set spindle speed & start spindle)
N130 F100 Z-52                        (set feed rate & plunge into work 2mm)
N140 F200 G2 I-44.375 J0        (set feed rate, cut Circle about 0,0)
(N150 F100 Z-54)                     (set feed rate & plunge into work 2mm)
(N160 F200 G2 I-44.375 J0)     (set feed rate, cut Circle about 0,0)

N1450 M05                               (Turn spindle off)

N1500 G00 X0 Y0 Z0                (move tool at fast rate to 0 0 0)
N1510 M30                              (Close Program)
%
I've included all comments/annotations rather than just the working lines in case there is something that I simply have wrong in the basic understanding.

Lines N150 and N160 are commented out because, with them in, Mach3 complained that "R or IJK are all missing from N150" - which I also don't understand - I would expect to take the first cut then reduce the feed for a further 'plunge' and then do a second cut (where I & J would be specified).  Ultimately there would be more cuts depending upon how deep I want the hole to be.

In the light of the Mach3 error message, can anyone suggest how the Z parameter can be specified in the same block as G2 and therefore create a helical cut getting deeper with each 'turn' and if such is possible how would the final depth the specified.

In case anyone thinks that the feeds and speeds are in error I should say that this would be cutting a hardwood such as Ash, Elm, Teak, Walnut  --  etc.
Title: Re: Cutting a Circle - Figures don't add up!
Post by: Graham Waterworth on July 22, 2020, 01:44:19 PM
A simple circle with the machine zero on the centre line of the circle and on the top face would be something like this :-

%
G21 G40 G00 G99 G17

N1 (8MM DIA END MILL)
G54 G00 G90 G43 X0 Y0 Z5. H3 S8000 M3
Z1.
G01 Z-52. F100.
X44.375 F200.
G02 I-44.375
G01 Z-54.
G02 I-44.375
G00 X0 Y0
Z5.
M30
%

For helical :-

%
G21 G40 G00 G99 G17

N1 (8MM DIA END MILL)
G54 G00 G90 G43 X0 Y0 Z5. H3 S8000 M3
Z1.
G01 Z-52. F100.
X44.375 F200.
G02 I-44.375 Z-54.
I-44.375 Z-56.
G00 X0 Y0
Z5.
M30
%
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 22, 2020, 02:53:00 PM
Thanks for the input Graham but your code produces exactly the same result as mine does   (I'm ignoring the helical for now).

To run it of course I had to modify the Z figures since my system has a Z max of 0 so Z5 and Z1 are both 'soft limit' errors.

Running a simulation and watching the X & Y DROs I see that the max X gets to 44.375 (as you would expect but the Min X goes to -133.125. Similarly the Max and Min Y go to + & - 88.75. From those figures I determine that with an 8mm cutter the diameter of the circle produced would be either 88.75+88.7+8  or  133.125+44.375+8  - both of which amount to 185.5   not the 88.75 ( 96.75-8 ) that I would expect from using a 44.375 offset.

To further check that I'm not ready for the asylum  :)     I've done a 'real life' test using my [Pencil] tool and produced a real plot - including marking the X0 Y0 position - see attached photo - you'll see that the ruler indicates about 177.5 dia and the line is just over 1 mm  wide  (that's due to the marginally off-centre sharpening of the pencil)  which further confuses the issue as it seems to be 8mm smaller than the simulation plot indicates   ???

Incidentally - I now know why I got the 'R or IJK missing' error - the way I'd added that line meant that G2 was still in operation and I should have issued a G1  :-[    but at least I've learned that today !!

In case you'd like to check that I haven't applied any pertinent changes to what you provided, here is the latest program which produced the plot :

Code: [Select]
%
G21 G40 G00 G99 G17

N1 (Pencil)
G54 G00 G90 G43 X0 Y0 Z0 T3 S3000 M3

G01 X44.375 F500.
Z-34
G02 I-44.375
G01 Z-34.5
G02 I-44.375
G00 X0 Y0
Z0.
M30
%
The second pass using Z-34.5 just presses the pencil down a little harder.

Title: Re: Cutting a Circle - Figures don't add up!
Post by: Graham Waterworth on July 22, 2020, 05:23:56 PM
You do not have the datum set right.

Move your pencil to a clear space.

Jog down until the pencil touches the paper.

Click Zero X to the left of the X DRO on the program screen.

Click Zero Y

Click Zero Z

Jog clear  in Z

Load and run this code

%
G21 G40 G00 G99 G17

N1 (8MM DIA END MILL)
G54 G00 G90 X0 Y0 Z5. S3000 M3
Z1.
G01 Z0 F100.
X50. F500.
G02 I-50.
G00 X0 Y0 Z5.
M30
%

You should get a 100mm circle give or take the line width of the pencil.

If not something is wrong in your settings

Title: Re: Cutting a Circle - Figures don't add up!
Post by: TPS on July 23, 2020, 03:20:15 AM
i assume in Config -> General config  the I/J Mode is set to absolute.

so your starting coordinate in X is 44,375

by using

G2 I-44,375

you are telling the System, that the Center X coordinate of your circle is absulute -44,375

so your start is at +44,375 and the Center is at -44,375 makes a radius of 88,75 and a
diamater of 177,5. exactly what your ruler Shows.

about the Min/Max:

Max X := X-Start = 44,375
Min X:= X-Start - Diameter = 44.775 - 177,5 = -133,125

Y is nowhere specified, so it takes the startvalue = 0

Max Y := 0 + Radius  = +88,75
Min Y := 0 - Radius = -88,75

so the entire Problem is the Absolute I/J Mode insteed of incremental.

with incremental Mode we will have the following situation

so your starting coordinate in X is 44,375

by using

G2 I-44,375

you are telling the System, that the Center X coordinate of your circle is incremental -44,375 witch
makes the Center going to absolute X = 0

so your start is at +44,375 and the Center is at 0 makes a radius of 44,375 and a
diamater of 88,75.

about the Min/Max:

Max X := 44,375
Min X:= -44.375

Y is nowhere specified, so it takes the startvalue = 0

Max Y := 0 + Radius  = +44,375
Min Y := 0 - Radius = -44,375







   
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 23, 2020, 03:59:34 AM
Thanks Graham & TPS  -  you have both helped immensely!

I've only run the codes on my 'simulation' system as yet but my next job is to go to the workshop system and test for 'real'. (I'll sharpen the pencil!)

Graham - your solution did work but I had to click [ Yes ] when asked to over-ride the soft limits.

TPS  -  you hit the nail firmly on the head!   -   I had assumed that IJK were incremental since I had seen that as the default so hadn't checked, but yes, it was set to absolute and once that was corrected the table display immediately changed.  ;D      I didn't really need to run the code (but I did) and of course the figures fell into line.

This probably also solves the seemingly erratic behaviour I'm seeing in another test of plotting a rectangle with 3 differently curved corners.      I'll let you know.

Title: Re: Cutting a Circle - Figures DO add up!
Post by: JG on July 23, 2020, 05:28:24 AM
Success all round - see photo attached showing 88.75mm dia circle about the centre of my machine table.

I knew it had to be something simple but there are so many potential 'adjustments' available in Mach3 that without pointers from experienced users it can become a mysterious 'fog' and I am very grateful for the advice received.

Now to cut some wood !     

Oh....   before I do,  Graham,  in your code for a helical cut, can the feed in the Z axis be specified ?    ie. can it be controlled separately from the X Y feed so that a 'thread' could be specified using the pitch as the Z distance per revolution?
Title: Re: Cutting a Circle - Figures don't add up!
Post by: TPS on July 23, 2020, 05:42:21 AM
this code from Graham:
Code: [Select]
%
G21 G40 G00 G99 G17

N1 (8MM DIA END MILL)
G54 G00 G90 G43 X0 Y0 Z5. H3 S8000 M3
Z1.
G01 Z-52. F100.
X44.375 F200.
G02 I-44.375 Z-54.
I-44.375 Z-56.
G00 X0 Y0
Z5.
M30
%

will start at Z -52
1st circle cut will bring Z to -54
2nd circle cut will bring Z to -56

so the pitch will be 2mm, it is not depending on Speed, it is depending on hight differenc (Z).
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 23, 2020, 05:56:45 AM
That is fantastic news TPS  -  and tells me exactly what I wanted to know - without me causing a disaster by running a cutter into wood.

I can see now that by changing the radius I can control the amount of 'cut' applied when milling a thread and by specifying the Z distance I'm specifying the 'pitch'.   I was obviously over-thinking the whole issue by not having very specific details about what parameters needed to be passed using G33, G34 or G76.


It is now going to be worthwhile making the thread-milling cutter I've already designed.  :)
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 24, 2020, 01:17:39 PM
Progressing a little further, I'm now wanting to cut a circular 'pocket' - well the outside - and I'd like it to be 22mm deep.
The top of the work is at Z= -52 so starting a Z= -51 to provide a 'Z lead-in' so that there is no plunge entry, I'm using G2 with the Z parameter changing at each pass by 2mm I want to get down to Z = -74 but, in the simulation, I'm getting a [Soft Limits] error when Z is below -71  ???   

This is the program I'm simulating :
Code: [Select]
%
O0010  (Bore ready to Thread Mill 80 x 3.NC)

N10 (Author - JG  - 24 July 2020)
N20 (for Denford MicroRouter Compact under Mach3 V2)
N30 (Thread Milling 80 x 3mm    -   bore = 76.75 - R= 38.376)
N40 (T3 D=8 Flatt End Mill to remove centre)
N45 (T4 D=24.32 Thread Mill cutter)
N50 (units mm)
N60 (X & Y 0 in MACHINE centre)
        (X Min = -200, X Max +200)
        (Y Min = -100, Y Max = +100)
        (Z Max = 0 at top    Z Min = -100)

N100 G17 G21 G00          (set up XY Plane & Metric - fast traverse)
N110 X34.0762 Y0 Z-51    (move XY & Z     -    Determine Z by reference to work)
N120 S8000 M3                 (set spindle speed & start spindle)
N130 F3000                        (set feed rate  -  simulation )
N140 G2 I-34.0762 J0 Z-52    (cut Circle about 0,0 feeding Z 2mm)
N150 I-34.0762 J0 Z-54
N160 I-34.0762 J0 Z-56
N170 I-34.0762 J0 Z-58
N180 I-34.0762 J0 Z-60
N190 I-34.0762 J0 Z-62
N200 I-34.0762 J0 Z-64
N210 I-34.0762 J0 Z-66
N220 I-34.0762 J0 Z-68
N230 I-34.0762 J0 Z-70
N240 I-34.0762 J0 Z-71
N250 I-34.0762 J0
(N260 I-34.0762 J0)        (Cut flat bottom    NO Z change)

N1450 M05           (Turn spindle off)

N1500 G00 X0 Y0 Z0  (move tool at fast rate to 0 0 0)
N1510 M30           (Close Program)
%

The error appears if I set Z in N240 to -72   --   I would expect (in theory) to be able to go to -100, there will of course be other factors such as tool length that will preclude that, but I'm not setting a tool Nº which might confuse the issue anywhere.

A separate question  -  after each rotation (line of G-Code  N140 - N240) there is a tool 'dwell'; can this be eliminated so that the program simply runs a continuous cycle ?
 

Title: Re: Cutting a Circle - Figures don't add up!
Post by: TPS on July 24, 2020, 01:28:32 PM
for the soft Limit error, you have to go to diagnostic page an have a look for the Machine Coord's

without Hardware reference Switches it is realy hard to use soft Limits, because they are allways related
to machine coords.
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 24, 2020, 01:42:15 PM
That was quick TPS !!   


I've found the [Diagnostics] and see that Z has a work offset 0f -29  which makes absolute sense BUT  I can't find a way to change that to zero.  -   I can simply type '0' over the -29 but can't see a [Save] and the figure returns to -29 when I go back to the Program Run page.

I have to stop programming for the evening - I'm due to host a Zoom Quiz at 6:45  :)    -  I'll look in later though.

Title: Re: Cutting a Circle - Figures don't add up!
Post by: TPS on July 24, 2020, 02:21:06 PM
that is what i tryed to explain (maybe my bad bavarian english is causing causing this).
softlimits are allways related to machine coords. machine cooods can only be set by
using Hardware reference Switches. thats it.
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 24, 2020, 07:36:47 PM
Certainly not your English TPS  -  that is vastly superior to my German :)   -  more likely to be my understanding.

I haven't yet tested this on my 'Real' system  -  it's on my simulation Office PC so no 'Hardware' attached  -  also it hasn't happened previously and I'm sure I've specified less than Z -71 in the past (I could well be mistaken though  :-\ ).


I will check the setting in the workshop system in the morning but I'd like to know how I can change the -29 to 0 -- as I've said I have no hardware attached so there surely must be a way to modify it.



Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 25, 2020, 07:09:12 AM
My workshop system did not have the -29 Z offset and when I closed the Office system & re-opened it - nor did that ??   How it became set to that figure will no doubt remain a mystery.

I've successfully cut the 'pocket' which is the 22mm deep bore for the 80mm thread so I have moved forward a great deal.  What I am now somewhat concerned about is the fact that clicking on the link A Wiki containing all the customization information for Mach3 (https://www.machsupport.com/Mach3Wiki/) just gives me a blank page and  the [Wizards] do not do what the Mach3Mill_1.84.pdf describes.

For instance I can select the [Circular Pocket] Wizard and I do get the screen display as shown on page 23 of the 'Manual' - Fig.3.8 I can modify the tool and pocket size but neither CW (M3) nor CCW (M4) are lit (even when I enter a spindle speed) and when I [Post Code] nothing changes and [EXIT] does not return me to the 'normal' screen and I can't find any way to regain control without closing & re-opening Mach3.
It is not just this 'Wizard' - I have tried [Thread Milling] and can't even change from inch to mm in that - again [EXIT] does not return me to 'Normal'.

I'm sure that once I can get more than a blank screen from the Wiki link many of my questions will be answered  :-\

 
Title: Re: Cutting a Circle - Figures don't add up!
Post by: Tweakie.CNC on July 25, 2020, 08:07:44 AM
Quote
I'm sure that once I can get more than a blank screen from the Wiki link many of my questions will be answered  :-\

https://web.archive.org/web/20070824162245/http://www.artsoftcontrols.com/MachCustomizeWiki/index.php?title=Main_Page

Tweakie.
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 25, 2020, 09:09:16 AM
Thanks for the link Tweakie but it doesn't give me much benefit  :(

There are a few 'links' which simply say something to the effect that "This is available on the Web and hasn't been archived" but doesn't provide a link to where it is on the web.

Also. there are many entries in the contents tree with no links at all ----  not at all what I expected a 'Wiki' to be.

Is it reasonable to expect the Wizards to work as expected or is this another of those issues that have been sidelined by the fact the Mach4 is now taking all the development resource and Mach3 is 'as is' ?  (like the G41, G42 offset issue I came across)



Title: Re: Cutting a Circle - Figures don't add up!
Post by: Tweakie.CNC on July 25, 2020, 09:59:35 AM
Unfortunately the 'Wiki' was terminated when the forum was re-designed for Mach4 and all that is left nowadays is the archived fragments.
Perhaps check out the Mach2 Customisation manual - that may have some more comprehensive details; https://www.machsupport.com/wp-content/uploads/2013/02/Mach2_6.11_Custom.pdf

As you say, Mach3 is 'as is' and as far as I can see, that is the way it will remain.

Tweakie.
Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 25, 2020, 10:34:48 AM
A quick scan though the Mach2 Custom .PDF seems to indicate that there is a probability that it will contain useful information when I have done a bit more study.

Currently I'm looking carefully at the Mach4 GCode Manual which is certainly more comprehensive than any previous G-Code tutorial I've seen -- specifically detailing the parameters expected for each code and providing explanations as to what each is expected to do.

It may well be that some of the codes have seen embellishment or at least 'tweaking' but I suspect that in general I can use the information for testing.

Having hand-coded a program to cut a circular pocket, clearing all the internal waste material away -  and realizing how tedious changing many lines of code can be, not to mention the fact that I now have to do the same to mill the thread, with each pass needing to feed the cutter a little deeper (increased radius) --- I'm considering writing a Program (in Pascal) to enter the various potential variables -- Pocket dia. & depth, Tool dia., Feed rate etc. which will then output the G-Code with all the many lines of code taking account of each 'pass' needed.  It won't be a 10 minute exercise though  ;D
Title: Re: Cutting a Circle - Figures don't add up!
Post by: Graham Waterworth on July 25, 2020, 07:14:34 PM
Why do you want to re-invent the wheel, why not use the built in wizards, click on the wizards menu and you have all the included ones in a window.

Title: Re: Cutting a Circle - Figures don't add up!
Post by: JG on July 25, 2020, 07:24:55 PM
Two reasons Graham  -   One is that I always like to know how things work since that gives me a better understanding when thing (inevitably) go wrong,  but the more important reason is that I can't get the Wizards to work  >:D

I have found the Wizards List as you point out and can select [Circular Pocket] or any of them for that matter but whatever I do after changing the parameters and clicking on [Post Code] when I click on [EXIT] nothing happens and I have to close Mach3 and re-start it  :(    so obviously there is no code in the window.