Home› Troubleshooting
Discussion
Back to discussions page
RemkoPr
Posts: 4 Apprentice
Motor current reading zero |
90 views
|
Answered | |
/ Most recent by RemkoPr |
4 comments |

Hello there, I have a Robotiq 2F-85 attached to a UR3e robot, the robot is connected to my laptop via a wired ethernet network. I'm using python code very similar to a different post to control the gripper over a socket connection, link and minimal code example below. I can set target position, speed, force etc without issue, I can read back the actual position, gripper status etc, BUT: when I try to read the motor current, it always returns zero, regardless of whether or not the gripper is holding something. Any idea what might be the problem? Is there some action that must be taken for the motor current to be written to its respective register?
Code source:
https://dof.robotiq.com/discussion/2420/control-robotiq-gripper-mounted-on-ur-robot-via-socket-communication-python
Code:
robotiq2f_tcp.py
main.py
output
COU 0
This output is also obtained when the robot is first made to grasp an object (using functions not included in the above code example).
Code source:
https://dof.robotiq.com/discussion/2420/control-robotiq-gripper-mounted-on-ur-robot-via-socket-communication-python
Code:
robotiq2f_tcp.py
import socket import time class Robotiq2F85TCP: def __init__(self, host_ip: str, port: int = 63352) -> None: self.host_ip = host_ip self.port = port def _communicate(self, command: str) -> str: """Helper function to communicate with gripper over a tcp socket. Args: command (str): The GET/SET command string. """ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: try: s.connect((self.host_ip, self.port)) s.sendall(("" + str.strip(command) + "\n").encode()) data = s.recv(2 ** 10) return data.decode()[:-1] except Exception as e: raise (e) def activate_gripper(self): """Activates the gripper, sets target position to "Open" and sets GTO flag.""" self._communicate("SET ACT 1") while not self._communicate("GET STA") == "STA 3": time.sleep(0.01) # initialize gripper self._communicate("SET GTO 1") # enable Gripper self.target_position = 0 self.speed = 255 self.force = 0
main.py
from robotiq2f_tcp import Robotiq2F85TCP robotiq = Robotiq2F85TCP("10.42.0.162") # activate and wait for 4sec for calibration procedure (gripper opens and closes) robotiq.activate_gripper()) time.sleep(4) print(robotiq._communicate("GET COU"))
output
COU 0
This output is also obtained when the robot is first made to grasp an object (using functions not included in the above code example).
Tagged:
Best Answer
-
bcastets Vacuum Beta tester Posts: 695 Expert
The force parmeter will the define the current threshold which will stop the motor. The more force you have the more will be the threshold.
The gripper is looking for a pick of current. Once this pick is detected the current is set to 0 if the force is 0 or few mA if the force is more than 0.
After grip, the current is the same whatever the value of the force parameter.
With a force parameter at more than 1 the gripper always try to close to keep fingers as close as possible from each others. That is way the motor consum few mA.
I recommand you play with our PC interface to understand how works the gripper. In this interface it is posible to see the modbus registers of the gripper.
https://assets.robotiq.com/website-assets/support_documents/document/RUI-2.4.6_20210412.zip
"The force setting defines the final gripping force for the gripper. The force will fix the maximum current sent to the motor. If the current limit is exceeded, the fingers stop and trigger an object detection notification. Please refer to the Picking Features section for details on force control."
It would seem then that internally the gripper current is indeed used for gripping force estimation, as force limits are translated to current limits? Is this gripper current not the same one made accessible in the COU register?
"The force setting defines the final gripping force for the gripper. The force will fix the maximum current sent to the motor. If the current limit is exceeded, the fingers stop and trigger an object detection notification. Please refer to the Picking Features section for details on force control."
It would seem then that internally the gripper current is indeed used for gripping force estimation, as force limits are translated to current limits? Is this gripper current not the same one made accessible in the COU register?