* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Copy of Headband Datasheet - Oklahoma State University
Survey
Document related concepts
FTA receiver wikipedia , lookup
Rectiverter wikipedia , lookup
MIL-STD-1553 wikipedia , lookup
Serial digital interface wikipedia , lookup
Index of electronics articles wikipedia , lookup
Telecommunication wikipedia , lookup
History of telecommunication wikipedia , lookup
Automatic test equipment wikipedia , lookup
Telecommunications engineering wikipedia , lookup
History of wildlife tracking technology wikipedia , lookup
Opto-isolator wikipedia , lookup
Charlieplexing wikipedia , lookup
Transcript
Design of Engineering Systems Project Report Title Headband Author Names Steven Welch, Bruce Lebold, Alan Cheville Submission Date 9/28/09 Summary Describe what this product does Provide enough background information to put the project in context. Describe briefly inputs and outputs of the product (not a technical description). The Headband is part of the Modular Artificial Gaming Environment. MAGE is a collection of subsystems that work together to create and implement a real time real life role playing game. The MAGE system uses several different technologies to communicate with its subsystems and other players. The head band provides a method of receiving data from an attacking player and displaying some data for the other players in the game about the player’s health. The communications from the attacking player will be received using infrared and relayed to the receiving player's wearable computer using CANbus. The headband will receive a health packet that indicates the player's health status from the wearable computer and display it using LEDs visible to the other players in the game. Instructions Submit this report to the SharePoint site in Microsoft Word format. The report should be in Times New Roman or Arial font, no smaller than 10 point and double spaced. Note that all reports are scored on a 100 point scale. If the report is worth more or less than 100 points the score will be normalized to the points for the course DO NOT REMOVE TEXT OR BULLETS FROM UNDER SECTION HEADINGS! Description Provide a description of what your device does. Compare what you stated you would do in the proposal to the work you have actually done. Specifically you should: Write down a bulleted list of product features Provide a brief technical description (approximately two paragraphs). Provide a level 0 functional block diagram. This block diagram should be a physical layout of the product showing the physical location of connections to the device. Features: One main and two small satellite printed circuit boards each with display LED’s and IR sensors integrated. Satellite boards are connected to main headband board using 8 pin flat flex connectors. Three colors of LEDs (red, yellow, green) indicate player health status. LED’s flash to indicate critical health conditions. Headband uses standard 38 kHz, 950 nm surface mount IR sensors (Vishay TSOP36138). Headband system connects to MAGE using CANbus [2]. System is powered directly from CANbus, no on-board power is needed. Technical Description: The headband is an accessory to the MAGE gaming system [1] that is used both to detect incoming IR data packets and visibly display player health. The headband system consists of one main communication and processing board and two satellite display and detector boards. Infrared light data packets are detected by the IR sensors, and the data packet is then read by an onboard microcontroller. The microcontroller then relays the incoming data packet over CANbus to the MAGE system. The MAGE system responds by sending the headband an 80 bit packet that contains player health. For details on data packet format see the MAGE system documentation. When a properly formatted data packet is received over CANBus the headband microcontroller lights red, yellow and/or green LED’s on the main and satellite boards to visually display player health status. Details on the LED status indicators are given in the Principles of Operation section under the Detailed Technical Description. The headband boards and connecting cables are mounted onto a hat or other headgear by the user. In use the headband is mounted around the head with the three boards equally spaced at approximately 120. The use of three IR sensors allows detection of incoming radiation over 360. Beyond the CANbus interface, LED’s and IR detectors, the headband processor board also has a Brainstem RS-232 port for debugging and a SIP header for programming the microcontroller as shown in the figure below. Level 0 Functional Block Diagram of Headband: Figure 1 - Diagram of Headband main board showing system inputs and outputs 2 Product Block Diagram and pin out diagram. On one sheet of paper provide a level 1 functional block diagram of your product. On a separate sheet of paper provide a pin out table. The pin out table should match the Reference Designators from your layout and also the terminology used in your level 0 block diagram. LEDs: R,G,Y Main Board Satellite HIU 38 kHz IR Transmission LEDs: R,G,Y 2 wire differential pair LED Drivers: Operate R,G,Y LEDs based on 3 PIC outputs 38 kHz IR Transmission CAN bus: Provide CAN connection to HIU IR Receivers: 38kHz modulated IR Receivers: 38kHz modulated Satellite 38 kHz IR Transmission LEDs: R,G,Y AND Gate PIC 16F688 IR Receivers: 38kHz modulated Brainstem Connector Figure 2 - Headband Level 1 Block Diagram 3 5V Power Programming Header Table 1- Programming Header RefDes Pin I/O Description U21 1 I MCLR 2 Power +5V 3 Ground 0V 4 I PGD 5 I PGC 6 NA NC Table 2- Satellite Boards RefDes Pin I/O Description U4,U8 1 NA NC 2 NA NC 3 O Green 4 O Yellow 5 O Red 6 I IR Data 7 Power +5V 8 Ground 0V 1 Tabel 3- CANbus RefDes Pin I/O Description U7 1 Power +5V 2 I/O CAN Low 3 I/O CAN High 4 NA NC 5 Ground 0V Table 4- CANbus RefDes Pin I/O Description J1 1 Ground 0V 2 Power +5V 3 I/O CAN High 4 I/O CAN Low Table 5- Brainstem Header (TTL-RS232) RefDes Pin I/O Description U20 1 I Headband Receive 2 Power +5V 3 O Headband Transmit 4 Ground 0V Table 6- Test Points RefDes Pin I/O Description U6 1 Power +5V U12 1 I ANDed IR Data U14 1 Ground 0V Detailed Technical Description: Describe the principles of operation of your device in detail. Provide a brief description of the signals at all inputs, outputs and internal test points. Describe the test procedures used to verify proper device operation. Provide a brief description of debugging techniques and common problems the user might encounter with your device. Principles of Operation The headband has two functions in the MAGE system. It displays a player’s health status and receives MAGE packets that have been sent through IR transmission. To display the health status, the headband waits for a MAGE packet on the CAN buffer. The packet must be properly formatted or it will be ignored. The Team ID Value must be 255, the player ID value must be 0, and the Process ID value must be 0,1,2,3, or 4. Other values are ignored. Each Process ID correlates to a different light sequence: 0: Green and Yellow steady 1: Yellow steady 2: Red and Yellow alternating then steady 3: Red flashing then steady 4: Green steady To receive IR transmissions, the headband uses a protocol created within the IR.h header file in the MAGE code. The IR transmission is a 38kHz modulated signal. At the transmission side a period with two sets of pulses represents a 0 and a period with no signal represents a 1. The transmission protocol requires a start sequence of one set of pulses followed by 64 bits of data contained in the MAGE packet. Figure 3 shows an example of the first four bits of a transmission. Figure 3 - Example Transmission The IR receiver output is active low, so when a 38 KHz modulated signal is being received the output is 0V. Otherwise the output is 5V. The receiver has open-collector outputs with a built in pull-up resistor which causes two high-to-low transitions when the transmission for 0 is received. The output should remain at 5V if a 1 is received. The start transmission causes the receiver to create one high-to-low transition. The IR packet is decoded by interpreting the high-to-low transitions driven by the output of the IR receiver. Figure 4 shows the output of the IR receiver after receiving the signal from Firgure 3. 5 Figure 4 - Receive Example Description of Signals During normal operation the programming header and brainstem connector are unused, however the power and ground pins are active and can be used. All power and ground pins are tied to the power and ground of the headband supplied through the CAN connection. The satellite board connectors have a pin to power each LED which should output 5vdc whenever the LED is set on according to the light sequences. The IR data input will normally remain at 5vdc until modulated IR is received. Pull-up resistors on the inputs to the AND gate insure that if a satellite board is disconnected, data from the other IR receivers will still be decoded correctly. The CAN bus connections have power and ground pins which supply the headband with power. For current draw with different combinations of LEDs, refer to Table 14. There are also CANH and CANL which is a differential pair used to transfer data packets between all devices attached to the MAGE system. Test Procedures When powered on, the headband should show a light sequence where all LEDs turn on, one after another, then turn off in the same order. In order to verify the CAN hardware has properly initialized, you may connect a brainstem serial interface connector [3] to the headband. If the headband prints any messages, the CAN hardware has initialized. To further test the CAN functionality, send a headband packet, as described earlier, over CANbus. This can be done using the testing terminal on the HIU or by setting up a test PIC and CANbus module to send packets. If the correct light sequence is displayed, the CAN is working properly. Technical details on CANbus can be found in [4]. In order to test the IR you may use the mage system HIU [1] or a brainstem. When any IR data is received it will be printed over RS-232 through the brainstem connector at 9600 baud. The default settings in SIOW are used which include one start bit of 0 and one stop bit of 1. The IR data will also be sent over CAN. If the HIU is connected, it will print the received packet over its USB connection. This test will also demonstrate the functionality of the CANbus on the headband. For more information please refer to MAGE system documentation. Debugging A problem with the headband may occur if any hardware changes occur. This could affect the timing of the IR decoding. . If IR data is consistently incorrect, try adjusting the PERIOD definition in IR.h..To adjust the PERIOD, first measure the actual time of a one bit transmission from your IR transmitter. Then start 6 by setting PERIOD that the measured time and reduce it by 5 each time until the data received is accurate. The current value is 1950. Some users have reported that ambient light, particularly fluorescent light fixtures, interferes with reception of data packets. It may be worthwhile to test the system in a dark room if continued data reception problems are encountered to eliminate ambient light as a source of error. IR data packets can be monitored through a dedicated test point, refer to Table 6. An IR transmitter using the protocol in IR.h is needed to test the IR functionality. If one is not available, a PIC could be programmed to mimic the signal as it is given by the IR receiver. This signal would need to be applied to the IR Data test point. Note that for simple on-off test of the receiver a 950 nm LED modulated by a 38 kHz square wave from a function generator will suffice. Tables of Detailed Technical Specifications (15 points) Describe the models, drawing, simulations, etc. that your team used to understand and make predictions about your design project. You should write one to three paragraphs on each of the points below: List in tables measured values of all input and output pins to the device during normal operation. Provide graphs or figures of any: o Measured time dependent inputs, outputs, and signals at all test points. o Measured change in output with changing input parameters (e.g. Variation of gain with operating voltage for an amplifier) o Considering all components used list the Absolute minimum and maximum operating ranges. Tables 7-12 show the measured voltages at each pin during idle use with a 5.001V supply. Table 7- Programming Header Description Measured Voltage MCLR 4.936 +5V 4.999 0V 0.001 PGD 0.002 PGC 0.002 NC NC Table 10- CANbus Description Measured Voltage 0V 0.000 +5V 5.001 CAN High 2.992 CAN Low 2.067 Table 11- Brainstem Header Description Nominal Voltage TTL Receive 2.020 +5V 5.000 TTL Transmit 5.000 0V 0.002 Table 8- Satellite Boards Description Measured Voltage Green 0.140 Yellow 0.140 Red 0.140 IR Data 4.994 +5V 4.998 0V 0.002 Table 12- Test Points Description Measured Voltage +5V 4.999 IR Data 4.997 0V 0.002 Table 9- CANbus Description Measured Voltage +5V 5.001 CAN Low 2.067 CAN High 2.992 0V 0.000 7 Table 13 - Table of maximum/minimums for the Headband Supply Voltage Continuous Current Time to update LEDs IR receive rate Min 4.5V 0.018A Max 5.5V 0.126A 5 sec NA 400 bps 400 bps Table 14 – Current Draw (mA) With Different LED Sequences 0 LEDs 1 LED 2 LEDs 3 LEDs No Satellites 17 33 48 57 1 Satellelite 18 50 80 98 2 Satellites 19 67 112 139 Figure 5 - IR Data Tx/Rx The figure above shows the result of IR test transmission that shows the transmission and reception of IR data. The bottom waveform is the 38kHz modulated signal transmitted by the IR LED. The top waveform shows the reaction from the IR receiver. Sending a 38kHz square wave cause the receiver to output low after a 200 us delay. Seizing transmission then causes the receiver to go high after a 300 us delay. Each time the receiver output goes low, an interrupt is driven on the PIC and the IR signal is decoded. 8 Detailed application information You should write one to three paragraphs on each of the points below: Describe in detail how to use the device Describe in detail how to connect the device to other systems Describe common fault conditions and how to correct them Describe any variable voltages, resistances, currents, or any other user selectable hardware features Describe if necessary how to calibrate the device and or test for proper operation. Describe how to program any onboard memory or microprocessor Device Usage To use the headband only one connection is needed. A connection to CANbus (USB or legacy 0.1" SIP header connectors) supplying 5V is required for minimal operation. The current design fully supports a CAN connection to the HIU (version 3.2 or newer). After connecting the headband to the HIU and powering on the HIU, the headband will be fully operational. It will be waiting for CAN packets indicating a health status to display as well as IR packets to be echoed over the CAN bus. Modular Usage It may be desirable to use the headband for some other purpose than MAGE. The headband could act as an IR receiver for any system using CAN bus or RS-232 to communicate with devices. Either connection the CAN connector or the brainstem connector, will provide power to the headband as well as a means of communication To use the headband as a modular device, some modifications to the code may be necessary. If using the RS-232 connection the firmware will need to be modified. Also, the IR communication protocol is unique to MAGE, so any pre-existing protocol will need to be added to the headband firmware. Fault Conditions The most common fault condition is the reliability of the IR data. The MAGE packet has a built in checksum that can be used to verify data is correct. Data could be incorrect for several reasons: interference from other light/IR sources, multiple simultaneous IR transmissions, or an incorrect PERIOD setting in the IR.h code. If IR data is consistently incorrect, try adjusting the PERIOD definition in IR.h..To adjust the PERIOD, first measure the actual time of a one bit transmission from your IR transmitter. Then start by setting PERIOD that the measured time and reduce it by 5 each time until the data received is accurate. The current value is 1950. User Selectable Hardware The headband has one user selectable hardware feature. There is a set of DIP switched on the board. Switch 1 activates/deactivates a 120 Ohm termination resistor across the CANH and CANL pins. Normally this should be left on. If another device on the CAN bus provides a termination the switch should be off.(Switch 2 is unused) Calibration and Testing If the CAN bus is improperly terminated, communication may fail sometimes or consistently. If the IR PERIOD is set incorrectly data will be interpreted incorrectly. Calibrations that may be required include enabling/disabling the CAN termination resistor and setting the IR PERIOD definition in the IR.h header file. Both of these processes are outlined previous to this section. When powered on, the headband should show a light sequence where all LEDs turn on, one after another, then turn off in the same order. A visualization of the LED startup pattern is shown below. 9 Figure 6 - LED Start Sequence To test the CAN functionality, send a headband packet, as described earlier, over CANbus. This can be done using the testing terminal on the HIU or by setting up a test PIC and CANbus module to send packets. If the correct light sequence is displayed, the CAN is working properly. In order to test the IR you may use an HIU or a brainstem. When any IR data is received it will be printed over RS-232 through the brainstem connector at a baud rate of 9600 bps. It will also be sent over CAN. If the HIU is connected, it will print the received packet over to the terminal through its USB connection. This test will also demonstrate the functionality of the CANbus on the headband. Programming the Microcontroller To program the PIC16F688 on the headband follow the steps listed below: Remove the two LED jumpers Power the headband from an external power supply or by connecting it to an active CAN connection. Open MPLAB Select the proper device(pic16f688) Select the ICD 2 Programmer Import the .hex file you wish to program to the headband Insure the ICD Programmer is connected to the computer’s USB port Connect the programmer to the programming header Click the program button in MPLAB and wait for completion Replace LED jumpers Remove programmer from programming header Application Example Describe in detail an example of how the device would be used by the end user. Provide a connection diagram specifying needed hardware, cables, power supplies, etc. The headband and its satellite boards will need to be mounted in some sort of headgear to be worn by the user. This allows IR transmissions to be received by the user and makes the health status visible to other players. The IR receivers were designed to be placed around the user’s head at 120 degree intervals to allow IR reception from any direction. This should be considered when mounting the headband in headgear. The headband board is mounted by four 1/8 inch through holes. The two satellite boards are also mounted through four 1/8 inch holes. The mechanical dimensions and hole spacings are shown in the figures below. 10 Figure 7 - Headband Mounting Figure 8 - Satellite Mounting The headband is intended to be used as a peripheral in MAGE. It acts as a receiver for IR packet transmissions and as a health status display to other players. Using the headband with MAGE requires the headband be connected to the HIU through a CAN connector. This will power the headband and provide a communication channel between the devices. A connection diagram for the headband in the MAGE system can be seen below[1]. 11 Figure 9 - Connection Diagram References Use the IEEE Style. Details can be found on the course web site or in the IEEE Authors Manual. References must be cited in the body of the text. [1] Oklahoma State University, “Gaming System Headband,” MAGE System Headband, 2009. [Online]. Available:https://stillwater.sharepoint.okstate.edu/ecendesign/projects/Headband/Shared%20Docume nts/Gaming%20System%20Headband.docx. [Accessed: Oct. 4, 2009]. [2] Baker, B. C., "Ease into the Flexible CANbus Network", Microchip Analog Design Note ADN004, 2003 [Online]. Available: http://ww1.microchip.com/downloads/en/DeviceDoc/adn004.pdf [Accessed, Oct. 9, 2009]. [3] Brainstem connectors convert TTL serial to RS-232 levels and are manufactured by Acroname Robotics. More information can be found at Acroname's web site [Online]. Available: http://www.acroname.com/robotics/parts/S13-SERIAL-INT-CONN.html [Accessed Oct. 29, 2009]. [4] Richards, P., "A CAN Physical Layer Discussion", Microchip Application Note AN228, 2002 [Online]. Available: http://ww1.microchip.com/downloads/en/AppNotes/00228a.pdf [Accessed, Oct. 9, 2009]. 12 Appendix Provide any relevant diagrams, schematics, PCB Layouts, Code, or other technical documentation. All current headband code will be located at: https://launchpad.net/headband/+download 13 Figure 5 - Headband Schematic Figure 10 - Headband PCB Layout Figure 11 - Satellite Schematic