torayeff / fanucpy

Python Interface for FANUC robots
Apache License 2.0
109 stars 29 forks source link

Issue in writting to Fanuc CR-4iA last value #15

Closed qboticslabs closed 1 year ago

qboticslabs commented 1 year ago

Hello

I am working on Fanuc CR-4iA robot, when I am trying to move the last joint or yaw value of the robot, it is always going to zero. I just printed the cmd that is sending to the robot from Robot.py , and it is having the value i am giving. The reading of the joint values are proper, but when we command last value it is always setting zero.

We can manually jog the joint using teach pendent, and can read the values as well.

I think some settings in Karel code may be wrong, can you give some insights about the same if possible ? @torayeff . This is 6 axis robot.

torayeff commented 1 year ago

Can you check the PR[81] register? This position register stores the joint values sent from Python. Can you please also put WRITE("joint_vals", joint_vals, CR) after this line https://github.com/torayeff/fanucpy/blob/main/src/fanuc-driver/mappdk_cmd.kl#L206?

qboticslabs commented 1 year ago

@torayeff It is showing zero for Joint 6, and also for the 6th value of the position mode.

torayeff commented 1 year ago

@torayeff It is showing zero for Joint 6, and also for the 6th value of the position mode.

I can confirm that it works on a physical robot LR mate with robot controller v9. Unfortunately, I cannot verify it for CR-4 this week. It might be the case that something is different with your robot controller version. Can you please provide more info about the version and robot?

Moon-Lord commented 1 year ago

I am having the same problem with an LR Mate 200iD 4S with controller Version V8.30.

Moon-Lord commented 1 year ago

I noticed, that the values for the joints/pose are using up 18 characters. When i debugged the code, i noticed, that the last value was not fully incorporated into the command string. So after the last colon you would onnly see "+000000". Basically only 7 characters of the last value where shown in the command string.

To solve the problem, I only used 3 instead of 6 decimal characters and used a total of 11 characters for the whole value.

@torayeff , the LR Mate 200iD 4S only has an accuracy in micrometers. I would like to know, what the reason was, that you would use 6 decimal characters.

torayeff commented 1 year ago

@Moon-Lord this is a very good observation and it should probably help others. I will try to update the code to reflect the changes or feel free to make changes and make pull request.

The main reason for 6 decimal places was for robots working with PCB manufacturing.

Moon-Lord commented 1 year ago

@torayeff I will make a pull request with 6 decimal places today.

gavanderhoorn commented 1 year ago

As an observation: precision related to floating point representation could be avoided by switching to a binary protocol.

torayeff commented 1 year ago

@gavanderhoorn, thank you very much for this observation. I will try to address this.

P.S.: I am happy that you are taking part in discussions, I was inspired by your works in ROS :)

torayeff commented 1 year ago

Thank you very much to everyone for contributing. The changes have been reflected in version 0.1.11 (PyPI). Newly compiled Karel files have also been added.