PIC Microcontrollers Provide 2 Cost-Effective Methods for Brushed DC Motor Control

In controlling the speed of a brushed DC motor, there are two cost-effective methods using a PIC microcontroller: optical encoder and Back EMF.

Industrial Motion Controllers provide precise speed and accuracy for operating rotating machines with microcontrollers and speed algorithms. A variety of mechatronic applications ranging from power windows to desktop electric robotic arms require motor control. With a variety of DC motors on the market, the brushed DC motor requires less complicated electronic controls to operate. In controlling the speed of a brushed DC motor, there are two cost-effective methods using a PIC microcontroller: optical encoder and Back EMF.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

Brushed DC Motors are used in variety of consumer, automotive, and industrial applications. They can vary in size and shape. (Source: Anaheim Automation)

Brushed DC Motor Construction

A brushed DC motor is an electric rotating machine that uses commutation, or the method of switching DC current through the various windings of the electromechanical part. The internal physical part that performs the commutation is a commutator. The commutator is a cylinder wrapped with multiple metal contact segments attached to the armature of the rotating machine. Brushes or soft carbon-based electrical contacts touch the commutator. The windings on the armature are attached to the multiple metal contact segments of the commutator. A brushed DC motor’s speed can be easily measured by an optical encoder and a PIC microcontroller.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

Simple pictorial diagrams showing the construction of a typical commutator. The brushes are mounted on opposite sides of the commutator to prevent motor winding shorting. (Source: hyperphysics)

Measuring Motor Speed with an Optical Encoder

An optical encoder, along with a PIC microcontroller, provides a simple method of measuring a brushed DC motor’s speed. To accomplish this speed measurement function, a PIC microcontroller’s Capture Compare (CCP) and Pulse Width Modulation (PWM) modules can be used to an operate a brushed DC motor. The optical encoder or interrupter provides a high-speed digital signal (pulses) to a slotted disk allowing light to pass through it. The slotted disk is attached to the brushed DC motor’s shaft. The PIC microcontroller’s Timer1 module will measure the optical encoder’s feedback of serial pulses. With this serial digital signal, the brushed DC motor’s speed is determined by measuring the time between the optical encoder’s pulses.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

The optical encoder or interrupter is a tiny optoelectronic component capable of producing a series of digital pulses that can be read by a PIC Microcontroller. The slots on the disk interrupt the light based on brushed DC motor’s rotation. (Source: Don Wilcher)

Viewing these pulses can be accomplished by attaching an oscilloscope to the optical encoder’s output signal pin.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

An oscilloscope can easily be attached to pin 24 (RC5 port) of a PIC16F917 microcontroller to observe the digital pulses. (Source: Microchip)

Here’s a lab setup using the PICDEM Mechatronics Development board for viewing the digital signals produced by the optical encoder.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

Viewing the optical encoder’s output pulses on an oscilloscope. (Source: Don Wilcher)

The oscilloscope measurement setup revealed the following serial pulses produced by the optical encoder sensor.

DC motor, Brushed DC Motor, PIC, microcontroller, ESC, Embedded Systems Conference, DC

The Vp (peak voltage) of the optical encoder displayed on the oscilloscope is 4.81V DC. (Source: Don Wilcher)

In addition to providing the jumpers, wiring, and circuit schematic diagrams, and the programmer,

Comments (0)

Please log in or register to post comments.
By submitting this form, you accept the Mollom privacy policy.
  • Oldest First
  • Newest First
Loading Comments...