Changing motor PIDs during operation


We are currently changing the PID gains of the arm’s motors during the arm’s operation in between movements e.g. go to point number 1, change the PID gains, go to point number 2, etc.

We have previously heard from the team that specific areas in the motor memory can only be written to a certain number of times, does this apply to changing PID gains as well? (i.e. is there any harm in changing the PID multiple times throughout our script or does that cause any problems with the motors?)

If there is indeed a limited number of times we can change the PID gains during each time we run our program, what is that number? If we rest the arm, close it down and re-initialise it and then continue our program would that be a decent way around it?

We have noticed that each time we change the PID gains to a higher (more accurate) value while the arm is at a specific position, the arm “jumps” to adjust its position due to the more accurate PID gains taking effect. We feel that this “jump” is certainly not healthy for the motors and hence are considering changing the PID gains incrementally. E.g. instead of changing from [32, 0, 0] to [90, 4, 30] directly (1 change), we would change them to 3 more steps in between the start and goal gains (4 total changes).

We are not using accurate PID gains for the whole program since the jerky motion it causes is not good for the motors. We hence keep switching the PIDs between a more accurate, more jerky gains (for small, accurate tasks), and less accurate, less jerky gains (for the larger movements).

Would be great to hear the team’s thoughts around this! Thanks in advance for any insights

1 Like

To the best of my knowledge there is no official number provided by robotis (the motor manufacturer). But as long as you are not writing the EEPROM at 100Hz for dozen of days I don’t think that’s an issue.

I’ve never tried this approach but indeed this may help.
Another option is to actually change the goal position to something closer to its actual present position before changing the PID. This way the motor should not jump to try to reach its goal position.

Let me know If it helps!