Hello Guest it is March 28, 2024, 09:32:51 AM

Author Topic: Misinterpretation of a relative move (G91) using G2?  (Read 8012 times)

0 Members and 1 Guest are viewing this topic.

Misinterpretation of a relative move (G91) using G2?
« on: January 17, 2010, 11:38:51 AM »
Hi everyone. I am new to MACH 3 and I’m having a problem converting an old program.

Mach seems to be misinterpreting a relative Z move in an arc command.

I wrote a sub-program to helix into my work piece, do a couple of clean up articulations, then extract.

Here is the code of my sub-program.

O21
N1 Y.0581 F20.
N2 G2 G17 J-.0581 Z-.2 F6. L11
N3 G1Y.015 F20.
N4 G2 G17 J-.0731 F20.
N5 G1 Y.005 F20.
N6 G2 G17 J-.0781 F20.
N7 G0 Y-.0781
N8 G0 Z2.2 M99

In 2 commercial machines, the N2 line using G91 (relative) is interpreted as each articulation goes -.2 deeper into the work piece, thereby going 2.2 inches deep in the 11 iterations.
N8 then retracts the tool from the work piece and X, Y and Z are back where the sub-program started.

Under Mach, the Z move is treated as relative on the first iteration, but never goes any further into the work piece. Z started at +0.1 and after the first iteration is at -0.1, so it appears to interpret the first iteration as relative. However, the next 10 iterations are all at a Z of -0.1.

Am I doing something wrong or is Mach misinterpreting this line?

Thanks in advance!

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #1 on: January 17, 2010, 11:48:03 AM »
I think you need to have the L11 in the M98 line, and use a parameter for the depth, increasing the parameter with each iteration.
Gerry

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

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

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #2 on: January 17, 2010, 01:04:12 PM »
Try it like this

O20
G91
M98 P21 L11
G0 Z2.2
M30

O21
G1 Y.0581 F20.
G2 G17 J-.0581 Z-.2 F6.
N3 G1Y.015 F20.
N4 G2 G17 J-.0731 F20.
N5 G1 Y.005 F20.
N6 G2 G17 J-.0781 F20.
N7 G0 Y-.0781
M99

Graham
Without engineers the world stops
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #3 on: January 17, 2010, 02:19:13 PM »
Try it like this

O20
G91
M98 P21 L11
G0 Z2.2
M30
The problem with that is I want to do the 11 iterations and then do the final 2 clean up passes at full cutter length to get a good clean journal with no helical cutter marks.

I removed the L11 command and added 10 complete copies of the N2 G2 G17 J-.0581 Z-.2 F6. code and it does what I want.

I still think the line as originally stated should work.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #4 on: January 17, 2010, 02:24:49 PM »
According to the manual, it looks like Mach only supports the L word in M98 or G10 codes.
Gerry

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

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

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #5 on: January 17, 2010, 05:07:22 PM »
OK, do it like this

O20
G91
M98 P21 L11
G1 Y.0581 F20.
Y.015
N4 G2 G17 J-.0731 F20.
N5 G1 Y.005 F20.
N6 G2 G17 J-.0781 F20.
N7 G0 Y-.0781
G0 Z2.2
M30

O21
G1 Y.0581 F20.
G2 G17 J-.0581 Z-.2 F6.
G1 Y-.0581
M99

Graham
« Last Edit: January 17, 2010, 05:09:05 PM by Graham Waterworth »
Without engineers the world stops
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #6 on: January 17, 2010, 08:56:42 PM »
This rattles Y less and accomplishes what I wanted. But if you allow indirectly what you disallow directly, what is saved?
My original code encapsulated the operation in a testable sub program where the start and end locations were exactly the same.
Powerful programming techniques are disallowed with the restrictions imposed with little (to no) gain.
O20
G91
G1 Y.0581 F20.
M98 P21 L11
Y.015F20.
N4 G2 G17 J-.0731 F20.
N5 G1 Y.005 F20.
N6 G2 G17 J-.0781 F20.
N7 G0 Y-.0781
G0 Z2.2
M30

O21
G2 G17 J-.0581 Z-.2 F6.
M99

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #7 on: January 18, 2010, 05:58:35 AM »
Mach3 is a different system, will your original code work on a Haas, Fanuc, Anilam, Meldas, Heidenhein, Sinumerik no it will not so why should it run an Mach3 and why is your old control doing it the right way and every other doing it wrong, simple answer is they are not, they are all g-code controls and all produce a part.  They just use a different dialect with custom functions.  :)

Graham
Without engineers the world stops
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #8 on: January 19, 2010, 10:26:06 AM »
I just find it unfortunate that a relatively easy to implement functionality is not used as much as possible, in as many places as possible. If your preprocessor just expanded any command that contained an L word, it adds great functionality at a low implementation cost.

Of the list you provided, only HAAS has been tried (by a friend) and it worked. I ran it on an old Yaznac MX1!

Again, if something is allowed indirectly, there is no gain in disallowing it directly.

Offline kf2qd

*
  •  148 148
    • View Profile
Re: Misinterpretation of a relative move (G91) using G2?
« Reply #9 on: June 01, 2010, 11:47:45 AM »
Flyer Tuck -

What was a nice feature on whatever machine you ran before is not a common feature so you would be hard pressed to find it on other machines designed by other people. Subroutines and such were not part of the original spec and as they were added most manufacturers tried to keep them defined so the various post processors would work without a major expense for the users of their machines. A few manufacturers had special functions and created special tools to take advantage of those special functions as a way to sell their project and perhaps leverage the customer into buying their machine in the future. As the machine tool industry has aged some of the old marketing schemes have been viewed as benefitting the manufacturer rather than the customer so customers have looked for other ways to meet their need for machine tools. Thus some of the old iron companies are no longer in business and smaller companies that build similar machines have become more the norm. And inordwer to sell a machine it needs to work with the software that the customer is already using. Thus some of the extra features that are not absolutely necesary have disapeared.

And seeing as how most CNC programmers have not been computer programmers it was easier to get results with simpler programmeing requirements. Results is what drove the process, rather than great skills.