Microcontroller Based DC Motor Controller

Motion control plays a vital role in industrial automation. Manufacturing plants in industries like chemical, pharmaceutical, plastic and textile, all require motion control. And it may be a flat-belt application, flow control application or mixing of substances. Different types of motors—AC, DC, servo or stepper—are used depending upon the application. Of these, DC motors are widely used because controlling a DC motor is somewhat easier than other kinds of motors.Using the DC drive you can program the motion of the motor, i.e., how it should rotate.

DC motor
PANEL  ARRANGEMENT


Features

1) Controlled through microcontroller AT89C51

2) Message displayed on the LCD module

3) Start, stop and change of direction of the motor controlled by push button switches and indicated by LED.

4) Changes the running mode of the motor to continuous, reversible or jogging.

5) Changes the speed of the motor

6) Time settings are possible for forward and reverse running of the motor


Circuit description

At the heart of the DC motor controller is microcontroller AT89C51. Port pins 32 to 39 of the microcontroller are interfaced with data pins 7 to 14 of the LCD module, respectively. Port pins 6, 5, 4 control the LCD operation through enable (E), register select (RS) and read/write (R/W) pins, respectively. Contrast of the LCD is set by preset VR1. Port pins 1 to 8 are connected to switches S1 through S8 for performing the various operations.


DC motor control
Circuit Diagram of Microcontorller based DC controller

Power-on reset signal for the microcontroller is generated by the combination of capacitor C1 and resistor R1. Switch S9 provides manual reset to the microcontroller. A 12MHz crystal provides the basic clock frequency to the microcontroller. Capacitors C2 and C3 provide stability to the oscillator. EA pin (pin 31) of the microcontroller is connected to 5V to enable internal access. Port pins 21 to 24 of the microcontroller are used for LED indication of run, stop, clockwise and anti-clockwise rotation. Port pins 25 to 27 are connected to the inputs of inverters N3, N2 and N1 of 74LS04 (IC2). The output of inverter N3 is used to trigger pin 2 of NE555 timer.

Timer NE555 is configured as a monostable and its time period is decided by preset VR2 and capacitor C4. When pin 2 of NE555 goes low, output pin 3 becomes high for the predetermined period.

The output of NE555 is connected to pole P of relay RL1. Normally-open (N/O) contacts of relay RL1 are connected to N/O1 and N/C2 contacts of relay RL2. N/C1 and N/O2 contacts of RL2 are connected to ground. The outputs of inverters N2 and N1 drive relays RL1 and RL2 with the help of transistors T1 and T2, respectively. D1 and D2 act as free-wheeling diodes. Poles P1 and P2 of RL2 are connected to pin no.2 and 7 of motor driver L293D. pin no. 3 and 6 of L293D drive motor M.

Power Supply
Circuit Diagram of Power Supply


The 230V AC mains is stepped down by transformer X1 to deliver the secondary output of 9V, 500 mA. The transformer output is rectified by a full-wave bridge rectifier comprising diodes D3 through D6, filtered by capacitor C6 and then regulated by ICs 7805 (IC5) and 7806 (IC6). Capacitors C7 and C8 bypass the ripples present in the regulated 5V and 6V power supplies. LED5 acts as a power-‘on’ indicator and resistor R10 limits the current through LED5.

Operation

The eight push button switches are connected for eight different functions as shown in the table.

When S1 is pressed, the microcontroller sends low logic to port pin 26. The high output of inverter N2 drives transistor T1 into saturation and relay RL1 energises. So the output of NE555 is fed to pin no. 2 and 7 of L293D through both the contacts of relay RL2. Now at the same time, after RL1 energises, the microcontroller starts generating PWM signal on port pin no. 25, which is fed to trigger pin 2 of NE555 through inverter N3. The base frequency of the generated PWM signal is 500 Hz, which means the time period is 2 ms (2000μs). The output pulse width varies from 500 μs to 1500μs. The R-C time constant of the monostable multivibrator is kept slightly less than 500 μs to generate exactly the same inverted PWM as is generated by the microcontroller.

When switch S2 is pressed, port-pin no. 26 goes high and RL1 de-energises to stop the motor.

When switch S3 is pressed, relay RL2 energises. Pin 2 of motor driver L293D receives the PWM signal and pin 7 connects to ground. As a result, the motor rotates in one direction (say, clockwise).

When switch S3 is pressed again, relay RL2 de-energises. Pin 7 of motor driver L293D receives the PWM signal and pin 2 connects to ground.The motor now rotates in opposite direction (anti-clockwise).

When switch S4 is pressed, different modes are selected in cyclic manner as given below:

1. Continuous mode : The motor rotates continuously with the set speed in either direction



2. Reversible mode : The motor reverses automatically after the set time

3. Jogging mode : The motor rotates for the set time in either direction and then stops for a few seconds and again rotates for the set time. It is also called ‘pulse rotation’

Switches S5 and S6 are used to set the speed of the motor, either in increasing order or decreasing order, in continuous mode only.

Switches S7 and S8 are used to set the time either in increasing order or decreasing order.
To download PCB layout, code for this project click on below button 

Previous
Next Post »