Having trouble getting absolute or quadrature position working

Questions about using encoders with the Roboclaw product line
Post Reply
kirklynk
Posts: 4
Joined: Sat May 02, 2020 4:30 pm
Having trouble getting absolute or quadrature position working

Post by kirklynk »

I know this question may have asked several times before, but it is hard to use the search feature to narrow search for a specific topic. My issue is trying to do position control with either an absolute encoder (5K pot) or via using a servocity yellow jacket motor with built-in quadrature encoder.

Following the instructions if surmised the QPPS value from the PWM Settings from motion studio enter that value in position setting screen, select PIV from the dropdown and click tune. The motor oscillates for a few seconds but never stop running. I have tried 4 different yellow jacket motors and two amazon bought motors first using quadrature encoders but all behave the same. So I thought made the encoders are bad based on what I have read in some postings here, so I resolved to trying using absolute encoders using 5K pots with a 7.5K resistor hooked to the 5V line, still the same issue and now I have some pots that are useless as the motor(s) drove beyond their stop limits.

What could I be doing wrong, it is hard to believe that all these motors have faulty encoders?

The motor controllers in question are RoboClaw 2x7A and the RoboClaw 2x60A hooked to a 12v power supply.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Having trouble getting absolute or quadrature position working

Post by Basicmicro Support »

You no longer need to set the QPPS before autotuning the Position PID or cascaded Velocity/Position PIV.

Pots are much worse then incremental encoders. For potentiometer based systems I usually recommend manually tuning. This applies to very low resolution incremental encoders too.

If the autotuner never stops it is never getting values it expects. Check the encoders are working correctly using PWM Settings screen first. Run the motors back and forth long enough to determine maximum speed and that the encoder direction is correct(Up on thje PWM Settings slider moves the motor forward so the encoder should count up. Down from center on the slider moves the motor backwards so encoder should count down. If it does the oposite the autotuner will fail. In that case reverse the motor wires OR the encoder A/B signal wires(not both).

Make sure the encoder readings while running open loop(eg using PWM Settings) are producing reasonable value. Look at the motor output shaft. Estimate the rotations per second. Then compare the actual encoder value with the expected value based on the rotations per second. Make sure you take into account the gear box ratio if the encoder is directly on the motor shaft. If the encoder is on the output shaft you dont need to worry about the gear ratio.
kirklynk
Posts: 4
Joined: Sat May 02, 2020 4:30 pm
Re: Having trouble getting absolute or quadrature position working

Post by kirklynk »

Thank you for your reply, there is so much to learn when it comes on to working with encoders. I will take this into consideration and using gearbox output ratio to determine the values needed to tune the encoders.

Post Reply