Magnetic encoders use a permanent magnet and a Hall Effect, or magnet resistive device, to produce a change in voltage or electrical resistance in the presence of ferromagnetic material. This change will occur in the form of a gear tooth (in a rotary encoder) or a metal band with slots (in a linear encoder). Tis type of sensor will work down to zero speed, and is available in both rotary and linear forms.
Optical encoders use a glass disk with a pattern of lines deposited on it, a metal or plastic disk with slots (in a rotary encoder), or a glass or metal strip (in a linear encoder). Light from an LED shines through the disk or strip onto one or more photodetectors, which produce the encoder’s output. An incremental encoder has one or more of these tracks, while an absolute encoder has as many tracks as it has output bits.
You can calculate the number of shaft positions on your encoder with the following equation: 2x where X = the resolution of your absolute encoder in bits.
Sinking and Sourcing inputs simply refer to the current flow in a transistor. This means that they require a voltage and a load to operate. A sinking input requires the voltage and load to be present before connecting it to the circuit. This means that it is "sinking" the current to ground for the circuit. A sourcing input must be before the load in the circuit. This means that it is "sourcing" the current to the circuit. Voltage and a load must be present in either case to detect a voltage change at the input. The same is true for sinking or sourcing outputs.
Gray Code is a form of binary. The difference between Gray code and binary is the method of incrementing to the next number. In Gray Code, only one digit may change states for every increment. This means the count sequence would look something like this 0,1, 3, 2, 6, and 7. This is different than standard binary, where the sequence would be 0, 1, 2, 3, 4, and 5.
Gray Code Binary
0000 0 0000 0
0001 1 0001 1
0011 2 0010 2
0010 3 0011 3
Gray Code is used to prevent errors as transitions to the next state occur. An example of how an error could occur would be where both values in the sequence were true. This can occur due to the timing sequence and the capacitance of the cable. The transition from 0011 to 0100 could cause 0111 to be generated, with Gray code this is not possible.
Topics: Encoder Signals Output
Many factors play a role in determining the maximum length of cable that can be used to connect the encoder to the controller. The largest problem with running long lengths of cable is that the cable becomes more susceptible to noise. This is due to the capacitance of the cable, the cable acting as an antenna, and the loss of power through the cable. The maximum distance of cable can be achieved by following some basic wiring principles. Do not run the cable near objects that create a lot of electrical noise. This includes AC motors, Arc welders, AC power lines, and transformers. Use twisted pair cabling when using the signal and its complement, and shielded cabling when running any type of signal. Use the highest voltage available for the output voltage. For example, if the encoder will output 5 to 24 volts, then use 24 volts. Use an Open Collector or Differential Line Driver output with a differential receiver (PM28S00) so that the maximum amount of current can be sink/sourced.
If you are using the encoder as an input to more than 1 controller, use a signal amplifier. This is also a good way to help increase the distance a signal can travel. Typical maximum distances for a Differential Line Driver are around 100 ft.or more when using a differential input, and for an Open Collector the distance is around 35 ft.