Page 1 of 1

PLC Preventing MPG Movement <<Answered>>

Posted: Tue Dec 05, 2017 3:24 pm
by tblough
I have a 3-axis mill where the quill can be disconnected from the ballscrew and used manually. The PLC program has code in it to prevent jog moves on the 3rd axis when the ballscrew is disconnected:

Code: Select all

IF (Ax3PlusJogKey  || KbJogAx3Plus_M) &&
   !(IncrContLED && FinalFeedOverride_W == 0) THEN (DoAx3PlusJog)
IF (Ax3MinusJogKey || KbJogAx3Minus_M) && !Ax3MinusJogDisabled_M &&
   !(IncrContLED && FinalFeedOverride_W == 0) THEN (DoAx3MinusJog)
IF (Ax4PlusJogKey  || KbJogAx4Plus_M) &&
   !(IncrContLED && FinalFeedOverride_W == 0) THEN (DoAx4PlusJog)
IF (Ax4MinusJogKey || KbJogAx4Minus_M) &&
   !(IncrContLED && FinalFeedOverride_W == 0) THEN (DoAx4MinusJog)

;------  Unclamped-Quill Jog Inhibit -------------
; If operator tries to jog the Z axis or use Tool Check, but
; the quill ballnut is not clamped, then display a warning
; message and suppress the jog or tool check attempt.
IF (DoAx3PlusJog || DoAx3MinusJog || (DoToolCheck && !SV_JOB_IN_PROGRESS)) &&
   !(QuillBallnutClamped ^ InvQuillClampSwitch_M)
  THEN RST DoAx3PlusJog,
       RST DoAx3MinusJog,
       RST DoToolCheck,
       InfoMsg_W = Z_DISCONNECT_ERR

The problem is that the MPG is still active and can cause problems by moving the Z axis ballscrew while it is disconnected. I need to disable the MPG in the same manner. I have tried modifying the MPG section below but it does not disable Z mpg movement when the axis is supposed to be disconnected:

Code: Select all

;--MPG 1 Enable
; modified to inhibit movement if quill unclamped - RTB 11/5/2017
IF MPG_AXIS_1 || MPG_AXIS_2 || (MPG_AXIS_3 && (QuillBallnutClamped ^ InvQuillClampSwitch_M)) ||
Can a PLC guru provide me some direction on how to inhibit MPG movement on Axis 3 when the quill is disconnected?



Re: PLC Preventing MPG Movement

Posted: Tue Dec 05, 2017 6:32 pm
by Centroid_Tech

Not exactly sure what this logic "QuillBallnutClamped ^ InvQuillClampSwitch_M" is for but as long as you have an input that tells the control when the quill is in manual mode, let's call it ManualQuill then all you need is the following logic.

IF MPG_AXIS_1 || MPG_AXIS_2 || (MPG_AXIS_3 && !ManualQuill) ||

If you don't have a physical switch then you can do it by setting a memory bit, ManualQuill_M, or even using an AUX button. You just need to make sure that the memory bit gets reset whenever you are in 3-axis mode.

Re: PLC Preventing MPG Movement

Posted: Wed Dec 06, 2017 1:50 am
by cncsnw
That looks like the allin1dc-basic-elrod.src program, which works with Dwayne's quick disconnect.

There is a micro switch which, if adjusted correctly, will open when the block is unclamped from the ballnut. The switch is probably on INP13, but might be on INP7 or a different one.

InvQuillClampSwitch_M is bit 13 of Parameter 178 (+8192), which should be set only if the switch functions backwards (closed when unclamped).

The proposed PLC logic should work just fine. If it is not working, check the Alt-i diagnostic page to see whether the QuillBallnutClamped input changes correctly when the ballnut is unclamped and clamped.

Re: PLC Preventing MPG Movement

Posted: Thu Dec 07, 2017 11:42 am
by tblough
Thanks CNCSW - your post put me on the right track. I really thought the code should be working and it turns out it does. My quill switch was adjusted right on the edge so that every other time it would not register the quill unclamp. I just happened to test my modified PLC program on one of those times causing much head banging and hence the post. Switch is now adjusted correctly and life is good.

You are correct that this is one of Dwayne's Z drives. I've contacted him a few times in the past about this problem with no luck. Just happens that I'm working on the PLC code for my Hardinge lathe conversion so I thought I'd try and tackle a few things on the mill PLC that have been bothering me as a learning experience.

If anyone else runs into this problem, the MPG 1 Enable code above does correctly work.