Skip to main content
Submitted by mwilk on Tue, 08/08/2017 - 07:49

Here is a short example of what I am trying to do:

DMC:

1) Read external encoder
2) if external encoder reaches setpoint, then "BG ABC"
3) go to #1

C++ in an external PC:

"PA a,b,c"

--

What happens:

Sometimes, the DMC program stops with TC 22 "Begin not possible due to limit switch":

What I think happens:

If a DMC move command stops on a limit switch because of a previous move, and the next PA command has been programmed to move in the same direction, the DMC program stops with TC = 22.

I am trying to find a way to keep the DMC program from halting if the axis can't move because of the limit switch.

My questions:

Is there away to catch error 22 without the DMC program halting?

Is there a way to send a BG, while on a limit switch and not get TC 22? It is OK if the axis does not move at all, but I have to keep the DMC program running.

Comments 3

KushalP on 08/15/2017 - 16:58

1.) You can handle Limit switch events by having a #LIMSWI routine defined in your DMC program. The #LIMSWI routine automatically interrupts thread 0 whenever a limit switch is tripped. This would allow you to handle the limit switch condition and move your motor away from the limit. Refer to the command reference for more information on how to use #LIMSWI.

2.) The controller will not profile any motion in the direction of a tripped limit switch. For example, if your reverse limit switch was active, the controller would only allow you to profile moves in the forward direction. As soon as the reverse limit switch was cleared you would be able to profile motion in the reverse direction.

mwilk on 08/29/2017 - 12:34

Because this move gets programmed from 2 different locations, it gets complicated.

During normal operation, the PC (C++) will send a PA, PB, and PC commanded position.

The DMC monitors a rotary encoder, then at a preset count does "BG ABC". It doesn't know if the BG will trigger a positive or negative move because the C++ program has already loaded the PA commanded positions independently. If an axis is on a limit switch and the BG command triggers a move in that same direction, the "begin not possible due to limit switch" error will occur.

Is there a way to test the preloaded PA position inside the DMC? Simply doing an MG _PAx will return the LAST commanded position, and not the current value of the NEXT commanded position.

I could make the PC send the PA command and also fill a variable at the same time. Then the DMC could read the variable, compare it to the current position, and know what direction the move would go. Then the DMC could test the limit switch and know if it is OK to send the BG command for each axis.

Using the #LIMSWI to move OFF the limit might not work for my application, if it's on the limit, it needs to stay there until programmed to a position in the opposite direction.

Any other ideas?

andriys on 09/01/2017 - 09:42

mwilk,
Please email support@galil.com and ask to forward the email to Andriy to discuss your application in details and work on the solution to your problem.

Thank you,
Andriy