Post file not adding gear change M codes

Post file not adding gear change M codes

brentm
Enthusiast Enthusiast
991 Views
5 Replies
Message 1 of 6

Post file not adding gear change M codes

brentm
Enthusiast
Enthusiast

When posting with the attached post file for my Mazak VCN700 the mill will not gear change. The output file is .eia. when looking at the posted file i can see the spindle speed, however i am not seeing the gear change codes m38 and m39. Can my post file be edited to place the gear change codes to use the m38 and m39?

0 Likes
Accepted solutions (3)
992 Views
5 Replies
Replies (5)
Message 2 of 6

boopathi.sivakumar
Autodesk
Autodesk

@brentm 

Yes it is possible to modify the post ?

Where you are expecting the M38 code should come right on the M03 line or before that?

it would be good if you tell us where you wanna trigger the M38 & M39.

 


Boopathi Sivakumar
Senior Technology Consultant

0 Likes
Message 3 of 6

brentm
Enthusiast
Enthusiast
Accepted solution

Sir,

 

I would like the M38 or M39 before the M3.

 

The maximum low gear is 930 RPM so M38 will be from 1 RPM to 930 RPM. High gear is anything above 930 RPM so M39 will be used.

 

i have placed below a short sample. Thank you for the help.

 

O0001
(T22 D=1.3125 CR=0. - ZMIN=-2.42 - DRILL)
N1 G90 G94 G17 G49
N2 G20
N3 G53 G0 Z0.

(DRILL1)
N4 T22 M6
(1.3125 KENNAMETAL DRILL)
N5 M38 (GEAR CHANGE)
N6 S930 M3
N7 G54
N8 M8
N9 G0 X0. Y-0.125
N10 G43 Z0.6 H22
N11 G0 Z0.2
N12 G98 G82 X0. Y-0.125 Z-2.42 R0.16 F4.656 D0
N13 G80
N14 G0 Z0.6

N15 M5
N16 M9
N17 G53 Z0.
N18 M30

0 Likes
Message 4 of 6

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

@brentm  it just needs a simple edit 

Edit the post processor file and search for this below line

if (spindleSpeed > 99999)
and you will get to find code like this
    if (spindleSpeed < 1) {
      error(localize("Spindle speed out of range."));
      return;
    }
    if (spindleSpeed > 99999) {
      warning(localize("Spindle speed exceeds maximum value."));
    }
    writeBlock(
      sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
    );
Add the code in the red below and save the file
    if (spindleSpeed < 1) {
      error(localize("Spindle speed out of range."));
      return;
    }
    if (spindleSpeed > 99999) {
      warning(localize("Spindle speed exceeds maximum value."));
    }
    if (spindleSpeed <= 930){
      writeBlock(mFormat.format(38));
    }else{
      writeBlock(mFormat.format(39));
    } 
    writeBlock(
      sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
    );
now it should post M38 or M39 based on the condition given
 

Boopathi Sivakumar
Senior Technology Consultant

0 Likes
Message 5 of 6

brentm
Enthusiast
Enthusiast
Accepted solution

THANK YOU

 

 

0 Likes
Message 6 of 6

Anonymous
Not applicable

I was reviewing your answer for the Gear Change solution for a 2 speed gearbox. Is there any way to modify the mach4mill.cps file to incorporate a 6 speed gearbox? I am using a 3axis Mill that has a six speed manual gear box with a speed range of 40-3000 rpm. I have a macro written using M101 P(0-5) to perform this but have to modify the Gcode to perform these functions. I currently set the spindle speed to 3000 and control the output with the gear changes.

 

Is there a way to incorporate the M101 P(?) selection from the requested speed of the tool and just maintain the 3000 max spindle speed?

 

Thanks for any input.

0 Likes