Design Project



Homework 5: Theory of Operation and Hardware Design Narrative Team Code Name: COST Robot_________________________________ Group No. __7___Team Member Completing This Homework: __Bryan Dallas__________________________E-mail Address of Team Member: ____bdallas_ @ purdue.eduNOTE: This is the second in a series of four “design component” homework assignments, each of which is to be completed by one team member. The body of the report should be 3-5 pages, not including this cover page, references, attachments or appendices.NOTE: This is the second in a series of four “design component” homework assignments, each of which is to be completed by one team member. The body of the report should be 3-5 pages, not including this cover page, references, attachments or appendices.Evaluation:SECDESCRIPTIONMAXSCORE1.0Introduction 5 2.0Theory of Operation203.0Hardware Design Narrative204.0 Summary55.0List of References10App ASystem Block Diagram10App BSchematic30TOTAL =SUM(ABOVE) 100Comments:Comments from the grader will be inserted hereIntroductionThe COST Robot is a design with the intention of building a robot that is able to traverse and map out a maze. The robot will have the ability to detect colored lights on the walls of the maze. When the robot has finished the mapping of the maze, the robot will be able to revisit the colored lights in an order defined by the user. Finally, the user will be able to upload a map via USB to their computer. A couple of circuit design issues that arise are the power consumption and the physical size. We must pick parts that are small and as few parts as possible so that that physical PCB will be small, whether or not the schematic is small. How much power the device uses is also a concern. While it isn’t necessary to choose as low power parts as possible parts cannot be used that consume a large amount of power and that will drain the battery quickly.Theory of OperationThe major subsections of the circuit consist of the power supply, clocking oscillator, motor drivers, I2C to USB, and analog inputs. The power supply (appx. B fig 2) will consist of a 7.4V battery input that will be in series with a fuel gauge sense resistor. A 7.4V battery was chosen to fulfill the requirement that the motors need to run at a desired speed. The fuel gauge will monitor all current entering and leaving the battery through monitoring the sense resistor. This fuel gauge is meant for 2-cell Li Ion batteries, and has a simple set-up for what we need. In order to provide information to the microcontroller, the fuel gauge will send out an interrupt train where calculations can be done based on the frequency of interrupts to determine the amp hours left in the battery. The battery will then connect to a 5V low-dropout regulator to power the majority of our ICs. The next major subsection is the 25 MHz clocking oscillator (appx. B fig 3). The oscillator will be running off 5V like the rest of the components and was chosen to run at 25 MHz because there is a possibility of needing to communicate directly to USB through the microcontroller. The microcontroller has the capability of running at 8 MHz without an external clock and 48 MHz with an external clock. Since 48 MHz is required to communicate through USB, the external clock was added in case the I2C to USB interface does not work as intended.Next, the motor drivers (appx. B fig 4) are based on a single IC that has two H-bridges. The motor driver will have two power inputs. One will be an isolated 5V power in order to power the switching logic, and the other will be the unregulated 7.4V power from the battery. Since the motors need to have their direction and speed controlled independently of each other, the motor driver will be operating in a mode with three inputs to control one motor. In order to prevent feedback from the motors, digital isolators will be used between the microcontroller and motor driver to feed each set of the three inputs. The isolators will be supplied with 5V to provide power to the inputs and another 5V line to supply power to the outputs going to the motor driver. These 5V lines will both come from the regulated power supply, but will be connected at a single point to prevent disturbance between the two.The I2C to USB circuitry (appx. B fig 5) is also another major subsection. This translator will be interfacing with the microcontroller and USB-B connector. It consists of a chip that translates I2C to USB protocol and a USB-B header to connect to a computer. The IC used to translate I2C to USB has the ability to supply its own 5V line to the USB port or accept a 5V line from the USB port. Since we are using a computer to interface with the robot, the IC will be accepting a power line from the computer and we will be using that configuration. The translator has an internal regulator that makes the I2C bus be based on 3.3V through a feedback configuration. A logic high for the microcontroller is well below 3.3V, however, so this will not be an issue. There are many pins on the translator available for programming the pins to output different information. Since our application is simple data transfer, there is no need to program any of these pins and they will not be used. Last, there will be many analog input lines that transfer voltage levels through headers (appx. B fig 6). There will be an 8-pin header to connect the long range sensor, short range sensors, and RGB color sensor. The four range sensors take up 1 pin each and the color sensor takes 3 pins. An extra pin will be used to include a ground pin to make the capacitance in the lines low. Each analog input line will have a possible voltage swing of 0V to 5V. There will also be one more 4-pin header that connects to the compass. This is an I2C interface that will require SDA and SCL lines plus power and ground. The compass is powered by 5V, but the I2C will still be based off of 3.3V since I2C is on the same bus as the I2C to USB translator chip. This should not present any problems.Hardware Design NarrativeBased on the major subsections of the circuit (power supply, clocking, motor drivers, I2C bus, and analog inputs) the microcontroller will use many of its subsystems and pins. The first section, the power supply, interfaces with the microcontroller (PIC18F4550) [1] on pins 28/29 and 6/7, these are the power and ground pins. Between the power and ground pins, on each set, is a bypass capacitor to reduce noise. These are small .01 ?F ceramic capacitors. The .01 ?F was chosen because the circuit is operating at greater than 15 MHz.The next subsection, clocking, interfaces with the microcontroller on pins 30 and 31. These pins are the OSC1 and OSC2 on the PIC18F4550.We use these pins because, as you can see in the schematic from Appendix B Figure 3, there is an external oscillator operating on this circuit, as was described in the previous section. The microcontroller will be configured to use these pins as the new clock for itself.The motor drivers (appx. B fig 4) are interfaced with the microcontroller on pins 38-41, and 35/36. These pins were chosen because 38-41 are used to control the direction of the motors via the h-bridge. These are GPIO, Port D 0-3 to be exact, on the PIC18F4550. Pins 35 and 36 will be configured for PWM output and control the enable to the h-bridge and thusly control the speed of the motor, via the duty cycle. As can be seen in appx. B, all of these signals run through digital isolator to keep the high current from the motors from affecting the microcontroller.The I2C bus (appx. B fig 5) will interface with two components, the I2C to USB converter and the digital compass. Pins 8/9 will be used to communicate with both of these components because the PIC uses pin 8 for SDA and pin 9 for SCL and the microcontroller will be configured to use the pins in that state. Both of these components can be connected to the same 2 pins because I2C is an address relative communication protocol. The pins have pull up resistors to 3.3 volts, as can be seen in appx. B Figure #, because I2C is contingent on pulling lines low to communicate between devices.Finally, the analog inputs (appx. B fig 6) will be connected to pins 19-22 and 24-26 because these pins are the ADC pins on the microcontroller. To be specific on the PIC18F4550 they are port AN{0-6}. The microcontroller will be configured to use these pins as inputs and in ADC mode so that the analog devices can be sampled.Any other pins on the micro controller that are being used are in GPIO mode and used as outputs for LED’s and inputs for pushbuttons. As well as an input to the reset pin to reset the microcontroller. Other used pins will be tied to a header for easy access.SummaryThe hardware for this design (appx. B fig 1) has many components. The major components that this contains are power supply, clock, motor control, I2C bus, and the analog signals. All of these components are being controlled or used by the microcontroller. The power supply is regulated down from 7.4 volts, which is needed by the motor, to 5 volts, needed by the digital components. The clock is 24 MHz and is connected to the microcontroller to give the option of using the USB on the microcontroller. The motor is controlled through an h-bridge, which is controlled by the microcontroller via PWM and GPIO, both of which are digitally isolated. The I2C bus is used by the microcontroller to talk to both the I2C to USB controller and the digital compass. Finally, the analog signals are all fed into the board through a header which runs directly to the microcontrollers ADC ports. 5.0 List of ReferencesMicrochip, “28/40/44-Pin, High-Performance, Enhanced Flash, USB Microcontrollers with nanoWatt Technology,” PIC18F2455/2550/4455/4550 Data Sheet, Mar. 2009.5143517780IMPORTANT: Use standard IEEE format for references, and CITE ALL REFERENCES listed in the body of your report. Provide “live” links to all data sheets utilized.00IMPORTANT: Use standard IEEE format for references, and CITE ALL REFERENCES listed in the body of your report. Provide “live” links to all data sheets utilized.Appendix A: System Block DiagramAppendix B: Schematic-32385081915Figure 1: Full Schematic DiagramFigure 2: Power CircuitFigure 3: OscillatorFigure 4: Motor ControlFigure 5: I2C Bus (to USB)Figure 6: Analog Port ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download