DINOLIGHT Will Gowell, Zack Teasdale, Spencer Dennis 2 CUSTOMER - - PowerPoint PPT Presentation

dinolight
SMART_READER_LITE
LIVE PREVIEW

DINOLIGHT Will Gowell, Zack Teasdale, Spencer Dennis 2 CUSTOMER - - PowerPoint PPT Presentation

1 DINOLIGHT Will Gowell, Zack Teasdale, Spencer Dennis 2 CUSTOMER NEEDS The System Must: mirror colors on screen using rear LEDs in real time accept and output HD digital video signal have a plug and play setup be controllable


slide-1
SLIDE 1

DINOLIGHT

Will Gowell, Zack Teasdale, Spencer Dennis

1

slide-2
SLIDE 2

CUSTOMER NEEDS

The System Must:

  • mirror colors on screen using rear LEDs in real time
  • accept and output HD digital video signal
  • have a plug and play setup
  • be controllable and configurable from web app
  • integrate with existing smart lighting
  • have an all-in-one enclosure and modular light strips
  • fit any size screen
  • have a simple user interface

2

slide-3
SLIDE 3

ENGINEERING REQUIREMENTS

Table 2: Engineering Requirements

Marketing Requirements Engineering Requirements Justification Marketing Requirements Engineering Requirements Justification 2, 7

  • A. Should accept and
  • utput up to 1080p,

60Hz standard video signal formats A 1080p video signal at 60 Hz is a standard high definition signal. 1

  • E. Must have delay

under 16 ms (60Hz refresh) This is the maximum rate of the input signal. 2, 3, 6

  • B. Must accept and
  • utput using the same

standard interface Creates ease of use for the user,

  • nly plugging in the cables.

1, 2, 7

  • F. Must contain enough

logic units to implement the desired algorithms The FPGA must have sufficient logic units to implement the color algorithms as well as registers to map super pixels to the LEDs 3

  • C. Must have under 15

minute average installation time User will only need to plug in cables and place strips, and setup and control via web application. 3

  • G. Must be

automatically programmed by the system The FPGA must be programmed by either a support chip or the Raspberry Pi on boot. 4, 5

  • D. Must be compatible

with 802.11 802.11 is the standard wireless communication interface used for wireless networks. 1

  • H. Must have backlight

color be within 5% of the average RGB value of the TV pixels The backlight LEDs must have an RGB value that is within 5% in

  • rder to mirror the colors closely

enough.

3

slide-4
SLIDE 4

TERMINOLOGY

Pixel:

an individual source pixel

Pixel Block:

a block of pixels that are used to calculate average color

LED:

what is on the back of the screen

4

slide-5
SLIDE 5

IMAGE CONCEPT

5

slide-6
SLIDE 6

LEVEL 0 BLOCK DIAGRAM

HDMI Down Sampler

HDMI Duplicator

HDMI HDMI HDMI

FPGA Raspberry Pi NeoPixels Serial UART Web Client USB HTTP HDMI Source Screen HTTP Hue

6

slide-7
SLIDE 7

BOM

Part Cost Our Cost Availability Lead Time miniSpartan6+ $105.00 $105.00 In Stock 7 Days HDMI Scaler $39.92 $39.92 In Stock 4 Weeks NeoPixels $16.95* $16.95* In Stock 5 Days HDMI Splitter $21.99 $21.99 In Stock 2 Days Raspberry Pi 3 $39.95 $39.95 In Stock 2 Days 150W PSU $35.10 $35.10 In Stock 1 Week HDMI Connectors $20.00 $20.00 In Stock 2 Days HUE System $199.99 $0 TV $175.00 $0 Enclosure ? ? Total Cost $653.90 $278.91

7

slide-8
SLIDE 8

POWER

  • .32 Watts/ RGB LED
  • 18 Watts/meter @ 60
  • 3.5 Amps/meter
  • 9.6 Watts/Meter @ 30
  • ~2Amps/meter
  • Pi: 5v @ 0.58A
  • FPGA: 5v @ ?A
  • Downscaler: 5v @ 1A
  • Duplicator: 5v @ 1A

Mean Well 5v 150W PSU

8

slide-9
SLIDE 9

FPGA INTERNAL ARCHITECTURE

9

slide-10
SLIDE 10

DEVICE CHOICE

  • miniSpartan6+25lx
  • 3,758 slices (15,032 LUTs and 30,064 FFs)
  • Small form factor
  • HDMI ports and plenty GPIO
  • Virtix-5 Development Kit
  • 17,280 slices (69,120 LUTs and FFs)
  • Massive form factor
  • Saturn Spartan6 Dev Board
  • 6,822 slices (27,288 LUTs and 54,576 FFs)
  • Small form factor
  • Large amount of GPIO

miniSpartin6+

10

slide-11
SLIDE 11

MINISPARTAN6+

  • Xilinx Spartan6LX25
  • 2 HDMI Ports
  • USB-FTI Chip
  • Program through USB
  • xc3sprog software from Pi
  • Load .bit file from SPI flash

miniSpartin6+

11

slide-12
SLIDE 12

FPGA LEVEL 1 BLOCK DIAGRAM

FPGA

Pi Communication Registers HDMI DVI

AVG Pixel Mapper

Neopixel Driver

UART HDMI Neopixel

12

slide-13
SLIDE 13

HDMI TO DVI

STANDING ON THE SHOULDERS OF HAMSTERS

  • Using open source HDMI-DVI designed

for miniSpartin6+

  • Protocol not that complicated,
  • would require a lot of work
  • The FPGA can only accept 720p signal
  • Support < 1050 Mbs
  • 720p & 1080i are 742.5 Mbs

TMDS Receiver Block

13

slide-14
SLIDE 14

Accumulators

COLOR AVERAGING

  • Pixel Block is 2𝑜 by 2𝑙 pixels
  • Removes need for divider
  • Can change size for different

experience

  • Resolutions are not a power of 2
  • Overlapping windows
  • Hard-coded start coordinate for

each block

  • Average screen color will use a

large 2𝑜 by 2𝑙 box

Red Green Blue

Screen

Pixel Block 1 2 3 4 5 6 7 8 15 16 17 18 19 20 21 9 11 13 10 12 14 22 23

Color Averaging Block Concept

14

slide-15
SLIDE 15

COLOR MAPPING

  • Pixel-block averages pass though

mux and go to LED register

  • Select is programmed by pi
  • “LED0, look at zone 0”
  • Allows for blocks to go to multiple

LEDs

0 - n RGB RGB RGB RGB RGB Neopixel selectReg n=numBlocks From Averager Generate 1 for each LED reg:

15

slide-16
SLIDE 16

UART

  • Easy to implement
  • Both FPGA and Server side
  • Quick enough
  • Pi GPIO natively supports it
  • Use command-payload structure
  • 0x01: powerLED
  • 1 byte payload
  • 0x02: Color Map
  • numLED*2 byte payload

16

slide-17
SLIDE 17

RISKS

Color Averaging

  • Locations become difficult to calculate

during development

  • Script can be made to generate

locations

Color Mapping

  • High fanout of averager output

registers

  • One going to each led mux
  • Can be stage registered
  • Add few clocks to delay
  • Large amount of muxes
  • Reduce neopixel color depth
  • Can use different .bit files

HDMI to DVI

  • Cant control EDID
  • Only working with 720p video to

accommodate multiple input resolutions

17

slide-18
SLIDE 18

LEDS

18

slide-19
SLIDE 19

ADAFRUIT NEOPIXEL STRAND

  • Individually addressable RGB-LED
  • Different Configurations
  • 30, 60, 144 LED/meter
  • Black, White Strip
  • 3-pin JTS SM Connection

Black 30 LED/Meter Neopixel Strand

19

slide-20
SLIDE 20

Neopixel (WS2812B) Neopixel Serial Chain

20

slide-21
SLIDE 21

PIXEL MATH

  • Neopixel pixel driver
  • Real-Time Protocol
  • NRZ Serial in-out

𝑔

𝑠𝑓𝑔𝑠𝑓𝑡ℎ =

1 𝑂𝑣𝑛𝑞 ∗ 1.25𝜈𝑇 + 50𝜈𝑇

  • ~60Hz at 500 LED chain
  • Multiple Chains
  • Driven by VHDL State Machine
  • Counter: T0H, T0L, T1H, T1L, and RET

𝑈𝑦𝐼 + 𝑈𝑦𝑀 = 1.25𝜈𝑇 𝑈𝑠𝑓𝑡𝑓𝑢 = 50𝜈𝑇 Neopixel Protocol Timing

21

slide-22
SLIDE 22

RISK

  • Refresh rate
  • Must keep LED chain count low

enough to keep refresh rate under 16 ms

  • Pixel Density
  • As the pixel density increases, the

covered length decreases

  • Power Consumption
  • Must keep Neopixel strip short

enough to avoid excessive power consumption

  • Heat generated by power supply

22

slide-23
SLIDE 23

FRONTEND/BACKEND

23

slide-24
SLIDE 24

DEVICE CHOICE

  • Raspberry pi 3
  • Built in Wi-Fi
  • High Powered
  • Developer Friendly
  • Raspberry pi zero
  • Low power
  • Cheep cheep cheep
  • Small
  • Need Extras (Wi-Fi, Ethernet, USB…)
  • Beagle Bone Black
  • Offers GPMC
  • Memory Map FPGA Registers

24

slide-25
SLIDE 25

OVERVIEW

AngularJS Frontend

  • AngularJS app running on python

HTTP server

  • All user input
  • Buttons/Fields for input
  • Mobile friendly
  • Hosted using python’s

SimpleHTTPserver module

  • Bootstrap for css styling

Flask Backend

  • Control system state
  • Retrieve HTTP POST requests
  • Makes UART calls to FPGA
  • Phillips Hue interaction
  • Program FPGA

25

slide-26
SLIDE 26

ANGULARJS, $SCOPE AND HTML

  • AngularJS provides an easy way to

manipulate the DOM

  • (document object model)
  • Model View Whatever
  • Angular controller controls a section
  • f HTML
  • ng-controller=“dinoController”
  • Change values on $scope reflect in

the DOM

JS: var dinoapp = angular.module('dinolightApp',[]); dinoapp.controller(‘dinoController’, function($scope){ $scope.value = “CE SD Rocks” });

  • HTML

<div ng-app=“'dinolightApp”>

<div ng-controller=“dinoController”> “My value is {{ value }}” <input ng-value=“value”> </div>

</div>

26

slide-27
SLIDE 27

FRONTEND CODE

  • All controlled by 1 ng-controller
  • Each option is tied to a ng-value/ng-click
  • Responsible for syncing with backend
  • Gets the current system state on load
  • POSTs any changes to the backend
  • Different template for initial setup
  • Hue Bridge authorization
  • Connecting to Wi-Fi

Frontend Webapp

27

slide-28
SLIDE 28

CLIENT-SERVER MESSAGING

  • JSON based
  • Dictionary based command routing
  • OP
  • Program
  • Set
  • Get
  • Only have 1 POST endpoint to hit
  • Easily converted to web socket
  • Easily expanded

Turn on power {op: ‘set’, what: ‘power’, to: 1} Set hue IP {op: ‘set’, what: ‘hueIP’, to: ‘10.0.1.7’} Program FPGA {op: ‘program’}

28

slide-29
SLIDE 29

BACKEND OVERVIEW

  • Flask App running on a Raspberry Pi
  • Programs and Configures the FPGA
  • Calculates required values
  • Single POST endpoint
  • Communicates with Hue System
  • HTTP Post Requests to Hue
  • Saves config in .json file

29

slide-30
SLIDE 30

SERVER MESSAGE HANDLING

def init_command_router(self): return {'set': self.set, 'program': self.program} @app.route('/c', methods=['POST']) def command(): return str(system.processCommand(request.json)) def process_command(self, command): if 'op' in command: return self.commandRouter[command['op']](command) return 'Op not found‘ def set(self, command): if not 'what' in command: return 'Key "what" not found in command:'+ str(command) if not 'to' in command: return 'key "to" not found in command: ' + str(command) what = command['what'] to = command['to'] if what == 'power': self.power = to elif what == 'horzLeds': self.numHorzLED = to elif what == 'vertLeds': self.numVertLED = to return 'Set Success'

{op: ’set’, what: ‘power’, to: 1}

30

slide-31
SLIDE 31

SERVER & HUE

  • POST JSON requests to Hue-Bridge
  • translated to zig-bee commands
  • /api/<username>/lights/<id>

{ “hue” : 50000, “on”: true, “bri” 200 }

  • Brightness + Hue:
  • 12 hue API commands/s
  • 80ms between calls

31

  • Set transition time to 100 ms
  • Will interpolate from last color
  • Pushbutton on bridge to

authenticate

  • Retrieve username that needs to be

stored

slide-32
SLIDE 32

RISKS

Need a way to connect pi to Wi-Fi

  • Connect to Ethernet first
  • Use PiFinder-like app
  • Pings all devices on subnet, looks for

raspberry pi MAC

  • Give frontend the ability to

set WPA-config User Interface

  • Relying on customer to have

another modern device

  • Using webserver does complicate

the initial setup

32

slide-33
SLIDE 33

TESTING

33

slide-34
SLIDE 34

Test Writer: William Gowell Test Case Name Web app and Server communication Test ID: Description: The web app is the main source of input to the system. Make sure it can talk with the server Type: Black Box

Step

Action Expected Result Pass Fail N/A Comments 1 Open Web app URL Web app loads and opens showing current system information 2 Turn on the system The System loads last known configuration and turns on 3 Change System Configuration lets you know the changes are ready to be applied 4 Tell system to update System reboots with new configuration options 6 Let system reboot System Works, but operating under new configuration 7 Turn off system System Shuts down

Overall Test Results

34

slide-35
SLIDE 35

Test Writer: Zack Teasdale Test Case Name LED Communication Test ID: Description: Ensure that the FPGA can communicate with the LEDs. Type: Black Box Name of Tester: Date: Hardware Version: Time: Setup: Connect the LEDs to the FPGA via its external pins and jumper wires. Step Action Expected Result Pass Fail N/A Comments 1 Write data to LED Correct LED colors displayed on specified LED Overall Test Results

35

slide-36
SLIDE 36

Test Writer: William Gowell Test Case Name Setup Time Measurement Test ID: Description: Test how long the system takes to set up from start to finish. Type: Black Box Setup: System is not connected or set up at all; "Fresh out the box" state. Step Action Expected Result Pass Fail N/A Comments 1 Start a stopwatch Timer Starts 2 Setup system System is fully functional 3 Stop stopwatch Timer reads less than 15 minutes Overall Test Results

36

slide-37
SLIDE 37

GANTT CHART

Project Planning HDL Webserver Testing

37

slide-38
SLIDE 38

DEMO

http://wjg9331.student.rit.edu

38