-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PID coeff in conversion for xl-320 #176
Comments
There is an issue withe the treatment of the PID parameters. The "external" PID values are supposed to be passed in a list [P, I , D] -- at least that is the expectation. But after conversion the values are passed to the "internal" values and to the registers in the XL320 as D, I, P because this is the order in which the registers are listed in the motor.
(that is quite often in the various robots initialisation code) will actually end up setting the registers as follows (for an XL320):
As you can see the result will be a very weak motor (P parameter is 0!) but also extremely unstable (D parameter is 254 which will make it very reactive to position errors). That is very different from the expected behaviour of a medium stiff motor (P = 4 x 8 = 32) and with 0 D coefficient that will make it less likely to oscillate. So the actual call would need to be:
It's unfortunate that the member is called pid and the conversions pid_to_dxl and dxl_to_pid suggesting that that external format is PID.
This way the calls to the PID members will be natural. |
Good catch! Do not hesitate to submit a PR with the modification, we'll gladly integrate it. |
Fixed in #238. |
Coeff are always strange for me. |
Maybe there is an explanation, but for me the coeff. for the PID gain is a little bit weird :
Because PID are all beetween 0 and 254 means that when you set in pypot range of :
P (value[2]) is between 0 and 31,75
I (value[1]) is between 0 and 124,0234375
D (value[0]) is between 0 and 1,016
A good PID in pypot could be (8.0, 15.625, 0.064), I find this not really "readable"
The text was updated successfully, but these errors were encountered: