*SOLVED* PLC Preventing MPG Movement

_______________________________________________________














LOGIN below to POST your questions and comments on AjaxCNC products.

Moderator: cnckeith

Post Reply
tblough
Posts: 64
Joined: Tue Mar 22, 2016 10:03 am
Allin1DC CNC Controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: Yes
DC3IOB: No
CNC11: Yes
CPU10 or CPU7: No
System Serial Number: 100505
100327
102696
Location: Boston, MA
Contact:

*SOLVED* PLC Preventing MPG Movement

Post by tblough » Tue Dec 05, 2017 3:24 pm

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 || MPG_AXIS_4 ||
;  MPG_AXIS_5 || MPG_AXIS_6 || MPG_AXIS_7 || MPG_AXIS_8
IF MPG_AXIS_1 || MPG_AXIS_2 || (MPG_AXIS_3 && (QuillBallnutClamped ^ InvQuillClampSwitch_M)) ||
  MPG_AXIS_4 || MPG_AXIS_5 || MPG_AXIS_6 || MPG_AXIS_7 || MPG_AXIS_8
  THEN (SV_MPG_1_ENABLED)
Can a PLC guru provide me some direction on how to inhibit MPG movement on Axis 3 when the quill is disconnected?

Thanks,


Tom
Last edited by tblough on Thu Dec 07, 2017 11:42 am, edited 1 time in total.

Centroid_Tech
Posts: 131
Joined: Thu Mar 18, 2010 2:24 pm

Re: PLC Preventing MPG Movement

Post by Centroid_Tech » Tue Dec 05, 2017 6:32 pm

Tom,

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) ||
MPG_AXIS_4 || MPG_AXIS_5 || MPG_AXIS_6 || MPG_AXIS_7 || MPG_AXIS_8
THEN (SV_MPG_1_ENABLED)

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.

cncsnw
Posts: 328
Joined: Wed Mar 24, 2010 5:48 pm

Re: PLC Preventing MPG Movement

Post by cncsnw » Wed Dec 06, 2017 1:50 am

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.

tblough
Posts: 64
Joined: Tue Mar 22, 2016 10:03 am
Allin1DC CNC Controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: Yes
DC3IOB: No
CNC11: Yes
CPU10 or CPU7: No
System Serial Number: 100505
100327
102696
Location: Boston, MA
Contact:

Re: PLC Preventing MPG Movement

Post by tblough » Thu Dec 07, 2017 11:42 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests