Skip to content

Ball Feeder

Started by designing a ball feeding mechanism.

Sketches Sketches Sketches

The first design was just purely mechanical design, that released the ball when the spring was pulled back to launch a ball. This was problematic, as the game has to be able to prevent multiple ball launches at once. Also I was skeptical of its tolerances, especially if it would get stuck when multiple balls attempted to get into the launcher at once.

The second design had a simple door, attached to a solenoid,that would only be open enough to let one ball throught. That would require too precise timing to function properly.

Third design made much more sense. It had a rotating gate that blocked the next ball from rolling into the door while the active ball was released.

Modeling

Sketched a gate in Autodesk Fusion.

Gate3D

The design was built around the following variables:

Variable Description
ballDiameter The diameter of the ball.
wallThickness The thickness of the back wall.
hingeDiameter Diameter for the center hole, where the servo is attached.
hingeWall The wall around the hinge.

In sketch, I drew a semicircle with 90 degree angle, starting from origin, with radius of ballDiameter. Then I added a a rectangle with height of ballDiameter * 2 and width of wallThickness, and constrained its left edge with midPoint to the origin. Then I added to circles with their midPoint at origin, with radiused of hingeDiameter and hingerDiameter + hingeWall to make room for the central hinge.

The I exited sketch mode, and extruded the design with ballDiameter.

I have redesigned this piece later as part of the final project. The redesign can be found here.

Test bed

The gate needed some testing, so designed a testing system for it. One simulation case with Unity, and one laser cuttable board that could be tested with. The testing board needs a tilted table that the balls can run on, and to be stopped by the feeder gate. That design could be done with Inkscape and laser cutters.

Downloaded QuickJoint extension to InkScape. Followed the instruction from there on how to install it. Played around it with a bit, decided that it is not useful as it only generates fingers to the edges.

As a secondary solution, went to boxes.py and generated a tray from there with the needed dimensions. (15 cm wide, 9 centimeter high (3 cm gutter) and depth of 5 cm.)

Dimensional magic

Edited the tray by removing inner walls from y-axis. Shortened one wall from x-axis to make room for inserting balls. Tilted front and right side walls, did nothing to others. Hopefully most of the weight will be in the bottom right corner, as the balls are there, so the bed does not tilt back. Otherwise the other walls need to be lenghtened to tilt in the same angle as the others.

The initial stuff that came from boxes.py

From boxes.py

The final laser cuttable thingie

My edits

Simulation

Scripted a small simulation for the gate in Unity. Unity is meant for game development, and not for mechanical simulations, but I already know how to use it, and it could do simple physics simulations. To simulate all the parts, I added 7 different GameObjects to the scene: 4 balls, 1 gate and 2 walls.

I added a SpriteRenderer to the balls and the gate. For balls, I used the default knob texture that is available in Unity, and the gate I drew myself with Clip Studio Paint. Saved it as .png and dragged it into the scene (which automatically creates a new object with SpriteRenderer attached, and with correct graphics in it.).

For collision detection, I added Rigidbody2D component to all objects. Balls were also given SphereCollider2D component, ceiling and wall have a BoxCollider2D, and the gate uses a PolygonCollider2D. I quickly sketched the collider from polygon around the sprite, using the weird polygon connection icon on the right side, when the game object was seleted. The ceiling and walls do not have any graphical representation, which makes it harder to see, but they all do important physical simulation stuff. This is not good enough to prove that the game works, as it is just 2D game physics simulation with inexact measurement, but at least it does not fail completely.

The gate is controlled with the following scripts (copied with changes from here):

public class Pivotable : MonoBehaviour {

    private Rigidbody2D body;

    private float desiredRot;
      public float damping = 10;

    private bool onoff = false;

    void Start() {
        body = GetComponent<Rigidbody2D>();
        desiredRot = 0;
    }

    void Update() {
        if (Input.GetKeyDown(KeyCode.Space)) {
            onoff = !onoff;
            desiredRot = onoff ? -100 : -10;
        }

        var desiredRotQ = Quaternion.Euler(transform.eulerAngles.x, transform.eulerAngles.y, desiredRot);
        transform.rotation = Quaternion.Lerp(transform.rotation, desiredRotQ, Time.deltaTime * damping);
    }

}

The script was added as a component to the gate game object. After all that was done, I pressed the big play button in the Unity Editor header, and it started playing the script. By pressing space bar, the gate would flip from open to closed.