Bidirectional brushed DC Motor Control
Created: May 27, 2016
No description available.
This reference design is a demonstration of the PIC16F684 microcontroller for bidirectional, brushed DC (BDC) motor control. The Enhanced, Capture, Compare, PWM (ECCP) allow easy interfacing to a full-bridge configuration for bidirectional BDC motor control. The ECCP peripheral builds on the technology of the CCP module with added features such as four PWM channels for easy bidirectional motor control through the hardware.
The hardware contains three major sections: a power stage for motor control, communication for RS-232, and measurement for RPM and current. The power stage consists of a full H-bridge used for bidirectional BDC motor control; the PIC16F684 uses RC2-RC5 as the four ECCP pins that interface with the full H-bridge circuit. The communication section consists of a RS-232 serial communication configuration; the PIC16F684 uses RA5 for sending and receiving RS-232 data. The measurement section consists of Microchip's MSC6S26 multi-channel PGA and a voltage divider circuit for scaling the back EMF voltage. The PIC16F684 communicates to the PGA via a 3-wire bit-banged SPI interface. The CS pin is connected to RA1, the SCK pin is connected to RA2, the SI pin is connected to RC0, and the VREF pin is connected to GND. The RA0 pin is used as an analog input for measuring RPM and current, which is connected to the VOUT pin on the PGA. Channel 0 on the PGA is used for RPM measurements and channel 1 is used for current measurements.
A firmware is responsible for many operations: Initializing the PIC16F684, sending bit-banged SPI commands to the PGA, receiving commands from the PC, modifying the PWM frequency and duty cycle, changing the motors direction, changing the internal oscillator frequency, and taking A/D converter measurements for RPM and current. The windows user interface provides the user a friendly environment for interfacing the BDC motor. The user interface allows the user to adjust the PWM frequency, duty cycle, motor direction and internal oscillator frequency. The user interface also displays the PWM frequency, duty cycle, resolution, RPM and current. The PC software is the host and sends commands to the PIC16F684 using RS-232. The windows user interface source code can also be downloaded from www.microchip.com.
The BDC motor control’s function is very common on every industrial and household product. It can be used in applications such as intelligent toys, small appliances, power tools, and many other motor control applications.