Watch those speed limits
Here are a few tips that will help you avoid common problems when using optical encoders to measure rotational speed.
Sufficient resonances that feed back into the control loop, destabilizing the drive and affecting the encoder's ability to accurately measure rotational speed. Solutions vary. To find the best one, designers can plot the frequency data of these devices against the motion profile.
Select figure to enlarge
Optical encoders accurately track the rotational position of shafts over a dynamic range. In a machine tool, that position data results in better spindle speed control, which can improve surface finishes and reduce secondary operations. However, to obtain the best accuracies from these devices, designers need to avoid several common pitfalls.
Taking a pulse
Speed control requires that designers reference the optical encoder's output signals to a time base. This is usually done in one of two ways: detecting two consecutive pulses and measuring the time between them, or counting a series of data pulses for an increment of time and averaging the pulse rate over that interval.
For example, in the consecutive pulse method, suppose we have an encoder with a resolution of 360 cycles/ rev and a measured time between two pulses of 100 μsec. The instantaneous rotational speed, in rpm, is calculated as 60 divided by the product of the resolution (360) and the time interval (0.0001 sec) for a result of 1,667 rpm.
This seems straightforward but there are limitations, especially in PID control systems and phaselocked servos. These systems anticipate the timing of subsequent pulses. Therefore, any timing-related errors can cause them to hunt, resulting in an inefficient and noisy drive.
Also, consecutive pulse timing requires the servo to "dead reckon" position between counts, but this becomes more difficult if quadrature detection is used. Any symmetry or quadrature errors will feed back into the servo loop.
A better method is for the controller to use leading-edge-to-leading edge detection, since it is inherently more accurate. Ideally, the controller should detect these pulses asynchronously, but this requires a more complex signal processing scheme.
Ideal encoder output signals, including their complements, look like this.
Thus, except for specialized systems, a more practical method is to use a pulse counter and a timer, which offers several advantages. For one, many encoder input stages on PLCs already incorporate a pulse counting feature. Therefore, engineers can easily write software code to periodically poll the counter, subtract the current reading from the previous reading, and calculate the speed based on the time between the two counting events.
Using the same encoder resolution as in the previous example, let's say that the counter records 101 pulses in 10.2 msec. The average rotational velocity over that time is calculated by multiplying 60 times the number of pulses and dividing that answer by the product of the resolution and time for a result of 1,650 rpm. Note that in the earlier example we calculated instantaneous velocity. In this example we calculated the average velocity. Because you need lots of counts to stabilize a velocity or position control loop, this method is better suited to most of the common control systems.
Another advantage is that while it's possible to have an error of up to one count, which can happen if the counter is polled just before it registers an incremental count, this count is not lost. Instead, it shows up in the next timed interval. These counting errors are not cumulative as the encoder always returns 360 counts over the course of a complete revolution.
In these examples, we treated a complete cycle of the A channel as a single pulse on the counter. Most encoder input circuitry has the option of quadrature detection to count the up and down transitions on both the A and B channels. In effect, this multiplies the input signal and reduces the speed error from pulse counting by a factor of four.
Once around
The index is a once-per-revolution signal usable for both error detection and safety. A number of index schemes are available, here is one of the more popular ones. It is described as a 1/2-cycle index, gated with negative B. The index pulse is ANDed with the negative part of the B cycle to ensure that the indexpulse duration and location bear a precise relationship to the B cycle.
An opportunity to establish a precise reference occurs when the index pulse changes from LO to HI. Monitoring that transition on the A channel at that moment gives a precise location regardless of the rotation direction. But monitoring the index transition only is insufficient because it occurs at a different part of the cycle depending on whether the encoder turns clockwise or counterclockwise.
Continue on page 2
Want to use this article? Click here for options!
© 2012 Penton Media Inc.
Acceptable Use Policy blog comments powered by Disqus




