45
MAGNETAG The Kurt Cobain Conspiracy Club is: John-Paul Petersen, Andrew Reich, Christopher Lembke, & Kush Gupta Team Advisor: Dr. Cory Prust

MagneTag Presentation Winter Quarter V3.0

Embed Size (px)

Citation preview

MAGNETAGThe Kurt Cobain Conspiracy Club is:

John-Paul Petersen, Andrew Reich, Christopher Lembke, & Kush Gupta

Team Advisor: Dr. Cory Prust

MAGNETAG V1.0

COIL MODULE AMPLIFIER ARDUINO

HIT/NO HIT

DETECT

UI

1 RGB LED

1 BUZZER

POWER

3.0V DC

4 ANALOG

PULSE

4 “DIGITAL”

TRIGGER

• Worn as a sash

• 2 front, 2 back

• Hit/No hit

• 3 hits you’re out

MAGNETAG V2.0

• Worn poncho style

• 4 front, 4 back

• Hit/No hit

• 3 hits you’re out

• Player stats tracked via BLE

2x 4-CHANNEL ADC

nRF51422 BLE EVALKIT

8x ANALOG

CONDITIONER

COIL MATRIX

MAGNETAG V3.0

MAGNETAG V3.0BLOCK DIAGRAM

MAGNETAGVERSION SPEC COMPARISON

V3.0 Objective: To advance gameplay via larger sensors with

hit strength and location tracking.

Specification V3.0 V2.0 V1.0Torso Sensor Coverage 75% 25% 15%

Differentiated Hit Strengths Yes No No

Differentiated Hit Locations Yes No No

Coil Output Variance (+/-) 5% Untested Untested

Bluetooth Ready Yes Yes No

Missed Hits < 0.5% < 2% < 7%

Interference Protection RF Filtering Near EM Sources Near EM Sources

Battery Life 2 hrs 2 hrs 2 hrs

Control Box Size 2.5" x 3.5" 2.5" x 3.5" 2" x 3"

Version Comparison Table

COIL MATRIX

3.3V

Analog Conditioner

REQUIREMENTS:

• Covers most of the torso

• Outputs indicate strike location

• Outputs reflect strike impact

• DC shift for single-ended amplification and sampling

COIL MATRIXDESIGN SELECTION

1. Circular

• Readily available from sponsor

• Uniform geometry

• Large dead center zone

2. Lemniscate

• Eliminates central dead zone

• Greater surface area coverage

• Peak flux linkage in center

3. Long Coils

• Simple construction

• Efficient coverage

• Peak flux linkage at ends

COIL MATRIXDESIGN

Specification TargetNumber of Coils 8

Coil Magnet Wire Gauge 38 AWG

Coil Spacing 5.75 cm

Coil Width 8.25 cm

Coil Length - Type A 56 cm

Coil Length - Type B 38 cm

Coil Length - Type C 104 cm

Coil Length - Type D 41 cm

Coil Matrix Specifications Table

COIL MATRIXDETERMINING STRIKE LOCATION

COIL MATRIXSTRIKE LOCATION RESULTS

COIL MATRIXDETERMINING STRIKE IMPACT

0.00

0.20

0.40

0.60

0.80

1.00

1.20

1.40

1.60

0 20 40 60 80 100 120 140 160 180 200

Sa

mp

led

Vo

lta

ge

[V

]

Sample Index [unitless]

Example Coil Pulse Samples With Absolute Peaks Marked

Idle Average

Ch0 Upper Pk

Ch0 Lower Pk

Ch1 Upper Pk

Ch1 Lower Pk

Ch0 Coil Output

Ch1 Coil Output

COIL MATRIXSUBSYSTEM PERFORMANCE TEST DATA

COIL MATRIXSUBSYSTEM PERFORMANCE TEST DATA

COIL MATRIXPROCESSING STRIKES

GAME MAIN

NEW PEAK IN

CHANNEL

BUFFER (n)

?

STORE PEAK w/

CH# IN HIT

BUFFER

RESET CHANNEL

CHECK

(n = 0)

UPDATE

HEALTH LED

ARRAY

ASSIGN VEST

LOCATIONS TO

PEAKS WITH

L.U.T.

STORE STRIKE

FINGERPRINT

IN BLE BUFFER

CHANNEL

NUMBER

INCREMENT

n = (n+1)

Y

ALL CHANNEL

BUFFERS CHECKED

FOR PEAKS

?

N

Y

N

ASSIGN TOTAL

DAMAGE FOR

STRIKE

FINGERPRINT

ANALOG CONDITIONER REQUIREMENTS:

• Prepare the signal for sampling

• Boost 80mV peaks to 800mV

• Filter unnecessary frequency content3.3V

ADCCoilMatrix

ANALOG CONDITIONERDESIGN SELECTION

1. Pre-amp filtering, inverting input

• Quickly discovered problems with coil isolation

2. Post-amp filtering, non-inverting input

• Both alterations help isolate the coils

ANALOG CONDITIONERDESIGN

Specification TargetSupply Voltage 3.3 V

Current Consumption 5 mA max

Gain 20.6 dB

Cutoff Frequency 2 kHz

Output Voltage 0 - 2 V

Analog Conditioner Specifications Table

ANALOG CONDITIONERFREQUENCY RESPONSE

-20

-15

-10

-5

0

5

10

15

20

25

0.1 1 10 100 1000

Am

plif

ier

Ga

in [

dB

]

Frequency [kHz]

Analog Conditioner Frequency Response

ANALOG CONDITIONERGAIN PREDICTABILITY

0.02

0.12

0.22

0.32

0.42

0.52

0.62

0.72

19.0 20.0 21.0 22.0

Pro

ba

bility

z-V

alu

e

Signal Gain [dB]

Gain Variance of 50 Random Coil Strikes

POWER SUPPLY REQUIREMENTS:

• Run off a 3.7V rechargeable

• Provide stable 3.3V supply

• Provide 40mA for 2 hours

nRF51422 BLE SoC

10 kHz ADCCoilMatrix

Signal Conditioner

POWER SUPPLYDESIGN

Specification TargetMiniumum Input Voltage 3.65 V

Output Voltage 3.3 V

Required Output Current 40 mA

Expected Battery Life 2 hours

Power Supply Specifications Table

nRF51422 BLE SoC

10 kHz ADCCoilMatrix

Signal Conditioner

POWER SUPPLYVOLTAGE REGULATION

0.0

0.3

0.6

0.9

1.2

1.5

1.8

2.1

2.4

2.7

3.0

3.3

3.6

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0

Ou

tpu

t V

olta

ge

[V

]

Input Voltage [V]

Voltage Regulation (Output vs Input)

POWER SUPPLYLOAD RESPONSE

0

0.3

0.6

0.9

1.2

1.5

1.8

2.1

2.4

2.7

3

3.3

3.6

0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0

Vo

lta

ge

Ou

t [V

]

Runtime Hours [hrs]

Voltage Supply Output for a 36mA Load

ANALOG TO DIGITAL REQUIREMENTS:

• Sample 8 coils at 10kHz each

• Interface via dual SPI bridges

• Dual chip solution

3.3V

nRF51422BLE SoC

AnalogConditioner

ANALOG TO DIGITALDESIGN SELECTION

1. nRF51422 onboard ADC

• 500 Hz, single channel max

• (We need 8x 10 kHz)

2. Single channel with external multiplexing

• Initially considered the cheapest solution

• High power consumption

• Added complexity

3. 4-channel with internal multiplexing

• Reduced power consumption

• Simplified interfacing

• Reduced cost

ANALOG TO DIGITALDESIGN

Specification TargetSampling Rate 40 kHz/chip (10 kHz/channel)

Sampling Bit Depth 12-bit

Data Interface SPI

Data Rate 4 Mbps

Data Clock 4 MHz

Supply Voltage 3.3 V

Reference Voltage 3.3 V

Current Consumption 400 uA max

4-Channel ADC Specifications Table

ANALOG TO DIGITALSAMPLING RATE TEST

0.0

0.5

1.0

1.5

2.0

0 5 10 15 20 25 30

Sa

mp

le V

olta

ge

[V

]

Channel (0) Sample Index

4MHz Slave Clock – 13.7 kHz/Channel

ANALOG TO DIGITALLOGIC ANALYSIS

NOTES:

• 54.6 kHz overall sampling

• 18.3 us between samples

• 8.0 us between chip shutdown and startup

• Delay caused by unseen microcontroller routines

4MHz Slave Clock – 54.6kHz Overall Sampling Speed

13.7kHz/channel

ANALOG TO DIGITALOVER-CLOCKING TESTS

0.0

0.5

1.0

1.5

2.0

0 5 10 15 20 25 30Sa

mp

le V

olta

ge

[V

]

Sample Index

2MHz Slave Clock – 10.3 kHz/Channel

0.0

0.5

1.0

1.5

2.0

0 5 10 15 20 25 30Sa

mp

le V

olta

ge

[V

]

Sample Index

8MHz Slave Clock – 16.4 kHz/Channel

0.0

0.5

1.0

1.5

2.0

0 5 10 15 20 25 30Sa

mp

le V

olta

ge

[V

]

Sample Index

1MHz Slave Clock – 6.9 kHz/Channel

0.0

0.5

1.0

1.5

2.0

0 5 10 15 20 25 30Sa

mp

le V

olta

ge

[V

]

Sample Index

4MHz Slave Clock – 13.7 kHz/Channel

ANALOG TO DIGITALDIMINISHING RETURNS

1MHz Slave Clock – 27.5kHz Sampling 4MHz Slave Clock – 54.6kHz Sampling

BLE SOFT DEVICE REQUIREMENTS:

• Transmit 8-bit/16-bit packets

• Identify unique player IDs

• Adequate transmission power

3.3V

Wireless to Player Mobile Devices

4-ChannelADC

Player UI

BLE SOFT DEVICEDESIGN

Specification TargetMin/Max Packet Size 8-bit/16-bit

UUID Per Player

Transmission Power <15dBm within 2 meters

Modulation GFSK

Supply Voltage 3.3 V

NRF51422 Current Consumption 25 mA max

BLE Specifications Table • Receives coil strike data via dual 4MHz SPI ports

• Processes strike fingerprints for BLE buffer

• BLE transmits when buffer updates

BLE SOFT DEVICEWHAT’S A SOFT DEVICE?

• Enables simplified BLE functionality

• Hides complicated BLE communication protocol stacks

• Accessed and controlled via manufacturer SDKs

• Requires licensing for production

BLE SOFT DEVICESIG PROFILES, PROTOCOLS, AND SERVICES

GATT Based:

HRP:

Heart Rate Profile

HRS:

Blood Pressure Profile

PASP:

Phone Alert Status Profile

BR/EDR Profiles:

A2DP:

Advanced Audio Distribution Profile

HSP:Headset Profile

FTP:File Transfer Profile

BR/EDR Protocols:

AVCTP:

Audio/Video Control Transport Protocol

AVDTP:

Audio/Video Distribution Transport Protocol

IrDA:

IrDA Interoperability

BLE SOFT DEVICEHRP SERVICES

GATT Based:

HRP:

Heart Rate Profile

HRS:

Blood Pressure Profile

PASP:

Phone Alert Status Profile

HRP provides three services:

• Heart Rate Service

• Battery Service

• Device Information Services

BLE SOFT DEVICEHRP SERVICES

HRP provides three services:

• Heart Rate Service

• Battery Service

• Device Information Services

Idel

HEAR RATE:

timer-time-out?

BATTERY:

timer-time-out?

DEVICE

INFO:timer-time-

out?

GET hear rate

value

(INTEGER)

GET battery

value

(INTEGER)

UPDATE device

info (CHAR)

SEND using

BLE to APP

TRUE TRUE TRUE

BLE SOFT DEVICEHRP SERVICES

HRP provides three services:

• Heart Rate Service

• Battery Service

• Device Information Services

Idel

HEAR RATE:

timer-time-out?

BATTERY:

timer-time-out?

DEVICE

INFO:timer-time-

out?

GET hear rate

value

(INTEGER)

GET battery

value

(INTEGER)

UPDATE device

info (CHAR)

SEND using

BLE to APP

TRUE TRUE TRUE

BLE SOFT DEVICEHRP SERVICES

HRP provides three services:

• Heart Rate Service

• Battery Service

• Device Information Services

Idel

HEAR RATE:

timer-time-out?

BATTERY:

timer-time-out?

DEVICE

INFO:timer-time-

out?

GET hear rate

value

(INTEGER)

GET battery

value

(INTEGER)

UPDATE device

info (CHAR)

SEND using

BLE to APP

TRUE TRUE TRUE

BLE SOFT DEVICEHEART RATE SERVICE DATA STRUCTURES

Data Structures:

struct ble_hrs_evt_t

Heart Rate Service Event

struct ble_hrs_init_t

Heart Rate Service init structure

struct ble_hrs_s

Heart Rate Service structure

One service of interest to us:

• Heart Rate Service

BLE SOFT DEVICEHRP SERVICE FUNCTIONS

Functions:

uint32_t ble_hrs_init(ble_hrs_t *p_hrs, ble_evt_t *p_ble_evt)

Function for initializing the Heart Rate Service

void ble_hrs_on_ble_evt(ble_hrs_t *p_hrs, ble_evt_t *p_ble_evt)

Function for handling the Application’s BLE Stack events

uint32_t ble_hrs_heart_rate_measurement_send(ble_hrs_t *p_hrs, uint16_t heart_rate)

Function for sending heart rate measurement if notification has been enabled

One service of interest to us:

• Heart Rate Service

MAGNETAG V3.0BLUETOOTH TRANSMITTER TEST RESULTS

Button ID Buffer Size Arbitrary Packet Data Buffered Sniffed Packet Data SentPB1 8-bit 0x3F, 0x7B, 0xAF, 0xF4 0xF4

PB2 16-bit 0x01BC, 0x02F1, 0x3039, 0xF618 0x02F1

8-bit/16-bit Buffer Transmission

Unique Players Adequate Power16-bit UUID Data Tx Power

0x180D 1m: -60dBm to -43dBm

0x180D 2m: -80dBm to -61dBm

MAGNETAG V3.0SYSTEM STATE DIAGRAM

SYSTEM STATE CHANGES:

• Pulse Triggered ADC Buffer

• Strike Fingerprint Processed

• BLE Buffer Updated

• BLE Transmission Completed

MAGNETAG V3.0CONCLUSION - NEXT STEPS

• Configure the strike fingerprinting algorithm (Andy & Chris)

• Migrate the SPI bridge to the nRF chip (Kush & John-Paul)

• Optimize the ADC sampling rate (John-Paul & Team)

• Ruggedize the system for live play (Team & Sponsor)

MAGNETAG V3.0CONCLUSION - NEXT STEPS

• QUESTIONS?