Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: 01sporty on March 07, 2019, 08:20:36 PM

Title: So, what's wrong with this bit of code?
Post by: 01sporty on March 07, 2019, 08:20:36 PM
I recently put together a lathe so I'm completely new to it.
I set it up to do a simple reaming job.  I assumed it would work pretty much like a mill.
For some reason, the code just doesn't work.
It moves to Z.05 then X.24 then X0 Z.04 just fine.
When it tries to execute the G85, it moves to X0, dwells, then finishes the program.
It never reams the Z-.132.
Can someone tell me what's going on?

N10 %
N20 G18  G20  G40  G61  G90  G95
N30 G50  S3400
N40 O100 (REAM)
N50 (CREATED  03/07/2019 17:01:06)
N60  (#17 - T17 REAMER D 0.12INCH )
N70
N80 (T17 REAMER D 0.12INCH)
N90 G95  G18  G50
N100 (T17 REAMER D 0.12INCH)
N110 G0 T1717
N120 G97 M3 S850
N130 M7
N140
N150
N160 G0 Z0.05
N170 X0.24
N180 X0. Z0.04
N190 G85  X0 Z-0.132 R0.P500 F0.005
N200 G80
N210 G0 Z0.05
N220 X0.24
N230 G53 Z0.
N240 G53 X0.
N250 M9
N260 M5
N270 M30
N280 %
N290

Title: Re: So, what's wrong with this bit of code?
Post by: Graham Waterworth on March 08, 2019, 08:06:45 PM
The secret with Mach3 turn is to long code everything, cycles do not work like in mill

I take it you have a speed sensor on the spindle.  If not you can not do feed per rev only feed per minute.

Try it like this :-

%
O100 (REAM)
N10
N20 G18  G20  G40  G61  G90  G95
N30
N40
N50 (CREATED  03/07/2019 17:01:06)
N60  (#17 - T17 REAMER D 0.12INCH )
N70
N80 (T17 REAMER D 0.12INCH)
N90
N100 (T17 REAMER D 0.12INCH)
N110 G0 T1717
N120 G97 M3 S850
N130 M7
N140
N150
N160 Z0.05
N170 X0
N180
N190 G01 Z-0.132 F0.005
N200 G4 P500 (HALF A SECOND DWELL)
N210 G01 Z0.05 F0.05
N220 G00
N230 G53 Z0.
N240 G53 X0.
N250 M9
N260 M5
N270 M30
%
Title: Re: So, what's wrong with this bit of code?
Post by: 01sporty on March 09, 2019, 11:04:59 AM
So, just to be clear. G73, G83, and G85 all do not work in any release of Mach3?

Wow, that is a huge setback.
Title: Re: So, what's wrong with this bit of code?
Post by: 01sporty on March 09, 2019, 12:01:25 PM
Wait a minute, these guys got drilling cycles to work:
https://www.youtube.com/watch?v=I2nH1NWm4dg
https://www.youtube.com/watch?v=xyirJ8cPgQo

So what's the secret to their success?
Title: Re: So, what's wrong with this bit of code?
Post by: 01sporty on March 09, 2019, 02:03:25 PM
OK, after a bit more research I have found that Mach3Turn will only support G83.  G83.1 works by calling G83 and putting in a C1 parameter.
To make G83 work like G85, (my original problem), set Q equal to your depth of cut.
So my original code becomes:

N160 G0 Z0.04
N170 X0.24
N180 X0.
N190 G83  X0 Z-0.132 R0.Q0.132 F0.01
N200 G80
N210 G0 Z0.04

Title: Re: So, what's wrong with this bit of code?
Post by: 01sporty on March 09, 2019, 02:09:02 PM
One more question.  How does Mach3 call a macro?  It seems it would be fairly simple to edit the macro for G83 (M1083.m1s) into a G83 macro if you knew how to call it from Mach3.
Title: Re: So, what's wrong with this bit of code?
Post by: Graham Waterworth on March 09, 2019, 08:06:25 PM
Save your macro in the macro folder of your profile and call it with M1083 in your code
Title: Re: So, what's wrong with this bit of code?
Post by: 01sporty on March 10, 2019, 11:51:23 AM
One more question.  How does Mach3 call a macro?  It seems it would be fairly simple to edit the macro for G83 (M1083.m1s) into a G83 macro if you knew how to call it from Mach3.

I misspoke there.  I meant to say you could edit it to make it into a G85 macro.
As it turns out, Mach3Turn does make a G85 call, there just isn't a macro there to catch it. 
I made a copy of M1083.m1s and renamed it M1085.m1s.
I then tried to edit out the requirement for the 'Q' word to no avail. That requirement seems to come from without the macro and that was what was wrong with my original g-code.  The 'Q' word is always required.
It was easy to to edit my post processor to create this: N190 G85  X0 Z-0.132 Q0.0 F0.005
That line of code gives the result you would expect. Notice the 'P' word was also taken out, it's not supported.

On a side note, the G83 macro states that it will also do a G83.1 if you add a 'C1' parameter.  I haven't yet tried to confirm this.