Hi all, As a newcomer to the list, I am interested in speed regulation of a small DC brush motor (e.g. as used in model trains) by using a PIC. Most information that is available refers to applying a PWM output signal to a mosfet H-bridge. The H-bridge is used for direction control. The PIC produces a PWM signal and the speed is controlled by the duty cycle of the PWM signal. However, does anyone have a PIC solution to the feedback control problem: i.e. a regulated constant speed by measuring the actual motor speed and comparing it to the desired speed. An additional limitation is that the hardware should be very small (SMD components) in order to fit in models. Here is my first idea: A 'simple' way is to measure the current through the motor since it has a 'linear' relation to motor speed (via the EMF: Electro Magnetic Force). This can be done by a small resistor in serie of the H-bridge. The resistor's voltage can be the input of a AD convertor. However the resitor will produce to much heat. A mosfet in serie with a current sense output instead of a resitor could probably be a solution. Another solution may be to count the number of rotations within a certain time, e.g. with a hall sensor or a tacho. IMHO this seems not the most appropriate way because of the available space in the model (but suggestions are welcome). My question is: Does anyone knows a PIC16F84 or PIC16C72/73 kind of solution to this problem. The PIC16C72/73 has a AD converter that could be used to measure the motor current. I'm also very interrested in code or parts of code. Any information is very welcome. Thanks in advance for any suggestions, Joost mailto:de.Vlieger@net.hcc.nl