Changing PID for Individual Motors

What is the correct syntax for changing the PID values for individual Dynamixel MX64 motors ? The documentation says:
get_pid_gain(ids, **kwargs), here I am able to use this command as example : dxl_o.get_pid_gain(ids) which returns a tuple which contains the PID values.

set_pid_gain(pid_for_id, **kwargs), here I am unable to set the PID values, I have tried the following commands:

dxl_io.set_pid_gain(ids, pid) where PID = “6,0.1,1” and,
dxl_io.set_pid_gain({1: ‘6’}) here it writes the value but when I read the PID values, none of them are 6. They all seem to be random values.

It would be really helpful if someone could guide me to the correct way of setting the PID values if I am writing it wrong or is this a bug in the code ??

Thanks in advance,
Shubham Vyas

I moved a post to a new topic: What is the actual role of internal motor PID?

If you create a pypot robot, it is very simple:


for m in robot.motors:
     m.pid = (x, y, z) # Robotis PID default is (4, 0, 0)
2 Likes

I haven’t created a pypot robot. I have to change individual motor’s PID values. The documentation gives the command as:

dxl_io.set_pid_gains(pid_for_id, **kwargs)

but it doesn’t give the format in which the pid values must be entered (Eg. Tuple, list, string etc)

pid=dict(zip(ids, itertools.repeat([6,2,0])))
dxl_io.set_pid_gain(pid)

Tuple in python is set by using ’ [ '.
Hope you get it.