Position Control jitters around target position

Questions about using encoders with the Roboclaw product line
Post Reply
Posts: 4
Joined: Fri Mar 01, 2019 3:13 am

Position Control jitters around target position

Post by cjr » Thu Mar 07, 2019 9:03 am

Next question ;)

Again using Command 65, i'm moving to some target position. Works so far, deccelerates, crawls to target (depending on Ki and MaxI).

As soon as the Target position is reached (the position error changes its sign), RoboClaw suddenly speeds up a little bit, overshooting the target (e.g. Pos 100000) by e.g. 800 steps. Then it reverses, crawls again to the target and the cycle repeats. I can reduce the behaviour by lowering Ki and/or MaxI till the DeadZone stops the motor, but i would really like to understand what's happening.

Release-notes show that You dropped the Leaky Integrator. I have yet to understand what the Back Calculation thing does.

Parameters are:

Velocity Kp = 0.953690
Velocity Ki = 0.059158
Velocity Kd = 0.000000
QPPS = 50000
Position Kp = 10.000000
Position Ki = 0.029297
Position Kd = 0.000000
Max I = 100000
Deadzone = 30
Min Position = 0
Max Position = 1163000
S3 Pin Func = 0 / 0x00
S4 Pin Func = 2 / 0x02
S5 Pin Func = 2 / 0x02

These are the values given to the Arduino/Linux library, so the PID values are the floating point ones. The Velocity PID values are from the AutoTune, the Position ones are handcrafted till positioning was fairly ok.

Many Thanks in advance.


User avatar
Basicmicro Support
Posts: 1160
Joined: Thu Feb 26, 2015 9:45 pm

Re: Position Control jitters around target position

Post by Basicmicro Support » Thu Mar 07, 2019 10:02 am

This is proabbly an interactioin of the Vel integral and Pos integral. You usually do not want to use a Pos integral when using cascaded control. At most you would use Vel PI and Pos PD. It defintely sounds like this is different than normal hunting/stiction caused oscilations which is why I suspect an unexpected interaction.

Note the +-30 deadzone is probably also part of this interaction problem.

Start by zeroing the Pos I and IMax settings. If position accuracy isnt good enough increase P but also make sure you have Vel P and I tuned well. If they are tuned well then a simple Vel PI and Pos P cascaded controller usually gives very good results. I recommend zeroing Deadzone until you have a good Pos P tuned and then add Deadzone to prevent hunting/stiction caused oscilations. Note to get higher Pos P(which will give a more aggressive movement) you can add some Pos D to dampen out any overshoot.

Posts: 4
Joined: Fri Mar 01, 2019 3:13 am

Re: Position Control jitters around target position

Post by cjr » Thu Mar 14, 2019 10:38 am

Thank You for this information. I will try this next week when i'm back at the machine.

Post Reply