Published on January 10, 2008
Target Alley: Target Alley Senior Design Project Due: April 26th, 2006 Dr. Hutchinson Sam Chilkotowsky Design Brief and Specifications: Design Brief and Specifications Background: The experience with the Board of Education in the Robotics course gave me a chance to apply my programming background to a design project. The BOEbot final project was an attempt to create a working device with a variety of electronic components that could be controlled by programming a microcontroller. The experience with the BOEbot made me want to work with microcontrollers in a more complex device. Design Brief : Design and create a tabletop arcade game controlled by a microcontroller. Specifications: The device will be an enclosed, self contained unit. The device will use small, round projectiles. The device will be able to communicate with the user through the use of lights or sound. The device must include the use of long term memory storage. (High score list) The device will incorporate the use of a timer. The device will use a target to be rotated through the use of a motor. The device will provide for the return of fired projectiles to the player. The device will be aesthetically pleasing. Investigation and Research: Investigation and Research What is a Microcontroller? A microcontroller is a simple computer, consisting of memory, a processor, and any input/output on a single chip. Memory on a microcontroller comes in three forms: ROM, RAM, and EEPROM. ROM is read only memory, which is used to store a program for the chip to execute. RAM is random access memory, used for data storage during runtime, but is erased each time the chip loses power. EEPROM is Electronically Erasable Programmable ROM, and combines attributes from RAM and ROM. During runtime information stored in EEPROM can be changed, but this data is not lost when the chip is turned off. (wikipedia) To be sufficient for my project, the microcontroller has to meet a few basic criteria. In order to support the display configuration of 3 letters and 2 numbers, as well as 5 target sensors, a minimum of 32 I/O pins are necessary. Storing a high scores list requires a small amount of EEPROM to be available on the chip. Finally, either an on chip timer or extra pins to support a 555 timer is also required. Additional pins, if available, can be used to add sound or more lights. Microcontrollers The following data sheet excerpt is from http://www.parallax.com/html_pages/tech/faqs/stamp_specs.asp, and shows a few of their controllers. Parallax’s chips simply do not have enough I/O pins for my needs, and their costs become prohibitive. Investigation and Research: Microcontrollers, Continued Atmel is another electronics distributor, which offers a great variety of microcontrollers. Several models supply more than enough I/O pins as well as meeting the EEPROM requirements at a reasonable price. However, the increased complexity of chips with higher amounts of I/O pins means that should I choose an amtel product, I will not be using most of the higher functionality available and it may unnecessarily complicate other parts of the circuitry. Also, these chips require programming software to be purchased or downloaded from 3rd parties. This is an example of a microcontroller based on 8051 architecture. It meets my minimum requirements, however, it leaves me no extra I/O pins for additional lights or sound. (Atmel) Investigation and Research This table shows just some of the additional features available on the more complex AVR 8 bit RISC model line. The prices for these models are extremely affordable, running from $10 to just under $20 for an ATmega1280 with much more memory than I could use in this project. (Atmel) Investigation and Research: Investigation and Research Microcontrollers, Continued A meeting with Dr. Hernandez at TCNJ provided another option. The CS110000 C Stamp Module is a microcontroller produced by Dr. Hernandez as a cheaper alternative to Parallax’s educational packages. It has 43 I/O pins, as well as ample amounts of each type of memory. It is programmable in a subset of C, a language with which I am already familiar. In addition, it has an on chip timing device suitable to my needs, and processes data at many times the rate of comparable Parallax chips. Finally, Dr. Hernandez has offered to donate the product for use in my project, making this the most cost effective option as well. This is the data sheet from the product manual. The program memory size is such that I will not be limited in terms of programming; I will be able to add any additional functionality (2 player mode, etc) without having to minimize my code. The voltage requirements are also more lenient than the other chips, which may let me run the lights and chip off of the same power source, without additional circuitry. Sensors Sensors will be required to detect when a target has been hit, and must be able to differentiate between the three different score values of the targets. Specifically, the sensor must be able to determine when a ball passes a given point while traveling down a ramp. This can be accomplished in several ways: Mechanical – Push button operated by ball as it passes. The accuracy of this device will depend on the weight of the ball being used, as well as the stiffness and size of the actual button. Electrical – Metal ball passing between contact points to complete a circuit. This relies on having a solid contact which may cause the ball to stick or degrade over time. Light sensor – Detect light, disrupted by passing ball. The presence or absence of ambient light will affect the accuracy or even functionality of a visible light sensor. Lights could be added inside the device to overcome this, but the complication is unnecessary. IR Sensor – Used in an emitter/detector pair, IR sensors provide a simple, effective answer. A passing ball will disrupt the beam without requiring contact, and with no moving parts, there is a smaller chance of mechanical failure. The various electronics required are all insignificant in price difference, making simplicity the deciding factor. The IR sensor provides the most reliable accuracy over time, as well as requiring only a simple electronic circuit. Investigation and Research: Investigation and Research Launchers The game will have to display certain information to the player, viewable from several feet away. The score alone will require 2 seven segment displays for displaying numbers (certain letters can also be displayed). Since I also want to keep a high scores list, alphanumeric displays will also be required. I briefly considered using an LCD screen for text display, but quickly discarded the idea. The size of the display required would make for an expensive LCD panel, as well as damaging the visual appeal of the game. 11 segment displays exist for the purpose of displaying letters as well, however each display thus used requires additional pins from the microcontroller. It is possible (in fact, necessary) to control several displays with the same pins with proper circuit design, but each additional display to be controlled this way adds a significant amount of circuitry. For this reason, I have decided that 3 alphanumeric displays will be used. This will allow me to display the initials of those on the high scores list, as well as allowing me to display short messages such as player turn or game mode. (1P or 2P, etc) While many electronics distributors have 7 and 11 segment displays available, I would prefer to design and create my own for two reasons. First, it will allow me to fully customize the size and look of the displays. Secondly, I will reduce my costs by only having to purchase LEDs. ApogeeKits sells kits which include 2 7 segment displays, but the kits are quite expensive ($30-50) and the actual displays are only a few inches tall. (Apogee) Displays A launcher will be required to shoot a ball through the target holes. In skee-ball games, balls are either thrown or rolled by hand. Pinball machines use a spring launcher which fires in a straight line. In electronic games, aiming a launcher is accomplished by pressing a button while a position marker moves up and down (or left/right). The position of the marker when the button is pressed determines the direction of fire. Smaller, hand-held devices use smaller versions of a pinball shooter, as well as miniature catapult-style launchers. Both catapult and pinball shooter style launchers would work in my design. Because I want the device to be entirely self contained, hand launching is not an option. A mechanized aiming device operated by pushing a button would be more complicated to create and control, and in my opinion would detract from the fun of the game. An informal survey found that people prefer a pinball shooter to a catapult launching device. The last consideration for the launcher is the degree of movement. The launcher can either be completely stationary or move in one or more of the following ways: linear left/right, linear up/down, rotational left/right, and rotational up/down. I believe the greatest degree of control is accomplished with a pinball launcher that can slide linearly left and right, while being able to rotate up and down. The strength of the spring will depend on the weight of the ball to be used, and will be determined later through extensive testing. Materials and Construction The information in this section came from an interview with Steve Perry, an experienced carpenter. The frame and sides should be constructed of plywood. Plywood is lightweight and stable, with a good strength to weight ratio. Additionally, the cross-grain stacking of layers of wood creates a product which resists deformation due to moisture, as the swelling of various layers work against each other. The edges and legs should be made with a hard wood such as oak or maple, which look good and will stand up to abuse. Curved sections, for separating the target values internally, should be made out of masonite board. Masonite is durable and flexible, allowing me to create the arched collection area for the balls behind the moving target front. Joints should be secured with glue and screws for maximum strength. The legs should be bolted on, which can be removed for transportation. I had originally thought to use hinges, but Steve said that unless it is being set up and taken down several times a day, bolting the legs on is much more secure while still being able to be removed. Any paint used should be enamel, which is much more durable than latex. Steve has also agreed to supply some of the necessary materials from his shop at no cost. Investigation and Research: Investigation and Research Existing Designs The purpose of this project is to give myself more experience using microcontrollers to control physical devices by creating an arcade version of a skee-ball game. In order to make my game sufficiently unique, it must be different than the existing products which inspired it. The following are six examples of Skee-Ball brand games. (Skeeball) Common Elements: humped alley (launching device), covered game area to prevent pitching. There is only one traditional layout for holes and point values. A 6 target setup is reused with different images to create an additional product. Variations of the traditional alley design (bottom left) are created by changing color schemes, but not altering positions of targets (top left). These games all dispense tickets based on how high a player scores, and are relatively simple electronically. Classic arcade games are on the other end of the spectrum, being much more complex electronically. They use a CRT monitor as the gaming area, and rely heavily on programming for gameplay. Pinball machines represent a midpoint between them, containing a mechanical gaming area controlled by a complex program. My design will not get as complicated as a pinball machine, however, it will contain more programming than a traditional skee-ball machine. A moving array of targets arranged in a unique configuration, combined with multiple play modes and a high score list, sufficiently distinguish my design from existing products. Sources, Developmental Work: (2006). Microcontroller. Retrieved 2/2006, from Wikipedia, the Free Encyclopedia. Website: http://en.wikipedia.org/wiki/Microcontroller (2006). Parallax Corporate Website. Retrieved 2/2006 from www.parallax.com (2006). Atmel Corporate Website. Retrieved 2/2006 from www.atmel.com Interview with Dr. Hernandez, Professor, TCNJ. 3/1/2006 Interview with Mr. Steve Perry, Carpenter/Cabinetmaker. 2/23/2006 (2006). Apogee Kits: Electronic Kits and Tools. Retrieved 2.2006 from ApogeeKits corporate website: www.apogeekits.com (2006). Skee Ball Amusement Games. Retrieved 2/2006 from SkeeBall corporate website : www.skeeball.com. (2006). All Electronics. Retrieved 4/2006 from All Electronics corporate website : www.allelectronics.com. (Purchased LEDs here) Additional sites were accessed through www.google.com image search to obtain general information concerning styles and artistic work done on other arcade machines. Displays Sources, Developmental Work Sources This is an alphanumeric display. At this point I am leaning toward constructing my own using white LEDs and a colored filter in a plywood frame. The number of pins required to control each display individually is much too high, but this is easy to deal with. The amount of pins required to control the LEDs can be reduced by using an array of transistors to control current flow. In this solution, the segments of each display are controlled by the same pins from the microcontroller. Each display then requires its own “address” pin, which controls a network of transistors. Only one address pin would be on at once, so only one display would receive the input. Because only one display could be outputted to at a time, the controlling program must be written accordingly. The displays need to be updated by a continuous loop that refreshes fast enough to allow a constant image to be seen. * This is only the number to control the 3 displays. An additional 14 pins are required to control the 7 segment displays. Developmental Work: Developmental Work The general shape of pinball and arcade games is fairly standard. Most are rectangular or vaguely trapezoidal, and wide enough to stand in front of comfortably. Keeping in mind that I would like to keep the project as small as possible, I made rough size models out of a cardboard box. A width of 2 feet is sufficient, but wider than 3 feet is too much. A length of 3-4 feet provides enough distance to the target without becoming too large. The height will be roughly 4-5 feet, including legs. Frame and Target Area The first layer seen by the player is the graphic façade. This front section will be used to cover various targets at different times, increasing difficulty. While more complex edges are possible, strong, simple shapes are preferred. This area will also be used to display the player information. Developmental Work: Developmental Work Target and Scoring System The second layer consists of a circular target area with holes cut through it. The target board will most likely have a 1 foot radius. Targets are spaced next to the center, on the outer rim, and centered at ½ the radius. These are a few possible layouts for the targets. Each target value requires a separate pin to sense when it has been triggered. Additionally, the more targets there are available, the easier the game is. The final layer needs to collect the ball, and determine what point value to assign for the goal. A circular construction such as this will work for any target layout with holes spaced as on the left. This solution is generic, and will work for any façade shape. A custom sensing area could be designed based on the façade chosen, which would allow differently spaced targets to be used as well. After the ball passes a sensor, it must then roll down a series of ramps to return to the player. Developmental Work: Developmental Work Launcher The launcher will be a simple spring rod as in pinball machines. It consists of a bar connected to a knob on one end and a plate on the other, with a spring in between. The rod is free to pull out of the launcher, compressing the spring to launch the ball. The launcher may be fixed using horizontal or vertical bars, allowing rotation on the y or x axes. These joints can be fixed in place or allowed to slide on the bars, providing linear movement along that axis. Development of Solution: Development of Solution Pro Desktop Drawings Side piece : Many different pieces will be fixed in position through the side wall. The kerf on the top is for holding a plexiglass sheet in position. Bottom : A sturdy base with attached launcher mounting component. Development of Solution: Development of Solution Alphanumeric and 7 Segment Display blocks Front face target cover Front section, holes for launcher and munition retrieval Development of Solution: Development of Solution “Guts” : Plastic rings to collect marbles, angled holes to drop them behind the piece, and a hole cut for the return. Launcher assembly, spring between bushings not shown. Fixing one bushing to the end of the plunger rod and the other to the inside of the launching tube keeps the motion smooth. Development of Solution: This shows how rotation will be accomplished for the launcher mount. A view of the target, and the spacing for the holes. This picture also shows a bearing to allow the target to rotate. Development of Solution Slide16: Development of Solution This is a side view of the game, with a wall removed to show detail. Slide17: Construction Construction of the frame with ripping the bottom to size and attaching rectangular sides. After the sides were measured and marked, a jigsaw was used to get a rough cut of the slanted edge. The final cut was done with a router following a guide bar which had been attached to the side. Aside from the basic form, there were several major components of the project: “Guts” and target, motor and gear assembly, launcher, and electronics. Electronics The first step was to get the holes drilled for the displays. A grid was drawn on a piece of stock and used to align the holes properly. Different shims were created to properly space the holes. After the blanks were created, LEDs had to be inserted in the holes. Each LED was aligned with the ground pin either down or to the right, depending on which row. This prevented confusion and incorrectly soldering the circuits. Once the LEDs were soldered into chains of 2 and 3, the positive leads were all connected, creating a common cathode display. Slide18: Construction Electronics 7 Segment displays were wired using a blue cat 5 cable. Each wire inside is a distinctive color, and I took advantage of this by standardizing wire color meanings for all my displays. Solid orange was +5 volts, etc. For the alphanumeric displays additional lines were necessary. I added a line of grey cat 5 cable to accommodate the 4 LED pairs, which were powered with 3 volts. Once again the meanings of the colors were standardized. A blue cat 5 cable was attached in exactly the same way for each alphanumeric, powering the 7 3-LED segments. This shows one of the LEDs being tested. Each segment was tested before and after being soldered to wires, and then connected to a darlington array and manually tested again. The darlington arrays allow the chip to address multiple displays with the same pins. The LEDs shine quite brightly. Slide19: Motor and Gears Construction The first solution to rotating the target was a variable speed sander. The head assembly was removed, and an eighth inch threaded rod was inserted. Directly applying this to the 16 inch wheel made for a full rotation about every 2 seconds, so a compound gear was created to slow down the rotation. An inverter I purchased to power the motor didn’t supply enough current to turn the rod, so a new solution was needed. This dc motor was harvested from an air compressor that runs out of a car socket. Unfortunately, it turns even faster than the rotor. Adding another gear to reduce the speed added too much friction, stopping the motor. A larger wheel (6 inch diameter) was used instead of the previous gear, and the belt is the rubber seal from a 5 gallon bucket lid. This was a change that stayed during various attempts to solve the speed problem. One failed solution attempted to use 2 motors from VCRs, however, they consistently threw the belt. Eventually, the compressor motor was selected even though it turned too quickly. Slide20: Construction “Guts” and Target The circular kerfs were created using a router fixture specifically designed for that purpose. Several center holes are drilled at marked distances from the bit. Once the center is fixed, the tool need only be rotated to create the kerf. Location marks are drawn around where the guides were fixed, so they could be replaced properly. The target itself is just a 16” diameter piece created using the same router as the kerfs. Holes were cut with a hole drill. The contact cement is in the process of drying. Once it is dry to the touch, the laminate can be applied, and the holes routed out. Three guides (used for rolling drawers and cabinets) were fixed to prevent the target from tilting. Once the plastic rings were securely in the kerfs, they were notched out in the appropriate places so the guides could be replaced. Slide21: Construction Launcher This was the first design for a launcher. A hollow rod was used, however, it turned out to be bent slightly and unsuitable for my uses. The bushing and spring design was tested in this form and found to be sufficient. The second launcher design used a hollow square tube. The plastic fixture around the tube is designed such that it can be loosened and the tube can slide to different positions within it. This plastic provides a way to mount the launcher onto the wheel caster (top right) so that it can rotate horizontally and vertically. This is a frontal view of the completed launcher. Spacers are inserted into the kerf in the plastic to provide stability and prevent wearing damage to the plastic. A side view of the launcher shows the breach for loading ammunition and a small rubber stopper to prevent pinching and reduce the impact force of the launcher rod stopping. It is powered by two springs used to close screen doors. Slide22: Construction Finishing Work The finish work involved using contact cement to fix various counter-top laminate material to the plywood. Black spray paint was also used on inside areas that would not be touched by the player. The laminate is applied and then cut with a router, and finally the edges are filed smooth. The picture on the lower left shows how other areas need to be taped before the contact cement spray can be applied. Small cabinet brackets are used to fix the button springs. I don’t know what they were originally intended for, but the spring is attached to the metal rectangle, which has a threaded hole inside. This picture shows laminate being applied to the edges. The first piece is mounted flush with a corner, and let hang long on the far side. The pieces then continue around, flush on one end and long on the other. The excess is then clipped off with hand snips, and then all the edges can be routed. Slide23: Construction Finishing Work After the laminate was applied, routed, and filed, some final touches were added. Aluminum edging was used to hold the plexiglass in place and provide a horizontal line for the finished product. A plastic piece was added at the bottom of the marble return to prevent marbles from spilling out. Applying laminate around the buttons was a problem because the buttons were in place during the application. A single bar was cut into the laminate before application and pieces were added afterward to fill in the gaps. Smoked plexiglass was placed over the displays. Also visible in this picture are the 3 return holes for marbles and some of the plastic guides attached to the aluminum roll sheet. This view shows the back with the panel off. The aluminum pieces return the marbles from the inside of the target to the roll sheet. Holes cut on the tops and bottoms of each piece allow an LED and sensor pair to detect a passing marble. A hole is cut for the power cord; A single cord plugging into the wall powers all aspects of the project. Slide24: Testing and Evaluation Mechanical Components Electronics and Scoring The mechanical components of the arcade game include the marble launcher, the target and associated gear chain, and the return system for the marbles. Launcher Pros: The launcher works as planned, as well as being aesthetically pleasing. It rotates on two axes and fires a marble with enough force that the marble reaches the target before reaching its maximum height. Cons: The spring inside is slightly stronger than necessary, allowing marbles to be fired too powerfully when compressed entirely. Feedback from several players identified the breach loader as slightly difficult to use, and the launcher itself difficult to aim effectively. Target and Gear Chain Pros: This component of the project functions properly and is appropriately finished. Cons: The target rotates a bit too quickly, making the game quite difficult. The holes in the target should probably be slightly (1/2 to 1” diameter) larger to make the game appropriately difficult without being impossible. Many different gear chains were developed and tested, the main problem was slowing down the rotation without adding too much friction and stopping the motor. The motors harvested from VCRs turned at an excellent speed, but consistently threw the belt. Marble Return System This system includes the area behind the target for separating different score values, the aluminum sheet, and the plastic bumpers for directing motion. Pros: This system functions properly most of the time, when marbles are fired at low or medium speeds. Marbles that pass through the targets are returned properly via an aluminum tube to the “play area” in the front section. Cons: Marbles fired at high velocities are able to fall into areas where they can become stuck. Bouncing marbles are able to get over the plastic bumpers and get caught to the left of the launcher. Additionally, marbles sometimes fall into the hole cut for the launcher mount, and end up underneath of the play area. Marbles that do not properly return to the user are difficult but not impossible to retrieve. Finally, the holes cut for the target and marble retrieval sometimes allow marbles to exit the game, sometimes with considerable speed. The electronic components of the system include the displays, control of the motor, sensors to identify which value to score a passing marble, buttons for interaction with the user, and a microchip to control the game. Displays Pros: The displays function properly individually, any set of segments can be lit at once to display any letter or number. The cat 5 cabling used effectively bundles the 52 individual wires needed to connect all of the lights. The wires are organized through the use of tape and clips in a way that prevents clutter and tangling. Cons: When hooked up into an array of darlington arrays on a breadboard, a certain amount of leakage is present in the system. Segments are still able to be properly addressed, but additional segments light up dimly at the same time. I do not believe this problem would be noticeable if the displays were properly controlled by a microchip, however I can not be sure. Sensors The method of detecting passing marbles is the use of photosensors whose resistance increases when a marble blocks light entering from the opposite side of the aluminum rail. These LED/photoresistor pairs function properly to allow the chip to recognize when a marble disrupts the light. Buttons The 3 buttons used for interaction with the user are not functional. Wires were connected and run through to the back of the game, however the contact points are not good enough quality to reliably register a hit. Microchip During early testing phases the microchip worked properly, and I was able to effectively write to and read from the EEPROM. The data was also properly saved even if the game lost power. Incorporation into the final game proved difficult, as both the chip itself (pins) and the wire used to connect it to a PC broke. The end result was that the microchip was not functional in the final design. Slide25: Gameplay Gameplay was tested by collecting volunteers (friends, family, co-workers) and allowing them to try to hit targets while stationary and while moving. Most people played for no more than 2-3 minutes before becoming discouraged by not being able to hit a target. Out of probably over 100 shots taken, less than 10 actually scored. Ability to aim was dramatically affected by the height of the game, the best position was found to be placing the base of the unit slightly above waist level. A problem discovered while aiming at a stationary target is that marbles can sometimes bounce off of the plywood backing and back out of the target. The functionality of the game was limited to shooting marbles at a moving target, as the microchip is required to calculate a score, control the displays, and register button presses. Evaluation and Redesign Finishing and Aesthetics The finishing work done on the project includes the black and metallic laminates applied to the outside, black spray paint used on inside surfaces, and aluminum “edging” used to secure the plexiglass. The laminate provides a visually appealing and durable surface capable of withstanding a good deal of wear and tear. Some wear can be seen on some sections of the outside, this is because the laminate used was scrap material and already worn. Similar wear is also evident on the plexiglass. On the side pieces, the rectangular portion at the bottom of the slope isn’t completely fixed, and the laminate can be pulled up at this point. In the marble return area, some contact cement is present on the wood. This not only interferes visually but can be felt when retrieving marbles. The finishing around the area of the buttons leaves much to be desired. The buttons catch on the laminate, and the wires are visible. Contact cement is visible around the edges of the buttons, marring the cleanliness of the rest of the product. Overall, the finished product is visually appealing and has a definite style. The interaction between the aluminum and matte black surfaces works well to create a sleek look. Special attention was paid to the edges, and this is evident in their smooth feel. The play area is visually interesting and exhibits the flashy/shiny arcade game style. Redesign Provided with an opportunity to make the product better, there are several changes/additions which could accomplish this. The holes in the target should be enlarged in diameter by roughly ½ to 1 inch. The area behind the target should be coated with foam or another deadening surface to prevent the marbles from flying back out of the target. The buttons should be designed better and their contacts made with copper foil to ensure proper functionality. Ultimately, the finished button should have no exposed wiring and should also provide for a finished surface all the way to the edge of the button. The plastic bumpers for directing marbles are insufficient. A flexible plastic net should be fixed around the launcher and to the roll sheet in a way that allows marbles to roll around either side (front/back) of the launcher and to the return area. The same plastic material should also be used to form a barrier around the target opening and a flap on the front of the marble return area. The rotation speed is too high. This can be slowed down, but a different motor than the one I used would be necessary. A slower motor could work with the existing gear chain, or additional gears could be added provided the motor has the power to turn with the additional friction.