By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Allendale Jan 24th

Fusion 360, Mach4 and first test of cnc router

All Topics | Latest Posts

Search for:  in Thread Title in  
Steve Pavey19/01/2021 14:46:59
336 forum posts
39 photos

I've got to the stage of attempting a first run with my cnc router. I drew up a 100x50x4mm cuboid in Fusion360, and generated the g-code file attached below. Loading it into Mach4 the preview of the path shows that the tool is going to describe some large arcs at three of the corners - possibly the lines which include I and J codes such as G2 X105 Y51 I101 J51.

Am I right in thinking that this is because I have added or omitted something in one of the F360 dialogs at the manufacture setup stage? Maybe something to do with lead-in and lead-out??

Also, I am confused on setting up the work origin. I have started by homing the spindle and zeroing the X,Y and Z axes, followed by manually jogging the cutter to the corner of the stock. At this point I'm setting G54 in the Mach4 dialog, so the DRO's display the offset (lets say that X Y and Z show 300, 200 and 80 for example). I'm not sure how Fusion360 can use this though - do I have to add a line of g-code along the lines of G54 X300 Y200 Z80? In which case where do I add it? Or does Mach4 use the G54 info I put in to sort out where the cutter actually moves to before it starts running the Fusion360 code?

Sorry for the dumb questions, but it has taken a bit of effort to get this far and I really don't want to destroy the machine before I've done any real work with it! And this first test will be run with the stepper motor couplings disconnected and the cutter removed!!

: (PGM, NAME="1001"
; MACHINE
; VENDOR AUTODESK
; MODEL CNC ROUTER
; DESCRIPTION GENERIC 3-AXIS
; T1 D=8 CR=0 - ZMIN=-4.5 - FLAT END MILL
: G90 G40 G94
G17
G71
; WHEN USING FUSION 360 FOR PERSONAL USE, THE FEEDRATE OF
; RAPID MOVES IS REDUCED TO MATCH THE FEEDRATE OF CUTTING
; MOVES, WHICH CAN INCREASE MACHINING TIME. UNRESTRICTED
; RAPID MOVES ARE AVAILABLE WITH A FUSION 360 SUBSCRIPTION.
M26
; 2D CONTOUR1
:T1 M6
S3500 M3
H0
G0 X101 Y-3
G1 Z20 F175
Z6
Z2
Z-4.5 F1059
X83 F175
Z-3.5
X69
Z-4.5 F1059
X33 F175
Z-3.5
X19
Z-4.5 F1059
X1 F175
G17 G2 X-3 Y1 I1 J1
G1 Y19
Z-3.5
Y33
Z-4.5 F1059
Y51 F175
G2 X1 Y55 I1 J51
G1 X19
Z-3.5
X33
Z-4.5 F1059
X69 F175
Z-3.5
X83
Z-4.5 F1059
X101 F175
G2 X105 Y51 I101 J51
G1 Y33
Z-3.5
Y19
Z-4.5 F1059
Y1 F175
G2 X101 Y-3 I101 J1
G3 X100.2 Y-3.8 I101 J-3.8
G1 Y-4.6
G19 G2 Y-5.4 Z-3.7 J-4.6 K-3.7
G1 Z20
G17
M26
G0 X0 Y0
M30
M2

Andrew Johnston19/01/2021 14:57:20
avatar
5927 forum posts
666 photos

There are two ways to program a cutter to go round a corner. One, let the cutter go one radius beyond the corner as it decelerates. Then accelerate in the perpendicular direction. That way you get a sharp corner unaffected by acceleration/deceleration effects. The alternative is to pivot the cutter around the corner point, which means the centre of the cutter follows an arc. The latter is most common as it saves time and leaves an acceptable corner.

Andrew

geoff adams19/01/2021 16:53:24
202 forum posts
196 photos

hope this helps when using fusion you set where you want the zero in xy and z to be on your part transfer the data to your machine control you then need to set the machine to zero on your workpart by joging probimg or edge finder then set the dros to zero this will give you g54 zero fusion is a cam package it does not no where you part is on the machine table the machine needs to now where the part is to the table confusing i know think of it as two separate operations fusion does the cam then you need to set the machine to zero on the part looking at your g code you have h0 for tool 1 this needs to be g43 h1 for the length off to work

pm me and we can talk if you need Geoff

JasonB19/01/2021 17:00:50
avatar
Moderator
19930 forum posts
2172 photos
1 articles

You should be able to see what path the tool is taking in F360's simulator and it will also show the tool path in both the manufacture and simulation screens. 

Under passes you have probably set it to "keep shape corners with loop, I tend to leave it on "roll around corners" and if it's a large movement then look in linking as your linear lead in is large, the default 0.6mm should so for most things.

I set the datum point I want to use during setup, usually top ctr of the work and then locate ctr of work on machine and zero X & Y then set my tool 20mm above top of work with a block and set Z as +20

Edited By JasonB on 19/01/2021 17:11:16

JasonB19/01/2021 17:19:30
avatar
Moderator
19930 forum posts
2172 photos
1 articles

This shows the tool path in blue for the usual roll around corners. I set the stock to have 5mm waste all around the sides. You can also dee my datum top ctr of the part.

roll around.jpg

And this is the sharp corners with loop. It actually goes past the corner in a straight line which is shown in green, then lifts, repositions and drops yellow and red before a green leading at 90deg to the previous cut. as andrew says it takes longer

sharp with loop.jpg

Steve Pavey19/01/2021 18:44:29
336 forum posts
39 photos

Thanks Geoff, a kind offer and useful to read your summary on setting the work co-ordinates. i’m Afraid you lost me on the H0 and G43 H1 bit at the end though.

Jason - checking on the setup in F360, I actually already have it set to roll round the corners. Also the simulation in F360 doesn’t show the loops at all. They only show up when I import the code into Mach4. For my last test I edited the code in Mach4 to reduce all the Ixx and Jxx codes down to 5 (mm) which obviously reduced the size of the loops considerably. And when running the code I noticed that the Z height remained the same, ie the tool didn’t retract out of the work. Of course, if I was cutting this shape from a large sheet these loops would result in a lot of waste!

I’m pretty sure this is all something to do with the setup options in Fusion360, and me not being familiar with them, along with Mach4 being mostly incomprehensible for novices.

Andrew Johnston19/01/2021 19:04:11
avatar
5927 forum posts
666 photos

The toolpath that the CAM program simulates and what the G-code actually cuts are not always the same. I use NCPlot to backplot the toolpath from the G-code as a sanity check on the real toolpath. It also calculates maximum excursions in all axes, which is another useful sanity check.

Andrew

Martin Connelly19/01/2021 19:15:41
avatar
1660 forum posts
179 photos

Rolling around corners also keeps the cutter engaged with the workpiece. Usually a better option. The facing wizards in Mach3 do not have this option (that I could find) so I had to write a parameterized file to do it for when I wanted to do it without going down the CAD CAM route.

Martin C

JasonB19/01/2021 19:35:20
avatar
Moderator
19930 forum posts
2172 photos
1 articles

This is the G-Code I get out for Mach3mill which I think does for Mach4 too for roll around. The 4mm is the radius as the tools ctr line goes around each corner, the 0.3 radius is lead in/out. Apart from knocking out the G28 codes as I don't use homing I have not had to alter any code so far and it seems to have gone where the simulator said it would.

1001)
(ALL OPS)
(T2 D=8. CR=0. - ZMIN=-4.5 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G21
(WHEN USING FUSION 360 FOR PERSONAL USE, THE FEEDRATE OF )
(RAPID MOVES IS REDUCED TO MATCH THE FEEDRATE OF CUTTING )
(MOVES, WHICH CAN INCREASE MACHINING TIME. UNRESTRICTED )
(RAPID MOVES ARE AVAILABLE WITH A FUSION 360 SUBSCRIPTION. )
G28 G91 Z0.
G90

(2D CONTOUR1)
M5
T2 M6
S2426 M3
G54
M8
G0 X-50.3 Y30.2
G43 Z15. H2
G1 Z5. F182.
Z1. F61.
Z-4.2
G19 G2 Y29.9 Z-4.5 J-0.3 K0. F182.
G1 Y29.3
G17 G3 X-50. Y29. I0.3 J0.
G1 X50.
G2 X54. Y25. I0. J-4.
G1 Y-25.
G2 X50. Y-29. I-4. J0.
G1 X-50.
G2 X-54. Y-25. I0. J4.
G1 Y25.
G2 X-50. Y29. I4. J0.
G3 X-49.7 Y29.3 I0. J0.3
G1 Y29.9
G19 G3 Y30.2 Z-4.2 J0. K0.3
G1 Z15.
G17

M9
G28 G91 Z0.
G90
G28 G91 X0. Y0.
G90
M30

Edited By JasonB on 19/01/2021 19:45:23

Steve Pavey19/01/2021 20:41:10
336 forum posts
39 photos

I've just drawn a new test piece, making sure I selected the 'roll round corner' option. Again the file produced large loops on three of the corners, with no Z command to raise the tool. The offending lines in the code are:

G2 X2 Y56 I2 J52

G2 X106 Y52 I102 J52

G2 X102 Y-2 I102 J2

I think the I value gives a loop of 102 mm radius, judging by the shape of the toolpath it displayed.

I edited these lines, changing the values of I and J to 2, which results in smaller loops as expected, though clearly it is still no good, resulting in this toolpath:

The toolpath in F360 looks like this, annoyingly showing the tool path I want:

And the dialog relating to corners in the setup looks like this:

I'm starting to think that perhaps I should be looking at an alternative program to sort out the G code if Fusion is going to insist on putting in secret moves that I only discover after I've made the trip to the workshop!

Andrew Johnston19/01/2021 20:48:57
avatar
5927 forum posts
666 photos

I suspect your post-processor may not be set up correctly. How are you setting up G02 and G03? I've seen the odd wobbly in generating G02/G03 commands, but never on every one in a design.

Andrew

JasonB19/01/2021 20:49:01
avatar
Moderator
19930 forum posts
2172 photos
1 articles

The other thing I can see in your code is that you have presumably entered a machine as it says CNC router and generic 3-axis. Try it without entering a machine and just leave it showing "select" on the first item of set up.

The blue screenshot you show doe snot have 102mm radius loops if the part is only 100 x 50mm

As I said I've never found it to have any "secret moves" the only time I've had the odd issue is either by entering datum point wrongly between what I used when setting up in fusion and what I did on the machine eg top of part on model and bottom of part when setting up but that's all down to my errors

Edited By JasonB on 19/01/2021 20:52:17

Steve Pavey19/01/2021 21:25:50
336 forum posts
39 photos

Andrew - I’m not setting up G02/G03 commands, unless that is something that happens when F360 generates its G codes. But putting your comment alongside Jason’s suggestion that I shouldn’t be specifying a machine suggests that this could be the cause of the problem maybe, ie choosing the wrong hardware setup gives me the wrong ‘starting point’ so to speak. I will try changing that first thing tomorrow.

And the reason the blue screenshot doesn’t show the large 102mm loops is that I edited them to 2mm before recording this screen - still there but very much smaller.

I really appreciate the help from everyone - sometimes even YouTube fails to provide the sort of answers that this forum does so helpfully.

blowlamp19/01/2021 21:40:24
avatar
1482 forum posts
97 photos

This is a common problem in Mach 3.

You'll probably need to change the I&J arc centre settings, either in your post-processor or within Mach settings.

Martin.

pete hammond19/01/2021 21:49:32
16 forum posts

Steve,

I think if you change , in mach general config screen ,IJ mode ,from incremental to absolute you will be a happy man!

Good Luck

Pete

JasonB20/01/2021 07:06:11
avatar
Moderator
19930 forum posts
2172 photos
1 articles

I can't see it being something that needs changing in Mach as the G-code that the F360 post processor gives me is one without the loops but Steve is getting loops before he has even got to the computer running mach4, seems more likely a PP issue as it looks OK on the F360 screen.

Though with the difference in the X position and I being 4 (106-102) that does point to incremental and absolute as the 8mm tool should follow a 4mm radius but that is being put in at PP stage.

Even if your blue screen capture is after alteration the arcs are more than 2mm radius, top left may be that size but others are larger. Bottom left will take a chunk out the work if you say it is not lifting the tool.

Edited By JasonB on 20/01/2021 08:45:40

geoff adams20/01/2021 10:42:22
202 forum posts
196 photos

hi Steve had a closer look at your code this morning are you using mach3 post processor there some errors as i said before h0 needs a g43 command you are using tool1 so the command needs to be g43 h1 if you are using multiple tools the machine needs to know the length difference of each tool and entered into the offset page

there is no g54 command mach3 needs this to know where your part is on the table in xy and z

m26 at the end of the prog mach does not have that code looked it up tool unclamp ?

when i use fusion i get g28 codes at being and end of prog and tool changes this takes the machine back to the machine home position it does need more code to work if you look at Jasons code you can this

if you look at Jasons code for his g2 and g3 its incremental g91.1

g71 metric in your code g21 metric in Jasons

so there are a lot of differences between the to two programs makes me think your using the wrong the wrong p.p

spent many years programming cnc by hand

Geoff

JasonB20/01/2021 11:03:41
avatar
Moderator
19930 forum posts
2172 photos
1 articles

I suppose the obvious question is have you selected Mach3mill?

pp f360.jpg

My code comes up OK on teh Mach3 computer

20210120_084859[1].jpg

Edited By JasonB on 20/01/2021 11:07:17

Emgee20/01/2021 11:24:04
1919 forum posts
243 photos

Perhaps there is a difference in Mach 4 to Mach 3 operation but as Jason says "roll around " does produce a square corner using Mach 3 PP

Perhaps using a different PP would give the result required, especially if no machine is entered in the set-up,
try a Fanuc PP.

Emgee

Steve Pavey20/01/2021 11:45:46
336 forum posts
39 photos

Well, thanks to all of you - Pete has solved it and he is absolutely right, as I’m now happy. The Defaults tab in the Mach4 Configuration dialog has a setting for Arc Centre Mode, which was set to Incremental rather than Absolute (there is a similar setting for Distance Mode, which also needs setting to Absolute). But all the other suggestions and information has proved to be very useful - it’s forced me to work through a lot of Fusion dialogs and become more familiar with at least a few of those settings as well.

Re my earlier G54 question, I have inserted a line near the start, just before the spindle switches on:

G54 X00 Y00 Z00

intended to take the cutter from the machine home position to the workpiece zero position. Am I right in thinking that this is something that isn’t (or can’t be) done in Fusion, but needs to be done manually for every job? And is that particular syntax ok?

Thanks again - now to fit the couplings to the steppers and try it again (without a cutter fitted - one step at a time!).

Edited By Steve Pavey on 20/01/2021 11:47:21

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Support Our Partners
JD Metals
emcomachinetools
ChesterUK
Eccentric July 5 2018
cowells
Warco
Eccentric Engineering
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest