I am beginning to implement the same thing. I have connected 4 JMC Jasd7502 EC Servo drives to a KRC4 robot. They are installed with a working ESI. I can exchange IO between servos and Robot.
These servos will open and close a gripper to variable positions.
I am thinking of writing a KRL file with signals etc... to initialize drive, home, set target position and move.
Did your method work? could you share your KRL file? how bad is the latency?
Hi Nicolas,
Here is my code,
Code: rotate_turntable.src
&ACCESS RVO1
&COMMENT Rotate the turntable
DEF rotate_turntable (target_pos:IN )
;Declaration
DECL INT target_pos
SIGNAL RxPDO_TARGET_POS $OUT[281] TO $OUT[312] ;32 bit
SIGNAL TB_Set_new_point $OUT[269]
SIGNAL TB_Target_reached $IN[275]
SIGNAL TB_Set_point_ACK $IN[277]
;Reset TB_Set_new_pt if it's not previously set as FALSE
IF TB_Set_new_point==TRUE THEN
TB_Set_new_point=FALSE
WAIT FOR NOT ( TB_Set_point_ACK )
ENDIF
;Set the Target position
RxPDO_TARGET_POS = target_pos
;set new point
TB_Set_new_point=TRUE
WAIT FOR ( TB_Set_point_ACK )
;Once the set point is acknowledged, set the TB_Set_new_pt to False
TB_Set_new_point=FALSE
WAIT FOR NOT ( TB_Set_point_ACK )
;Wait until the motor reach the target point
WAIT FOR ( TB_Target_reached )
END
Display More
This script did the job although I haven't refactored it to make it more concise.
I never measure the latency since it's not a time-critical project.
I hope this can be helpful, and any advice is very welcome!