This website is using cookies for analyzing webtraffic with Google Analytics. More details
Fanuc macros for moving tailstock and steadyrest with M code
Having worked on several Doosan Puma's with a manual tailstock / steadyrest, I wanted a way to program and move these in GibbsCAM.
Below are Fanuc macros I wrote that will move tailstock and streadyrest with an M code.
These macros will move tailstock and steadyrest relative to the current G54 workoffset for Z
Issuing command for moving tailstock to Z50, will use turret to move tailstock to Z50 (using G54 workoffset)
These custom macros converts operator typed Z values into machine coordinates, making it easier to program tailstock moves in GibbsCAM.
I have installed these macros on :
DOOSAN Puma 700 machines with manual tailstock and steadyrest (uses turret to move around).
MAZAK QUICK TURN NEXUS 450-II MY LBB with controlled tailstock and steadyrest. (adapted to mazak controller)
If you need help installing these macros, write an email to email@example.com and i'll try to help.
These are written as "Fanuc Macro B" macros and are the most common Macro Programming Dialect.
Custom macros like this needs to be installed into the controller as an M code.
I've used M500 for moving the tailstock and M501 for moving the steadyrest.
Parameter 6085 - M code that calls the custom macro of program number 9025
Parameter 6086 - M code that calls the custom macro of program number 9026
To set these commands, set parameter 6085 to 500 and 6086 to 501
Getting arguments from an Mcode on Fanuc controllers
Fanuc arguments are done with internal variables and are handled by the controller.
For example : A=#1 B=#2 C=#3 etc...X=#24 Y=#25 Z=#26
As we want to move the tailstock and steadyrest along the Z axis, the variable used are #26 (letter Z).
So issuing a command like : "M500 Z100" will set variable #26 to 100 and run the macro.
Explanation of the stored variables #500 and up (5xx variable numbers are stored in nvram and remembered in controller after poweroff)
#500 = current machine position of the tailstock
#501 = current machine position of the steadyrest
#502 = allowed distance between tailstock and steadyrest
#512 = distance to compensate for pin movement in tailstock pickup
#513 = distance to compensate for pin movement in steadyrest pickup
This distances are stored to prevent pin rubbing against pickup slot when moving pin up for pickup
#514 = offset distance to add to tailstock Z value to match face to Z0
#515 = offset distance to subtract to steadyrest Z value to match arm to Z0
Running the tailstock macro does the following:
Type "M500 Z50" in MDI
1. Clears tooloffset with T0000 and moves turret up (home X/Y axes)
2. calculate new Z tailstock position in machine coordinate value
3. calculate closest allowed tailstock position compared to stored steadyrest position
4. check if new tailstock position will collide with current stored steadyrest position
-if new tailstock position is safe, then allow move
-if new tailstock position is not safe, move to calculated position from step 3
5. move turret to current tailstock position to pick up tailstock
6. run the M code command to move the pin up and attach tailstock to the turret
7. move turret and tailstock to the new position (Z50)
8. run the M code command to retract the pin and release the tailstock from turret
9. store the new tailstock position into variable #500
Using custom Fanuc macros with Utility Ops in GibbsCAM
In order for the post processor to know the utility operations, the post need some functions added.
You can copy and paste the macros from above, or download them here :
Download Click here -> Fanuc-macros.zip ( 34 downloads )