340 likes | 629 Views
Magic Wand Battle Game. Team 53 Shanoon Martin, Jialin Sun, Manfei Wu. Introduction. Combine the technology of gesture recognition and the concept of wide-range game Implement the wireless network in the game to make it portable and flexible . Block Diagram. Wands. Wand’s Workflow.
E N D
Magic Wand Battle Game Team 53 Shanoon Martin, Jialin Sun, Manfei Wu
Introduction • Combine the technology of gesture recognition and the concept of wide-range game • Implement the wireless network in the game to make it portable and flexible
Inertial Measurement Unit (IMU) • Consist of 3-axis Gyroscope and 3-axis Accelerometer • Accelerometer detects static and dynamic acceleration for tilt-sensing • Gyroscope senses angular velocity for motion orientation
Filtering the IMU raw data • Gyroscope is less susceptible to noise on short term, but has accumulated drift over time • On long term, accelerometer data is sampled accurately because it does not drift • Complementary Filter and Kalman Filter
Gesture Recognition Algorithm • Limitation: Arduino Uno computational time and memory • Better algorithm : Trajectory estimation algorithm and Bayesian network gesture recognnition • Actual implemented algorithm : Perceptron Algorithm
Multiclass Perceptron Algorithm • Single layer artificial neuron network • Each data input vector is processed to be a feature vector f(x) • Weight vector (w): a specialized vector that used for identification for each different class • Activation: the dot product between w and f(x). The result determine which class the feature vector belong to
HitSensor HitSensor=UltrasonicReceiver+Xbee+Arduino
UltrasonicReceiverSchematic • Three stages of amplifier(2N2222) and a comparator(LM386) • Capacitors are added to get rid of DC components • At the input of the comparator, if V+ > V-, output is high, otherwise it is low, so we will have a square wave output
Ultrasonic Transmitter • MaxSonarEZ4 • narrowbeam • Range: 0-5meters • ConnectitsVddand • GNDanditwillsend • outultrasonicwave • automatically
Ultrasonic Receiver Output Oscilloscope output Arduino Serial Port Output
Xbee • Wand • Hit Sensor • Receiver XBee S1
Enable a wide range communication system • Distance 100ft (30m) • Set Transmitter Receiver XBee 1 XBee 2 ATID 40 ATID 40 Network ID ATMY 1 ATMY 2 Current ID ATDL 2 ATDL 1 Destination ID ATWR ATWR Save parameters ATCN ATCN Exit
Receive Message hello 0-100 Point-to-Point Communication System is Ready
Multiple Transmitters One Receiver Transmitters Receiver (Wand & Hit Sensor) ATID 40 ATID 40 ATMY 1 ATMY 2 ATDL 2 ATDL 1 ATWR ATWR ATCN ATCN
Main Receiver: Raspberry Pi A Receiver Xbee is connected Raspberry Pi with Xbee adapter • Enable Serial input of Pi • Download a Serial package • Test code
Game Logic • Usedpython,especiallypygame • UsedseverallocalvariablestodistinguishdifferentincomingsignalsfromIMUorultrasonicreceiver classplayer(): hp=100 hit=0 move=0
User Interface • Solder the PiTFT 2.8” touchscreen from Adafruit to female • header • Software: Install a new Kernel package over the Paspbian • Test and then edit more files to make it auto-load
Wand’s Requirements and Verification • Test on IMU calibration
Stable connectivity between Wands and Receiver • Transmit real time sampling data at once from the wand to the receiver, average data lost is less than 5%
Hit Sensor Requirements and Verifications Requirements: • Ultrasonic receiver will receive ultrasonic wave 5 meters away • At the longest distance, the receiver will have accuracy of 5cm Verifications: • Set the transmitter and receiver in parallel and 5 meters away from each other • Move the transmitter 5cm away from the line and see if the receiver gets any signals
Wireless Communication Requirements and Verifications • Enable a wide range communication system • Support the mesh Network for multiple users communication with one receiver
Power Budget • First Design : • Total power for wand: 5hr of gaming needs 812mAh • Final Design • Total power for wand: 5hr of gaming needs 1250mAh Current battery can sustain for 2hrs
Challenges: 1. wand • Transmission rate between Xbees becomes slower when the end side is Raspberry Pi Affecting the algorithm accuracy • Perceptron Algorithm can only sample limited movements
2. Hit Sensor • Calibration time 3. User Interface • Touchscreen is not stable
Modified Design • Additional Arduino in Hit Sensor Coded to enable distinguishing multiple points 2. Use ArduinoUnos instead of building Arduinoboards using Arduino chips Could not fix the bug of “avrdude: stk500_getsync(): not in sync: resp = 0x50”
Future Work • Implementing the wand algorithm on a different processor to increase the complexity tolerance of calculation • Integrate the processor and PCB of the wand to a lighter, smaller dimension for a better mobility • Decrease hit sensor calibration time • Make the touchscreen more stable • Add more players to the game
Reference • (2010) Accelerometer and Gyro Tutorial : http://www.instructables.com/id/Accelerometer-Gyro- Tutorial/ • Ultrasound device data sheet : http://www.maxbotix.com/documents/MB1040_Datasheet.pdf • Raspberry Pi to Arduino : http://www.cooking-hacks.com/documentation/tutorials/raspberry-pi-to- arduino-shields-connection-bridge • Ultrasound receiver information: http://www.engineeringshock.com/store/p311/The_40kHz_Ultrasonic_Transducer_Receiver_DIY_Kit_w ith_Custom_PCB.html • IEEE code of ethics