380 likes | 571 Views
Laser-Guided Turret. ECE 445 – Senior Design Group #6 Ryan Nevell, Smit Shah, Sharlene Wu. Introduction. Capture laser dot and control an Airsoft turret to fire at target Designed for fun - Targeted towards Airsoft audience
E N D
Laser-Guided Turret ECE 445 – Senior Design Group #6 Ryan Nevell, Smit Shah, Sharlene Wu
Introduction • Capture laser dot and control an Airsoft turret to fire at target • Designed for fun - Targeted towards Airsoft audience • Could be expanded to infrared detection, motion detection, live firearms, etc
Features • Uses 2 cameras for 3D world view • Works with ordinary laser pointers • Serial communication between system and turret • Accurate up to 16 ft. • Harmless projectiles
Turret • Built by machine shop • American Precision Stepper motors (23H-502U) • Soft Air Defender of World Peace
Circuit Components • Allegro SLA7060M Motor Drivers • PIC16F877 • HIN232CP RS-232 transmitter/receiver • NTP75N06 Power MosFET for firing mechanism • F1100E 20MHz Oscillator • TXM-900-HP-2 RF Wireless Transmitter • RXM-900-HP2 RF Wireless Receiver
American Precision Stepper motors • Pan Motor driver draws about 0.35 A current at 11 Volts • Tilt Motor driver draws about 0.25 A current at 11 Volts • Motors has each step of 1.8° • Pan Motor has freedom of 360° • Tilt motor has freedom of 40°
Motor Drivers • SLA7060M Allegro Stepper Motor Drivers • Operates both motors in Half Step Mode giving 0.9° of precision • A reference Voltage and Sense resistors are used to specify current through motor windings.
Firing Mechanism • Uses a 5V DC Motor to reload and fire. • It requires up to 2A current when firing • Generates noise • Uses a power MOSFET controlled by PIC • Switch needed to stabilize firing current
PIC16F877 Functions • Receives serial data sent by system • Decodes the data and check for errors • Send back information to system about operation • Controls both motor driver direction and clock inputs to motor Driver
PIC16F877 (cont.) • Controls firing mechanism • Monitors reset position and performs positions correction
Wireless Schematic (Removed) • LINX HP-2 Series receiver and transmitter • Encoding and decoding algorithm • Operating frequency 921.37MHz
Communication Protocol • 3 or more identical bits in a row (000 or 111) drops accuracy over wireless • A bit is always followed by its inverted bit • Contains 3 data bits and 1 command/data specify bit • For example in 10101010 Command/Data Specifier Command Code (000=Move Pan Motor to right)
Cameras • Labtec Webcam Pro • 640 by 480 pixel resolution, 24 bit color • Facing in generally the same direction and level
Laser Detection Algorithm • Existing algorithms rely on laser to be red or significantly brighter than rest of scene • Looks for increases in brightness • Box method used to check appropriate size • More efficient and simpler than blob method
Matlab Configuration • Our program takes picture pairs from cameras, one for left camera, one for right camera • Matlab program by Jean-Yves Bouguet (Caltech) • Pinhole camera model
Matlab (cont.) • A coordinate system is initialized with the left camera being at the origin • Rotation and transformation matrices relate the right camera to the left • Intrinsic parameters (focal length, principal point) are sent to the program as well
Stereo Triangulation • Uses pinhole method • Draws a line from image planes to the point • Utilizes least-squares method to determine depth of point (Z) • Calculates the disparity
Targeting Process - Trajectory • Adjustable Pan Plane and Zero vector • Allows cameras to be out-of-level to turret • Allows fine-tuning of turret aim • More complicated ballistic calculations abandoned when Nerf gun failed
PC Software • Decided to use Linux • Thought Video4Linux would be easiest • x86 Linux drivers support only 1 camera • Use network to combine 2 PC’s • Multi-threaded, written in C • Sleep time between camera frames, turret commands
PC Software (cont.) • Modular design • Various input/output plug-ins • Easily expandable to 3+ cameras • Simple console UI to change parameters at runtime • Specially built version of Knoppix used for development
Wireless Transmitter/Receiver Testing • Best performance when operated on separate breadboard from Crystal Oscillator • Firing mechanism adds noise to receiver circuitry causing false detection • Tried to disable receiver while firing
Targeting Accuracy • At distances between 7 and 10 feet, targeted point averaged within 0.548” of laser point • Depth accuracy much worse than horizontal/vertical – especially at long range • Might clear up with larger calibration grid
Targeting and Firing Accuracy 26 Shots fired at various positions at distances between 10 and 16 feet.
Original Design Specifications • Accurate up to 30 ft from cameras • At 30 ft, BB’s will hit target within 1 ft radius • Wireless configuration
Current Design • Accurate up to 16 ft from cameras • At 16 ft, BB’s will hit target within 1 ft radius • No Wireless due to noise
Challenges • Laser detection • Cameras saturated by laser • Laser cannot be seen at 30 ft • Camera driver limitation • Defective equipment • Finding correct stereoscopic algorithm • Firing circuit generated too much noise
Future Hardware Development • Stronger motors • Timing belts • Enhance wireless performance • Better cameras • Infrared cameras • Sell cameras pre-mounted and calibrated
Future Software Development • GUI interface • Infrared detection • Motion detection • Implement camera calibration into program • Calibrate cameras before production
Credits • Professor Jonathan Makela • TA: Jason Skowronski • Professor Seth Hutchinson • TA: Jonathan Holm