Hi,
I am looking for a solution to solve delayed response by the KUKA robot over real time data transfer ethernetKRL.
We have a setup in which we are sending data from the force torque sensor to produce the movement of the robot in the direction of the force. The data transfer is working at 16ms approx, which is same as the data refresh rate of the sensor.
I am using LIN_VEL function to do this task.
As I mentioned above the problem lies in the delayed response of the robot. I suppose this delay is because of the robot takes time to take command for new position, only when the previous position is attained (within C_DIS) the new position would be triggered.
I believe there is a better way to do this task, Please share your ideas on this.
Other details - Kuka KRC4 compact, EthernetKRL 2.2
; ===============================================
; Interrupts
; ===============================================
INTERRUPT DECL 22 WHEN $FLAG[1] == TRUE DO OnEkiIntrpt() ;TIMER FLAG - which runs at 500ms, makes sure that even if some packet is lost or robot is stopped, communicatiob would restart in 500ms
INTERRUPT DECL 23 WHEN $TIMER_FLAG[1] == TRUE DO OnEkiIntrpt() ;WAIT for the data buffer received from board
;INTERRUPT DECL 1 WHEN $TECHVAL[1] > 20.0 DO OnEkiIntrpt()
;FIRST TIME START COMMUNICATION
CAST_TO(SendBuffer[],OFFSET,$POS_ACT,$AXIS_ACT,$TORQUE_AXIS_ACT[1],$TORQUE_AXIS_ACT[2],$TORQUE_AXIS_ACT[3],$TORQUE_AXIS_ACT[4],$TORQUE_AXIS_ACT[5],$TORQUE_AXIS_ACT[6],"R",TRUE)
RET = EKI_Send("BinaryFixed",SendBuffer[])
WAIT FOR $FLAG[1]
RET=EKI_GetString("BinaryFixed","Buffer",ReceiveBuffer[])
$FLAG[1]=FALSE
RET = EKI_Send("BinaryFixed",SendBuffer[])
;TURN ON THE INTERRUPT AND WAIT FOR 0.20sec
;ATTENTION THIS WAIT IS IMPORTANT
INTERRUPT ON
WAIT SEC 0.20
ORG_POS =$POS_ACT
; ===============================================
; start move loop
; ===============================================
FOR i=(1) TO (1000000)
;Transfering Data to the buffer
;CAST_TO(Bytes[],OFFSET,34.425,674345,"R",TRUE)
;CAST_TO(SendBuffer[],OFFSET,$POS_ACT,$AXIS_ACT,$TORQUE_AXIS_ACT[1],$TORQUE_AXIS_ACT[2],$TORQUE_AXIS_ACT[3],$TORQUE_AXIS_ACT[4],$TORQUE_AXIS_ACT[5],$TORQUE_AXIS_ACT[6],"R",TRUE)
;RET = EKI_Send("BinaryFixed",SendBuffer[])
;Acquisition of DATA Received
;RET=EKI_GetString("BinaryFixed","Buffer",ReceiveBuffer[])
;CAST_FROM(ReceiveBuffer[],OFFSET,Robotiq_forceX,Robotiq_forceY,Robotiq_forceZ,Robotiq_momemtumX,Robotiq_momemtumY,Robotiq_momemtumZ)
;CAST_FROM(ReceiveBuffer[],OFFSET,valueReal,valueInt,valueChar[],valueBool)
;Give motion command only in this conditio
IF (Handle_hold AND New)== TRUE THEN
REL_POS.Z = -40*Robotiq_forceY
REL_POS.X = -40*Robotiq_forceX
REL_POS.Y = -70*Robotiq_forceZ
$BWDSTART=FALSE
LDAT_ACT=LCPDAT_BINFIX1
FDAT_ACT=FP_BINFIX1
BAS(#CP_PARAMS,100)
LIN_REL REL_POS C_VEL
;SPLINE
;SPL_REL REL_POS
;ENDSPLINE C_SPL
ENDIF
;Re-fill buffer so that it is not to be used again
REL_POS.Z = 0
REL_POS.X = 0
REL_POS.Y = 0
New = FALSE
ENDFOR
; ===============================================
; End move loop
; ===============================================
INTERRUPT OFF
$TIMER_STOP[1] = TRUE
;CLOSE THE XML
RET=EKI_Close("BinaryFixed")
RET=EKI_Clear("BinaryFixed")
END
; ===============================================
; End of main progr
;===============================================
; ------------------------------------------------------------------
; Subprogram
; ------------------------------------------------------------------
DEF OnEkiIntrpt()
DECL EKI_STATUS RET
RET=EKI_GetString("BinaryFixed","Buffer",ReceiveBuffer[])
$FLAG[1]=FALSE
New = TRUE
$TIMER[1]=-500
OFFSET=0
CAST_FROM(ReceiveBuffer[],OFFSET,Robotiq_forceX,Robotiq_forceY,Robotiq_forceZ,Robotiq_momemtumX,Robotiq_momemtumY,Robotiq_momemtumZ,Handle_hold)
OFFSET=0
CAST_TO(SendBuffer[],OFFSET,$POS_ACT,$AXIS_ACT,$TORQUE_AXIS_ACT[1],"R",TRUE)
WAIT SEC 0.02
RET = EKI_Send("BinaryFixed",SendBuffer[])
END
Display More