MG400 EnableRobot() command


#1

I am facing problems with the “EnableRobot()” command when sending additional command parameters via TCP-IP

I am using the TCP-IP-4Axis-Python library from your github repository to control the MG-400:


with the latest firmware 1.5.6.0

The center of mass of our added object is off the rotation axis, which is why I set eccentric distance x in Dobot Studio to 30 mm. Then, the robot works fine. Otherwise the robot starts to shake strongly when I make a move or rotation.

Now, I would like to do the same via the TCP-IP. I found that “EnableRobot()” accepts 4 more parameters being mass, eccentric distance x, eccentric distance y, eccentric distance z.

The current version of the python API does not support further parameters which is why I changed/overwrote “EnableRobot()” to accept these 4 parameters, e.g. “EnableRobot(m,x,y,z)” where m is the mass in kg and x,y,z are distances in mm.

Interestingly, the Dobot Studio only allows to set mass, eccentric distance x, and eccentric distance y while the TCP-IP also supports eccentric distance z.

The problem is that the “EnableRobot()” command fails when I send further parameters. The alarm starts and I get error code 105 (“Robot Servo on failed”). The problem does not happen if I use “EnableRobot()” without any parameters. Once the error happens, the robot is in an unsafe state. For example, if I enable the robot via Dobot Studio after clearing the error, the robot arm makes sometimes a sudden move downwards.

If I use “EnableRobot()” without any additional parameters, everything works fine except that I cannot add the object that is off the rotation axis.

Could you please tell me how to set the eccentric distance x correctly using the python API for TCP-IP or how to use the “EnableRobot()” command? Thanks in advance.


#2

Today, I made a couple of tests and found a solution:

By sending first “EnableRobot()” and subsequently “EnableRobot(mass, x, y, z)” one can start the robot without any 105 error and still set mass and the eccentric distances x, y, z. The values are also changed in the Dobot studio.

I believe that it is a bug in the firmware and might be related to the fact that the python API does not support the “EnableRobot()” command with all arguments yet, so that it is maybe not tested so far.

Furthermore, I figured out that the “Payload(mass, inertia)” does not work as well. The return code is -1.

Here, are further tests I did that might be interesting for reproducing or testing the problem:

Send to 192.168.1.6:29999: ClearError()
Receive from 192.168.1.6:29999: 0,{},ClearError();
Send to 192.168.1.6:29999: EnableRobot()
Receive from 192.168.1.6:29999: 0,{},EnableRobot();
Send to 192.168.1.6:29999: Payload(0.325, 0.0)
Receive from 192.168.1.6:29999: 0,{-1},Payload(0.325,0.0);
Send to 192.168.1.6:29999: RobotMode()
Receive from 192.168.1.6:29999: 0,{5},RobotMode();
Send to 192.168.1.6:29999: GetErrorID()
Receive from 192.168.1.6:29999: 0,{[
[],
[],
[],
[],
[],
[]
]
},GetErrorID();
Send to 192.168.1.6:29999: DisableRobot()
Receive from 192.168.1.6:29999: 0,{},DisableRobot();


Send to 192.168.1.6:29999: ClearError()
Receive from 192.168.1.6:29999: 0,{},ClearError();
Send to 192.168.1.6:29999: EnableRobot()
Receive from 192.168.1.6:29999: 0,{},EnableRobot();
Send to 192.168.1.6:29999: RobotMode()
Receive from 192.168.1.6:29999: 0,{5},RobotMode();
Send to 192.168.1.6:29999: GetErrorID()
Receive from 192.168.1.6:29999: 0,{[
[],
[],
[],
[],
[],
[]
]
},GetErrorID();
Send to 192.168.1.6:29999: DisableRobot()
Receive from 192.168.1.6:29999: 0,{},DisableRobot();


Send to 192.168.1.6:29999: ClearError()
Receive from 192.168.1.6:29999: 0,{},ClearError();
Send to 192.168.1.6:29999: EnableRobot(0.325)
Receive from 192.168.1.6:29999: 0,{0},EnableRobot(0.325);
Send to 192.168.1.6:29999: RobotMode()
Receive from 192.168.1.6:29999: 0,{9},RobotMode();
Send to 192.168.1.6:29999: GetErrorID()
Receive from 192.168.1.6:29999: 0,{[
[
105
],
[],
[],
[],
[],
[]
]
},GetErrorID();
Send to 192.168.1.6:29999: DisableRobot()
Receive from 192.168.1.6:29999: 0,{},DisableRobot();


Send to 192.168.1.6:29999: ClearError()
Receive from 192.168.1.6:29999: 0,{},ClearError();
Send to 192.168.1.6:29999: EnableRobot(0.325,0.0,0.0,0.0)
Receive from 192.168.1.6:29999: 0,{0},EnableRobot(0.325,0.0,0.0,0.0);
Send to 192.168.1.6:29999: RobotMode()
Receive from 192.168.1.6:29999: 0,{9},RobotMode();
Send to 192.168.1.6:29999: GetErrorID()
Receive from 192.168.1.6:29999: 0,{[
[
105
],
[],
[],
[],
[],
[]
]
},GetErrorID();
Send to 192.168.1.6:29999: DisableRobot()
Receive from 192.168.1.6:29999: 0,{},DisableRobot();


#3

Received, this problem has been repeated in our test, we are repairing it, and it may be solved in the next version


#4

The MG400 EnableRobot() command is useful for researchers looking to write a research report efficiently. This command helps to simplify the process by providing easily-followable Steps in writing research report to create a comprehensive and accurate report. Using the MG400 EnableRobot() command, researchers can be assured that their research report is up to the highest standards.