Hi Voicurob,
I ran your code on my OM. (See below)
One question: What version of OM are you running. A?B?C?
Not sure if you resurrected your machine from battery death and had to reload parameters at one time, but you might want to review parameters 1 thru 3. Some of them have to do with how G43 acts and what happens at RESET. Also how your RELATIVE position acts.
I only ran your 2nd batch of code as that's the one a person would normally want to use.
As I figured, my machine over-traveled in +Z after the G53Z0. move and the subsequent recall of G43. Your program ran fine after I removed all the garbage.
Here's the parts of your code that worked as it should. (with parts removed and a few things cleaned up)
%
O3001
(T2 D=6. CR=0. TAPER=120DEG - ZMIN=27. - SPOT DRILL)
(T3 D=8. CR=0. TAPER=118DEG - ZMIN=0. - DRILL)
G90 G17 G80 G21
(DRILL3)
T2 M06
S5700 M03
G54
G00 X-30. Y-23.
G43 Z45. H02
M08
G98 G81 Z27. R33.5 F171.
G55
X-30. Y-23.
G80
M09
G0Z55.
G53 Z0. M5
(DRILL4)
M01
T3 M06
S3638 M03
G54
G00 X-30. Y-23.
G43 Z45. H03
M08
G81 Z0. R33.5 F437.
G55
X-30. Y-23.
G80
M09
G0Z55.
G53 Z0.Y0.M5
M30
%
In all the post processor outputs I've seen on machining forums, I'm still waiting to see one without a whole lot of garbage tagging along. Just once I'd like to see that.
Another question: If you have all three axis of your machine at roughly mid travel, what happens when you MDI say T2M06? If the machine head goes up and does a tool change, then you can easily remove all G53 or any other Home type moves before going for a new tool. All the preliminary stuff needed for a tool change is probably included in the Tool Change Macro or Program, so why duplicate it in the main program? The occasional need to move in X or Y before a tool change to avoid high sitting fixtures is another thing. Program accordingly there.
A little note of caution when moving between work offsets with differing Z heights. It is critical to be mindful of when the Z setting of the newly called Work Offset will take effect. In the case of your current drilling program, using G98 instead of G99 is a good way of playing it safe, especially because your Initial Level is higher then your R level. In the program above, when the program went from G54 to G55 and the G55 XY coordinate was called and realized, the Z display showed 60mm and not 45mm, which was the Retract to Initial Level height, plus the 15mm that my G55 setup was lower then my G54 one. (A safe move) With the next push of the green button, the tool lowered itself to the correct R level, (33.5) with full consideration of the G55 Z setting.
Try the program above. It should work if your setup is correct. Sinha is right about G49. Shouldn't be a problem.