The Challenge:
A pinball machine, that tilts at different angles, controlled by an accelerometer, utilizing machine learning.
How We Did it:
1. Chose a game (pinball) to recreate and integrate with machine learning concepts. 2. Sketched and drafted the initial design of the pinball machine. 3. Developed the code, using a K-means clustering algorithm to train the motor response based on accelerometer data. 4. Modeled the machine in Onshape and created a basic assembly to determine proper part sizing and fit. 5. Fabricated components: laser-cut the base and 3D-printed the gear system and handles. 6. Trained the motor with accelerometer inputs — then tested and played the game!
Learnings & Improvements:
To control the flipper arms, we used two servo motors, each attached to one arm. Since the servos alone did not provide enough torque to lift the arms and push the ball effectively, we designed a gear system to amplify their strength. The gears and motor mounts were 3D-printed, allowing us to securely connect both the DC motor and the gear train to the tilting plate.
Improvements: We encountered challenges with the gear system because the 3D-printed gears we used were too small, which limited their effectiveness. In the future, larger laser-cut gears could provide more reliable performance. Another alternative would be to explore a direct mounting solution, attaching the servo motors straight to the plate for improved power transfer.
How to Train it:
To train the motor, we do the following:
First, tilt the board to the desired positions (left, middle and right)
Then, record corresponding values for the accelerometer.
The code will cluster the data into three groups (K-means). For each group, it calculates the average value and updates the centroid to that new average. This is how the code “learns” the true accelerometer values for left, middle, and right on your specific hardware
Now, the system knows what are the corresponding values for the tilting of the motor for both the DC motors and the accelerometers.