Homework 3: Design Constraint Analysis and Component Selection Rationale Due: Friday, February 10, at NOON Team Code Name: Motion Tracking System Group No. 9 Team Member Completing This Homework: Tarun Chawla NOTE: This is the first in a series of four professional component homework assignments, each of which is to be completed by one team member. The completed homework will count for 10% of the team member s individual grade. It should be a minimum of five printed pages. Evaluation: Component/Criterion Score Multiplier Points Introduction 0 1 2 3 4 5 6 7 8 9 10 X 1 Analysis of Design Constraints 0 1 2 3 4 5 6 7 8 9 10 X 3 Rationale for Component Selection 0 1 2 3 4 5 6 7 8 9 10 X 3 List of Major Components 0 1 2 3 4 5 6 7 8 9 10 X 1 List of References 0 1 2 3 4 5 6 7 8 9 10 X 1 Technical Writing Style 0 1 2 3 4 5 6 7 8 9 10 X 1 TOTAL Comments:
1.0 Introduction The design project is a motion tracking system which uses a camera to take multiple images, compare them, locate the center of a moving body, and use motors to point a laser at the estimated center. The device will also be able to record timestamps of motion events that occur and output the timestamps to an LCD screen. The project will require plenty of RAM to store images and difference data, as well as a processor fast enough to track motion in real time. 2.0 Design Constraint Analysis The major design constraints that will be considered in this report include memory, real time processing, I/O pins required, power constraints, and packaging constraints. The two largest constraints are memory and real time processing. Power and packaging are notable constraints as well due to the intended portability of the design. I/O constraints are also mentioned, but the design does not require an excessive amount of I/O. 2.1 Computation Requirements The processor must be able to determine the location of a moving object and focus the laser pointer on its center in real time. To do this, the processor must first acquire a reference image to use from the camera and store it in the microcontroller s memory. From then on, images will be captured at a fixed interval and sent to the microcontroller, which will run a simple difference filter on the new image and the reference frame. The images sent from the camera must have a small size to be acquired quickly. The maximum transfer rate of the camera (part number OV6620) is 12 MHz, letting one full image arrive in.02 seconds (one image is 352 x 292 pixels) [1]. If a difference is seen (meaning an object has come into view that is not in the reference frame), the center of the detected object will be determined, and the microcontroller will output PWM signals to two servo motors (used to control tilt and pan) that point the laser at -1-
the moving object. It is critical that the microcontroller be able to complete the image acquisition, processing, and PWM output in as short a time as possible to ensure that the laser follows the target without delay. The entire process should be completed in well under one second (depending on the image processing algorithm). 2.2 Interface Requirements The microcontroller will need to interface to the camera, the LCD interface, two push buttons, the on/off switch, the laser pointer, and the two motors. The camera requires 20 pins of I/O in total, 16 for image data and 4 for control signals [2]. The LCD interface requires 12 pins of I/O, 4 for control signals, 8 for data values [3]. The two push buttons will each need one pin of I/O. The laser pointer will need one pin, and each PWM output will also need one output pin. In total, the microcontroller will need 37 I/O pins. The motors may have to be optically isolated from the microcontroller. 2.3 On-Chip Peripheral Requirements There are a few on-chip peripheral requirements for the design. An I 2 C bus interface is needed to set register values on the camera. An RTI system is needed to keep a real time clock running, which is used to keep timestamps of motion events. A PLL register will be used to scale down the clock when no motion is detected, lowering power consumption during this time. Two channels of 8-bit PWM are needed to control the two servo motors. 2.4 Off-Chip Peripheral Requirements The off-chip peripherals required are an LCD interface, push buttons for scrolling through the LCD interface, enabling/disabling the LCD backlight, an on/off switch, a laser pointer, and two servo motors. The LCD interface will be used to display the timestamp data. Three push buttons will be used: two bounceless push buttons for scrolling through the LCD -2-
interface, and one push button for enabling the LCD backlight. A simple two position switch will be used to turn the device on or off. A standard red laser diode will be used to project the laser beam on the moving object. The two servo motors will be used to tilt and pan the laser pointer. 2.5 Power Constraints The design will be powered by battery for increased mobility. One set of four rechargeable nickel metal hydride batteries will be used to power the microcontroller, the motors, the laser pointer, and the LCD interface. All components require a 5 volt DC input. All of our components should not have a very large current draw. The PWM outputs to the motors will ramp up slowly in software to not cause a large current draw when the servo motors start moving. 2.6 Packaging Constraints The design has a size constraint, though not a strict one. The goal is to make the device as small as we can. Since the device is most likely going to be mounted somewhere where it gets a good view, the device should be as lightweight and small as possible. The largest components on the device will be the four batteries attached on the back, followed by the servo motors which are on the front. The laser pointer and the mounting it is attached to should weigh as little as possible so the servo motors will have not have trouble moving it. The entire device will weight under 2 pounds. 2.7 Cost Constraints There are a few products that are similar to the design. One of them is the Creative Webcam Live Motion, which has an MSRP of $110 [4]. The product is a webcam that follows motion by tilting and panning the camera, ensuring that the user is always on screen. Another -3-
product that is similar to the design is X10 s security cameras, which are sold in packs of 3 for $270 [5]. These cameras track motion and have a wireless output to a TV screen for viewing. 3.0 Component Selection Rationale The design has two major component choices. The first choice was to determine which camera to use. Multiple cameras were examined and researched, and the decision was narrowed down to either the Omnivision OV6120 [1] or the Kodak KAC-9630 [6]. Both cameras use the I 2 C bus for setup. The Kodak camera has a resolution of 128 x 101 pixels, and the OV6120 has a resolution of 352 x 292. Both cameras are monochrome. Both cameras also had a downside. The Kodak KAC-9630 is meant for more high speed applications, able to capture 580 frames a second, making it a very expensive ($270 plus $100 for a matching lens). The problem with the OV6120 is that there are no American vendors for the part. Instead, we decided to go with the OV6620, which differs from the OV6120 in only one aspect: the 6120 is monochrome, and the 6620 is color (in fact, they are so similar, they share a data sheet). The OV6620 is sold for $43.65 along with a lens. The second choice was microcontroller selection. The microcontroller needed to have all of the required peripherals stated in Section 2.3 as well as plenty of memory and be fast enough to meet the real time constraints stated in Section 2.1. The newer 16-bit 9S12 and 9S12x series microcontrollers from Freescale have most of the on-chip peripherals needed (the older microcontrollers did not have onboard I 2 C controllers) and run fast (24 MHz). Two microcontrollers were investigated, the MC9S12DP512 and the MC9S12XDP512. Table 3.0.1 shows a comparison between the two devices. -4-
Microcontroller MC9S12XDP512 [7] MC9S12DP512 [8] Internal RAM 32,768 Bytes 12,288 Bytes Flash Memory 524,288 Bytes 512,000 Bytes Serial Interfaces CAN, IIC, SCI, SPI CAN, IIC, J1850, SCI, SPI PWM Channels 8 8 PWM Bits 8 8 I/O Pins 91 91 Additional Peripherals Periodic Interrupt Timer Addressable External Memory Table 3.0.1: Comparison between two Freescale microcontrollers A difficult design decision was choosing between having to store the reference image on the microcontroller itself or to interface to an off-chip RAM. The image sent from the chosen camera has dimensions of 352 x 292 pixels. The MC9S12XDP512 was chosen instead of using the MC9S12DP512 along with external RAM for two reasons. The first reason is that if all of the data is kept on-chip, it can load and store faster, which lets determine motion faster. The second reason is that an image shrunk by 1/3 on each dimension (giving a new resolution of approximately 119 x 99 pixels) only takes approximately 12 kb. If each image is 12 kb, two images will comfortably fit in the MC9S12XDP512 s and still give plenty of room for difference data and any libraries that need to be loaded. Also, it will take much less time to locate motion in a 119 x 99 pixel image rather than a 352 x 292 pixel image. 4.0 Summary In conclusion, the two major design constraints are memory concerns and real time processing concerns, as they are both pivotal to the functionality of our design. Packaging and power constraints are also important, because if the unit is not of a good size and weight or power dies out too quickly, the design will be unusable. The camera and microcontroller to use were chosen to meet the memory and real time constraints, as well as interfacing compatibility. Our planned design should be able to perform within the constraints detailed in this report. -5-
ECE 477 Digital Systems Senior Design Project Spring 2006 List of References [1] OV6620 Color Camera Data Sheet, Available at HTTP: http://ovt.com/pdfs/pb_6120_6620.pdf [2] C088 Camera Module Data Sheet, Available at HTTP: http://www.electronics123.net/amazon/datasheet/c3088.pdf [3] Powertip PC1202-A LCD Interface Data Sheet, Available at HTTP: http://www.powertip.com.tw/product/pc%20series/pc%201202a.pdf [4] Creative Live Motion! Camera Product Page, Available at HTTP: http://www.creative.com/products/product.asp?category=218&subcategory=219&product= 13979 [5] X10 Security Camera Product Page, Available at HTTP: http://www.x10.com/minisites/security_camera/wireless_camera_motion_activated_rem ote_control_vcr_recording.html# [6] Kodak KAC-9630 Product Page, Available at HTTP: http://www.kodak.com/global/en/digital/ccd/products/cmos/kac-9630/indexkac- 9630.jhtml?id=0.1.10.4.13&lc=en [7] Freescale Microcontroller MC9S12XDP512 Page, Available at HTTP: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=mc9s12xdp512&no deid=0162468636k100 [8] Freescale Microcontroller MC9S12DP512 Page, Available at HTTP: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=mc9s12dp512&node Id=0162468636K100 IMPORTANT: Use standard IEEE format for references, and CITE ALL REFERENCES listed in the body of your report. -6-
Appendix A: Parts List Spreadsheet Vendor Manufacturer Part No. Description Unit Cost Qty Total Cost Freescale Freescale MC9S12XDP512 16-bit microcontroller 19.90 1 $19.90 Electronics123 Omnivision C3088 OV6620 camera and evaluation board 43.65 1 $43.65 Powertip Powertip PC1202-A LCD Character Interface 7.95 1 $7.95 Servo Hut GWS NARO STD STD Servo motor 11.00 2 $22.00 Amazon Sutter s Mill DA-1900 Laser pointer 16.50 1 $16.50 TOTAL $???.?? -7-