Hi Everyone,
I have a KR10 robot with KRC4 compact controller running KSS 8.3.34. I want to achieve similar behavior to SmartServo mode on Iiwa. In SmartServo you give the controller a destination and it plans a path and moves the robots to that destination. While it's moving to the destination you can give it another destination and, without stopping, the robot it will compute a new path from the robot's current position to the new destination.
This is what I tried on KR10:
Code
&ACCESS RVP
&REL 1
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM EDITMASK = *
DEF tst( )
; Declaration of KRL variables
DECL AXIS p1
DECL AXIS p2
DECL AXIS p3
DECL INT vel_limit
DECL INT acc_limit
p1 = {A1 0, A2 -90, A3 90, A4 0, A5 90, A6 90}
p2 = {A1 0, A2 -90, A3 90, A4 0, A5 90, A6 -90}
p3 = {A1 0, A2 -90, A3 90, A4 0, A5 70, A6 0}
;FOLD INI
;FOLD BASISTECH INI
BAS (#INITMOV,0 )
$ADVANCE = 0
vel_limit = 20
acc_limit = 100
$VEL_AXIS[1]=vel_limit ;definition of the axis velocities
$VEL_AXIS[2]=vel_limit
$VEL_AXIS[3]=vel_limit
$VEL_AXIS[4]=vel_limit
$VEL_AXIS[5]=vel_limit
$VEL_AXIS[6]=vel_limit
$ACC_AXIS[1]=acc_limit ;definition of the axis accelerations
$ACC_AXIS[2]=acc_limit
$ACC_AXIS[3]=acc_limit
$ACC_AXIS[4]=acc_limit
$ACC_AXIS[5]=acc_limit
$ACC_AXIS[6]=acc_limit
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
INTERRUPT DECL 1 WHEN $TIMER_FLAG[1]==TRUE DO StopMotion ( )
; Move to start position
PTP p1
MsgNotify("p2")
$TIMER[1] = -2000
$TIMER_STOP[1] = FALSE
INTERRUPT ON 1
Motion(p2)
INTERRUPT OFF 1
MsgNotify("p3")
Motion(p3)
END
DEF Motion (p: IN)
DECL AXIS p
PTP p
END
DEF StopMotion ()
MsgNotify("int")
$TIMER_STOP[1] = TRUE
RESUME
END
Display More
The problem is that after RESUME it will not switch the motion from p2 to p3, it will complete p2 before doing p3. If I put a BRAKE command before the RESUME command it will stop p2 and start p3 but I want a transition without stopping.
Any ideas on how to do it?