Hi again,
I have developed a serial interface from Mach 4 to my Allen Bradley Ultra 3000 servo drives using LUA. One of the capabilities of this interface is to define the zero (home) position of the motor in the servo drive, and later read the current position of the motor back into Mach 4. Since my motors have magnetic multiturn encoders, this position will be stored through power cycles and even when the motor is moved by hand when the machine is powered off. This means that once the home position is set in the servo drive, I will never need to home my CNC again unless the motor is decoupled from the drive or ballscrew.
What I am hoping to do is run the normal homing routine in Mach 4, but modify it to set the zero position in the drive at the same time as it is set in Mach 4. Then going forward, clicking Ref All Home need only ask the drive where it is currently located and copy that data into Mach 4 axis positions.
My questions is this, if I have all my axes dereferenced, can I copy my known motor position into the axis position using mcAxisSetPos(Inst, 0, XPosition)? If so, how do I mark that axis as referenced without running the Mach 4 homing sequence to drive the axes to their limit switches?
Thanks in advance for any help or thoughts on this.