Sunday, 17 September 2017

G28 no more - custom post for Newker controller

Seems there was a fairly minor update to Fusion recently that made some fairly minor syntax issues become fatal errors. No idea why my current working post remains working until you make an identical copy which won't but it's of no consequence to me. I'm just interested in getting stuff working for me.

So basically I needed to get rid of all G28 moves from the post and there are 3 as far as I could see:
  1. At the program beginning, when the tool is retracted to safe height before machining starts. I think it's the same code as 3).
  2. Ahead of tool changes in the middle of the program.
  3. At the program end when the tool is retracted (part of coolant off, it seems).
The changes that At-Man (Tim Dykes) made to achieve a "return to home" move were what I had in my own "Newker" post. Ideally what I'd like is to simply add a Z move to this, so that the tool retracts to quill top (machine Z0) for tool changes and safe retract moves.

**** ****

The standard code in the generic Fanuc post (on which mine is directly based) generates a G28 ahead of tool changes like this:

writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(0));

...which simply outputs "G28 G91 Z0" ie incremental move to machine home with no preceding Z move".

I replaced it with this:

writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), "Z0");

...which outputs "G90 G53 Z0"

**** ****

In onClose(), the subsection used to say:

writeBlock(gFormat.format(28), gAbsIncModal.format(91), "X" + xyzFormat.format(0), "Y" + xyzFormat.format(0)); 

...which outputs "G28 G91 X0 Y0" ie return directly to machine X0 Y0.

I replaced it with this:

{
    var homeX;

    if (machineConfiguration.hasHomePositionX()) 

{

      homeX = "X" + xyzFormat.format(machineConfiguration.getHomePositionX());

    }
    var homeY;
    if (machineConfiguration.hasHomePositionY()) 
{
      homeY = "Y" + xyzFormat.format(machineConfiguration.getHomePositionY());
    }
var homeZ;
{
      homeZ = "Z0";
    }
    writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), homeX, homeY, homeZ);
  }

...which outputs "G90 G53 (homeX), (homeY), (homeZ)", where the 3 values in brackets are defined previously. X and Y can be specified at the time of post processing via the dialogue box. 

Z is hard wired in the post file as zero. I don't expect to need to change this ever. Note that the variable getHomePositionZ doesn't exist in the standard list and I've no idea how to create it, even if that is possible.

This seems to work. There are no G28s in the posted code and I get the return to Z0 at the beginning and end of each operation. 

No comments:

Post a Comment

TIG welder up and running - after some fault diagnostics and repair

Finally got some time to connect up the flow meter and argon hose. Plugged in the torch and ground cables and the torch hose etc. Powered it...