Hi out there.
I want to run two interrupts, triggered over ProfiNet at $IN[401]. When signals go TRUE, the robot should ramp down in speed, wherever it is, and stop within like say 2-3 sec. And when signal is FALSE, the robot should ramp up again. My idea was as followed in this test program below, where I declare the interrupts as below:
INTERRUPT DECL 30 WHEN $IN[401] == TRUE DO ISR_SlowSpeedTestTrue()
INTERRUPT DECL 31 WHEN $IN[401] == FALSE DO ISR_SlowSpeedTestFalse()
Full test program:
&ACCESS RVP
&REL 16
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM DISKPATH = KRC:\R1\Program\HelperFunctions
DEF SlowSpeedTest( )
$ADVANCE = 1
INTERRUPT DECL 30 WHEN $IN[401] == TRUE DO ISR_SlowSpeedTestTrue()
INTERRUPT DECL 31 WHEN $IN[401] == FALSE DO ISR_SlowSpeedTestFalse()
LOOP
INTERRUPT ON 30 ; Enable the interrupt
INTERRUPT ON 31 ; Enable the interrupt
;FOLD SPTP P1 CONT Vel=100 % PDAT1 Tool[1]:ForkCenterOfBoxCAD Base[5]:PalletAligned ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=P1; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT1; Kuka.VelocityPtp=100; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XP1 WITH $VEL_AXIS[1] = SVEL_JOINT(100.0), $TOOL = STOOL2(FP1), $BASE = SBASE(FP1.BASE_NO), $IPO_MODE = SIPO_MODE(FP1.IPO_FRAME), $LOAD = SLOAD(FP1.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT1), $APO = SAPO_PTP(PPDAT1), $GEAR_JERK[1] = SGEAR_JERK(PPDAT1), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
;ENDFOLD
;FOLD SPTP P2 CONT Vel=100 % PDAT2 Tool[1]:ForkCenterOfBoxCAD Base[5]:PalletAligned ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=P2; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT2; Kuka.VelocityPtp=100; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XP2 WITH $VEL_AXIS[1] = SVEL_JOINT(100.0), $TOOL = STOOL2(FP2), $BASE = SBASE(FP2.BASE_NO), $IPO_MODE = SIPO_MODE(FP2.IPO_FRAME), $LOAD = SLOAD(FP2.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT2), $APO = SAPO_PTP(PPDAT2), $GEAR_JERK[1] = SGEAR_JERK(PPDAT2), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
;ENDFOLD
;FOLD SPTP P3 CONT Vel=100 % PDAT3 Tool[1]:ForkCenterOfBoxCAD Base[5]:PalletAligned ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=P3; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT3; Kuka.VelocityPtp=100; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XP3 WITH $VEL_AXIS[1] = SVEL_JOINT(100.0), $TOOL = STOOL2(FP3), $BASE = SBASE(FP3.BASE_NO), $IPO_MODE = SIPO_MODE(FP3.IPO_FRAME), $LOAD = SLOAD(FP3.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT3), $APO = SAPO_PTP(PPDAT3), $GEAR_JERK[1] = SGEAR_JERK(PPDAT3), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
;ENDFOLD
;FOLD SPTP P4 CONT Vel=100 % PDAT4 Tool[1]:ForkCenterOfBoxCAD Base[5]:PalletAligned ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=P4; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT4; Kuka.VelocityPtp=100; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XP4 WITH $VEL_AXIS[1] = SVEL_JOINT(100.0), $TOOL = STOOL2(FP4), $BASE = SBASE(FP4.BASE_NO), $IPO_MODE = SIPO_MODE(FP4.IPO_FRAME), $LOAD = SLOAD(FP4.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT4), $APO = SAPO_PTP(PPDAT4), $GEAR_JERK[1] = SGEAR_JERK(PPDAT4), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
;ENDFOLD
ENDLOOP
END
Display More
ISR for Slowing down the robot.
&ACCESS RV1
DEF ISR_SlowSpeedTestTrue()
DECL INT count
INTERRUPT OFF 30
; Ramp down
;FOR count = 100 TO 0 STEP 10
;$OV_PRO = count
;WAIT SEC 0.1
;ENDFOR
;Somehow the for loop did not work, but I will figure this out later... Perhaps because I cant declare INT in an interrupt?
$OV_PRO = 90
WAIT SEC 0.1
$OV_PRO = 80
WAIT SEC 0.1
$OV_PRO = 70
WAIT SEC 0.1
$OV_PRO = 60
WAIT SEC 0.1
$OV_PRO = 50
WAIT SEC 0.1
$OV_PRO = 40
WAIT SEC 0.1
$OV_PRO = 30
WAIT SEC 0.1
$OV_PRO = 20
WAIT SEC 0.1
$OV_PRO = 10
WAIT SEC 0.1
$OV_PRO = 0
WAIT SEC 0.1
END
Display More
ISR for speeding up the robot again...
&ACCESS RV1
DEF ISR_SlowSpeedTestFalse()
DECL INT count
INTERRUPT OFF 31
; Ramp up
;FOR count = 0 TO 100 STEP 10
;$OV_PRO = count
;WAIT SEC 0.1
;ENDFOR
$OV_PRO = 10
WAIT SEC 0.1
$OV_PRO = 20
WAIT SEC 0.1
$OV_PRO = 30
WAIT SEC 0.1
$OV_PRO = 40
WAIT SEC 0.1
$OV_PRO = 50
WAIT SEC 0.1
$OV_PRO = 60
WAIT SEC 0.1
$OV_PRO = 70
WAIT SEC 0.1
$OV_PRO = 80
WAIT SEC 0.1
$OV_PRO = 90
WAIT SEC 0.1
$OV_PRO = 100
WAIT SEC 0.1
END
Display More
I was looking into the manual and was thinking, that I should be able to override the acceleration, and I was trying to set
$ACC, $ACC_OV etc, but it complained when I e.g. set
$ACC.CP = 1.
So therefore I went back to the OV_PRO version, and "manually" ramping down using decrementing the value with an wait statement. I think this is a bit ugly, so what is the best practice to do this?
Thanks in advance...