Adding conditional dwell based on spindle speed, to allow spindle to spin down before tool change

claylong
Explorer

Adding conditional dwell based on spindle speed, to allow spindle to spin down before tool change

claylong
Explorer
Explorer

I'm running a Sharp 2412 with a Fanuc control. Using a modified Fanuc post. I want to add a conditional dwell of 6 seconds at the end on any tool with 6000 or more rpm spindle speed. (over 6000 rpms the spindle is still spinning too much for a tool change and it alarms out, if I dwell 6 sec after the spindle stop command the tool change works without a problem. I have figured out how to add a dwell to all the tool changes but can't seem to get to the current spindle speed at the end of a tool path. Below the M08 in the post on a given tool, it thinks the spindle speed is the next tool's speed. If I put an IF statement in to write the dwell line if the spindle speed is over 6000, it looks at the next tool's speed rather than the current tool's speed (the tool that just stopped). If I add a "write Block (spindle speed)" it writes the next tool's speed, If I add "write Block (s Output .format (spindle speed)", it writes the current tool's speed which is the one I want to use.

Can someone explain how I can get the If statement to query the current spindle speed of the tool that just ended and not the next tool up? Been messing with this a couple of weeks and think it's time for some expert help.

 

Thanks,

Clay

0 Likes
Reply
Accepted solutions (1)
294 Views
2 Replies
Replies (2)

AdamKunzo
Collaborator
Collaborator
Accepted solution

Hi,

 

You can use this - if ((getPreviousSection().getTool().spindleRPM) > 6000)
 
Take a look at line 489 in attached PP.
0 Likes

claylong
Explorer
Explorer

I couldn't get the {onDewell (6) part of the If statement line to output anything in the code but I replaced that part with writeBlock ("G4 P6000") and it looks to work perfectly. Thank you so much for your help. I can't tell you how many hours I poured over this code trying to figure out how to do this. Many many thanks.

 

Clay