Paul's Posts

March 16, 2006

Dealer

body1.jpg

As seen in the picture, the main body of the dealer consists of a bed on which the cards rest, 2 bumpers that limit clearance to allow dealing of one card at a time, 4 springs that constantly raise the deck such that the top card is at the appropriate dealing level, a wheel that spins in either direction to deal cards, a flap attached to the wheel that sweeps the top card off the deck, and a motor that controls the motion of the wheel.



body2.jpg

The bed was machined of Ultra-High Molecular Weight (UHMW) Polyethylene, selected primarly because of its low friction and low cost. We wanted to minimize any friction that could inhibit the cards in exiting the dealer. It was designed to ride on 4 shoulder bolts to prevent twisting and binding inside the dealer and to ensure the cards remained level.



bumpers.jpg

The bumpers were machined of polycarbonate and were a 3rd generation design. The first two essentially worked, although with less consistency, as cards seemed to have more difficulty exiting the dealer. Polycarbonate was selected because of its availability in the machine shop. The original design specified UHMW Polyethylene for low friction; however, we were unable to obtain this for the 2nd and 3rd generation designs.

The springs were purchased based on their length, diameter, and wire gauge. We needed a spring that was longer than the deck was tall to ensure the deck was constantly being raised, with an appropriate diameter to fit the shoulder bolts, and of very thin gauge to create enough force to lift the deck but not pinch it. The springs we found were selected on a trial and error basis, and did not have accompanying specifications.



wheel.jpg

The wheel was machined out of stock aluminum from the machine shop. It attached to a shaft, also machined from aluminum, which joined the wheel and motor. Aluminum was used because of its availability and low density. To further reduce weight, we cut holes in the wheel using a CNC mill and trimmed down the thickness using a lathe. The wheel had a diameter of approximately 3.5", which is equivalent to the length of a card. The diameter was specified to maximize the contact between the flap and card, while fitting in the space constraints.

The flap was cut from a sheet of Neoprene-like material obtained in the machine shop. This material proved suitable given its flexibility and high friction characteristics. This component went through countless evolutions, mostly based on a trial-and-error process. We wanted the flap to contact the card and sweep it off the top of the deck by overcoming the friction forces holding it in place. We had many good ideas on how to achieve this, many of which were eliminated once tested. The final design is a strip, held to the wheel by a metal bracket and bound with a piece of electrical tape.

The motor was obtained from the mechatronics lab and is the same motor used in the in-class labs. We used this motor simply because of its availability, familiarity, and zero cost. This was likely not the optimal motor for the application; we would have preferred a motor with higher torque and lower velocity to deal the cards. As it was, we had to power the motor with a +/- 15 V swing, which simply spun the wheel more quickly, in order to deal a card. By spinning the motor quickly, we were able to overcome the forces holding the card in place, although this velocity then carried through to the end of the dealing process, when the card was then flung distances up to 3 ft. A higher torque motor would have produced more pull on the card at a lower velocity, which would have provided a more controlled method of removing a card.



Once all these components were assembled, there was a great deal of fine-tuning that had to be done to allow the dealing of one card at a time. All the mounting holes for each component were slotted to better faciliate adjustments. This was an extremely invaluable foresight that led to the successful deal. Without these slots, adjustments would have been very difficult or virtually impossible. In particular, the bumpers were slotted to adjust the clearance between the walls of the dealer and the bottom of the bumpers. This distance was set to allow one card to easily pass through, but prevent multiple cards. The precision of adjustments for this aspect was astounding. Setting the clearance to one card proved too tight, while two cards proved too loose. The optimal clearance was determined to be the thickness of one card, plus the thickness of 3 sheets of standard office paper. The second area of adjustment was between the motor shaft and top of the deck. The motor had considerable flexibility in positioning to optimize the use of the flap. This adjustment required less precision, although it was equally frustrating to align.

March 15, 2006

Results and Reflections

Although it came down to the wire, we were able to align all the components just right, achieving our first objective of successfully dealing cards. Out of an inserted deck of 52 cards, we were able to deal all but 10 cards, a fairly low failure rate, given the complexity and time constraints of the project.

We were also able to achieve our second objective of reading the cards, although with limited success. We were only able to accurately read approximately 1 out of every 7 or 8 cards. This seemed to be a result of the dealer spitting out the cards too quickly for the scanner to read the barcode. Additionally, given the limitations of our PC-104 stack inputs and the ps/2 scanners we purchased, we were not able to interface the two, but had to output the card value to another computer and monitor.

Finally, we were able to achieve our third objective of moving the cart into different dealing positions with consistent success. After dealing a card in each direction, the cart moved to the next space without a single failure.

Our fourth objective, of lowest priority, was to flip cards as they were dealt. We were unable to address this task in our programming, although we were able to flip cards by activating the solenoids manually. We did not have time to fine-tune the timing between the card sliding off the deck, being scanned, and then being flipped before it left the dealer.

Although we were able to confidently declare our project a success, given that we achieved our three primary objectives, there are a number of improvements and changes that we would make in either continuing or redoing the project.

The biggest challenge we faced throughout the project was balancing the complexity of our mechanisms with the time constraints of the quarter. There were a number of changes we would have liked to make, had the project run a few weeks longer.

For example, we recognized early on that the springs used to lift the deck would have wide variance in applied force, depending on how many cards were in the bin. An entire deck compressed the springs by nearly 50%, causing the cards to bind and sometimes prevent their exit from the dealer. We would have liked to incorporate constant-force springs into the dealer, which would have applied the same force, regardless of how many cards were in the bin. We decided to stick with the standard compression springs only because the design was already developed and time was quickly growing short.

Another example is in the dealing wheel. We initially planned on using a belt with 2 sprockets that ran the length of the cards, and would pull each card entirely off the deck. However, once we began fabrication, we decided to experiment with a wheel instead, which was much easier and quicker to fabricate in the machine shop. By the time we realized that this was a more difficult solution to implement, we did not have enough time to order the necessary components and re-machine parts. We were able to make our single wheel work relatively consistently, but we believe a belt and sprocket system would have been even more consistent. Additionally, the belt would have allowed us to pull the card out more slowly, allowing the scanner more time to accurately read each card. As it was, we had to spin the wheel fast enough to simply accelerate each card enough for it to overcome the friction forces. This meant the cards flew out of the dealer, often distances up to 3 feet, and often moved too quickly for the scanner to read.

Although we were not able to accomplish everything we had originally outlined in the initial project conception, our ambitious objectives motivated us to develop the very best dealer we could in the short time we had. From here, our initial vision of an automated blackjack dealer and player is very attainable, and would only require the implementation of the card-flipping solenoids, a more consistent dealing mechanism using a belt and sprockets, and some additional programming.

We very much enjoyed working on this project and in this class, despite the difficulties and long hours, and we only wish we had more time to accomplish everything we wanted.

February 09, 2006

Project Proposal - The Dealer

This entry contains the continuation of our project propsal, found here.

The following is taken from our project proposal:


1 The Dealer

Cart.jpg

The cart has 4 wheels, powered by a DC motor, and rolls along a straight path of approximately 1-2 feet. As it rolls, the machine deals out the necessary cards for blackjack: the dealer’s 2 cards, the user’s 2 cards, and any additional “hits”. The DC motor is equipped with an encoder to determine where to deal the cards such that they are evenly spaced and do not overlap.

To prevent the cart from rolling off a table, it is equipped with an infrared range sensor on each end that will detect the difference between the tabletop and the floor. In the event the IR ranger detects the edge of the table, the machine will stop moving and produce an error signal or message.

The main component of the cart body is the storage bin for the cards. We intend to play with 2 to 4 decks, which will rest on a spring-loaded bed. This spring lifts the deck as cards are dealt, keeping the top card at a constant height for dealing. By dealing from the top of the deck, there is less weight on the card being dealt, thus reducing friction and enabling a more reliable deal. To deal from the bottom of the deck places the entire weight of the deck on the dealt card, increasing friction. Additionally, dealing from the top follows standard casino rules.

To lift the deck, the spring must simply be able to exert a force slightly larger than the weight of the deck. As cards are removed from the deck, the weight will lessen and the deck will become thinner. Accordingly, the spring will lengthen, given the extra space, and will exert less force (by Hooke’s Law) as the spring nears its natural length. Thus, by carefully selecting a spring with the appropriate length and spring constant, we can expect the top card to always be in the correct position for dealing, with the correct amount of force acting on it.

The cards are dealt using a rubber flap attached to a belt driven by a DC motor. The motor drives the belt clockwise or counterclockwise, depending on whether the card is being dealt to the user or computer. The rubber flap, selected to have a very high coefficient of friction, moves around the belt until it contacts the top card. As it continues along the belt, the flap drags the top card off the deck, since the flap/card friction will be considerably higher than the card/deck friction. Also, by using a single flap to contact the card, none of the other cards below will be touched or moved, which could potentially jam up the dealer. To reduce friction further, we are investigating the use of a small CPU fan to create a thin air pocket between the top card and deck.

Project Proposal - Introduction

The following is taken from our project proposal:

Our goal is to design and build an automatic card game capable of dealing cards for a game of Blackjack and then playing the game with a user. This machine has virtually endless possibilities in the number of games it could play and the number of users with whom it could play. We would like to program the computer for multi-user games like Texas Hold-‘em Poker, but given the time constraints of the quarter, we intend to focus primarily on Blackjack.
proposal_overall_sketch.jpg

The machine can be divided into two primary roles: a dealer and a player. The main component of the dealer is a small cart that rolls back and forth on the playing surface (tabletop or floor), as seen in figure 2.

Cart.jpg