Sentinel is an automated area deterrent system utilising stereo vision, custom servo-mechanisms, and target-projectile interception equations that allow it to fire accurately at moving targets using a paintball gun.
Determine the requirements for an effective stereo vision paintball sentry.
Develop a viable concept of such a system
Create a detailed design of the system
Build a proof-of-concept prototype
Test and evaluate the prototype
1 SYSTEM REQUIREMENTS
The system will need to accomplish certain goals in order to be a viable solution to the problem stated in section 1. Discussions on what a prototype system should accomplish were held with various class mates and home owners and the key points are summed up in the user requirements below.
1.1 User requirements
The system should be able to hit a moving target in 3 shots at 20 meters.
The system should not be out maneuvered by the targets.
Perform in a typical backyard.
Be operable for at least 2 hours demonstration time.
Not need very advanced equipment.
Easy to use.
Give meaningful feedback like where the turret is aiming, where the target is etc…
Be able to control the turret manually as well as give it commands to arm, disarm, fire, or stand down.
Give feedback on the turret state.
The system should cost in total less than R10 000 excluding labour costs.
Easy to carry.
Not be larger than 0.5 m2.
Should not be too heavy.
1 Technical Requirements
To achieve the goals stated in the previous sections, the system needs to meet certain technical performance requirements.
1.1 Range and operational volume
A typical backyard defined in the Systems Specification Document as having a surface area of around 400 square meters. A point located close to the house with the best view of approaching intruders will be chosen.
Figure XX shows illustrations drawn from a Google earth image of the backyard chosen for developing the technical requirements further.
To keep track of which way things are pointing, which way things think they're pointing and which way things talk to other things about pointing, we need to establish a standard set of world axes. So here they are:
X axis – Horizontal Left and right of the forward-facing position
Y axis – Forwards and backwards in the forwards facing position
Z axis – Vertical movement up and down perpendicular to the ground
If anything in the project needs to talk about up down left or right, this is the standard.
Distance Range of 20 m
Pan Range of 70 ̊
Tilt Range of 30 ̊
To be able to determine accuracy and performance requirements, detailed geometric and movement capability information needs to be known about the target. The Learn Easy site has detailed human dimensional information for various positions and poses (Anon., 2017). It was considered the person would either cower or run away
Max speed of 24 km/h
Max acceleration of 8 m/s/s
Knowing the target acceleration capability and mass, the rate of change in direction can be calculated for a human. This is different to a mechanical natural frequency as the acceleration is constant and the frequency is dependent on the amplitude of movement. Calculations to determine this frequency can be seen in Appendix C with a result of 4 Hz rounded up.
Target movement frequency of 4 Hz
1.2 Standard target definition
Accuracy ultimately depends on the marker which can be determined statistically by mounting the paintball gun in a fixed position and firing a determined number of shots at 20 m to measure the bullet spread as shown in Figure XX
Circular error probable (CEP) is a term used in ballistic science to describe a weapon system’s accuracy. It is the diameter of a circle which guarantees to contain 50% of the shots fired.
25 Shots were chosen since a blog post by Connecticut Muzzleloaders show CEP error is only 5% with negligible improvement at increased shots (Wardlaw, 2011). Following this procedure and assuming a linearly diverging cone of spread, the normal distribution at 20 m for the gun could be found.
For the Tippmann Gryphon FX it turned out to be a
300 mm radius at 20 m (Stock barrel at 95%tile normal dist.)
Turret angular accuracy
Now that we know how accurate the gun is, and how likely it is to hit within a certain radius of where you aim it, we can work out how accurate the turret needs to be to ensure that despite the gun's spread of fire we can still hit the target in 3 shots.
For this i did some simple probability calculations
The 164 mm maximum deviation is directly relatable to a solid angle requirement at 20 m .
So the total turret accuracy needs to be within
+/- 0.47 degrees angular tolerance
2 System structure and layout
The system will be broken up into three main subsystems with their individual working components. The tracking system will detect a target and calculate the required gun laying angles. It will then send the gun laying angles to the control system along with other instructions and the control system will drive the mechanical system which will orient the gun to the required angles for a successful shot,
3 Mechanical system
This section deals with the mechanical system and how it functions. It is responsible for the physical actuation of the gun, being driven by the control system.
The diagram below, Figure XX, shows an exploded view of the mechanical system
1 - FRONT TRAY COVER
2 - BASE TRAY
3 - BASE PLATE
4 - PAN ENCODER MOUNT
5 - PAN DRIVE SPACER
6 - PAN DRIVE MOTOR
7 - FRONT SHEAR BRACE
8 - PAINTBALL GUN
9 - TILT DRIVE PULLEY
10 - TILT DRIVE SPACER
11 - TRIGGER SERVO HOLDER
12 - TRIGGER SERVO
13 - TILT DRIVE FACE-PLATE
14 - TILT ENCODER MOUNT
15 - TILT ENCODER
16 - SCREEN
The structure is panned and tilted by two belt driven drive mechanisms. Belt drives offer shock resistance and zero backlash with the ability to 3D print the gears to any size.
To the right is a component colored version
of the tilt drive CAD model and similar to the left is the pan drive CAD model
Stress calculations as well as finite element analysis was done on different parts of the structure to make sure everything is stiff enough and will function as required.
4 Tracking System
The tracking system is responsible for detecting the target and determining where to shoot.
To find the center of the target,
three steps are performed.
First it subtracts the camera frame from a background frame. Then it thresholds the pixels to white or black.
Then it draws an approximate polygon around the outer pixels to get a steady target center
Here the tracking program is being tuned to predict the right distance for the targets. The center of the bottle appears in slightly different positions on the left and right camera frame, and the distance between the two shows how fr away it is.
The graph on the right shows how the disparity relates to the distance.
In theory if both cameras are completely parallel and facing the same direction then the disparity will be related by a power curve to the distance. In reality the cameras are not perfectly aligned and also have other non-linearities and so a symmetric sigmoidal curve fits the data better
The target will be moving as well as accelerating, and because the paintball takes time to travel, the gun needs to be aimed at the point the target would be later in time.
Other delays such as the time it takes to pull the trigger, image processing delays, data transfer delays and so on also need to be taken into account.
The interception algorithm takes care of figuring this out for us. It uses the parametric equations for the projectile and the target paths and solves for the time instance they will be at the same point.
To the right is mat lab produces image of the algorithm at work. You can see the projectile and target trajectories along with the interception points.
Here the tracking system is tracking an orange ball thrown through the air. The expected path is extrapolated ahead of it and the interception point is also shown.
5 Control System
The control system is responsible for receiving the required gun angles from the tracking system, and driving the turret axes there quickly and accurately.
First a model of the mechanical system that needs to be control was created, then a controller was built around the model using simulink in Matlab.
To the left is an image of the model of the system used to develop the controller showing the motor electrical model, the system masses and flexible links.
Each axis was then simulated and the results for the pan axis is shown to the left. A fast rise time for a step input can be seen of about 0.2 seconds. This showed the system would be fast enough to keep up with a maneuvering human target.
The control system was based on the RL78 G14 microprocessor which offered many peripheral functions and timers that could be used to drive a servo, read the encoders, and output PWM signals for the motors.
The motors were driven by a Cytron MD10A motor driver that received power fro ma 12 V battery and PWM signals from the micro controller
Here is a video demonstrating the working system