g38 duy nguyen (ee) mind games justin dwyer (ee) john

52
Mind Games Daniel Warner (EE) John Parker (EE) Justin Dwyer (EE) Duy Nguyen (EE) G38

Upload: others

Post on 05-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Mind GamesDaniel Warner (EE)John Parker (EE)Justin Dwyer (EE)Duy Nguyen (EE)

G38

Page 2: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Goals & Objectives

Basic OverviewThe goal of this project is to control multiple applications through nontraditional methods.

Human Input - Brainwaves, Muscle Movement, Heart Rate via BCI (Brain Control Interface)

DSP - Laptop Computer to MCU

Application - RC Car, Water Fountain, Claw Machine

Page 3: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

MotivationDiverse Multi-discipline project - Aspects include:

Biomedical Engineering DSP / Programing RF / Wireless Communications Mechanical Engineering Concepts

Page 4: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Specifications-Overall System Latency of 750ms

-General controller board should be flexible and offer many control options

-Claw machine needs to capable of carrying a load of 1/2 pound

-Claw machine needs a minimum of half of an inch precision in x-y motion

-Water fountain displays pulse across three pumps

-RC Car should be drivable using basic controls (Left, Right, Forward, Reverse)

Page 5: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Overall Block Diagram

Page 6: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

BCI HardwareKey Points

-Multiple Bio- Potential Inputs

-High Resolution

-High Bit Depth

Page 7: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Electrodes Passive vs Active

-Passive requires Capacitive gel to overcome trace impedance of skull

-Active uses small amplifier to boost signal

-Modern Active and Passive Electrodes have a similar SNR

Page 8: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Headwear

10-20 Headset

International Standard for EEG Capture

Primarily Targeting Brain Alpha Waves

Found between 9 - 14 Hz

Strongest Propagation in the O1 and O2 Region

Occurs when users eyes are closed

Page 9: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

DSP Software

3 options for software choice

-MATLAB, Python, BrainBay

Pro Con

MATLAB Extremely powerful, experienced in using it

Expensive to buy software & Processing Package

Python With correct modules, as powerful as MATLAB, free, Code establishing connection to board available

No experience in programming python

BrainBay Extremely simple to use, free Too simple. Lacks programming options & output is limited to keyboard strikes.

Page 10: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Lab Streaming LayerThe lab streaming layer (LSL) is a system for collecting data. It handles both the networking, time-synchronization, access as well as optionally the centralized collection, viewing and disk recording of the data.

We will use LSL to send our data from the board into the scripts designed to process it.

Latency is a big concern with our project. LSL samples are transferred with less than .1 milliseconds of latency for samples smaller than a megabyte.

Page 11: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

EMGThe code for this portion must detect a muscle being flexed.

The spikes created by this muscle activity are huge and easily detected.

We will compute the absolute value of the signal, then output a positive if the signal is above 12uV.

Page 12: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

EMG Output

We will be monitoring the muscle activity of the jaw in the Claw Machine program.

As soon as we detect a clenched jaw, we will output a ‘C’ over serial to the PCB controlling the Claw Machine.

Page 13: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 14: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

EKG DetectionThe code for this portion must detect the pulse of the user. By counting the number of samples between the strong negative peaks, the time between each pulse can be determined.

Sample of minimum

Samples between mins

Calculated pulse

8

213 205 74.6

426 223 68.6

652 216 70.8

860 208 73.5

Page 15: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

EKG OutputLimitations on communicating between python and our MCU limited us to transferring ascii characters.

Once the pulse is found, that number is converted into an ascii character, and that character transferred to the MCU

Page 16: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

EKG Program Flowchart

Page 17: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Alpha Wave DetectionAlpha waves are produced at ~10 Hz. The image below shows EEG Data band pass filtered between 9-12 Hz to show the alpha band. When the eyes are closed, there is a large increase in activity in the range 9-12 Hz.

Page 18: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Alpha Wave DetectionDetecting Alpha

-Filter Signal

-Compute Average

-Output if wave detected

Page 19: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 20: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 21: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Determining Head TiltDetermining the way a user is tilting their head will be accomplished using the on board accelerometers.

Compute what percentage of earth’s gravity each axis experiences

From that, the angle of the head will be determined

Page 22: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Accelerometer Processing

Page 23: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Accelerometer TestingData is shown in its separate channels, with channel 0 = x, 1 = y, 2 = z

The data begins with the board flat on a desk, then tilted different directions every 5 seconds

Page 24: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Head Tilt OutputIf a head tilt is determined using the accelerometer, a coresponding ascii character is output.

The Claw Machine will expect an ‘l’ for left, ‘r’ for right, ‘f’ for forward, and ‘b’ for backwards.

The RC Car will expect a ‘w’ for forward, an ‘s’ for backward, a ‘d’ for right, and an ‘a’ for left

Page 25: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

General Development BoardMany specialized Dev boards are currently available for different technologies.

3G GSM, Bluetooth, Wifi, RF.

We wanted something that was able to do more and offered useful inputs with a seamless connection.

Page 26: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

••••

Page 27: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 28: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 29: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

••••

Page 30: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

––

Page 31: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 32: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

•••

Page 33: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 34: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 35: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 36: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Water Fountain;/,.,.This water fountain will change output based on the user’s pulse. The following slide will show the schematic for the water fountain.

Pulse<75 75<Pulse<110 Pulse>110

Tiers active

1 1,2 1,2,3

Page 37: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John
Page 38: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Issues*Inductive load from relay end

*sparking from contact end

*inductive noise when pumps shut off

*isolating analog and digital grounds

*decoupling capacitors

*solid state relays

*dc motor

Page 39: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Claw Machine Application

User friendly:Easy input signals to control the claw machine game. with little to no BCI training.

EMG signals: Unlocks control of x and y-axis

Accelerometer signals: tilt forward -> move forwardtilt backwards -> move backwardstilt left -> move lefttilt right -> move right

EEG signal:close eyes and relax (alpha wave) -> claw drop

References----------------------not many claw machine references-decided to reference the x-y motion/rails from a 3d Printer-attach a motor on a platform for z motion

Page 40: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Claw Machine Subsystem

Page 41: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Bipolar Stepper MotorAdvantages: Provides high resolution and fair amount of torque, relatively cheap, long lifespan

Disadvantages: Current draw, Dedicated Drivers, No internal feedback system

Requirements: Project requires precision, enough torque to move the metal rails, and durability. Power consumption is not a main concern and a feedback system can be implemented through hardware and software design

How to overcome the feedback issue:

z axis:utilize a counter in software and rely on precision of stepper motor

x-y axis: Timing belt slipping means counter is not an option

Utilize limiting switches to send signal to mcu when collision occurs

Page 42: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Stepper MotorsLeadshine’s stepper motor selection document used for torque calculations through dynamics free body diagrams and equations:

Stepper motors selected:

Page 43: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

x-y Axis Feedback System

Limit switches: Cheap Simple configuration effective easy coding

Encoder: expensive hardware and software

unnecessarily harder bulkier

Page 44: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Stepper Motor DriverAllegro A4988:--------------------------------------------Max load supply voltage: 35VMax output current: 2ALogic supply voltage: 3.3V to 5.5V---------------------------------------------

Enable pin will be used to shut off holding torque and reduce power consumption

Heatsink required for full 2 A current draw

Page 45: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Claw RelayParasonic 5V Relay: JS1A-B-5V-F High contact capacity: 10 AMax operating voltage: 100V DCNominal operating current at 5V: 72 mACoil resistance: 69.4Ω

FairChild NPN Transistor: BC337Max Ic current: 800mAminimum hfe at Ic=100mA: 100Vbe(sat): 1.2V Vce(sat) from circuit configuration: 40mV

*ensure Ib does not exceed mcu rating

Page 46: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Power SystemRAIDMAX XT series RX-300XT 300W ATX12V / EPS12V Power Supply:----------------------------------------------------------------------------------------------------+3.3V@14A, +5V@15A, +12V@21Acost: $22

Need: output 24V1 Amp Current--------------------------------------------------------------------------------------*attempted to use +12V to -12V for 24 but could only supply .5A*used 24V wall adapator @1.5A

TI TPS55340RTER DC-DC Boost Converter:--------------------------------------------------------------Vin: 2.9V to 32VVout max: 38V95% efficiencycost: $5

Page 47: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Program Flow x-y motion

Page 48: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Delivery System Program Flow

Page 49: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Work Distribution

BCIHardware

DSP Wireless Communication

RCCar

WaterFountain

ClawMachine

Admin/Management

Daniel Primary Secondary Primary

John Secondary Primary Primary

Justin Primary Primary

Bob Primary Primary

Page 50: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Budget

Page 51: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John

Financing / Sponsors

Page 52: G38 Duy Nguyen (EE) Mind Games Justin Dwyer (EE) John