Position - PWM - Difference Pos Neg Directions

General discussion of using Roboclaw motor controllers
Posts: 1
Joined: Tue May 08, 2018 2:02 pm

Position - PWM - Difference Pos Neg Directions

Postby robof2 » Tue May 08, 2018 2:32 pm

I'm trying to tune a motor for position and while it works quite well in the positive direction, stopping nearly perfectly at my position, it appears to always undershoot in the negative direction.

Back on the PWM tab, I realized my motor speed at 1000 duty is around 63,000 in positive direction and only 55,000 in the negative direction.

Is this normal ^? Or how much difference is acceptable or expected?

QPPS = 55000
Position P = 1740
Position I & D = 0

I can set position to 25000, and hit within 5 almost every time.
I then set position to 0, and I will hit around 400 (undershooting).

I can tweak the Position P value to 2235 to cause the negative direction to not undershoot, but then the positive direction will overshoot by about the same amount, 400.

Any thoughts as how to get this corrected? I've tried both M1 and M2 on a 30A roboclaw with no difference.

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

Re: Position - PWM - Difference Pos Neg Directions

Postby Basicmicro Support » Wed May 09, 2018 10:09 am

It depends on the motors. On some motors the commutator is shifted so it works better in one direction than the other. I find most motors have some difference in speed at the same power in each direction. Yours is pretty drastic so I'd guess its one of those motors specifically designed to work most efficiently in one direction.

Using P only as you are you arent going to be able to compensate for the difference. You need to use D at a minimum. This way you can tune a higher P and then D will dampen the overshoot(or elliminate it entirely).

Increase P until it causes significant oscillation(or even continous oscillation) around the set point. Then back P off to 2/3rds that value. Set D to 10 times P. Make set point changes. If the movement is over damped(starts slowing down before it gets to the new setpoint(in either direction) then reduce D. Otherwise keep increasing D until set point changes stop crisply(no early slow down and no overshoot) in both directions.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests