First off, this robot project started here, make sure you get caught up first!
This thread chronicles the process that it took to communicate with my FANUC robot arm. It was missing all the expensive options that allow for PC control via serial or TCP/IP. I could not find much online aside from ‘read the manuals and talk to fanuc’ both options cost money, and as I found not that helpful. I went through over 11 manuals, and even they where not 100% correct. They also lacked any example strings!
NOTE: If you write manuals always include a string of data that can be used to test coms!
Here is a walkthrough of all the work that went into the process.
First step was to figure out how to wire the serial port, the former owner had wired in a crude setup, and I had to figure out if it was done correctly, so I have attached the photos of the process above, and the pinout between the PC DB9 and the FANUC 20 pin special connector that worked for me.
The Com port used some not so normal port settings, here is what I found it needed to use!
Here is the first program I wrote in Processing, to auto generate the proper hex strings and be able to send them out via the serial port, calculating the BCC Checksum with XOR was new to me an a fun challenge.
Now to see if I can have this work on the robot.
Awesome! I can write data! Can I get the robot to follow?
Now that I have proof of concept, time to add more features, lets try and add a second dimension, the Y axis!
Here is what the robot program looks like now
Now to see if I can get the X and Y to have separate slider controls.
Now that I have X,Y control, lets make one of those a Z height and add a Lidar sensor and make things fun!
I now have full remote PC control of the robot! This opens up many new projects so stop back often for updates! If you have any fun ideas, be sure to comment them below!
I want to make a project similar to yours, but I have not been able to configure the serial port, since if I change the device it returns to the previous one and does not let me select the “Sensor” one. Could you guide me on this?
Happy to try and help out! I know it can be a bit frustrating, each Fanuc is a bit different so it may be a challenge. Some Serial ports are ‘hard baked’ and can not be changed, but if you try another com port it may let you change its settings and have them save! I think mine was on the 2nd com port. If you use my contact form here, I can email you back and we can chat!
https://www.djdlabs.com/about/
Looks like it says Port 1 can not be changed, so try the JD17 (P3) Connection!
https://www.djdlabs.com/wp-content/uploads/2022/09/20220909_180123.jpg
Hello! Can you sent code communication of Pc with robot?
Have you use arduino board?
Thank you very much!
Tony,
Thanks for reaching out! I have my comunication code, for the robot and PC on this project thread,
https://www.djdlabs.com/fanuc-robot-g-code-project/
The PC side was written in processing, if I remember correctly it is almost identical to arduino. IF not Chat GPT can convert it for you. I have used Arduino for a lot of projects in the past, so let me know if you would like me to try and make some test code to send commands from an arduino to the robot via serial.
The hardest part is the hand shaking of the data, and doing it quickly. Plus the checksum calculation. Let me know if you have any questions along the way!
Best of luck with your project! There seems to be very few of us out there doing this.
Ok! Have you need software robot fanuc to open more option of robot? I will sent help you!
I did not need anything from Fanuc for my controller. I belive mine is the base config, no special options at all.
Hello! Have you tried controlling with force sensor?
I have not, I would imagine it would be simpler, for that is what this interface is built for!
Hello! Can you sent help me code only communication PC with robot?
Would be happy to help! Can I ask what you are trying to do? That may help me with a basic code example. Do you just want the PC program to change a variable on the robots contreoller? OR send a number?
Right! i have use processing software to run code of you but it error, i only code sent variable controller robot with PC
http://www.djdlabs.com/wp-content/uploads/2022/09/robot-xy-new-control.mp4
The error you are getting may be related to your COM port, you will need to set this number to match the number of the port on your PC. For example COM1 or COM2… You can check this in the device manager in windows, under com ports. In my code check this line,
// Setup the serial port for FANUC sensor input. The ‘O’ is of odd parity.
myPort1 = new Serial(this, “COM3”, 4800, ‘O’, 8, 1);
//Serial(parent, portName, baudRate, parity, dataBits, stopBits)
Make sure your COM number is the same as the one in the code, as well as the Baud rate and Parity and Stop bits, those need to match the same number in your fanuc robot com port setup.
I copied the code you linked the video of here for you to try as well.
https://www.djdlabs.com/Slideplusserial7.txt
Let me know what questions you may have!