tweaking closed loop parameters

18 years 1 month ago #5709329 by bebel
tweaking closed loop parameters was created by bebel
Hi,

I am running a roboteq ax2500 controller in closed-loop position mode(potentiometer) over rs-232, with a sizable gearmotor as a jumbo-servo. I recently noticed that turning the servo one tick(i.e., from analog position 10 to analog position 11) took as much time as moving the servo 10 ticks(i.e., position 0 to position 10).

It seemed that the internal PID controller was dampening the servo movements, which was unacceptable as we have a control theory guy implementing a higher-level controller in software that expects lower-level access to the controller(i.e., moving the servo 5 ticks takes roughly half the time as 10 ticks, not counting some starting and stopping delay) We tuned the P and I gains to maximum and set the D gain to 1.0 (in the roborun software) and now the higher-level controller works as expected; however, regardless of how little we move the servo(one or more "ticks") the motor moves quickly then stops abruptly and jerks the low-backlash chain attached to the servo. One thought is the high back-EMF generated by the motor "brakes" the servo but that is purely a guess.

So, in summary, we wish to have low-level access to the servo(i.e., we require that the small turns of the servo complete faster) but we would like smoother stopping for all turns. We are unable to smooth the stopping of the servo in the higher-level controller because it manifests itself on every turn, regardless of how small. Is there any way to tune the roboteq unit to accomplish this?

Thanks for reading my long-winded question.

Please Log in or Create an account to join the conversation.

18 years 1 month ago #5711661 by cosma
Replied by cosma on topic Re:tweaking closed loop parameters
<P style="MARGIN: 0px">From your description, the problem seems to be with the Integrator part of the PID.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">When the I gain is 0 or low, the P is the main factor that will push the motor. Obviously, if the error is very low, there will be less power applied to the motor than if the error is large. This would explain why you see slow motion with small errors.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Our integrator accumulates the error. Here again, if the error is small, the accumulation is not as fast as if the error is large. Futhermore, if the motor+gear is slow, the integrator has more time to accumulate, so more and more power is applied to the motor while it moves towards its set point.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The above is how an integrator is indeed supposed to work "by the book". However, the result is not always satisfactory as in the case of a slow moving motor.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Since the Integrator is digital, we do a few additional tweaks on it. First, the accumulator is "capped" at the value that would result in 100% power applied to the motor (which depends on the gain).
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Then, once the setpoint is reached (or passed), the accumulator is cleared. This typically causes the motor to quickly stop at the set point. Without it, it would be allowed to overshoot, the error to change sign, and the integrator to start decreasing, etc ... We found that in most systems, this make for very quick and accurate tracking.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The bottom line is that the Integrator function could still be improved, particularly given the very different type of motors and speed range. We have a few ideas on such improvements, but we are open to any suggestions if you have any.

Please Log in or Create an account to join the conversation.

18 years 1 month ago #5721011 by bebel
Replied by bebel on topic Re:tweaking closed loop parameters
Thanks Cosma,

According to the guy who is developing our higher-level controller, the clearing of the integral accumulator is appropriate for set-point control, but not for our control method. Apparently we want to minimize the discontinuity in the power applied to the servo, to avoid the jerking problem, and every time the servo hits the desired position there is a large discontinuity due to the large size of the I term (both large gain and large accumulated error) being reset to zero. We are not terribly concerned about overshoot, but it may become an issue if too big or oscillating.

Therefore, the first thing we would probably like to try is to have the integrator not reset when the servo reaches the set-point; then we would lower the integrator gain to zero then slowly raise it until the desired effect is obtained. There does not appear to be a way to reset this in the manual but perhaps there is a command for it?

Please Log in or Create an account to join the conversation.

18 years 1 month ago #5777719 by cosma
Replied by cosma on topic Re:tweaking closed loop parameters
<P style="MARGIN: 0px">There are no commands to disable the Accumulator reset. This would require a modification to the firmware which we try to avoid as much as possible.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">We can discuss offline. Please use our Tech support form at <A href="dev.roboteq.com/dev1/supportform.shtm" target=_blank>dev.roboteq.com/dev1/supportform.shtm

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.081 seconds