Abort the current motion and return home with a DI?

  • Hi,
    Need to know the best way to accomplish the following function:

    *CRX-robot (with Mini Plus controller)
    *Robot performs a slow linear motion over a relative large distance

    *Robot is in Local mode (as opposed to Remote -controlled through UOP)


    I would like to, at the push of a button (connected to a DI in the controller), abort the current motion and call a homing routine.


    This cannot be done with a Macro (Motion Group is already locked by another task), nor with a Monitor/Condition solution.

    I don't want to split the motion up into smaller increments, and check for this button to be pushed after each motion instruction (too much coding and not a general solution).


    Is my only choice to switch over to Remote and start using additional push buttons for Start and Stop functions?

    I'm thinking that this "abort and go to home"-button will be used in a BG-logic program something like this:


    Basically a simple sequence for getting the timing for the UOP signals correct in order to first abort the running program and then initiate the main program with the start signal. If needed, perform a reset before trying to start.

    I will set the CSTOPI for ABORT = TRUE

    and START for CONTINUE only = FALSE

    in the SYSTEM CONFIG MENU.


    Also I will make the required mapping of Flags to the correct UO/UI signals

    I will also make another BG Logic program where I monitor the pushbuttons mapped to the UI-signals and disregard these if the sequence is running:


    Code
    IF !F[100: Sequence is running] THEN
        F[4: UI 4 STOP] = DI[4: UI 4 STOP]
        F[5: UI 5 RESET] = DI[5: UI 5 RESET]
        F[6: UI 6 START] = DI[6: UI 6 START]
    ENDIF
    END
        


    What do you think?

    Is there a better/easier way to accomplish my desired functionality?

  • Place your Ad here!
  • Yes, the SKIP solution could work for this instance, but I'm looking for a more general solution, one such that you wouldn't have to add the SKIP to every motion instruction, and also not having to be performing a motion instruction for this function to work.

  • I suppose using KAREL could work as the ABORT_TASK function allows you to abort a specific task. Then you could have a main program that simultaneously runs your motion program as well as an observer that can cancel the program (and its motion) and then do whatever you need it to do.


    I don't really have any experience with KAREL's multitasking, but by the looks of it this might be worth looking into.

  • Here's how I do it using bglogic and a macro in one of my robots - replace F[24] with your DI (I have a bit of logic requiring the button to be held for 3 seconds before triggering the robot to go home, which is why it's a F instead of DI in this code snippet).


    Code
      12:  !Auto-Homing ;
      13:  IF (F[24:Go Home]),F[14:Cycle stop]=PULSE,0.2sec ;
      14:  IF (UO[6:Fault] AND F[24:Go Home]),F[33:GoHome FaultClear]=PULSE,0.2sec ;
      15:  IF (F[33:GoHome FaultClear] OR F[40:FaultClear Delay]),F[40:FaultClear Delay]=PULSE,5.0sec ;
      16:  IF (F[24:Go Home] AND !F[14:Cycle stop] AND !F[40:FaultClear Delay] OR F[41:GoHome Trigger]),F[41:GoHome Trigger]=PULSE,1.0sec ;
      17:  IF (F[41:GoHome Trigger]),F[42:GoHome Delay]=PULSE,0.2sec ;
      18:  F[25:Call GoHome Macro]=(F[41:GoHome Trigger] AND !F[42:GoHome Delay]) ;
  • Skip is a good solution.


    A general solution would be using UOP to abort, reset, and prod start again, then have a robust recovery routine at the beginning of your main program.

    Yes,
    Using UOP was my initial solution. However, if I'm not using it to start with, it's a dreadful door to open if I don't need it for other reasons. Also, would require more pushbuttons...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners