Looking for a way to use current robot position in BG Logic.

  • I want to use the current BG Logic, basically a simple interference zone....

    PR[i] = LPOS doesn't work. So maybe a sys var that has world tcp coordinates.

  • Place your Ad here!
  • Look at using a ref(erence) position to turn on a digital output when near or at this position. BG logic is used for things that are in either an on or off state like inputs and outputs. It's not for checking positions.

  • I am sorry if you think i was being snotty answering your questions. I tried to help you by telling you that BG logic is for logic only. You left a general question about something that is against its design. Be more specific please.

    Good Luck-

  • I want to use the current BG Logic, basically a simple interference zone....

    PR[i] = LPOS doesn't work. So maybe a sys var that has world tcp coordinates.

    I've done joint positions like this in BGlogic before: R[160:Joint 1]=($SCR_GRP[1].$MCH_ANG[1]) ;

    But I think R[160]=($SCR_GRP[1].$MCH_POS_X); would work for x-position in world, you have to test it though.

    Edit: I just used it for visualization, not interference zones. I'm not sure how quickly the position values updates.

    Edited once, last by luetin ().

  • The problem is not how fast the $SCR_GRP[1].$MCH_POS_X updates.
    The real problem is that it updates only during motion by program execution.
    It does not reflect the robot jogging.
    Jogging may be detected programmatically, in order to know the reading is invalid since,
    but I've never heard about a way to read the position while jogging.

  • Weird, I didn't know that. When looking at the angle variables it updates just fine even in jog mode :thinking_face:

  • I know this is a late response, but I have done this with BG Logic, and it's very simple:

    R[120:Xpos]=$SCR_GRP[1].$MCH_POS_X ;
    R[121:Ypos]=$SCR_GRP[1].$MCH_POS_Y ;
    R[122:Zpos]=$SCR_GRP[1].$MCH_POS_Z ;
    !At Machine ;
    F[2:AtMach]=(R[121:Ypos]<R[124:AtMachYBnd]) ;
    !Inside Machine ;
    F[1:InMach]=(R[121:Ypos]<R[123:InMachYBnd]) ;

    R[123] & R[124] are set to the Y value of the boundary you want to define. F[1] & F[2] will turn on when the TCP crosses that boundary. You can be as complex or simple as you like. Such as:

    F[1]=(R[120:Xpos]<R[100:XHigh] AND R[120:Xpos]>R[101:XLow] AND R[121:Ypos]<R[102:YHigh] AND R[121:Ypos]>R[103:YLow] AND R[122:Zpos]<R[104:ZHigh] AND R[122:Zpos]>R[105:ZLow])

    ... which will set a flag if the TCP is within a defined box in space. However I try to keep each line down to only one or two boundaries if possible.

    As others have stated, it only works during program execution and not jogging. It is very helpful with recovery though. One word of advice: If you plan to use this for recovery, also include this as one of the first lines in your recovery routine:

    PR[?]=LPOS ;
    J PR[?] 10% FINE ;

    This will just move the robot to it's current position. That way if somebody has jogged the robot since the last time it was run, the MCH_POS variables will update.

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