HSM Post Processor Forum

HSM Post Processor Forum

Reply
Highlighted
Post 1 of 5
Accepted Solution

Need to modify lathe post to not go Z home at end of run (hits tailstock limit)

46 Views, 4 Replies
03-16-2017 12:54 PM

So I have a modified Fanuc turning post that I use on my Milltronics ML22 lathe. Normally it is just fine, but recently I have been running some shafts that require a live center. When the run finishes X and Z both go back to their home position.  This is completely fine on the X (diameter) but the Z runs right into the tailstock (luckily stopped by a soft limit switch)  Aparently the machine only knows to go home when it sees an x or a z after a g28. 

 

See below.. In bold red I tried first to change the value to .100" which would be a safe rapid to position. It still tried to go all the way home.. Then I tried to add two forward slashes // to try and just skip the zFormat since I dont really need it.  The post fails when I remove that Z.  What is the proper way to remove?

 

 

forceXYZ();
if (!machineConfiguration.hasHomePositionX() && !machineConfiguration.hasHomePositionY()) {
writeBlock(gFormat.format(28), "X" + xFormat.format(10), conditional(yOutput.isEnabled(), "Y" + yFormat.format(0)); //"Z" + zFormat.format(0.1)); // return to home
} else {
var homeX;
if (machineConfiguration.hasHomePositionX()) {
homeX = xOutput.format(machineConfiguration.getHomePositionX());
}
var homeY;
if (yOutput.isEnabled() && machineConfiguration.hasHomePositionY()) {
homeY = yOutput.format(machineConfiguration.getHomePositionY());
}
if (properties.type == "A") {
writeBlock(gFormat.format(53), gMotionModal.format(0), homeX, homeY, zOutput.format(machineConfiguration.getRetractPlane()));
} else {
writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), homeX, homeY, zOutput.format(machineConfiguration.getRetractPlane()));
}
}

onImpliedCommand(COMMAND_END);
onImpliedCommand(COMMAND_STOP_SPINDLE);
writeBlock(mFormat.format(30)); // stop program, spindle stop, coolant off
writeln("%");

This kind of setting is dependant on what type of machine you have setup in the post. Is it defiantly the G28 line causing the issue? Or is it infact the G53 line?

 

You almost removed the Z value correctly, you're just missing one close bracket before the comments, it should be like this:

 

forceXYZ();
if (!machineConfiguration.hasHomePositionX() && !machineConfiguration.hasHomePositionY()) {
writeBlock(gFormat.format(28), "X" + xFormat.format(10), conditional(yOutput.isEnabled(), "Y" + yFormat.format(0))); //"Z" + zFormat.format(0.1)); // return to home
} else {

Re: Need to modify lathe post to not go Z home at end of run (hits tailstock lim

03-16-2017 01:05 PM in reply to: cmleschak
Could you attach your post so I can take a look at it?


Ivan Stanojevic
3D Solutions Technology


Post 3 of 5

Re: Need to modify lathe post to not go Z home at end of run (hits tailstock lim

03-16-2017 02:05 PM in reply to: ivan.stanojevic

See attached post..

 

I re-enabled the part I tried to disable just so I can post again. At the end of my program after G28 I have to remove the Z manually

 

ex (these are the last 3 lines of processed code)

 

N114 M9
N115 G28 X20. Z0.1
N116 M30
%

 

Has to be changed to 

 

N114 M9
N115 G28 X20.
N116 M30
%

 

My machine sees G28 (return to reference point) and Z and just goes back to its home position disregarding the .1 coordinate I am posting out. 

Post 4 of 5

Re: Need to modify lathe post to not go Z home at end of run (hits tailstock lim

03-16-2017 02:06 PM in reply to: cmleschak

This kind of setting is dependant on what type of machine you have setup in the post. Is it defiantly the G28 line causing the issue? Or is it infact the G53 line?

 

You almost removed the Z value correctly, you're just missing one close bracket before the comments, it should be like this:

 

forceXYZ();
if (!machineConfiguration.hasHomePositionX() && !machineConfiguration.hasHomePositionY()) {
writeBlock(gFormat.format(28), "X" + xFormat.format(10), conditional(yOutput.isEnabled(), "Y" + yFormat.format(0))); //"Z" + zFormat.format(0.1)); // return to home
} else {


George Roberts
CAD/CAM Applications Engineer
Man and Machine

UK Master reseller for Autodesk CAM

Post 5 of 5

Re: Need to modify lathe post to not go Z home at end of run (hits tailstock lim

03-16-2017 02:32 PM in reply to: George-Roberts

That did it, it was the missing bracket..  ugh. 

 

I program robots using a Java like language and that has bitten me before. I should have seen that one.. DOH!

 

The post works as it should now.

 

G53 does not post anywhere in my code, nor should it..

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post