P01-2022-S04-S06-S07: Card shuffler
P01: Card Shuffler
Team
- Adam Gajdoš - 3D modeling;
- Marián Jarník - team leader, electrotechnics, assembly;
- Róbert Karpiel - domain expert, project administration and documentation (EA / Prolaborate / WikiFactory / Joomla).
Motivation
A card shuffler is a device that is used to randomly rearrange a deck of playing cards. There are several reasons someone might want to use a card shuffler, for example:
- Speed, efficiency, convenience: Shuffling cards by hand can be time-consuming. A card shuffler can quickly and efficiently shuffle the cards, making it faster to get to the game. Therefore it can be a useful tool for people who host regular card games or for those who play multiple games in a row.
- Randomness: Many often-used methods of shuffling, such as "overhand shuffle", are extremely inefficient in producing truly random shuffles. Riffle shuffles approach randomness much more quickly, but they are also harder to execute.
- Accessibility: Some people may have difficulty shuffling cards by hand due to physical limitations; a card shuffler can make it easier for them to participate in card games.
- Reduced risk of cheating, professional use: Shuffling cards by hand can open the possibility of cheating, as a skilled person may be able to manipulate the cards. A card shuffler can make it more difficult to cheat by taking the shuffle away from the players' hands. In casino or professional card game tournaments, card shufflers are often used as well in order to ensure fair play and to prevent cheating.
Our major motivation was to speed up and automate the tedious preparation of card games so that players can use the time needed to sufficiently shuffle the cards more meaningfully. This way, we could automate (and make more interesting) especially those card-game-related activities, which are usually perceived as the least fun; furthermore, we wanted to raise awareness about the less intuitive facts about randomness in card and board games, such as the difference between various kinds of shuffles (and possibly use the end result in our own randomness-focused experiments).
Randomness in card shuffling
Not all card shuffling methods are equal; one of the most common methods used by beginners, overhand shuffling, requires about 10.000 shuffles to start approaching statistically insignificant levels of non-random bias. However, riffle shuffle, for example (shown in the upper right corner) only requires 7 to 8 shuffles to reach the same level of randomness.
External sources (papers) on the subject:
- Trailing the Dovetail to its Lair (7 shuffles) (paper, direct download)
- Shuffling Cards and Stopping Times (paper)
- The Overhand Shuffle Mixes in Θ(n^2 log n) Steps (paper)
Team vision
As part of working on this project, we wanted to focus mainly on and gain experience in the following areas:
- the basics of 3D modeling in general, 3D modeling tools and subsequent printing-related software,
- try out 3D printing and pre-print optimization in practice,
- creating a tangible product / prototype (as programmers / CS students, we usually only create software) that we could potentially later even use for our own statistical experiments.
Strategy and specification
At the beginning of the project, we identified / determined the following major steps:
- problem analysis, getting to know similar existing solutions, specification,
- 3D model design inspired by existing solutions,
- identification and procurement of necessary external components (engine, gears) compatible with our model,
- 3D Model printing, prototype assembly (incl. drive and power supply),
- prototype testing.
Our final goal was to create a device capable of mixing standard decks of 52/32 playing cards mechanically (using the "riffle shuffle" method) powered by an electric motor and a battery.
Existing solutions
We drew inspiration from multiple existing 3D-printed card shuffler solutions, for example:
Implementation
Initial design
We started by creating a v0.1 design sketch of the expected device:
As can be seen in the sketch above, the original design included a single motor and a gear/transmission mechanism for force transfer. In later phases, these choices were superseded by a two-motor design.
3D design
During the modeling phase, we went over the total of 7 full iterations of prototype design. We used FreeCAD as our 3D CAD modeling tool and PrusaSlicer for STL-to-G-code conversion and printing optimization. Select pictures of the last iteration of all parts can be seen below; STL files and full documentation are available at the WikiFactory repository.
Process of designing one section of the 3D model in FreeCAD (shuffler body):
Final iteration
Body
Card holders
Drawer
Axes
Fully assembled model
(FreeCAD + Assembly4 extension, incl. motor models)
External components
Outside of 3D-printed parts of our design, a single common 9-volt battery, electrical switch, two motors (LaskaKit LA143059) and necessary wiring to power the device were also used.
Assembly
Assembly of the 3D-printed parts went mostly according to expectations; however, the motor holders (which were reworked and diminished in one of the prototype iterations in order to cut back on material costs and printing time; see below) proved to be too small to reliably hold the motors, especially when turned on.
The originally intended wiring method (series) had to be also switched for a parallel alternative in order to even out motor speeds (see example videos at the WikiFactory repository).
Testing
Issues identified
During the final testing, one major issue was identified - the cards were not moved quickly / far enough to slide through the gap between the card holder and central shuffler area. Due to the gap being too large, too many cards managed to get into the gap at the same time and got stuck on occasion. Furthermore, some of the friction-induced kinetic energy was often wasted on card rotation instead of merely pushing the cards into the central area.
Some alterations were made to mitigate these issues, but only with partial success, such as moving the axes closer to the gap, limiting card rotation (see temporary solution below) and using various materials to increase their friction (masking tape, insulation tape, silicone or rubber bands). Due to time- and tool-related constraints, re-printing of the relevant 3D parts or ordering stronger motors was not possible in time.
Recommended solutions
We would recommend the following improvements to mitigate some of the issues faced:
- narrow the gap which the cards fall through to the central section (to force fewer cards to go through at any given time),
- introduce a more permanent solution to undesirable card rotation directly in the 3D model,
- ideally movable/detachable/customizable, as card sizes differ.
- Návštevy: 260