Motion Controller using Stepper Motor
Table of Contents:
Motion Control System Block Diagram
The figure given below shows complete block diagram of the system
The main parts of the systems are 2 micro controllers 89C51 and 89C2051 from which 89C51 is main controller and the other one is auxiliary controller. Rest of the parts are LCD, stepper motor driver, IC555, push buttons laser and LDR. Apart form these some LEDs are also used at both sides for indication purpose. Complete system is divided in to two parts stepper motor control section and RPM counting section.
Stepper motor control section:-
The main controller 89C51 performs all following tasks.
· It takes user inputs through four push buttons like starting / stopping of motor and increasing or decreasing the speed
· Displays set RPM and current RPM on LCD
· Receives the RPM count serially from auxiliary controller
· Give different indication on LEDs
· Drives stepper motor at the RPM set by user
RPM counting section: -
Here IC 555 is used as monostable multivibrator and it will generate pulse output corresponding to revolution of motor. These pulses are fed to 89C2051 that counts these pulses for calculated time and after counting final RPM it will send this final count serially to main controller.
Stepper motor control section
The figure given in Circuit Diagram Tab 1 shows actual schematic diagram of this section.
As shown in figure major components are micro controller 89C51, LCD (16 X 2), and ULN2003A chip.
Connections: - four push buttons s1 – s4 are connected with P1 pins P1.0 – P1.3. The data pins of LCD are connected with port P0 and three control signals EN, Rs & RW are connected with P3.1, P3.2 & P3.3 respectively. Rx pin (P3.0) is connected with Tx pin of auxiliary controller (89C2051) of RPM counting section. The lower nibble of port P2 drives stepper motor through ULN2003A chip. Four LEDs are connected with upper nibble of port P2 for different indications. Reset switch RST is connected as shown with master reset pin (9) of 89C51. A 12 MHz crystal is connected on pin no 18 & 19.
Four push buttons are used for following functions
- S1: - to start stepper motor
- S2: - to stop stepper motor
- S3: - increase RPM
- S4: - decrease RPM
Four LEDs are used for following indication
- L1(Green LED): - indicated motor is running by blinking
- L2(Red LED): - indicates motor is stop
- L3(Blue LED): - blinks when RPM is increased/decreased
- L4(yellow LED): - blinks when data byte is received
Initially the motor is stop (indicated by Red LED) and LCD displays set RPM. When S1 is pressed motor will start rotating at set RPM and it is indicated by blinking of Green LED. As the motor starts the interrupt is generated in RPM counting section and it will start counting pulses. After 10 sec it will count RPM and return the count. This count is displayed as current RPM on LCD. After every 10 sec this cycle repeats. Mean while if any one increases or decreases set RPM it will be displayed on LCD. For accurate counting every time when RPM is changed one has to reset auxiliary controller to start counting again.