Hello Guest it is April 19, 2024, 08:20:54 PM

Author Topic: Strange toolpath  (Read 7862 times)

0 Members and 1 Guest are viewing this topic.

Strange toolpath
« on: October 15, 2007, 07:40:51 AM »
Hi,

I have written the following code but I don't understand why the first subroutine work good and the second make a strange toolpath ( the tool goes on a wrong path ).

If I add the thirth subroutine the path is still wrong.

Can you help me ?

Where is my error ?

Thanks.
Maurizio




(#9001 = QUOTA OFFSET ASSE X )
(#9002 = QUOTA OFFSET ASSE Y )

(--------------------------------------------------------------------------)
(                 INIZIALIZZAZIONE MACCHINA                )
(--------------------------------------------------------------------------)

(- SELEZIONE PIANO XY INTERPOLAZIONE -)
G17

(- EXACT STOP MODE -)
G61

(- ABSOLUTE DISTANCE MODE -)
G90

(- NESSUNA CORREZIONE UTENSILE -)
G40

(- MANDRINO FERMO -)
M5

(- RESET OFFSET -)
G92.1


(--------------------------------------------------------------------------)
(                 POSIZIONAMENTO IN SICUREZZA          )
(--------------------------------------------------------------------------)

G01 Z200 F3000
G01 X0 Y0 F3000
 
M3
G04 P3


(--------------------------------------------------------------------------)
(         REALIZZAZIONE CONNETTORE DB9                )
(--------------------------------------------------------------------------)


(*** CONNETTORE DB9 IN ALTO SX *** )

G01 Z10 F3000

#9001=37.25
#9002=125.50

M98 P1001 L1


(*** CONNETTORE DB9 IN ALTO DX *** )

G01 Z10 F3000

#9001=100.75
#9002=125.50

M98 P1001 L1



(--------------------------------------------------------------------------)
(                 POSIZIONAMENTO IN SICUREZZA           )
(--------------------------------------------------------------------------)

G01 Z200 F3000
G01 X0 Y0 F3000


M5

M30




(**************************************************************************)
(**************************************************************************)
(                              SUBROUTINES                                 )
(**************************************************************************)
(**************************************************************************)



(**************************************************************************)
(* CONNETTORE DB9 SU PANNELLO 2 MM                                        *)
(**************************************************************************)

O1001

G01 Z10 F3000

G01 X[#9001] Y[#9002] F3000

G01 Z2 F3000

G01 Z-1 F120

G41
G01 X[#9001+0.00] Y[#9002+5.15] F120
G01 X[#9001-6.95] Y[#9002+5.15] F120
G03 X[#9001-9.45] Y[#9002+2.65] J-2.50 F120
G01 X[#9001-8.44] Y[#9002-2.65] F120              (QUOTA CORRETTA PER ESTETICA)
G03 X[#9001-5.98] Y[#9002-5.15] I2.5 F120
G01 X[#9001+5.98] Y[#9002-5.15] F120
G03 X[#9001+8.44] Y[#9002-3.08] J2.5 F120
G01 X[#9001+9.45] Y[#9002+2.65] F120
G03 X[#9001+6.95] Y[#9002+5.15] I-2.5 F120
G01 X[#9001+0.00] Y[#9002+5.15] F120
G01 X[#9001+0.00] Y[#9002+0.00] F120
G40

G01 Z2 F3000
G01 X[#9001-12.5] Y[#9002+0.00] F3000
G01 Z-1 F120

G41
G01 X[#9001-12.5] Y[#9002+1.6] F120
G03 X[#9001-12.5] Y[#9002-1.6] J-1.6 F120
G03 X[#9001-12.5] Y[#9002+1.6] J1.6 F120
G40

G01 Z2 F3000

G01 X[#9001+12.5] Y[#9002+0.00] F3000

G01 Z-1 F120

G41
G01 X[#9001+12.50] Y[#9002+1.6] F120
G03 X[#9001+12.50] Y[#9002-1.6] J-1.6 F120
G03 X[#9001+12.50] Y[#9002+1.6] J1.6 F120
G40

G01 Z10 F3000


M99

(**************************************************************************)


Online Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: Strange toolpath
« Reply #1 on: October 15, 2007, 08:21:22 AM »
In what way is the 2nd path wrong?

The only thing I can see wrong with the code is that Mach has no reference to the tool size for the G41's, you need to put a Px.xx or a Dnn

Where x.xx is the tool diameter and nn is a tool number for the offset containing the tool diameter.

If you have programed allowing for the tool size then the G41's are not needed.

Graham.
« Last Edit: October 15, 2007, 08:43:12 AM by Graham Waterworth »
Without engineers the world stops
Re: Strange toolpath
« Reply #2 on: October 15, 2007, 08:30:31 AM »
G01 Z200 ? are you in metric mode also maybe this line is doing it to you (- RESET OFFSET -)
G92.1 is there a value for the x and y
you have one of these code file I just don't work with that often
« Last Edit: October 15, 2007, 08:43:55 AM by Lakeside design »
Re: Strange toolpath
« Reply #3 on: October 15, 2007, 08:33:38 AM »
Hi Graham,

If you load the code on Mach 3 you will see that the first object is OK.
The second object ( called the second time from the same subroutine ) has some jump form the second toolpath to the first toolpath.
You can see this problem also from the toolpath window.

I have also tried to work on CNC but the tool has been broken from this strange return to the first object.

If I write the same program without subroutines but with only one program the second object is OK.

The same problem will occour if I repeat 3-4-5 times the same subroutine.

I think that is a problem on program but I have not understand where !!!!


Online Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: Strange toolpath
« Reply #4 on: October 15, 2007, 08:56:17 AM »
Try this version, but change the tool dias in the marked lines.

Graham.

%

(#9001 = QUOTA OFFSET ASSE X )
(#9002 = QUOTA OFFSET ASSE Y )

G20 G17 G90 G40 G61
G00 Z200
X0 Y0
M3
G04 P3
Z10
#9001=37.25
#9002=125.50
M98 P1001 L1
G00 Z10
#9001=100.75
#9002=125.50
M98 P1001 L1
G00 Z200
X0 Y0
M5
M30

O1001
G00 Z10
X[#9001] Y[#9002]
Z2
G01 Z-1 F120

G41 P1. (change this for your cutter dia)

X[#9001+0.00] Y[#9002+5.15]
X[#9001-6.95] Y[#9002+5.15]
G03 X[#9001-9.45] Y[#9002+2.65] J-2.50
G01 X[#9001-8.44] Y[#9002-2.65]
G03 X[#9001-5.98] Y[#9002-5.15] I2.5
G01 X[#9001+5.98] Y[#9002-5.15]
G03 X[#9001+8.44] Y[#9002-3.08] J2.5
G01 X[#9001+9.45] Y[#9002+2.65]
G03 X[#9001+6.95] Y[#9002+5.15] I-2.5
G01 X[#9001+0.00] Y[#9002+5.15]
X[#9001+0.00] Y[#9002+0.00]
G40
G00 Z2
X[#9001-12.5] Y[#9002+0.00]
G01 Z-1

G41 P1. (change this for your cutter dia)

X[#9001-12.5] Y[#9002+1.6]
G03 X[#9001-12.5] Y[#9002-1.6] J-1.6
G03 X[#9001-12.5] Y[#9002+1.6] J1.6
G40
G00 Z2
X[#9001+12.5] Y[#9002+0.00]
G01 Z-1 F120

G41 P1. (change this for your cutter dia)

X[#9001+12.50] Y[#9002+1.6]
G03 X[#9001+12.50] Y[#9002-1.6] J-1.6
G03 X[#9001+12.50] Y[#9002+1.6] J1.6
G40
G00 Z10
M99

%

Without engineers the world stops
Re: Strange toolpath
« Reply #5 on: October 15, 2007, 09:42:24 AM »
I have tried it but have the same behavior of my program.

The first object is OK.
After the CNC goes to the second object, make the first G01 code and now go to the coordinates of first object.
The result is a jump from the second to the first object for 3 times when he work on the same object.

If I load your Gcode on Mach3 l see the jump from a object to other.

Maurizio

Re: Strange toolpath
« Reply #6 on: October 15, 2007, 09:58:02 AM »
After the CNC goes to the second object, make the first G01 code and now go to the coordinates of first object.

The result is a jump from the second to the first object for 3 times when he work on the same object.
Maurizio

That tells me that your code is reading the first shift as a single G91 move. Then it is going back to G90. Have you thought about just using another offset like G55 and repeat the code?
you use those funny code [#9001-12.5] I just don't work with them so I'm not much of a help

(- RESET OFFSET -)
G92.1 is reset where G92 is offset coordinates and set parameters
« Last Edit: October 15, 2007, 10:05:32 AM by Lakeside design »
Re: Strange toolpath
« Reply #7 on: October 15, 2007, 10:17:11 AM »
Dear Lakeside,

I haven't programmed offset or G55 function.

I use the subroutine to repeat the same object in different position ( the object can be repeated 50-60 times on the same program ).

Regards
Maurizio
Re: Strange toolpath
« Reply #8 on: October 15, 2007, 10:27:15 AM »
I only sudjested an offset to get you around this issue. I know with subprogramming you can do a lot of thing. it the call out that your using that I don't use . a lot of times I just bolt stock down and do a repeat with another offset. But I also use cad/cam where as your trying to write by hand. Which is ok but I will always mess something up with hand coding...

Online Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: Strange toolpath
« Reply #9 on: October 15, 2007, 11:01:37 AM »
OK, lets try it this way.

Graham.

%

G21 G17 G90 G40 G61
G00 Z200
X0 Y0
M3
G04 P3
Z10
G52 X37.25 Y125.50
M98 P1001 L1
G00 Z10
G52 X100.75 Y125.50
M98 P1001 L1
G00 Z200
X0 Y0
M5
M30

O1001
X0 Y0
Z2.
G01 Z-1 F120
G41 P1. (change this for your cutter dia)
X0 Y5.15
X-6.95 Y5.15
G03 X-9.45 Y2.65 J-2.50
G01 X-8.44 Y-2.65
G03 X-5.98 Y-5.15 I2.5
G01 X5.98 Y-5.15
G03 X8.44 Y-3.08 J2.5
G01 X9.45 Y2.65
G03 X6.95 Y5.15 I-2.5
G01 X0 Y5.15
X0 Y0
G40
G00 Z2.

X-12.5 Y0
G01 Z-1
G41 P1. (change this for your cutter dia)
X-12.5 Y1.6
G03 X-12.5 Y-1.6 J-1.6
G03 X-12.5 Y1.6 J1.6
G40
G00 Z2.

X12.5 Y0
G01 Z-1 F120
G41 P1. (change this for your cutter dia)
X12.50 Y1.6
G03 X12.5 Y-1.6 J-1.6
G03 X12.5 Y1.6 J1.6
G40
G00 Z2.

G52 X0 Y0
M99

%
Without engineers the world stops