So as you found from the e-manual for the MX-28
http://support.robotis.com/en/produc...ries/mx-28.htm
P/I/D are at register 28/27/26
The simplest way to set the values would be with set register (we'll assume servo ID 1 ans that we're setting all the PID values to they're default values of 32/0/0
Code:
ax12SetRegister(1, 28, 32) //set servo ID 1's register 28(P) to the value of 32
ax12SetRegister(1, 27, 0) //set servo ID 1's register 27(I) to the value of 0
ax12SetRegister(1, 26, 0) //set servo ID 1's register 26(D) to the value of 0
Alternative, you could define P,I, and D registers
Code:
#define MX_P 28
#define MX_I 27
#define MX_D 26
ax12SetRegister(1, MX_P , 32) //set servo ID 1's register 28(P) to the value of 32
ax12SetRegister(1, MX_I , 0) //set servo ID 1's register 27(I) to the value of 0
ax12SetRegister(1, MX_D , 0) //set servo ID 1's register 26(D) to the value of 0
This will have the same effect as the first 3 lines of code, but might be easier to read.
I've got some updates to the arbotix libraries in the works to better address some of the #define issues like this.
Bookmarks