xa-mont
Hot Rolled
- Joined
- Apr 4, 2014
- Location
- Victoria, Australia
Hey guys,
I just recently got a new to me hartford VMC running. It's got an OMc controller and so far most things seem to be working well - one issue i have is that when i give an "M06 T#" and the tool is the same as what's currently in the spindle when its doing it's G28 Z0. move it actually heads to Z0 for whatever work coords are currently active, without any tool offset applied - so basically it drives into the workpiece - no bueno.
I tried stuffing some g91's in the tool change program before the g28 lines. that fixed the plunging to z0 issue, but it then started running the program without tool offsets applied.
basically i need someone with some more knowledge of macros and g/m code than me to sus out where my problem/s are stemming from? (all of my other machines are Mazaks, so my g/m code experience is very limited.) If someone could take the time to explain the whole thing so I can learn a bit more that'd be awesome too. (i have a bit of a programming background so if/else/etc all makes sense already)
here's my tool change prog.
I just recently got a new to me hartford VMC running. It's got an OMc controller and so far most things seem to be working well - one issue i have is that when i give an "M06 T#" and the tool is the same as what's currently in the spindle when its doing it's G28 Z0. move it actually heads to Z0 for whatever work coords are currently active, without any tool offset applied - so basically it drives into the workpiece - no bueno.
I tried stuffing some g91's in the tool change program before the g28 lines. that fixed the plunging to z0 issue, but it then started running the program without tool offsets applied.
basically i need someone with some more knowledge of macros and g/m code than me to sus out where my problem/s are stemming from? (all of my other machines are Mazaks, so my g/m code experience is very limited.) If someone could take the time to explain the whole thing so I can learn a bit more that'd be awesome too. (i have a bit of a programming background so if/else/etc all makes sense already)
here's my tool change prog.
Code:
:9020G00
IF[#1015EQ1]GOTO180
#1111=1
#100=0
WHILE[#100LE20]DO1
#[#100+100]=0
#100=100+1
END1
#1100=0
#1101=0
#1102=0
#1103=0
#1104=0
#110=#4001
#111=#4002
#112=#4003
#113=#4006
#114=#4017
G63G0G40G80G49
#1100=1
M94
#107=#1032
IF[#20EQ#107]GOTO150
G17G91G21
M92
#109=#1032
/M73
N10G28Z0
IF[#5023NE0.0]GOTO10
M19
IF[#20EQ#107]GOTO170
IF[#107EQ99.0]GOTO120
IF[#20EQ99.0]GOTO140
IF[#107EQ#105]GOTO110
M93
N110M82
M11
N120G30Z0
T#20
M82
M11
#1101=1
G91
G28Z0
G90
M10
#1102=1
M83
GOTO150
N140IF[#107EQ#105]GOTO145
M93
N145G28Z0
M82
M11
G30Z0
M10
#1103=1
M83
N150G28Z0
GOTO170
N160#1104=1
N170#1100=0
#1101=0
#1102=0
#1103=0
#1104=0
G64G#110G#111G#112G#113
#100=0
WHILE[#100LE20]DO1
#[#100+100]=0
#100=#100+1
END1
N180M95
M74
#1111=0
M99
%