# Encoder PPR Required Resolution

This question leads on from a question I asked last night, so some people will know it.

I am using an FPGA with a 1000 ppr rotary quadrature encoder counting 4x (counting all edges is 4000ppr) and had planned on counting the number of pulses every 1ms. The motor rpm range is from around 1000 or 2000 up to 4000 rpm with no gearbox. The encoder is coupled straight to the motor.

I had planned to use this equation:

(Hopefully someone can edit this :) RPM = ((Pulses per ms) * 60,000) / Pulses per revolution

However when I run this calculation on a calculator I see a change of 1 pulse per millisecond equates to 15 rpm of the motor.

Does this encoder not have enough ppr for this application, or am I doing something incorrect in my maths?

• Not clear what you're asking. At a glance your numbers seem OK, what's the problem with 1ppms = 15rpm? What RPM accuracy do you need? If you need 1rpm accuracy, simply measure over 15ms, or average the last 15 1ms readings. – user_1818839 Apr 1 at 12:21
• @user_1818839 If I measure the number of pulses every 1ms and multiply by 15, does this work out the same as measuring the number of pulses every 15ms? – David777 Apr 25 at 16:08
• Not accurately, obviously. If there are e.g. 7 pulses in 15ms, in each ms you will either see 0 or 15 after multiplication. – user_1818839 Apr 25 at 17:08

## 1 Answer

I answered a similar question regarding optical encoder accuracy here:

PWM accuracy vs speed control accuracy

Minimum resolvable angle: $$\begin{equation} \theta(1) = \frac{360}{4000}=0.09deg\\ \end{equation}$$

Sampling Period: $$\begin{equation} T=0.001s \end{equation}$$

Expected error bounds: $$\begin{equation} \omega_{error} = \frac{\theta(1)}{T} = \frac{0.09}{0.001} = 90 \frac{deg}{s} = 15 rpm \end{equation}$$

This is what you calculated. It is up to you to decide if 15 rpm is an acceptable error. One suggestion is that I would look at the mechanical dynamics of you motor and load and determine the inertia of your system. You can model the inertia as a first order transfer function and see how fast any torque disturbance will change the speed. From there you can evaluate your sampling time to see if you really need 1 ms. Cause it is easier changing the sampling time than finding a new encoder.

• Is there a way to use the sample time of 1ms measure the counts from the encoder every 1ms, to achieve 1rpm accuracy? – David777 Apr 25 at 16:17
• There are two ways. (1) Buy an optical encoder with a higher resolution. I believe you would need a 16 bit encoder which would give you 65536 counts per revolution -> and an error of 5.5 deg/s or 0.91 rpm. (2) You can estimate speed using an observer. If your system has torque disturbances, such as varying loads, the observer would not be helpful. If your system has a known load that does not vary with time then you probably could use it. For information on Observers I would recommend you look at "Modeling and High Performance Control of Electric Machines" ISBN 0-471-68449 – Real Magnetics Apr 25 at 23:18
• One more comment on the observer. When using the observer (implemented in firmware) you would use your existing, less accurate encoder, and the observer would act to reduce the error. – Real Magnetics Apr 25 at 23:23