transducers and sensors - philadelphia university · transducers and sensors. 10/15/2016 2 digital...

15
10/15/2016 1 Transducers and Sensors Dr. Ibrahim Al-Naimi Chapter THREE Transducers and Sensors

Upload: others

Post on 18-Oct-2020

36 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

1

Transducers and Sensors

Dr. Ibrahim Al-Naimi

Chapter THREE

Transducers and Sensors

Page 2: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

2

Digital Transducers

• Digital transducers are defined as transducers with a digital output.

• Transducers available at large are primary analogue at nature, and some form of conversion is needed to convert to transform them into digital form.

• Analogue transducers with A/D convertors can serve the purpose of digital transducers. However, this introduces an additional uncertainty, that of the converter. Inconsequence, overall accuracy and resolution are likely to be affected.

Digital Transducers

• Mechanical disks (or bar) with optical receivers and transmitters can act as digital displacement transducers. This type of transducers called optical encoder.

• Optical encoders can be used to measure linear and angular displacements. Therefore, optical encoders can be classified as:

– Rotary encoders

– Linear encoders

Page 3: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

3

Digital Transducers

Optical Rotary Encoders

• An optical rotary encoder produces angular position data directly in digital form, eliminating any need for the ADC converter. The concept is illustrated in following figure, which shows a slotted disk attached to a shaft. A light source (LED) and light receiver (phototransistor or photodiode) arrangement are mounted so that the slots pass the light beam as the disk rotates. The angle of the shaft is deduced from the output of the photocell.

• There are two types of optical rotary encoders: the absolute encoder and the incremental encoder.

Digital Transducers

Optical Rotary Encoders

Page 4: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

4

Digital Transducers

Absolute Rotary Encoder

• The output of the absolute rotary encoder is in the form of a binary word which is proportional to the angle of the shaft.

• The absolute encoder does not need to be homed because when it is energized, it simply outputs the shaft angle as a digital value.

• Absolute optical encoders use a glass or plastic disk marked off with a pattern of concentric tracks as shown in the figure.

Digital Transducers

Absolute Rotary Encoder

• A separate light beam is sent through each track to individual photo sensors. Each photo sensor contributes 1 bit to the output digital word. The encoder in the figure outputs a 4-bit word with the LSB coming from the outer track (note that this is for illustrative purposes only and a 4-bit encoder is of little practical use). The disk is divided into 16 sectors, so the resolution in this case is 360°/16 = 22.5°.

Page 5: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

5

Digital Transducers

Absolute Rotary Encoder

• The absolute angle of the encoder shaft can be found by multiplying the binary output of the encoder times the resolution. For example, assume our 4-bit encoder has an output of 1101 (decimal 13). The encoder shaft would therefore be at an angle of 13 x 22.5 degrees = 292.5 degrees. Because of the relatively poor resolution of this encoder, the shaft could be at some angle between 292.5 degrees and 292.5+22.5 degrees.

• For better resolution, more tracks would be required. For example, eight tracks (providing 256 states) yield 360°/256 = 1.4°/state, and ten tracks (providing 1024 states) yield 360°/1024 = 0.35°/state.

Digital Transducers

Absolute Rotary Encoder

Page 6: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

6

Digital Transducers

Absolute Rotary Encoder

• An advantage of this type of encoder is that the output is in straightforward digital form and, like a pot, always gives the absolute position. This is in contrast to the incremental encoder that, as will be shown, provides only a relative position.

• A disadvantage of the absolute encoder is that it is relatively expensive because it requires that many photocells be mounted and aligned very precisely

Digital Transducers

Absolute Rotary Encoder

• If the absolute optical encoder is not properly aligned, it may occasionally report completely erroneous data. The following figure illustrates this situation, and it occurs when more than 1 bit changes at a time, say, from sector 7 (0111) to 8 (1000). In the figure, the photo sensors are not exactly in a straight line. In this case, sensor B1 is out of alignment (it’s ahead) and switches from a 1 to a 0 before the others. This causes a momentary erroneous output of 5 (0101). If the computer requests data during this “transition” time, it would get the wrong answer.

Page 7: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

7

Digital Transducers

Absolute Rotary Encoder

Digital TransducersAbsolute Rotary Encoder

• One inherent problem that is encountered with binary output absolute encoders occurs when the output of the encoder changes its value. Consider our 4-bit binary encoder when it changes from 7 (binary 0111) to 8 (binary 1000). Notice that in this case, the state of all four of its output bits change value. If we were to capture the output of the encoder while these four outputs are changing state, it is likely that we will read an erroneous value. The reason for this is that because of the variations in slew rates of the photo-transistors and any small alignment errors in the relative positions of the phototransistors, it is unlikely that all four of the outputs will change at exactly the same instant.

Page 8: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

8

Digital Transducers

Absolute Rotary Encoder

• For this reason, all binary output encoders include one additional output line called data valid (also called data available, or strobe). This is an output that, as the encoder is rotated, goes false for the very short instant while the outputs are changing state. As soon as the outputs are settled, the data valid line goes true, indicating that it is safe to read the data. This is illustrated in the timing diagram in the following figure.

Digital Transducers

Absolute Rotary Encoder

Page 9: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

9

Digital Transducers

Absolute Rotary Encoder

• The second solution is to use the Grey code on the disk instead of the straight binary code as shown in the following figure. Gray code requires the same number of bits to achieve the same resolution as a binary encoder equivalent. However, the counting pattern is established so that, as the angle increases or decreases, no more than one output bit changes at a given time, i.e. only 1 bit changes between any two sectors.

• If the photo sensors are out of line, the worst that could happen is that the output would switch early or late. Put another way, the error can never be more than the value of 1 LSB when using the Grey code.

Digital Transducers

Absolute Rotary Encoder

Page 10: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

10

Digital Transducers

Absolute Rotary EncoderConverting Binary to Gray:

1. Write the binary number to be converted and add a leading zero (on the left side).

2. Exclusive-OR each pair of bits in the binary number together and write the resulting bits below the original number.

Converting Gray to Binary:

1. Write the gray code number to be converted and add a leading zero (on the left side).

2. Beginning with the leftmost digit (the added zero), perform a chain addition of all the bits, writing the "running sum" as you go.

Digital Transducers

Incremental Rotary Encoder

• The incremental optical encoder has one track of equally spaced slots. Position is determined by counting the number of slots that pass by a photo sensor, where each slot represents a known angle. This system requires an initial reference point, which may come from a second sensor on an inner track or simply from a mechanical stop or limit switch. In many applications, the shaft being monitored will be cycling back-and-forth, stopping at various angles. To keep track of the position, the controller must know which direction the disk is turning as well as the number of slots passed. A single photo sensor cannot convey which direction the disk is rotating; however, a clever system using two sensors can

Page 11: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

11

Digital Transducers

Incremental Rotary Encoder

Digital Transducers

Incremental Rotary Encoder

Page 12: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

12

Digital TransducersIncremental Rotary Encoder• In the following , the two sensors, V1 and V2, are located slightly

apart from each other on the same track. For this example, V1 is initially off (well, almost you can see it is half-covered up), and V2 is on. Now imagine that the disk starts to rotate CCW. The first thing that happens is that V1 comes completely on (while V2 remains on). After more rotation, V2 goes off, and slightly later V1 goes off again. Figure (b) shows the waveform for V1 and V2. Now consider what happens when the disk is rotated in the CW direction [starting again from the position shown in Figure (a)]. This time V1 goes off immediately, and V2 stays on for half a slot and then goes off. Later V1 comes on, followed by V2 coming on. Figure (c) shows the waveforms generated by V1 and V2. Compare the two sets of waveforms, notice that in the CCW case V2 leads V1 by 90°, whereas for the CW case V1 is leading V2 by 90°. This difference in phase determines which direction the disk is turning.

Digital TransducersIncremental Rotary Encoder

Page 13: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

13

Digital TransducersIncremental Rotary Encoder

1. If rising edge in v1 when v2 is logic high

→ CW rotation

2. If falling edge in v1 when v2 is logic high

→ CCW rotation

Digital Transducers

Incremental Rotary Encoder

• Incremental encoders are specified by the number of pulses per revolution that is produced by either the phase A or phase B output. By dividing the number of pulses per revolution into 360 degrees, we get the number of degrees per pulse (called the resolution). The resolution is the smallest change in shaft angle that can be detected by the encoder. For example, a 3600 pulse incremental encoder has a resolution of 360 degrees / 3600 = 0.1 degree.

Page 14: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

14

Digital Transducers

Incremental Rotary Encoder

• An incremental encoder can be used to extract three pieces of information about a rotating shaft. First, by counting the number of pulses received and multiplying the count by the encoder’s resolution, we can determine how far the shaft has been rotated in degrees. Second, by viewing the phase relationship between the phase A and phase B outputs, we can determine which direction the shaft is being rotated. Third, by counting the number of pulses received from either output during a fixed time period, we can calculate the angular velocity in either radians per second or RPMs.

Digital Transducers

Incremental Rotary Encoder• When an incremental encoder is switched on, it simply outputs a 1

or 0 on its phase A and phase B output lines. This does not give any initial information about the angular position of the encoder shaft. In other words, the incremental encoder gives relative position information, with the reference position being the angle of the shaft when the encoder was energized. The only way an incremental encoder can be used to provide absolute position information is for the encoder shaft to be homed after it is powered-up. This requires some other external device (such as a slotted disk) to provide this home position reference. Some incremental encoders have a third output signal named home that provides one pulse per revolution and can be used for homing the encoder.

Page 15: Transducers and Sensors - Philadelphia University · Transducers and Sensors. 10/15/2016 2 Digital Transducers •Digital transducers are defined as transducers with a digital output

10/15/2016

15

Digital Transducers

Incremental Rotary Encoder• The main advantage of an absolute encoder is its ability to provide

absolute angle readings (within a full 360° rotation) ). Hence, if a reading is missed, it will not affect the next reading. Specifically, the digital output uniquely corresponds to a physical rotation of the code disk, and hence a particular reading is not dependent on the accuracy of a previous reading. This provides immunity to data failure. A missed pulse (or, a data failure of some sort) in an incremental encoder would carry an error into the subsequent readings until the counter is cleared. An incremental encoder has to be powered throughout operation of the device. Thus, a power failure can introduce an error unless the reading is reinitialized (or, calibrated). An absolute encoder has the advantage that it needs to be powered and monitored only when a reading is taken.