Design and Implementation of Image Capture Sentry Gun Robot

. This paper is about the development and design of semi-autonomous sentry robot using aurdino controller. There is a global issue of that everyone wants to secure themselves from different sorts of danger and to navigate their surroundings. This robot called Sentry Gun, because it consists of a Gun mounted on a stand and an operator can also operate it from a secure location. Sentry Gun is based on latest research, it uses high resolution camera to scan the target area and movement can be detected by using software i.e processing .org As compare to humans it can perform far better while operating in autonomous mode in red zones, it will bring a significant fall in the death toll, if installed outside every check post, law enforcement agencies and borders, to stop illegal intrusions.


Introduction
For intelligence based systems it is used for security and defense purposes.These ideas have been taken from the computer game and implement it on our thesis work.The sentry gun model suggested in this paper has two degrees of freedom; one degree allows the gun turret to scan the area along the horizontal axis (azimuth) while the other degree allows the gun turret to move up and down (elevation).These two degrees allow the gun turret to move in any direction in a 2D plane.The most important part of this project was that the aim of the turret should be accurate i.e. the sentry is able to detect and locate intruders effectively [1].The earliest functioning military sentry guns were the close-in weapon systems pointdefense weapons for detecting and destroying short range incoming missiles and enemy aircraft first, used exclusively on naval assets, and now also as land-based defenses.Sentry gun robot which can operate both in manual mode and automatic mode to track the moving objects.This gun should be installed on all the borders and outside all the check posts.It has a camera which will enable the operator (sitting in a secure location) to see all the incoming and outgoing peoples, all these incoming and outgoing peoples can be attended from a secure location with the help of Sentry gun Robot.We are mainly focusing on the autonomous mode for all of its calibration and functioning.Robots might also prove vastly superior to humans in the battle.
The idea of implementing Sentry Gun technology is not something novel.Numerous attempts have been made on a commercial level, military level, and even independent level.In 2006, MediaZen in cooperation with Samsung Techwin Inc., Korea University, Sysfo Lab Co. and Sejin System Co., produced the Guard Robots and Intelligent Surveillance Systems to defend the South Korean borders.From 2003 to 2006, Private sector and South Korea's government invested about $5 million on such military robots [2].This technology has also been installed to protect Korean military bases in Iraq.This system uses visuals and infra-red cameras to distinguish between humans, animals, and trees.It can detect targets up to a 2.5 mile during the day, and about half of it at night.Bob Rudolph is quite a prominent name when we talk about Paintball Sentry Gun.On his website, he has shared the details of his numerous attempts at designing a paintball sentry gun.To date, he has created 9 different prototypes.He has also documented the flaws and strengths of each design and is still actively continuing development.He created Autonomous System last year, LLC as an entity to sell his hardware and software designs as a way to finance this hobby.However, he hasn't stopped publishing information on his latest software and hardware prototypes.

Backgrounds
There are many ways to detect motion but particularly in robotics, most general approaches use image processing or Light Detection and Ranging (LIDAR) tracking [3].These two methods basically require extensive processing power or costly sensors.Many military grade solutions are available for this problem but usually, they are very expensive solutions and a low priced solution for this problem makes it more potent.Now the military is gaining a lot of practical experience and work for the interaction of human and robots.Robotics is an evolving branch of technology that deals with the design, construction, operation and application of robots and computer systems for their control, sensory feedback and information processing [4].It improves security, reduces unnecessary causalities and reduces operational cost.

Modes of Operation
It has two modes of operation.They are described below-

Autonomous mode
In automatic mode sentry gun robot would be standing at a fixed location and automatically aim and fire the target detected by the sensors.In automatic mode it is operated in red alert areas where no one is allowed to go.So it would fire anyone who enters the surveillance area despite the fact whether he is an enemy or an alley.

Manual mode
In manual mode it is controlled by the operator for shooting the particular targets.It's like a gun in the hand and you decide what to shoot and what not to shoot but the only difference in this scenario is that you are operating it from a safer location.You have a laptop in front of you and you just have to click on the target the gun would automatically calculate the angle, aim at the exact target and shoot it.So there would be little chances of missing the target.

Hardware
The main hardware used in our project is Aurdino Uno, Servo motors and JF39 Air soft Gun.Aurdino Uno is used as a processing unit and Servo motors are used to control the vertical and horizontal motion and for pressing the trigger.

Arduino
In 1975, Arduino was originally assembled up with a purpose of creating such a device that controls studentbuilt interactive projects with less expense comparing with other prototypes available in the market.David Cuartielles and Massimo Banziare the founders.Along with these the Arduino development team also includes: Gianluca Martino, David Cuartielles, Massimo Banzi, David Mellis, and Tom Igoe.Along with providing advantages for students, teachers, interested amateurs, and developers, it also has simplified the work as compare with other microcontrollers.

Selection of Motor
We needed motors that could give our sentry gun a vertical and horizontal motion but the selection became harder and harder when we studied different types of motors Servomotor consumes power only when it rotates to its commanded position, while rest of the time it doesn't consumes any power to maintain its commanded position. ii.
Stepper motors continuously consumes power to hold the commanded position or to move to the commanded position and due to continuous consumption of power it becomes warm.iii.
Servomotors are generally replacing Stepper motors due to its high performance iv.
Stepper motors have built-in output steps.v.
Stepper motor can only work properly with a load that is well within its capacity, otherwise over load may lead to missed steps and as a result we would get positioning errors.vi.
Servo motors contains encoder and controller which is the reason of their high cost, but they improve the performance of the overall system (for all of accuracy, power and speed) relative to the capacity of the basic motor.

Interconnection between software and hardware
Webcam is connected with Laptop or C.P.U through serial port and in C.P.U the processing and Aurdino software are executed their respective codes given in appendix A and B. Data from the Webcam is collected through processing Software and is send to Aurdino board through Aurdino software to control the motion of Sentry gun through servo motors.

Manual Mode
In manual mode the gun is aimed at the target using the mouse cursor, by moving the cursor towards the right side of the screen, the x-axis servo rotates clockwise and while moving the cursor towards the left side of the screen the servo rotates counter clockwise, this servo's shaft is attached to the sentry gun, so when the cursor is moved to the right side the servo moves the gun to the right and vice versa, Similarly when the mouse cursor is moved up the servo will move the gun upwards and when the cursor is moved down the servos will bring the gun downwards.There is another servo attached to the trigger, by clicking or holding the left mouse button the servo will press the trigger and upon releasing the left mouse button the servo will release the tiger.If the gun is in semi mode and you hold the left mouse button the gun will fire only ones but if the gun is in auto mode and you hold the left mouse button the gun will start continuous firing and wouldn't stop until you release the left mouse button.

Autonomous Mode
In Autonomous Mode, the system could only successfully track and hit 1 to 2 objects in a frame moving at up to approximately 3 to 4 miles per hour (human walking speed).Its accuracy was extremely sensitive to the calibration of the system, but it has about 95% hit rate and can shoot up to twice per second.The sentry gun will not require any user control, instead it will aim and fire at its own discretion driven by the image-processing engine.
There are two methods of finding targets.One is by background subtraction, the other by frame differencing.
Frame differencing detects only moving targets while Background Subtraction detects moving targets as well as stationary targets.However, in the environment where sentry gun is typically placed, there are often changing conditions, such as shadows gradually shifting ,leaves blowing around and even decoys thrown out before an attack to distract the sentry gun.These will mess up the background subtraction, but they will not affect frame differencing as much.However, choose for yourself which to use, based on the application.When Autonomous Mode is in background subtraction state, clicking on Background button will store the current camera image as a background image and will subtract the next images form this background image.While in Frame Differencing, it does not have any effect on the result.The Frame Differencing speed buttons adjust the sensitivity of the frame differencing state to the motion, by defining how many frames should be used to find motion.

Results
Some of the results are given below -

User controlled mode result
The movement, positioning, and firing of the Sentry Gun in user mode performed as we expected.Because the tilt and pan servos selected could not support large weight, it was necessary to select the weapon around this constraint.DC gear motors could handle more weight than servos but servos allow for precise control of angular positioning, velocity and acceleration.
The grouping of the projectiles fired from the weapon in USER mode was well within an acceptable range when fired within the determined operating range of 25 feet

Autonomous tracking result
In Autonomous mode the tracking was somewhat disappointing as compared to our original hopes; it not only met our expectations it even surpass them.Image processing is a very CPU intensive task and the laptop selected for the system could only successfully track and hit 1 to 2 objects in a frame moving at up to approximately 3 to 4 miles per hour (human walking speed).Its accuracy was extremely sensitive to the calibration of the system, but it has about an 80% hit rate and can shoot up to twice per second.This performance is not only well within the acceptable range, it exceeded our expectations.

Constrains
There were Several factors that limited the performance of our Sentry Gun during testing.The low budget webcam we used to perform the Sentry Gun's image-processing was above all other constrains.Even at its maximum 30fps rating, the webcam was not sufficient for high quality real time applications.
The algorithm of image-processing itself, turned out to be the biggest constrain in the Sentry gun's system.In real-time systems it is very difficult and requires a high clock frequency as well as large amounts of memory to perform the task of processing large datasets.Ideally, the image-processing algorithms should be run on a multicore processer, and the system should be parallelized.

Scope of Project
The idea of implementing Sentry Gun technology is not something novel.Numerous attempts have been made on commercial level, military level, and even independent level.In 2006, MediaZen in cooperation with Samsung Techwin Inc., Korea University, Sysfo Lab Co. and Sejin System Co., produced the Guard Robots and Intelligent Surveillance Systems to defend the South Korean borders.From 2003 to 2006, Private sector and South Korea's government invested about $5 million on such military robots.This technology has also been installed to protect Korean military bases in Iraq.This system uses visuals and infra-red cameras to distinguish between humans, animals and trees.It can detect targets up to a 2.5 mile during the day, and about half of it at night.Bob Rudolph is quiet a prominent name when we talk about Paintball Sentry Gun.On his website, he has shared the details of his numerous attempts at designing a paintball sentry gun.To date, he has created 9 different prototypes.He has also documented the flaws and strengths of each design and is still actively continuing development.He created Autonomous System last year, LLC as an entity to sell his hardware and software designs as a way to finance this hobby.However, he hasn't stopped publishing information on his latest software and hardware prototypes.

Conclusions
Use In this paper the development and design of a robotic sentry gun for security applications are discussed by detection as well as engagement of a target.It is a soldier that never sleeps, to hit a target is its first priority .In future these autonomous robots can replace soldiers.The hardware of the this system includes mechanical structure mainly consists of accessible equipment that make it low budget system .The algorithm of image-processing itself, turned out to be the biggest constrain in the Sentry gun's system, Ideally, the image-processing algorithms should be run on a multi-core processer, and the system should be parallelized.It's not the final design we can modify it with so many modifications like with 3D camera and face/object recognition.We can also add voice password recognition.This is an open source project then perhaps this is a good place to work on AI algorithms to improve the gun's performance.

Figure 2 .
Figure 2. Block Diagram Basic features of aurdino i.Low Cost: The plus point of Aurdino board as compared to other microcontroller is that it has relatively less cost.ii.Cross-platform: Aurdino can work on Linux, Windows, and Macintosh, while others are only for Windows.iii.Simple and clear programming environment: Aurdino programming is more flexible and easy, even beginners can benefit from it.As it's based on processing environment, so professional programmers are also taking advantage of its features.iv.Extensible and open source software: Aurdino software was published as an open source tools and is available for extension.All types of source codes and libraries of Aurdino environment are available openly, with which anyone can get used to Aurdino.v.Extensible hardware: The Aurdino board is based on Atmel's ATMEGA8, ATMEGA328P PU and ATMEGA168 microcontrollers.It can be connected with any type of sensor, and circuits.

Figure 5 .
Figure 5. Autonomous Mode The Tolerance buttons lowers and raise the tolerance of the subtraction both in Frame Differencing and Background Subtraction; it determines how sensitive image-processing should be, to color change.Sensitivity