Interrupt when testing in T1

  • Hi all,


    I have a query on interrupts when running tests in T1. I have a program that jumps to a sub routine---executes some code----then if an interrupt signal is high should jump to an interrupt routine.


    While testing in T1, the main routine is running, then the sub routine starts to run but the interrupt sequence does not appear to be called even though the signal (input) to call the interrupt goes high.


    I'm not sure if it is something that will not work in T1 mode or whether there is a problem in my interrupt code. I have included extracts from code below. Thanks


    SubRoutine ()

    ;FOLD BASISTECH INI
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3
        GLOBAL INTERRUPT DECL 10 WHEN $IN[14]==TRUE DO SLIPSHEET_Find ( )
             INTERRUPT ON
    10 
        BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)




    Interrupt Routine()


    &ACCESS RVP


    &REL 9


    &PARAM EDITMASK = *


    &PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe


    &PARAM DISKPATH = KRC:\R1\Program


    DEF SLIPSHEET_Find( )


    ;FOLD INI;%{PE}


      ;FOLD BASISTECH INI


        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )


        INTERRUPT ON 3


        BAS (#INITMOV,0 )


      ;ENDFOLD (BASISTECH INI)


      ;FOLD USER INI


        ;Make your modifications here



      ;ENDFOLD (USER INI)


    ;ENDFOLD (INI)




    BRAKE




    XTEMP_POS2=$POS_ACT


    XTEMP_POS2.Z=XTEMP_POS2.Z+50



    ;FOLD SPTP TEMP_POS2 Vel=40 % PDAT7 Tool[1]:kitting_Head Base[0] ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=XTEMP_POS2; Kuka.BlendingEnabled=False; Kuka.MoveDataPtpName=PDAT7; Kuka.VelocityPtp=40; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP


    ;ENDFOLD


    SPTP XTEMP_POS2 WITH $VEL_AXIS[1] = SVEL_JOINT(40.0), $TOOL = STOOL2(FTEMP_POS2), $BASE = SBASE(FTEMP_POS2.BASE_NO), $IPO_MODE = SIPO_MODE(FTEMP_POS2.IPO_FRAME), $LOAD = SLOAD(FTEMP_POS2.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT7), $APO = SAPO_PTP(PPDAT7), $GEAR_JERK[1] = SGEAR_JERK(PPDAT7), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)


    ;ENDFOLD



    XTEMP_POS2=$POS_ACT


    XTEMP_POS2.Z=XTEMP_POS2.Z-50



    ;FOLD SPTP TEMP_POS2 Vel=40 % PDAT8 Tool[1]:kitting_Head Base[0] ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=XTEMP_POS2; Kuka.BlendingEnabled=False; Kuka.MoveDataPtpName=PDAT8; Kuka.VelocityPtp=40; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP


    ;ENDFOLD


    SPTP XTEMP_POS2 WITH $VEL_AXIS[1] = SVEL_JOINT(40.0), $TOOL = STOOL2(FTEMP_POS2), $BASE = SBASE(FTEMP_POS2.BASE_NO), $IPO_MODE = SIPO_MODE(FTEMP_POS2.IPO_FRAME), $LOAD = SLOAD(FTEMP_POS2.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT7), $APO = SAPO_PTP(PPDAT7), $GEAR_JERK[1] = SGEAR_JERK(PPDAT7), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)


    ;ENDFOLD


    ;ADJUST POSITION MOVE HEAD DOWN TO SLIPSHEET PICK POSITION



    XTEMP_POS2=$POS_ACT


    XTEMP_POS2.Z=$POS_ACT.Z-100



    ;FOLD SLIN TEMP_POS2 Vel=0.2 m/s CPDAT3 Tool[1]:kitting_Head Base[0] ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=XXTEMP_POS2; Kuka.BlendingEnabled=False; Kuka.MoveDataName=CPDAT3; Kuka.VelocityPath=0.2; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SLIN


    ;ENDFOLD


    SLIN XTEMP_POS2 WITH $VEL = SVEL_CP(0.2, , LCPDAT3), $TOOL = STOOL2(FTEMP_POS2), $BASE = SBASE(FTEMP_POS2.BASE_NO), $IPO_MODE = SIPO_MODE(FTEMP_POS2.IPO_FRAME), $LOAD = SLOAD(FTEMP_POS2.TOOL_NO), $ACC = SACC_CP(LCPDAT3), $ORI_TYPE = SORI_TYP(LCPDAT3), $APO = SAPO(LCPDAT3), $JERK = SJERK(LCPDAT3), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)


    ;ENDFOLD



    ;TURN ON VAC PODS FOR PICKING OF SLIPSHEET


    ;FOLD OUT 7 '' State= TRUE;%{PE}%R 8.3.22,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:7, 3:, 5:TRUE, 6:



    $OUT[7]=TRUE


    ;ENDFOLD


    ;FOLD OUT 8 '' State= TRUE;%{PE}%R 8.3.22,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:8, 3:, 5:TRUE, 6:



    $OUT[8]=TRUE


    ;ENDFOLD


    ;FOLD OUT 15 '' State= TRUE;%{PE}%R 8.3.22,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:15, 3:, 5:TRUE, 6:



    $OUT[15]=TRUE


    ;ENDFOLD


    ;FOLD OUT 16 '' State= TRUE;%{PE}%R 8.3.22,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:16, 3:, 5:TRUE, 6:



    $OUT[16]=TRUE


    ;ENDFOLD



    ;FOLD WAIT Time=2 sec;%{PE}%R 8.5.19,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 3:2


    WAIT SEC 2


    ;ENDFOLD ; WAIT FOR VACUUM GRIP



    ;ADJUST POSITION TO LIFT SLIPSHEET 20MM IN ORDER TO REDUCE VACCUM BETWEEN SHEETS



    XTEMP_POS2=$POS_ACT


    XTEMP_POS2.Z=$POS_ACT.Z+20




    ;FOLD SLIN TEMP_POS2 Vel=0.2 m/s CPDAT4 Tool[1]:kitting_Head Base[0] ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=XTEMP_POS2; Kuka.BlendingEnabled=False; Kuka.MoveDataName=CPDAT4; Kuka.VelocityPath=0.2; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SLIN


    ;ENDFOLD


    SLIN XTEMP_POS2 WITH $VEL = SVEL_CP(0.2, , LCPDAT4), $TOOL = STOOL2(FTEMP_POS2), $BASE = SBASE(FTEMP_POS2.BASE_NO), $IPO_MODE = SIPO_MODE(FTEMP_POS2.IPO_FRAME), $LOAD = SLOAD(FTEMP_POS2.TOOL_NO), $ACC = SACC_CP(LCPDAT4), $ORI_TYPE = SORI_TYP(LCPDAT4), $APO = SAPO(LCPDAT4), $JERK = SJERK(LCPDAT4), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)


    ;ENDFOLD



    ;DELAY TIME FOR VACUUM BETWEEN PICKED SHEET AND STACK TO DISSIPATE


    ;FOLD WAIT Time=1.5 sec;%{PE}%R 8.5.19,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 3:1.5


    WAIT SEC 1.5


    ;ENDFOLD





    RESUME ; RETURN TO SLIPSHEET_Pick PROGRAM









    END

  • Hi Hermann,


    The signal input comes from a sensor mounted on the head. It only comes high as the head approaches a stack of material. I monitored the input during test and observed it coming high as the head moved down towards the stack.


    Thanks

  • Stampy

    Changed the title of the thread from “Interrupt whentesting in T1” to “Interrupt when testing in T1”.
  • the structure is wrong... RESUME does not work with global interrupts. that should not prevent ISR from being called. also ISR are special programs, their primary characteristics is that they need to be SHORT and FAST. but you have entire INI in there too. get rid of it. record interrupt position using $POS_INT and get out of there. do the dancing after ISR stops program and records position.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Thanks Panic mode,


    If I limit my ISR to:


    DEF SLIPSHEET_Find( )



    BRAKE



    XTEMP_POS2=$POS_ACT


    XTEMP_POS2.Z=XTEMP_POS2.Z+50



    Will this suffice? If I enter the movement commands on the line under the movement command that was being executed in the sub routine when the interrupt was triggered, will they immediately be executed after the ISR has executed


  • of course not... you seem to have trouble reading feedback...


    first you need to decide on proper behavior and choose correct structure. and you are not there yet...


    do you want the "SLIPSHEET_Find( )" routine to cancel scanning motion when target is detected? you may have to do that if continuing search will result in a collision with the product....


    if you do not need to stop, there is no reason for RESUME command. but if you need to stop RESUME is required and you cannot have this interrupt declared as global.


    as already stated, do NOT use $POS_ACT, use $POS_INT. $POS_ACT will tell you current robot position but this may be quite a bit off from place where robot was at the moment interrupt was triggered.


    next, why are you doing offsets in the ISR? what is this 50mm for? i mean i KNOW what is for but this does not belong here. it is something you can do later on in the main program - after you have captured value and returned from ISR.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Hi guys,


    Thanks for help on this. After some mods and following advice above, the interrupt sequence is all working perfect and robot is carrying out function as expected.

Advertising from our partners