How much extra resolution is required when using a PID controler on a motor?

I’m trying to figure out what the feedback requirements are control the position of a motor to within a certain tolerance.

For instance, say I want to control the position of a lightweight rotating arm to within an accuracy of 1.5 degrees, which is a resolution of 240 counts per rotation.

The Neo 550 has 48 counts per revolution, and 240/48 is 5x. Obviously, that’s not enough information alone because the PID controller can’t maintain a single value.

My question is, 1) what factor of additional resolution is required if there is little dynamic load on the system, and 2) do I need an additional encoder on the motor shaft or can I get away with using only gear ratios to achieve the required feedback?

A 25:1 gear ratio would give me 48*25 = 1200 counts per revolution, or 5x feedback. Would this work, or would I need more like 10x or 20x, thus requiring a 50:1 or 100:1 gear ratio?

Also, as shipped, the motor still has to go undergo 1/48th of a rotation before any position error is even detected regardless of the gear ratio. Does this mean I have no choice but to raise the resolution at the motor shaft from 48 to 2048 by using an external encoder? (The through bore encoder claims 2048 cycles per revolution, but 8192 counts per revolution. Do the motor controllers typically recognize individual counts, or only full cycles? I’m sure there are encoder accuracy considerations at these high counts, too.) If so, is the resulting 8.5x resolution sufficient by itself (ignoring torque requirements), or would I still require an external gearbox to drive the resolution higher? (5:1 gearbox + encoder = 42.5x resolution?)

Thanks.

1 Like

The sensor should be the last thing you optimize; do the mechanicals first. First, see if you can provide springs or counterweights for your arm so that you aren’t actually lifting it to rotate it. This will make controlling it much easier.

When considering motor and gear ratio selection, the most important thing is really whether you have enough power and control over the thing you’re moving. If you gear too fast, you will have difficulty accelerating the arm, and if you gear too slow, it’ll take too long to do the task. Figure out what speed you’re looking at, and what gear ratio will make your free speed about twice that - enough overhead for control, but little enough that you won’t be running your motors at low speed, high torque all the time. Then check the motor curves that you won’t draw too much current to provide the necessary torque. THEN figure out what sensor to use.

Check on the jitter you get. This will be due to a combination of sensor, connections, cables, processor, and electrical noise, so your best bet is to measure it. That is, set up the sensor in a situation similar to what you anticipate, motor not attached to the arm, and see how much your inputs play around. I would want that jitter to be at most half and preferably a fifth of the target resolution.

With position measurements from counting sensors, “jitter” is almost entirely a result of system noise rather than signal noise. Encoder measurements are very accurate.

I’ve personally yet to encounter an FRC application where the NEO encoder resolution was much of an issue. That’s not to say there aren’t any, but for basic stuff (drivetrains, arms, etc) it’s perfectly fine. So long as the actual discretization error (i.e. the sensor resolution in units of the end effector) is somewhat smaller than the accuracy you need, you’ll be okay.

A better reason to use an external encoder is to collocate the sensor with the end effector to avoid backlash.

I’ll take your word for it - I’m not sure how to separate the effects I can’t control, but I do know that system noise is a considerable fraction of the total noise at low speeds. In any case, if the jitter (peak-to-peak) is similar in size to your target location, signal jitter will map to a twitchy mechanism.

Your question is a good one. The TL;DR, rule of thumb which I’ve gone by is “somewhere between 4 and 10 times”. I’m not an expert on this stuff.

It can really vary based on how much power (both processing and electromechanical) you have at your disposal in relation to the mass of the system being controlled.

Your motor/encoder has a resolution of 360/48 = 7.5 deg, and you want to hit 1.5 deg on the actuator. Ignoring backlash (which isn’t wise), you’d need a 1: 7.5/1.5 * (4 to 10 thumb factor) = 20 to 50 gear ratio.

Again that ignores backlash.

Your observation re: backlash is a great one, thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.