cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting Motion is complete

Detecting Motion is complete

bclapperton
New Contributor

In my motion programs I often start an absolute motion command inside an Sequential Function Chart Entry Action. Then I want to stay in that step until the command is completed. I find that I usually need to define my own logic for when the command is completed. I've had to do this for MLC and MLD, PLCOpen and AxisInterface. It looks MotionInterface is the same. The problem is due to two issues:

1. The transition out of the SFC is evaluated immediately after the SFC step. This will be before the motion engine has been updated. So you can't use the standard "command done" signal eg. arAxisStatus_gb[AxisA.AxisNo].Admin.CmdDone;  This signal will still have the status for the last move. 

2. If you command an axis to the same position the command done signal may not go off and on again. (Sometimes this happens due to the machine process or maybe a recovery routine.)

So, what I usually do is add my own "motion done" bit that I reset in in the SFC entry action, just after the motion commands. Then I write some code that runs after the motion interface call. This updates my motion done bit depending on the output of the motion interface. 

I am wondering if there is already something in ctrlX MotionInterface that does this? Or could be added? Or is there another way to handle this situation. I don't want to add minimum times to all my SFC motion steps. 

 

4 REPLIES 4

Jochen_Mueller
Community Moderator
Community Moderator

Hello Bruce

what's up with the last/active CmdID. The counter will count up as soon you trigger a new command. I haven't test it but maybe you can check this counter as an indicator to leave the entry state...

Jochen_Mueller_0-1719812107896.png

 

Regards

Jochen

Thanks @Jochen_Mueller , I will have a look at these signals. 

Goldfinger
Established Member

Hello Bruce,

regarding point 1): arAxisStatus_gb[AxisA.AxisNo].Admin.CmdDone is immediately reset when you trigger a motion command. This is new in the MotionInterface  on the CORE. CmdDone is now a property and i think you can use it for your entry action.

Hth,

Klaus

Hello @Goldfinger and @Jochen_Mueller 

Today I had a good play with this system. I found that arAxisStatus_gb[AxisA.AxisNo].Admin.CmdDone works as I would like it to work for ModePosAbs. However, I found that it doesn't work for ModePosRel and ModePosAdd. In these modes, when you run a command for the second time, the sequential function chart sees the CmdDone bit TRUE and skips to the next state immediately. See attached video and sample program (zip file containing .project, CtrlX works 1.20.10). I am running the code on an X3 with virtual axes. Axes setup as Rotary, Modulo 360 degrees. 

So, it looks like there is a bug for ModePosRel and ModePosAdd. At least in 1.20.11. I don't have a 2.6 setup yet. Can one of you try the same thing with OS2.6? If there is still a bug then maybe it can be raised as a bug to be fixed. 

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist