Sensor feedback
There are a variety of sensors available for speed feedback. The most common are optical encoders and Hall effect sensors. An optical encoder consists of multiple components. Install a sheave on the shaft of the non-drive end of the motor. An infrared LED provides a light source on one side of the wheel and a photo transistor detects light on the other side of the wheel (see Figure 9). Light passing through the slots in the wheel turns the phototransistor on. When the shaft rotates, the phototransistor turns on and off as the light passes through the wheel groove. The frequency at which the transistor turns on and off characterizes the speed of the motor. In applications where the motor is displaced, an optical encoder is also used to feed back the motor position.
Hall effect sensors are also used to provide speed feedback. Similar to optical encoders, Hall effect sensors require a rotating element attached to the motor and a stationary element. The rotating element is a wheel on which the outer edge is fitted with one or more magnets. A stationary sensor detects the passing magnet and produces a TTL pulse. Figure 10 shows the basic components of a Hall effect sensor.
Anti-electromagnetic flux (BEMF)
Another form of providing fast feedback of BDC motors is BEMF voltage measurement. The BEMF voltage is proportional to the speed. Figure 11 shows the location of the BEMF voltage measured in the bidirectional drive circuit. A voltage divider is used to drop the BEMF voltage to a range of 0-5V so that it can be read by the analog to digital converter. The BEMF voltage is measured between PWM pulses when one end of the motor is left floating and the other end is grounded. In this case, the motor acts as a generator and produces a BEMF voltage proportional to the speed.
All BDC motors behave slightly differently due to differences in efficiency and materials. The experiment is the best way to determine the BEMF voltage for a given motor speed. The reflection band on the motor shaft helps the digital tachometer to measure the motor speed (in RPM). Measuring the BEMF voltage while reading the digital tachometer will take the relationship between the motor speed and the BEMF voltage.
Note: Microchip's application note AN893 provides examples of firmware and circuitry for reading BEMF voltages using the PIC16F684.
in conclusion
Brushed DC motors are easy to use and control, so they have a short design cycle. PIC microcontrollers, especially those with CCP or ECCP modules, are ideal for driving BDC motors.





