optical encoder for a game steering wheel -...

49
Optical Encoder for a Game Steering Wheel End-Product Design Report: May05-26 Client: Thomas Enterprises David Thomas Sr., President David Thomas Jr., Vice President Faculty Advisors: Dr. James Davis Dr. Douglas Jacobson Team Members: Samuel Dahlke CprE Peter Fecteau CprE Daniel Pates EE Lorenzo Subido EE DISCLAIMER: This document was developed as a part of the requirements of an electrical and computer engineering course at Iowa State University, Ames, Iowa. This document does not constitute a professional engineering design or a professional i

Upload: builiem

Post on 21-May-2018

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Optical Encoder for a Game Steering WheelEnd-Product Design Report: May05-26

Client: Thomas Enterprises

David Thomas Sr., PresidentDavid Thomas Jr., Vice President

Faculty Advisors: Dr. James Davis

Dr. Douglas Jacobson

Team Members: Samuel Dahlke CprE

Peter Fecteau CprE

Daniel Pates EE

Lorenzo Subido EE

DISCLAIMER: This document was developed as a part of the requirements of an electrical and computer engineering course at Iowa State University, Ames, Iowa. This document does not constitute a professional engineering design or a professional land surveying document. Although the information is intended to be accurate, the associated students, faculty, and Iowa State University make no claims, promises, or guarantees about the accuracy, completeness, quality, or adequacy of the information. The user of this document shall ensure that any such use does not violate any laws with regard to professional licensing and certification requirements. This use includes any work resulting from this student-prepared document that is required to be under the responsible charge of a licensed engineer or surveyor. This document is copyrighted by the students who produced this document and the associated faculty advisors. No part may be reproduced without the written permission of the senior design course coordinator.

i

Page 2: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

1 Monday, May 08, 2023Table of Contents1.1 List of Figures iii1.2 List of Tables iv1.3 List of Definitions v

2 Introductory Material 12.1 Executive Summary 12.2 Acknowledgement 22.3 Problem Statement 22.4 Solution Approach 22.5 Operating Environment 32.6 Intended Users 32.7 Intended Uses 42.8 Assumptions 52.9 Limitations 52.10 Expected End-Product and Other Deliverables 5

3 Approach Used and Detailed Design 63.1 Approach Used 6

3.1.1 Design Objectives 63.1.2 Functional Requirements 63.1.3 Design Constraints 63.1.4 Technical Approach Considerations and Results 6

i

Page 3: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

3.1.5 Testing Approach Considerations 73.1.6 Recommendations Regarding Project Continuation or Modification 8

3.2 Detailed Design 83.2.1 Optical Encoders 8

3.2.1.1 Encoder Background Information 83.2.1.2 Optical Encoder Operation 93.2.1.3 Encoder Selection and Installation 10

3.2.2 Power Supply 123.2.3 Circuit Board Design 153.2.4 Electrical Design Summary 183.2.5 Microcontroller Design 19

4 Resources and Schedules 214.1 Resource Requirements 21

4.1.1 Personnel Effort Requirements 214.1.2 Other Resource Requirements 214.1.3 Financial Resource Requirements 21

4.2 Schedules 21

5 Closing Material 215.1 Project Team Information 21

5.1.1 Client Information 215.1.2 Faculty Advisors Information 215.1.3 May05-26 Team Members Information 21

5.2 Summary 21

ii

Page 4: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

1.1 List of FiguresFigure 1 – Steering wheel components 3Figure 2 – Racing game 4Figure 3 - Testing phases 8Figure 4 - Timing diagram of optical encoder quadrature output 10Figure 5 - Optical encoder 11Figure 6 - Mechanical drawing of the optical encoder. 11Figure 7 - Top view of Steering wheel assembly. 12Figure 8 - Drawing of the wall transformer for the encoder power supply. 13Figure 9 - Drawing of the output plug from the power supply. 13Figure 10 - Schematic of the power jack 14Figure 11 - Photo of the power jack 15Figure 12 - Current PCB 16Figure 13 - Schematic of the current PCB 17Figure 14 – Data flow for microcontroller 20Figure 15 – Original personnel efforts requirement estimate 21Figure 16 - Revised personnel effort requirements estimate 21Figure 17 – Original other resource requirements estimate 21Figure 18 - Revised other resource requirements estimate 21Figure 19 – Gantt chart for project tasks 21Figure 20 – Gantt chart for deliverables 21

iii

Page 5: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

1.2 List of TablesTable 1 - Transitions of the encoder output and how they are interpreted 10Table 2 - List of parts needed for upgrading client’s current product 19Table 3 – Original personnel effort requirements estimate 21Table 4 – Revised personnel effort requirements estimate 21Table 5 – Original other resource requirements estimate 21Table 6 - Revised other resource requirements estimate 21Table 7 – Original financial requirements estimate 21Table 8 - Revised financial requirements estimate 21Table 9 - Revised financial requirements estimate (continued) 21

iv

Page 6: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

1.3 List of Definitions

The following terms are used throughout this report and may not be widely known or understood.

American wire gauge (AWG): A standard system for measuring and classifying the thickness of wire conductors.

Analog to digital conversion (ADC): The process of converting a signal from analog voltages to digital ones and zeros.

Assembly language: Programming language one level above binary machine code.

C: Programming language used for many hardware systems.

Cycles per revolution (CPR): The maximum rate at which voltage pulses come out of an optical encoder.

Breadboard: Structure used for the quick assembly/destruction of small circuits for the purpose of testing.

Hardware interface driver (HID): Software that converts hardware output into a standard from that can be used by computers.

Integrated circuit (IC): Small electrical single-function or multi-function device

Microcontroller: Device responsible for receiving and handling electrical signals from the various steering wheel devices.

Optical encoder: Small device used to detect rotational movement. Its resolution is determined by the number of ticks that it can detect through one full rotation.

Printed circuit board (PCB): Structure that holds small electrical components and their respective connections.

Potentiometer: Variable resistor. Potentiometers are commonly used in speaker devices to change the volume.

SPICE: Software used primarily for circuit simulation.

Universal serial bus (USB): Standard port that allows connection to external devices (such as digital cameras, scanners, and mice) to computers.

v

Page 7: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

2 Introductory MaterialThis section will introduce the project and specifically define the problem statement. Topics discussed are the problem statement, operating environment, intended users and uses, assumptions and limitations, and the expected end product and deliverables.

2.1 Executive SummaryIowa State University’s computer/electrical engineering senior design team has been invited to upgrade a video game steering wheel for Thomas Enterprises’ product line. Specifically, they would like an updated steering wheel design with optical encoders; currently, potentiometers are responsible for the steering wheel and pedals input. The optical encoders will offer greater resolution and better performance from the steering wheel.

The new solution must use the optical encoders specified by Thomas Enterprises, remain compatible with the current software, and be cost efficient.

Optical encoder: Thomas Enterprises has recommended the S1-512 optical encoder from Digi-Key. It provides a resolution of 2048, but also draws significantly more power than the currently used potentiometers.

Compatibility: The design should offer a solution which uses the same hardware interface drivers that the current steering wheels use. The current steering wheel uses standard hardware interface drivers that work through a universal serial bus.

Cost: The design solution should cost no more than $150. This cost only covers the new parts required and does not included the price of the optical encoders and labor costs.

In order to make the steering wheel work with the optical encoders, several components need to be added to the current design as well as modified. The components include an external power supply and a new microcontroller.

Power supply: Currently, the entire steering wheel circuitry runs on power received from the USB port that the steering wheel plugs into. However, the optical encoders draw significantly more power than the currently used potentiometers, so it is necessary to add a power supply to the system in order to run the steering wheel properly.

Microcontroller: An 11-bit microcontroller must be selected to handle the resolution of the optical encoders. It is recommended that a microcontroller from Microchip Technology be used, because the assembly code written for current microcontroller will be easily ported to the new one. The microcontroller may or may not have USB supported. In the event that it does not, a separate USB chip will have to be selected. However, the second solution is not recommended because it will greatly increase the complexity of updating the current assembly code.

The team has designed a solution that will cost less than $20 to produce. Implementation will begin in January 2005 and testing in February 2005. A working prototype is expected by April 2005.

1

Page 8: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

2.2 AcknowledgementSpecial thanks go to Thomas Enterprises of Anamosa, Iowa. Thomas Enterprises, the client of this project, has provided the video game controller hardware and racing simulation software for the team to use in researching the team’s design.

Appreciation is also expressed to Andrew Bice of Iowa State University’s Center for Industrial Research and Service. Mr. Bice designed the original USB interface PCB and will provide the team with the technical documentation generated during the original design.

Faculty advisors Dr. Doug Jacobson and Dr. Jim Davis have also provided guidance and advice for this project. Gratitude is expressed for their efforts.

2.3 Problem StatementThomas’ current products are capable of sensing 255 positions on the steering wheel and pedals and they also accept 16 pushbutton inputs. The output of the PCB connects to a personal computer through a USB cable. The desired upgrade would be a direct replacement for the current sensors and PCB. The ideal solution would be capable of sensing at least 1024 positions and retaining all 16 pushbutton inputs. The end-product should cost on the order of $30 - $50 but no more than $150, not including the price of the encoders.

2.4 Solution ApproachThe solution for this project requires using optical encoders that will replace the potentiometers that are currently being used to sense the position of the steering wheel and pedals. The encoders will have the desired resolution to provide the precision control that is required for this application. The encoders will be mounted in the same position as the current potentiometers.

The current microcontroller senses the input from the wheel, pedals, and pushbuttons and sends output to the computer through a USB cable. The microcontroller will most likely need to be replaced by another microcontroller that is capable of accepting the higher resolution input and all the pushbutton functions. Computer code will need to be written in order to send instructions to the microcontroller. The code may be written in C or assembly language. Figure 1 illustrates the different components on the current steering wheel design.

2

Page 9: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 1 – Steering wheel components

2.5 Operating EnvironmentThe video game controllers are used with personal computers. In most instances the controllers will be used indoors, or in similar conditions where temperature, moisture, and other environmental factors will be controlled.

The typical conditions for use are:

Temperature of approximately 70°F

No moisture

Mostly dust-free conditions

Thomas Enterprises does operate a scaled race car simulator that is taken to local community events. The controller must operate in an outdoor environment under this circumstance, although the simulator would not be operated under adverse weather conditions.

The product is relatively robust and strong mechanically, such that it will last a long time under normal use. Even though it is durable and strong it is not intended to be dropped or thrown, but could withstand a drop from approximately 2 - 3 feet. The steering wheel assembly is attached to a desk or table for use by a bracket similar to a C-clamp. The pedals sit on the floor and are heavy so that they will stay in place when the pedals are pushed.

2.6 Intended UsersThe intended users of this product are serious video gamers, race car drivers, and others who would play racing games on a personal computer and demand a high quality product with high sensitivity from the controller input. The typical description of a person

3

Potentiometer

PCB

USB

Microcontroller

Page 10: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

who fits into the category of the intended users is age 12–30 with a familiarity with computers. Described above is the typical user, but many other people can use and enjoy the product.

2.7 Intended Uses It is intended that a person would use this product in their home at a table or desk on video games that are played on a personal computer. The controller is interfaced to the computer via the standard hardware interface drivers (HIDs) that are currently being used. The most common games used with the controller are racing simulation games. Thomas Enterprises also has customers who are interested in controllers for other simulations, such as semi truck driving. It is assumed that this controller will not be used on video game consoles such as Sony Playstation® or Nintendo Gamecube®. It cannot be used to with every video game; it only controls games that accept input from the steering wheel device. The figure below shows a typical racing game that can make use of the steering wheel.

Figure 2 – Racing game

4

Page 11: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

2.8 AssumptionsThe team assumes the following statements in the design of the project solution:

The team should be able to modify and use some of the existing assembly code so that the code can be written in a much shorter amount of time.

All the original schematics, documentation, part numbers, computer code, and other relevant data from the design of the original PCB still exist and are available for the team’s use.

Any additional power that is needed will be supplied by a secondary power source, instead of solely operating from the USB power.

2.9 LimitationsThe project solution must operate under the following limitations:

A replacement PCB should be of the same dimensions as the original so that it can be replaced in existing products.

Optical encoders should be able to be placed in the same location as the current potentiometers so that existing products can be easily upgraded.

Cost should be kept within the $150 budget; further funding will have to be requested from Thomas Enterprises

The PCB should have all the same connections, inputs, and outputs as the existing PCB.

2.10 Expected End-Product and Other DeliverablesThe end-product will include:

Optical encoders that will be used to provide much greater input sensitivity. The optical encoders will be direct replacements for the analog potentiometers that are currently being used.

A PCB which receives input from the encoders and pushbuttons and sends output to the computer through a USB cable. The USB interface PCB should be able to discern at least 1024 positions of the steering wheel and foot pedals. The PCB should be of the same external dimensions of the original board so that it may be directly replaced in existing products.

The minimum required quality of the end-product is at least of prototype quality, although the higher quality and reliability that the team has time to design and test, the better. If a suitable outside vendor can be found to manufacture the PCBs in high volume for Thomas Enterprises, then it should be fairly simple to implement the circuit design in a way that is robust enough for high volume manufacturing.

Thomas Enterprises may also wish to have technical documentation, specifications, and instructions that will fully explain the operation of the encoders and USB interface PCB. They have not asked for this to be delivered, but it may be possible to deliver these items so they can provide a higher level of service on their products.

5

Page 12: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

3 Approach Used and Detailed DesignThe proposed approach to the design of the end-product and statement of work is discussed in this section.

3.1 Approach UsedThe following sub-section addresses the team’s approach to the problem statement. Discussed topics are project requirements, constraints, and management procedures.

3.1.1 Design ObjectivesThe new circuit design should recognize at least 1024 positions in the steering wheel and pedal assembly. The steering wheel should maintain USB connectivity and button functionality. Costs should be under $150 for the circuit board fabrication and parts, not including the price of the encoders.

3.1.2 Functional RequirementsThe project solution must meet the following functional requirements:

Longevity of the product: The new steering wheel controller design with optical encoders should last longer than the potentiometer design and require little or no replacement.

Higher resolution: The optical encoders should recognize at least 1024 positions for the steering wheel. This will, in turn, provide a more realistic gaming experience to the end user.

16 function buttons: The controller should maintain the 16 button layout with each button fully customizable from within the software.

3.1.3 Design ConstraintsThe project solution must adhere to the following constraints:

Dimensions: The dimensions of the finished PCB should be no larger than the current design of 13.5 cm x 6 cm.

Wear and tear: The product should be sturdy and be able to handle racing simulations, which can include long usage periods for the steering wheel and pedals. With the replacement optical encoders, it will no longer be necessary to maintain the internal workings of the controller.

USB power requirements: The USB connection will provide a limited amount of power. It is likely that a power supply will be needed.

3.1.4 Technical Approach Considerations and ResultsThe project solution will address the following technology considerations.

USB connectivity: The device will use USB to connect to the computer, using the same HIDs that the current PCB uses. There is no reason to migrate to a different type of connection, when there are already working drivers.

6

Page 13: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Optical encoders: In one revolution of turning, the wheel should have at least 1024 positions. Optical encoders will also be installed on the pedals. The optical encoders will replace the potentiometers in the current device.

Microcontrollers: There are a number of microcontrollers available that will suit the purpose, but using a microcontroller with built-in USB communications would be simpler to design for because there would be fewer components to add to the circuit board.

A new microcontroller will need to be selected for the design. At least an 11-bit input microcontroller is needed, in order to send the high resolution output through the USB cable. The USB connection would preferably be on the microcontroller, but it could possibly be implemented in with a separate USB chip on the board.

Using the optical encoders provided by Thomas’ Enterprises, an external power supply will be used to power these optical encoders.

The construction of the new PCB can be in done in a few stages. The first stage will include a schematic for the new layout including the connections to the optical encoders. The second stage will be the actual assembly of the parts onto a breadboard, testing for functionality. Some adjustments will be made to compensate for the real specifications for each part, instead of having ideal outputs and specifications. The third stage will be the final implementation of the PCB which will represent the prototype; the design will be sent to be fabricated.

After a prototype is built, adjustments can be made to the assembly code for the encoder and other data output to interface with the current HIDs properly.

3.1.5 Testing Approach ConsiderationsThe finished product should function with the provided simulation racing software. Each of the buttons should be programmable within the game. If any major changes were made to the USB driver, the connection should be tested across multiple platforms to ensure compatibility with most modern computers.

Initial lab testing will be carried out by the team members. This stage of testing will include functionality of the assembly code and microcontroller outputs. These results will be compared against the calculated outputs. The assembly code should compile and run without errors; the microcontroller should be checked for proper communication with the assembly code and USB interface. Lastly, the USB interface should be checked for compatibility with a variety of computers and operating systems, to ensure that the finished product will work on any prospective user’s computer.

Once the controller is operational, testing will be performed by a gaming enthusiast or one that is interested in racing simulation. This phase of testing will evaluate the performance of the steering wheel and foot pedal sensitivities in the racing simulation software.

Upon completion of these two testing periods, the final test will demonstrate the functionality to the company, Thomas Enterprises. The end design will be presented to show that the improvements meet or exceed the expectations, in terms of cost and functionality. Figure 3 shows the major testing phases for the project.

The original steering wheel limitations that were earlier noted should now be compared to the results of the optically encoded steering wheel.

7

Page 14: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 3 - Testing phases

3.1.6 Recommendations Regarding Project Continuation or ModificationThough the original circuit design must be altered, the new design should not be difficult to implement. There will be some additional costs for new optical encoders, microcontrollers, and microcontroller programmers. If there is no single chip solution for the microcontroller, an additional cost will be added for the USB controller.

3.2 Detailed DesignThis section details the design of the electrical components of the video game controller. The necessary components and their interconnection will be explained.

3.2.1 Optical EncodersThis section explains how the encoders will be used to sense the position of the steering wheel and pedals and how the encoders will interface with the rest of the components.

3.2.1.1 Encoder Background InformationThis section explains how the original design works. This is important for understanding how the upgraded design will enhance the performance of the system.

The purpose of this project is to increase the resolution and sensitivity of the video game steering wheel controller. To achieve this goal the potentiometers that are currently being used will be replaced with optical encoders.

The current design uses potentiometers connected to the steering wheel and foot pedals. The potentiometer is used in a voltage divider circuit. The analog voltage across the potentiometer is sampled by the microcontroller. The microcontroller used in the

8

Hardware and software functionality

Platform compatibility

Demonstration to client

Page 15: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

original design has 8 channels of 8-bit analog to digital conversion. The analog voltage is converted to an 8-bit binary word. The microcontroller uses the digital word to keep track of where the steering wheel and foot pedals are, and which way they are moving. The output is eventually sent to the computer through a USB connection that is built into the microcontroller.

The current system is limited by the 8-bit wide channels on the ADC. This only provides, at most, 256 possible positions of the wheel and pedals. The sensitivity is also limited by the analog potentiometers. The output voltage of the potentiometer is not sensitive enough to changes in the angular position of the input shaft.

Optical encoders can be purchased in many different levels of resolution. Generally the higher the resolution, the more expensive they are. The type of output generated by the encoder also determines the level of resolution. The client would like to have at least a resolution of 1024 positions per revolution of the steering wheel.

3.2.1.2 Optical Encoder OperationThis section explains the operation of the optical encoders that will be used in the design.

The most popular type of encoder for applications is an encoder with quadrature output. Quadrature refers to the fact that the signals produced by the encoder are 90° out of phase with each other. The encoder has two channels, A and B, and some models also have an index output. As the input shaft of the rotary encoder is rotated square waves are produced on channels A and B. The rate at which the square waves click out of the encoder depends on how fast the input shaft is rotated. The direction the input shaft of the encoder is being rotated can be determined by looking at which voltage waveform is leading, channel A or channel B. The index output goes high when both channels A and B are low. The index output will not be used in the design.

The most attractive feature of the encoder with quadrature output is that the two square waves give four transitions per cycle, high-to-low and low-to-high on each channel. This effectively increases the resolution by four times the maximum CPR. For the design an encoder with a maximum CPR of 512 will be used, so that the overall resolution will be 4 x 512 = 2048.

The diagram shown below in Figure 4 illustrates the timing of the output waveforms of the optical encoder. As can be seen, channels A and B are 90° out of phase and the index goes high when both inputs are low. The timing diagram is from the US Digital data sheet.

9

Page 16: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 4 - Timing diagram of optical encoder quadrature output

As mentioned above, monitoring the output channels of the encoder provides information about how fast the input shaft is being rotated and which direction it is being rotated. The most recent state of the encoder’s output channels can be stored in memory and when the channels are sample the next time the current state is compared to the previous state. It is necessary that the microcontroller be able to sample the encoders faster than they are capable of changing, or else some transitions will be missed. In general, the clock speed of the microcontroller will be much faster than the speed at which a human would be capable of turning the wheel or moving the pedals.

Table 1 below summarizes the possible transitions of the encoder outputs and how they are to be interpreted by the microcontroller. The table is shows the outputs as the state of A and B (A, B.)

Table 1 - Transitions of the encoder output and how they are interpreted

The transitions of the encoder output shown above in Table 1 are the desired transitions. There are also unwanted transitions that may occur. The unwanted transitions are: 0,0 to 1,1; 1,1 to 0,0; 0,1 to 1,0; and 1,0 to 0,1. When these transitions occur, it means that at least one state was missed. The microcontroller code must contain instructions to handle these situations.

3.2.1.3 Encoder Selection and InstallationThis section explains the encoder that was chosen for this project and the issues related to installing it in the video game controller.

10

Page 17: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

The optical encoders for this project were provided by the client. The encoder provided is manufactured by US Digital and is the manufacturer’s part number S1-512. The S1 is an incremental rotary shaft encoder with a sleeve bushing and ball bearing. The price for one encoder is $49 and the price for 100 encoders is $39 each. The S1-512 optical encoder is shown below in Figure 5. A mechanical drawing of the encoder is shown in Figure 6, and the dimensions are shown in inches. The following drawings are from the US Digital data sheet.

Figure 5 - Optical encoder

Figure 6 - Mechanical drawing of the optical encoder.

The encoders require a 5 V DC supply voltage. The typical supply current for this model and CPR specification is 27 mA, and the maximum input supply current is 30 mA. The encoders will require an external DC power supply which will be discussed in section 3.2.2.

Two of the most important characteristics of the optical encoders are the diameter of the input shaft and the CPR of the output. The diameter of the input shaft must be correct so that it can properly mate up with the steering wheel. Figure 6 shows how the encoder and the steering wheel connect using a rubber sleeve. The output waveforms from the encoder must have a CPR of 256 so that a total resolution of 1024 can be achieved. The

11

Page 18: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

encoders that were provided for this design have a CPR of 512, which is more than enough resolution.

One encoder will be installed onto the output shaft of the steering wheel. Three encoders will be installed in the foot pedal housing, one for the gas, brake, and clutch. The encoders will all be installed in the location of the potentiometers that are currently being used. In Figure 7, the potentiometer can be seen at the top, connected to the steering wheel.

Figure 7 - Top view of Steering wheel assembly.

3.2.2 Power SupplyThis section discusses the power supply that is needed for the operation of the optical encoders.

Currently there is no external power supply to the video game controller. The voltage supplied to the circuit comes from the USB cable. The encoders require a power input for the LED and circuitry that generates the output signals. The required input is 5 V DC and a maximum current of 30 mA. With a total of four encoders a total maximum of 120 mA needs to be supplied. The USB cable will not be capable of supplying this load, so an external power supply will be necessary.

The power supply chosen for this design converts 120 V AC, 60 Hz, from the wall outlet into 5 V DC. It has a maximum output current of 300 mA and the output voltage is regulated to within 5%. The manufacturer is CUI Inc. and it can be ordered from Digi-Key. The price is $8.10 for one or $5.38 for one hundred. The manufacturer’s part number is DPR050030-P6P and the Digi-Key part number is T309-P6P-ND.

The dimensions of the wall transformer and the plug are shown below in Figure 8 and Figure 9. The drawing of the transformer is from the manufacturer’s data sheet and the

12

Page 19: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

dimensions are in millimeters. The drawing of the plug is from Digi-Key and the dimensions are given in inches and millimeters are in parentheses.

Figure 8 - Drawing of the wall transformer for the encoder power supply.

Figure 9 - Drawing of the output plug from the power supply.

A power jack will need to be installed on the case of the video game controller to accept power from the output plug of the wall transformer. The jack could be installed on the steering wheel assembly or the pedal assembly because both will require power. It will be more convenient to install the jack on the steering wheel assembly because it will be easier to access for the user. A technical drawing and a photo of the jack are shown below in Figure 10 and Figure 11. The drawing and photo are from Digi-Key.

13

Page 20: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 10 - Schematic of the power jack

Page 21: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 11 - Photo of the power jack

The power jack can also be ordered from Digi-Key. The price is $0.38 for one or $0.26 for one hundred. The manufacturer is CUI Inc. The manufacturer’s part number is PJ-002B and the Digi-Key part number is CP-002B-ND.

Once the power is connected to the video game controller it must be routed to the encoders. The power from the jack will be wired to the encoder connected to the steering wheel. Power will also need to be routed to the pedal assembly and distributed to each of the three encoders for the pedals. Currently a cat 5 cable with RJ-45 connections connects the steering wheel and pedal assemblies. A standard cat 5 cable consists of 8, 24 American wire gauge wires. Of the 8 total wires, 6 carry the output of the encoders to the microcontroller. The remaining 2 wires can be used to carry power and ground for the power supply to the encoders. According to the Handbook of Electronic Tables and Formulas, the current carrying capacity of 24 AWG wire is 577 mA. Only 90 mA is supplied through these wires, so the cat 5 cable should work fine for connecting power between the steering wheel assembly and the pedal assembly.

3.2.3 Circuit Board DesignThis section discusses the design of the circuit board that connects the encoders and pushbuttons to the microcontroller, and the microcontroller to the computer.

The printed circuit board is located in the steering wheel assembly. The PCB design will be the same, or very similar, in dimension to the current PCB. This will allow an easy upgrade of existing video game controllers. The current PCB can be seen in Figure 12. A cat 5 cable with a RJ-45 connection connects the steering wheel assembly to the foot pedal assembly. A RJ-12 connection connects the pushbutton inputs to the PCB. The steering wheel and shifter are connected to the PCB through the jumper pins along the periphery of the PCB. The USB output connects the microcontroller to the computer that is running the simulation software.

Page 22: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 12 - Current PCB

A schematic representation of the current PCB is shown in Figure 13. The resistors are used to help limit the current that flows into the microcontroller. The capacitors are used in the oscillator circuit for the microcontroller’s clock and also as filters to help stabilize the power supply voltages to the microcontroller. The crystal oscillator operates at a frequency of 6 MHz. The resistor and capacitor values used on the new board will be very similar, if not identical to the current design. The resistors used on the PCB all have a standard tolerance of 10%.

Page 23: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 13 - Schematic of the current PCB

Page 24: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

The new PCB will be very similar to the current design. The package and pin-out of the new microcontroller will be the same as the current design. The current clock frequency is 24 MHz derived from a 6 MHz crystal oscillator. The new microcontroller’s clock speed can be as high as 48 MHz, so the crystal oscillator circuit may need to be redesigned. The microcontroller will draw more supply current as the clock speed is increased, so it would be best to make the clock frequency as low as possible so that the current drawn by the microcontroller is minimized. Although, the clock must run fast enough to ensure that the encoder channels are sampled fast enough, so that no transitions of the state of the encoders is missed.

If the microcontroller draws too much current it will not suitable to supply power the microcontroller through the USB cable. The maximum supply current for the microcontroller is 250 mA. If the microcontroller needs to be connected to the external power supply the DC power supply will need to be upgraded to supply the additional current. This will add a cost of about $10 per power supply.

The new PCB will no longer reading in an analog voltage from potentiometers; instead it now samples the digital outputs of the encoders. There are four encoders with two channels each, so there are eight bits to be sampled from all encoders. The functionality of the pushbutton switches will also be retained in the design.

The new PCB will be laid out using Eagle circuit board design and layout software. Andrew Bice (of Iowa State University’s Center for Industrial Research and Service) has offered to provide the use of this software and guidance on how to use the software.

3.2.4 Electrical Design SummaryThis section summarizes the design of the electrical components for the video game controller. This section does not include any information about the microcontroller or the assembly code written for the controller.

The potentiometers will be replaced by optical encoders. Instead of sampling an analog voltage and converting it into a digital signal, the digital output of the encoders will be sampled directly. Monitoring the transitions of the state of the encoder’s outputs determines which way the steering wheel or pedals are moving. The rate at which the transitions occur determine how fast the steering wheel or pedals are moving.

The encoders will require an external power supply. A 5 V DC AC to DC adapter will be used to power the encoders. A power jack will also be installed on the steering wheel assembly to allow the 5 V input to be conveniently connected to the video game controller.

The PCB that connects all the components to the microcontroller, and the microcontroller will be very similar the current PCB. The main difference will be that two outputs from each encoder will need to be routed to the microcontroller. The encoder outputs do not need to be converted from analog to digital on board the microcontroller because the outputs are already digitized by the encoders themselves.

The table below summarizes the parts that will be needed for the electrical design. This table does not include the microcontroller or any programmer or other device that may be needed, related to the microcontroller.

Page 25: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Table 2 - List of parts needed for upgrading client’s current product

3.2.5 Microcontroller DesignThis section will discuss the design of the microcontroller, which processes the signals from the encoders and buttons, focusing on the software written for it.

As is shown in Figure 14, the microcontroller receives input from the four optical encoders and the 16 buttons. The encoder quadrature data will be processed to yield the direction and speed of the wheel and pedals. The buttons' data does not require processing.

The processing of the optical encoder data will be done after the inputs are stored in a buffer. The buffer will then be read to find the transitions indicating direction. The transitions, and the speed at which they occur, will be used to update the stored data on the wheel and pedal locations.

This position data will be output to a USB encoder. At the host computer, this USB data will be decoded by the computer's USB system, then converted to the control input for the game program by the driver software.

Page 26: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 14 – Data flow for microcontroller

Page 27: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

4 Resources and SchedulesThe resource requirements and schedules are discussed in this section. This section will be a prime indicator of whether or not the project has been a success upon the completion of the project.

4.1 Resource RequirementsThe following sub-section covers the time and money required for the project to be completed successfully.

4.1.1 Personnel Effort RequirementsThe team members have estimated the required effort needed to complete the project tasks successfully. Table 3 displays the original estimates that were made at the start of the project in terms of the number of hours of work expected to complete each project task successfully in addition to the total time expected to complete the entire project successfully. Figure 15 displays the information graphically. Table 4 and show the revised estimates.

Table 3 – Original personnel effort requirements estimate

Page 28: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 15 – Original personnel efforts requirement estimate

0 50 100 150 200 250

Problem Definition

Technology Considerationand Selection

End-Product Design

End-Product PrototypeImplementation

End-Product Testing

End-Product Documentation

End-Product Demonstration

Project Reporting Dahlke, SamuelFecteau, PeterPates, DanielSubido, Lorenzo

Page 29: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Table 4 – Revised personnel effort requirements estimate

Page 30: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 16 - Revised personnel effort requirements estimate

0 50 100 150 200 250

Problem Definition

Technology Considerationand Selection

End-Product Design

End-Product PrototypeImplementation

End-Product Testing

End-Product Documentation

End-Product Demonstration

Project Reporting Dahlke, SamuelFecteau, PeterPates, DanielSubido, Lorenzo

Page 31: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

4.1.2 Other Resource RequirementsThe team has estimated the cost of the required resources needed in order to complete the project successfully. Table 5 displays the original estimated required resources required and their respective costs. Figure 17 displays the information as percentages of the total projected cost. Table 6 and Figure 18 show the revised estimates.

Table 5 – Original other resource requirements estimate

Figure 17 – Original other resource requirements estimate

5%

26%

5%

64%

MicroprocessorOptical EncoderMiscellaneous PartsPoster

Page 32: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Table 6 - Revised other resource requirements estimate

Page 33: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 18 - Revised other resource requirements estimate

Page 34: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

4.1.3 Financial Resource RequirementsThe team has estimated the cost of labor for each team member over the course of the project. Although the team members will be working without pay, for the purposes of the project, adding labor costs adds context to the potential expenses of this project in a real-world sense. Table 7 displays the original estimated cost of the project with and without labor costs and Table 8 and Table 9 show the revised estimates.

Table 7 – Original financial requirements estimate

Page 35: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Table 8 - Revised financial requirements estimate

Page 36: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Table 9 - Revised financial requirements estimate (continued)

Miscellaneous ResourcesTotal Price w/o

LaborTotal Price with Labor

Poster $60.00 $60.00 Project Plan Binding $10.00 $10.00 Design Document Binding $10.00 $10.00 Final Report Binding $10.00 $10.00

Subtotal $90.00 $90.00 Labor at $10.50/hourDahlke, Samuel $0.00 $2,341.50 Fecteau, Peter $0.00 $2,100.00 Pates, Daniel $0.00 $2,709.00 Subido, Lorenzo $0.00 $2,152.50

Subtotal $0.00 $9,303.00 Total $260.27 $9,563.27

4.2 SchedulesThe following sub-section contains estimated schedules of work proposed by the team and course advisors. Figure 19 displays the original estimated time planned for each of the tasks outlined in the schedule of work in the Project Plan document and the revised estimates. Figure 20 shows the set of deliverables expected from the team over the course of the project, as well as the expected contribution of time and deadlines.

Page 37: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 19 – Gantt chart for project tasks

Page 38: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

Figure 20 – Gantt chart for deliverables

Page 39: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

5 Closing MaterialProject team information is given in this section, followed by a brief summary of the project.

5.1 Project Team InformationThis sub-section includes client, faculty advisor, and team member contact information.

5.1.1 Client InformationThomas EnterprisesDavid Thomas Sr., PresidentDavid Thomas Jr., Vice President13859 Buffalo RoadAnamosa, IA [email protected]

5.1.2 Faculty Advisors InformationDr. James Davis Dr. Douglas Jacobson2550 Beardshear 2419 CooverAmes, IA 50011 Ames, IA 50011-3060515-294-0323 [email protected] [email protected]

5.1.3 May05-26 Team Members InformationSamuel Dahlke, CprE Peter Fecteau, CprE7312 Frederiksen Court 6326 Frederiksen CourtAmes, IA 50010 Ames, IA 50010515-572-7972 [email protected] [email protected]

Daniel Pates, EE Lorenzo Subido, EE205 South 5th Street, apt. 907 2355 WallaceAmes, IA 50010 Ames, IA 50013515-450-4380 [email protected] [email protected]

Page 40: Optical Encoder for a Game Steering Wheel - …seniord.ece.iastate.edu/projects/archive/may0526/dd_v1_5.doc · Web viewEnd-Product Design Report: May05-26. Client: Thomas Enterprises

5.2 SummaryThomas Enterprises, a producer of top-of-the-line gaming and simulation steering wheel controllers, needs to keep their product line competitive. To this end, they wish to use optical encoders to increase the sensitivity in their controllers.

The end-product of this project will provide the upgrade Thomas Enterprises wishes to incorporate into their product line. The end-product will include an optical encoder and a new microcontroller that will interface properly with current hardware. Ease of implementation will be a major factor in the end-product design. It will allow Thomas Enterprises to update controller production and existing controllers at low cost.