Most of you might have got the idea from the project title itself that what kind of project it may be. The project is the demonstration of automatic missile launcher that sets missile to correct launching angle before its actually launched (fired).
In actual automatic missile launcher system, the position of missile (means launching angle) is first set and then missile is fired so as it will hit the target. The missile angle is set in horizontal plane (azimuth angle) and vertical plane (elevation angle)
In the given demonstration model the missile angle is set for horizontal plane (azimuth angle) only. The angle can be set from 0o to 350o in step of 10o. A micro stepping stepper motor is used to set missile angle. The stepper motor rotates missile to set angle (azimuth). The project is build using AT89C52 micro controller and it uses push buttons to take user input to set angle and LCD to display missile angle.
Circuit description:
As shown in above figure the circuit is build using micro controller AT89C52, stepper motor driver chip ULN2003, LCD and few additional components like push buttons, crystal, capacitors, resistors etc.
· Three push buttons are connected to port P1 pins P1.0 to P1.2 as shown. When push button is pressed, the pin is connected to ground so it will get logic 0 input when switch is pressed
· Port P3 pins P3.4 – P3.7 drives stepper motor through ULN2003 chip. These pins are connected to inputs of ULN and outputs of ULN are connected to motor coil terminals. Because its 4 pol unipolar motor it has 4 input terminals.
· The common terminal of ULN and two common terminals of stepper motor are connected to supply as shown
· Port P0 drives data bus D0 – D7 of LCD. Two control pins Rs and En of LCD are connected with port P2 pins P2.7 and P2.6 respectively. Third control pin RW is connected to ground to make LCD write always enable
· One pot is used to vary the brightness of LCD. Its sliding terminal is connected to Vee pin of LCD to provide it variable voltage. Other two fixed terminals of pot are connected with Vcc and Gnd
· A 12 MHz crystal is connected between crystal input terminals XTAL1 and XTAL2 to provide basic clock signal to micro controller for all its internal operation. Two 33 pF capacitors are connected with crystal as shown for biasing and stability
Circuit operation:
· When the circuit power is switched ON, the stepper motor is at rest. This missile (mounted to the shaft of motor) position is marked as 0o or reference.
· The message is displayed on LCD as “Set target angle” and the circuit prompts user to enter desire missile launching angle. The user has to set the angle by pressing inc angle / dec angle push buttons
· Each time when user presses inc angle or dec angle push buttons, the angle is incremented or decremented by 10o and it is displayed on LCD
· Once desire angle is set, the user has to press rotate missile button. As the user presses this button, the micro controller starts sending pulses to motor to rotate it clockwise or anticlockwise. Also the set angle is displayed on LCD as “Target angle is set to XXo”
· The micro controller calculates desired number of pulses to be given to motor to rotate it to exact degree of angle. If the new set angle is greater than previous angle of motor than motor rotates CW and vice versa
· Motor stops rotating when micro controller stops applying pulses and it reaches to desired angle.
· Again it prompts user to set target angle and displays current angle of motor. User can either increment or decrement this angle by pressing buttons and rotate missile to new angle
Software program:
For complete circuit operation, the software program is written and embedded into internal memory of micro controller. The program performs following tasks
· It displays various messages and set angle – actual angle of missile on LCD
· It takes user inputs through push buttons to set angle and to rotate missile
· It calculates required number of pulses to be given to motor to rotate it to exact degree
· It decides direction of rotation of motor either CW or CCW as per new set angle and current motor angle
The program is written in C language. It is compiled using KEIL (IDE) software tool. This software generates HEX file when the program is compiled successfully. This HEX file is downloaded into internal FLASH (EEPROM – memory) of micro controller using EEPROM programmer software and hardware tools.
The most important function of software program is to calculate number of pulses that should be given to stepper motor to rotate it to exact degree. The stepper motor used here is micro stepping (as i said earlier) motor. Its specifications are
Fig. 1: Prototype of 8051 Microcontroller based Automatic Missile Launch Angle Control Circuit
Motor type – unipolar, 4 phase, 5 terminal
Max operating voltage – 5 V
Max rated current – 50 mA
Max RPM – 30
Step angle – 0.17o/ pulse aprox. (min rotation 0.70o)
So the motor has step angle of 0.17o. It rotates for complete 360o rotation when it is given 2048 pulses.
So for 360o rotation 2048 pulses required
Then for 10 o rotation require pulses are = 2048×10 / 360 = 56
So for 10 o rotation required pulses are 56. That means for every 10 o increment (or decrement) in angle the pulses are given to motor in multiples of 56. And because 4 pulses are given in loop the multiplying factor is 56/4 = 14.
Also the motor has to be rotated CW or CCW. Every time when new angle is set it is compared with previous set angle if its higher then motor should rotate CCW and if its lower, then it should rotate CW. For example motor angle is set to 50o from 0o. So the motor will rotate CCW. Now if new motor angle is set to 20o then the motor will rotate CW to reach 20o position.
Project Source Code
###
#include<reg51.h> // header file
#include <string.h>
#define lcd_data_bus P0
sbit rs = P2^7;
sbit en = P2^6;
sbit intr_led = P2^0;
unsigned int set_az_angle = 0,old_az_angle=0,actual_az_angle=0;
unsigned int az_motor_dir_flag=1,new_f=0;
void dly()
{
int a,b;
for(b=0;b<20;b++)
for(a=0;a<2000;a++);
}
void delay_ms()
{
int k;
TL1 = 0x17;
TH1 = 0xFC;
TR1 = 1;
for(k=0;k<3;k++)
{
while(TF1==0);
TF1 = 0;
TL1 = 0x17;
TH1 = 0xFC;
}
TR1 = 0;
}
void lcddly()
{
int x;
for(x=0;x<1500;x++);
}
void lcd_send_cmd(unsigned char a)
{
lcddly();
rs = 0;
lcd_data_bus = a;
en = 1;
en = 0;
}
void lcd_send_data(unsigned char b)
{
lcddly();
rs = 1;
lcd_data_bus = b;
en = 1;
en = 0;
}
void lcd_print(unsigned char *s)
{
unsigned char l,i;
l = strlen(s);
for(i=1;i<=l;i++)
{
lcd_send_data(*s);
s++;
}
}
void display_angle(unsigned int a)
{
unsigned int t,t1,j;
unsigned char ascii[3];
if(a>=100)
{
t=a%10;
ascii[2] = t+0x30;
a=a/10;
t1=a%10;
ascii[1] = t1+0x30;
a=a/10;
ascii[0] = a+0x30;
}
else
{
t1=a%10;
ascii[2] = t1+0x30;
a=a/10;
ascii[1] = a+0x30;
ascii[0] = 0x20;
}
for(j=0;j<3;j++) lcd_send_data(ascii[j]);
lcd_send_data(0xDF);
}
void inc_az_angle()
{
if(set_az_angle<360) set_az_angle+=10;
lcd_send_cmd(0xC0);
display_angle(set_az_angle);
}
void dec_az_angle()
{
if(set_az_angle>0) set_az_angle-=10;
lcd_send_cmd(0xC0);
display_angle(set_az_angle);
}
void rotate_missile()
{
unsigned int num,pulses,k;
lcd_send_cmd(0x01);
lcd_print("Target angle set");
lcd_send_cmd(0xC0);
lcd_print("to:");
display_angle(set_az_angle);
if(set_az_angle>old_az_angle)
{
num = (set_az_angle-old_az_angle)/10;
pulses = num*14;
for(k=0;k<pulses;k++)
{
P3 = 0x8F;
delay_ms();
P3 = 0x4F;
delay_ms();
P3 = 0x2F;
delay_ms();
P3 = 0x1F;
delay_ms();
}
}
else
{
num = (old_az_angle-set_az_angle)/10;
pulses = num*14;
for(k=0;k<pulses;k++)
{
P3 = 0x1F;
delay_ms();
P3 = 0x2F;
delay_ms();
P3 = 0x4F;
delay_ms();
P3 = 0x8F;
delay_ms();
}
}
old_az_angle = set_az_angle;
}
void initialize()
{
P0 = 0x00;
P2 = 0x00;
P2 = 0x0F;
P1 = 0xFF;
P3 = 0x0F;
TMOD = 0x10;
}
void main()
{
initialize();
lcd_send_cmd(0x3C);
lcd_send_cmd(0x0E);
back:if(new_f==0)
{
lcd_send_cmd(0x01);
lcd_print("Set target angle");
lcd_send_cmd(0xC0);
display_angle(set_az_angle);
}
P1=0xFF;
while(P1==0xFF);
switch(P1)
{
case 0xFE:
new_f=1;
inc_az_angle();
dly();
break;
case 0xFD:
new_f=1;
dec_az_angle();
dly();
break;
case 0xFB:
rotate_missile();
new_f=0;
break;
}
goto back;
}
###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.