Position and Velocity Sensors Introduction: A third type of sensor which is commonly used is a speed or position sensor. Position sensors are required when the location of an object is to be controlled. Examples include The location of a vehicle on the road (preferably in the car lane as opposed to the ditch) The angle of a rocket as it moved from the hanger to the launch pad, The position of the aerlorons on an airplane, The speed of a vehicle for a cruise controller, etc. In each of these cases, a method for conveying information about the position, angle, or speed of an abject is required. This section looks at several types of position and speed sensors: Potentiometers: Angle is related to resistance Optical Encoders: Angle is related to a binary count Ultrasonic Range Sensors: Distance is related to a time delay, and Tachometers: Speed is related to voltage. Potentiometers: A potentiometer is a resistor with a center tap that can slide along the length. Both rotational and sliding potentiometers exist - although the rotational ones are less expensive and more common. For both types of potentiometers, the resistance Rab is proportional to angle (rotational) or position (slider). Some of the common characteristics for potentiometers are summarized below: Parameter Rotational Linear Ohms 10 to 10M Range 1 to 60 turns 2mm to 8m Linearity 0.002% to 0.1% of full scale Resolution 0.2 0 to 2.0 0 to 50um Max Freq Life approx 3Hz up to 4 x 10 8 cycles from R.P. Arney & J.G. Webster, "Sensors and Signal Conditioning," John Wiley & Sons, 1991. page 1 November 1, 2018
Potentiometers are very common and have some good features. They are easy to use They have high sensitivity, and Ceramic potentiometers have infinite resolution (in theory at least). The drawbacks to using potentiometers are They have high inertia and friction, They have a short life Wipers corrode and cause noise, and With wire wound potentiometers, the output changes in discrete steps, adding noise to the signal. Examples of using a potentiometer Problem 1: Use a 10k 3/4 turn potentiometer to output 0.. 10V: 0V at 90 degrees 10V at 180 degrees Solution: 3/4 turn is 270 degrees. Using a 10V power supply, the output will be at 90 degrees: (V out = 0V) 900 270 0 10V = 3.33V At 180 degrees (V out = 10V) 1800 270 0 10V = 6.66V As the input voltage goes up, the output voltage goes up. Connect to the + input. The output should be 0V when the input is 3.33V. Connect the offset to 3.33V. The gain is gain = change in output change in input = 10V 6.66V 3.33V = 3 Add a gain of 3.00. The resulting circuit is then: page 2 November 1, 2018
100k 300k +10V 270 deg 180 deg 90 deg 10k A Vout 0 deg 3.33V 100k 300k Note that the instrumentation amplifier loads the potentiometer so that the voltage at A is no longer linear with angle. Loading Effects on Potentiometers: In the above circuit, 400k is in parallel with the center tap to a virtual ground. When the center tap is at the top or bottom, Va = 10V and 0V respectively. In the middle where it should read -5.00V, however, the 400k will pull the voltage towards ground. If you let 'a' be the ratio of Rab to Rac, the voltage at A without loading will be linear V a = ar ar+(1 a)r V = av With loading, the voltage will be V a = which simplifies to V a = ar R L ar R L +(1 a)r V arr L arr L +(1 a)r(ar+r L ) V which is no longer linear in 'a'. To illustrate this, the voltage at Va for various values or the load resistance is shown below. page 3 November 1, 2018
Linearity of a Loaded Potentiometer. Lines show the ratio of the load to the potentiometer's full scale reading. Note that even though a potentiometer may be linear to within 0.2%, the loading of the 100k resistor can distort this read quite severely. In the worst case, the potentiometer barely responds until nearly at the full sweep. To prevent loading, typically a load of at least 10x the resistance of the potentiometer is required. This causes the potentiometer to be off by 2.5% at mid-scale from linear. Optical Encoders A second type of angular measuring device is an optical encoder. These are commonly found in robotic arms instead of potentiometers due to shortcomings of the latter. For example, A 0.2 degree error translates to 3.5mm at 1m. Most robotics require a precision of 0.1mm or better. 10 8 cycles is 11 days at one cycle per second. The potentiometers would need to be constantly replaced if used for repetitive tasks. Optical encoders offer a way to get better resolution without any physical contact. Description An optical encoder generates a square wave whose frequency is proportional to the speed the device is turning. Typically, a disk with white and black stripes is used with an optical detector: page 4 November 1, 2018
When the disk rotates, light and dark regions are brought between the light detector. This is then turned into a 0-5V signal. By counting the number of transitions, you can measure the motion of the disk and the sensor. Incremental Optical Encoder If the object you're measuring only goes in one direction, an incremental optical encoder will work. Incremental optical encoders have a single 0-5V output with the 0V or 5V being generate d when a white or black area is under the detector. By counting the number of transitions, you can measure the position of the device. By measuring the frequency of the square wave generated, you can measure the speed. You cannot measure direction of motion, however. Several types of incremental optical encoders are common. White and Black Paint of a Disk: This is used for optical encoders. These are more expensive ($40 to $100) but have higher resolution (128 to 512 pulses per rotation) Iron Teeth and a Magnetic Pickup: These are used to measure the speed of a gear (counting the rate the teeth pass by the magnetic sensor) in engines as well as with stair-masters. Insulators on a conductor: Alternating regions of insulation and bare copper, a brush can be used to generate 0-5V with a physical contact. This typically has low resolution (2-4 pulses per rotation) and lower life due to a physical contact but is less expensive ($10). Diffraction Gratings with an optical encoder Phase Quadrature Incremental Encoders The most common type of optical encoder uses two strips placed 90 degrees out of phase form each other. With this skew, the direction of motion can be determined as well as incremental position. For example, assume that the square waves, A and B, are generated from an incremental optical encoder. If it is turning clockwise, time goes from left to right. If it is turned counterclockwise, time goes right to left. The direction can be determined by observing the level of channel B at the rising or falling edge of A. If you move left to right (clockwise motion), B is always high on a rising edge on A and low on a falling edge on A. If you go from right to left (counterclockwise motion), B is low on a rising edge of A and page 5 November 1, 2018
high on a falling edge. This can then be used to drive an up-down counter. A simple circuit which almost works is as follows: A D-type flip-flop looks for the rising edge of Channel A. If channel B is high, the counter counts up on the rising edge of B. If low, the counter counts down. The problem with this circuit is that if you jiggle the sensor back and forth, you can get channel B to chatter - which the counter will interpret as motion. To fix this problem, you need to count on both the rising and falling edges of B. A circuit using a PIC microcontroller to do this is as follows: PIC18F4620 Channel A RB0 PORTC Channel B RB1 Binary Count PORTD RB0 detects edges on channel A (rising and falling) while RB1 detects edges on channel B (rising en falling). If the optical encoder outputs 500 pulses per rotation (per channel), the PIC will count 2000 edges per rotation (500 rising edges and 500 falling edges on channel A, ditto on channel B). Note that in both of these circuits, no zero position exists. To define where the count should start from. a limit switch is often used. The device is required to move in one direction until the switch is closed. This clears the counter and all positions are taken relative to this zero position. If the counter ever has an error in it, it can only be cleared by returning to this "home" position, closing the limit switch, and setting the count back to zero. Typically, phase quadrature incremental encoders will have 128 to 512 lines per rotation. When placed on the motor of a robotic arm, which is often geared down 127:1 or more, this results in over 16,256 (127x128) pulses per rotation of the robotic arm, or a resolution of 0.022 degrees. At 1 meter, this is a resolution of 0.38mm - a typical precision of a robotic arm. Absolute Position Encoders: page 6 November 1, 2018
An optical encoder with N channels (instead of just one or two) can measure angles to within one part in 2N. For example, if four channels are encoded as follows and the reading from the optical encoder was 1010, you would know the absolute position of the encoder is in region A. Knowing the absolute position can be a real advantage. The price, however, is more connection (N wires are required, along with power and ground) and cost. It is a lot cheaper to make one or two gratings than it is to make N with precise alignments. Tachometers The speed of a motor can be measured using an optical encoder. Here, the frequency of the square wave generated is the measure of the motor's speed. Such sensors are becoming more popular since Optical encoders are readily interfaced to computers, having a binary output, The output is linear with speed, No upper or lower limit exists on the linear region of the optical encoder. A more traditional form of tachometer is a DC servo motor. The dynamics of a DC servo motor are T = K t I a = Js 2 θ + Bsθ V = K t ω where KT is the motor's torque constant, IA is the armature current, J is the motor's inertia, B, the friction, and q the shaft position of the motor. The transfer function from Voltage to shaft position is θ = K t s (Js+B)(Ls+R)+K t 2 V or, going backwards, the transfer function from shaft speed (sq) to voltage is V = Js+B+K t 2 K t sθ At steady-state, the gain is then V = B+K t 2 K t sθ K t sθ Hence, if you spin a motor you produce a voltage. Any motor could be used as a tachometer. Tachometers are specialized motors which have Low inertia to prevent loading the device you're trying to measure, page 7 November 1, 2018
Low friction (for the brushes), and likewise Low current capabilities. By duality, you can interchange motors and tachometers. A motor will typically saturate more easily than a tachometer (i.e. have a nonlinear voltage vs. speed relationship) while a tachometer will have a poor torque constant and a low maximum torque. page 8 November 1, 2018