Rotary encoder - sensor arrangement

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
In my first video about rotary encoders I have demonstrated how those devices work. I used a simple way of creating a rotary encoder by arranging the sensors side by side and cutting a sensor disc with teeth and gaps that are wide enough to cover both sensors. Each of the sensors shown here is 6mm wide, thus we get 12mm of tooth width. The resulting diameter of a sensor disc with 30 teeth is 23cm. Let's have a closer look at the sensors. As you can see, the light emitting and sensing areas are limited to a slit with a width of just 1mm at the center of the device. With the sensors being side by side, we can reduce the tooth width to a minimum of 7mm resulting in a disc diameter of just 13cm. In the animation we can cut the sensors into halves to get a clear view on the inside. As you can see, the 7mm teeth are wide enough to cover both sensor areas simultaneously resulting in a HIGH signal of both outputs... ...or in a LOW signal of both signals whenever the infrared light passes a 7mm gap. To have a manufacturing tolerance when cutting the cardboard sensors, the tooth width on my CNC shown here is 10mm. We get 120 pulses for a full turn and the arrangement works fine. Let's go back to the animation... ...and enlarge the teeth and gaps to 10mm. Now, let's turn the sensor disc counterclockwise until both sensors are covered by a tooth of the disc, so that both outputs are on HIGH signal. Let's say, a device changes it's output signal, whenever half of the sensor area is exposed to infrared light. That's what happens at the starting position of the disc that is reached as soon as the lower sensor changes from HIGH to LOW. After 3.52 degrees of rotation, half of the slit of the upper sensor gets exposed to light and changes from HIGH to LOW, too. Another 2.48 degrees of rotation and the lower sensor changes from LOW back to HIGH signal... ...which is true for the upper sensor after another 3.52 degrees of rotation... ...and finally another 2.48 degrees of rotation are needed to trigger the LOW signal on the lower sensor again as in the initial state of the encoder wheel. The disc turned for one tooth which equals 12 degrees. As you can see, the rotation was not divided into equal steps which doesn't matter for most applications. To get equal steps, the width of the teeth must be twice the distance between the center lines of the sensor slits which is 12mm for this type of sensors. Again, the movement starts if the lower sensor changes from HIGH to LOW signal. After 3 degrees of rotation, the upper sensor changes also from HIGH to LOW. At 6 degrees of rotation the lower sensor changes back to HIGH signal... ...which happens at the upper sensor after 9 degrees. The initial state is reached after 12 degrees when the lower sensor changes back to LOW signal. The width of the slits is just 1mm, so can we go below a tooth width of 7mm? Here I am using a sensor disc on my CNC machine that has 30 teeth and gaps, being 4mm wide. We still get 120 steps for a full turn and as you can see, the arrangement works fine. Let's go back to the animation and see what happens: At this position, both sensors are blocked, but now by two different teeth of the disc. Let's turn the disc counterclockwise until the lower sensor changes from HIGH to LOW, which is the initial position, marked by 0 degrees. After 3 degrees of rotation, the signal at the upper sensor changes from LOW to HIGH. The lower sensor is covered by the next tooth and changes its state after 6 degrees... ...and the upper sensor changes back from HIGH to LOW at the 9 degree position. After 12 degrees, the sensor disc has moved for one tooth with both sensors being in the initial state. When having a look at the table of output states, you can see that it differs from that of the previous run with one tooth covering both sensors. To get an identic sequence of output signals, you must swap the sensor pins. The slits are no more than 1mm in width - can we use teeth and gaps with 2mm? Yes, we can! Here, the distance between the center lines is 9mm and the tooth width is 2mm. The sensors are arranged in such a way, that the slits point into the radial direction of the sensor disc. The animation sequence starts with the infrared light on both sensors being blocked by two different teeth. Same as before, when turning the sensor disc counterclockwise, the initial position is reached as soon as the lower sensor gets exposed to infrared light, bringing it's output to LOW. The first step ends when the upper sensor is brought to LOW signal, too. The second step ends when the lower sensor goes back to HIGH... ... the third step when the upper sensor is brought to HIGH again... ...and finally the fourth step ends as soon as the lower sensor falls back to LOW signal. The sensor disc moved for one tooth or 12 degrees and the movement has been divided into four equal steps having 3 degrees each. The sequence of sensor outputs equals that of the first animation sequence with one tooth covering both sensors. The 2nd sensor can be put anywhere on the wheel as long as it is an integer of the tooth and gap width plus or minus half a tooth width apart from the first one. The distance is usually given in degrees rather than in millimeters. Once more, the sensor disc has 30 teeth resulting in an angle of 12 degrees for one period. The right sensor is 177 degrees apart from the first one which equals 15 periods minus one quarter of a period. Same as before, four steps are triggered whenever the sensor wheel turns for one tooth, thus we get 120 steps for a full turn. When enlarging the distance between the sensors to 15 periods plus one quarter of a period, which is 183 degrees... ...we still get 120 pulses for a full turn, but the sequence of output signals changes. In practice, the sensors are usually arranged as closely as possible. Same as in the animations, this sensor wheel has 30 teeth each being 2mm wide and the distance between the center lines of the sensors is 27 degrees, thus 2 teeth and gaps widths plus half a tooth width. We get 120 steps for a full turn and as you can see, the arrangement works fine. You can get more information about rotary encoders on my project page. If you like this video, use the donate button on my pages to keep my open source open access projects going. Thanks for watching and: "I'll be back!".
Info
Channel: HomoFaciens
Views: 431,914
Rating: undefined out of 5
Keywords: rotary encoder, encoder wheel, rotary sensor, sensor, sensor disc, animation, arrangement, position control, experiment, arduino
Id: dPBKTZw_xi4
Channel Id: undefined
Length: 10min 25sec (625 seconds)
Published: Tue Nov 29 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.