finally, I finished my project. I would like to share it with all the users who are trying to use FANUC robots for their job.
1. connect: find a CAT-5 wire to connect the computer and robots (located at the down side of the door of R-30iB.
2. IP setting:
2.1 set a IP for your computer ether net card (e.g. 192.168.1. 15). If you already have one, remember the network segment
2.2 set IP of FANUC robot, MENU->SETUP->HOST COMM and set the IP to ROBOT (e.g. 192.168.1.10). NO SPACES BEFORE DIGITS
2.3 then NEXT->INIT->YES->reboot
3. RoboDK connect:
3.1 preparation -
download FANUC driver from RoboDK website
make sure the FANUC robot has a "user socket messaging" installed
USB inserted in Teach Pendant
3.2 setting -
set device:
MENU->FILE->FILE, UTIL->SET DEVICE->USB on TP
show files:
select "*" mark on Teach Pendant
upload files:
select files(RDK_S3.PC, GO_MJ, GO_ML, GO_MC, GO_PROG) which downloaded from website, then press LOAD->YES on Teach Pendant
activate driver: (from instruction of RoboDK website)
Select Menu-(Next)-System-[TYPE]-Variables.
Select $HOSTS_CFG (holding shift while selecting key down will help you scroll down faster)
Select Number 3
Set $SERVER_PORT to 2000
($HOSTS_CFG[3].$SERVER_PORT = 2000)
Select Menu-Setup
Select [TYPE]-Host comm
Select [SHOW]-Servers
Select “S3”-Enter.
Set Protocol Name to SM
In Port Name, if multiple ports are available: Set Port to P3 (or the corresponding port).
Set Inactivity Timeout to 9999
Set Startup state to [CHOICE] START
Set Current state to STARTED:
To do so, select [ACTION]-DEFINE, then [ACTION]-START
Start RDK_S3 driver: (in manual mode, PRESS the DEADMAN SWITCH)
Select the Select button from the teach pendant.
Scroll down towards the DRIVERRDK_S3 program
Select Enter (button from the teach pendant)
Select Shift-Reset and Shift-Forward to start the program
if setting OK, will see the green sigh(BUSY and RUN) at the top-left of Teach Pendant
3.3 Run a program -
right click a robot model at the RoboDK screen -> connect to robot
click connect should a green "ready" appears
right click a python program (e.g. Prog1)-> run on robot (you can also click "run python script to silulate)" and the robot should follow your program to move. (IF it moves but not according your direction, check the version of RoboDK driver)
EVERY TIME HAVE PROBLEM TO CONNECT ROBOT, TRY "FCN->ABORT ALL, SELECT RDK_S3->ENTER->DEADMAN+SHIFT+RESET->DEADMAN+SHIFT+FWD"
4. IO:
you can use both PLC and CRMA15/16 to connect to a peripheral device. CRMA15/16 is located at the down side of the door of R-30iB (on the side of the ether net cable connector), see the attached file of connect method
use a PLC is also a good solution (if you know how to set the prot. between PLC and ROBOT)
use setDO(I/O, 1/0) to control ON/OFF of your device
"DON'T WASTE TOO MUCH TIME ON CONTROLLING THE EE INTERFACE OF FANUC", I tried many methods and failed.
5. Move Robot:
Code:
#x_offset = forward (+ value) and back (- value)
#y_offset = left(+) and right (-)
#z_offset = up(+) and down(-)
def moverobot1(x_offset,y_offset,z_offset):
target_ref = robot.Pose()
pos_ref = target_ref.Pos()
robot_x = pos_ref[0]+x_offset
robot_y = pos_ref[1]+y_offset
robot_z = pos_ref[2]+z_offset
target_i = Mat(target_ref)
target_i.setPos([robot_x,robot_y,robot_z])
robot.MoveL(target_i)
# a_value = trun join axis 6 (+ = Counterclockwise, - = Clockwise)
# b_value = turn join axis 5 (+ = backward, - = forward)
# c_value = turn join axis 4 (when arm is toward to left, + = Counterclockwise, - = Clockwise)
def moverobotj(a_value,b_value,c_value):
target = robot.Pose()
xyzabc = Pose_2_KUKA(target)
x,y,z,a,b,c = xyzabc
xyzabc2 = [x,y,z,a+a_value,b+b_value,c+c_value]
target2 = KUKA_2_Pose(xyzabc2)
robot.MoveJ(target2)
hope it helps!