Siemens SINUMERIK 840D need to add M5

Siemens SINUMERIK 840D need to add M5

Anonymous
Not applicable
1,231 Views
5 Replies
Message 1 of 6

Siemens SINUMERIK 840D need to add M5

Anonymous
Not applicable

I need to add an M5 at the end of each cycle prior to a tool change, currently if the tool is over 9,000 RPM I get a spindle position error. Getting a little tired of manually adding it in every time.

 

I tried changing line 2557 from OnImpliedCommand to OnCommand, that worked but it only adds the M5 at the end of the program, not between tool changes.

 

I then tried adding on M5 on line 2540 before the SUPA Command. This works perfect, except when I have multiple work offsets. It turns off the spindle when it retracts before switching to the next work offset, but then there is no command to turn the spindle on.

 

Is there anyway to fix this?

0 Likes
1,232 Views
5 Replies
Replies (5)
Message 2 of 6

bob.schultz
Alumni
Alumni

As you found out, adding the stop spindle command to the writeRetract function will stop the spindle each time the Z-axis is retracted.  The previous section is actually ended at the top of the onSection function, so you can add the following lines at line 1097 to stop the spindle whenever there is a tool change.

if (insertToolCall || newWorkOffset || newWorkPlane) {
    if (insertToolCall && !isFirstSection()) {
      onCommand(COMMAND_STOP_SPINDLE);
    }
    
    // retract to safe plane
    writeRetract(Z);

    if (newWorkPlane && useMultiAxisFeatures) {
      setWorkPlane(new Vector(0, 0, 0), false); // reset working plane
    }
  }


Bob Schultz
Sr. Post Processor Developer

Message 3 of 6

Anonymous
Not applicable

Thanks Bob, that worked perfect, only problem is now I realized I need the M5 to be moved up one line, needs to be at the end of the Z retract. Being one line below doesn't fix the problem at the machine.

 

I'll trying editing this myself, but if you happen to see this message before I reply back, your help would be greatly appreciated.

0 Likes
Message 4 of 6

bob.schultz
Alumni
Alumni

It is easy enough to move the spindle off block to wherever you need it.  To place it after the Z-retract block simply move it to here.

if (insertToolCall || newWorkOffset || newWorkPlane) {
// retract to safe plane writeRetract(Z);

if (insertToolCall && !isFirstSection()) {
onCommand(COMMAND_STOP_SPINDLE);
} if (newWorkPlane && useMultiAxisFeatures) { setWorkPlane(new Vector(0, 0, 0), false); // reset working plane } }


Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 5 of 6

Anonymous
Not applicable

Sorry should have been more specific. I need it to move the the initial Z retract (to the CLRNC Plane)

see example:

 

N50 X1.5375
N51 MCALL
N52 G0 Z0.465 M5   <----- This is where I need it
N54 M5   <-----This is where your initial recommend change puts it
N55 G0 SUPA Z0 D0      (end of cycle)

 

0 Likes
Message 6 of 6

bob.schultz
Alumni
Alumni

This could be a bit more difficult to implement, since the post processor does not know when the last retract of an operation is.  What is the reason that the M5 code needs to be output on the retraction to the clearance plane and is it for all operations or just for drilling cycles?

 

Thanks. 



Bob Schultz
Sr. Post Processor Developer

0 Likes