Turreting Treat-Launching Catapult for my Dog

Making my dog less fat

My family’s dog Griff gets a lot of treats at home. Our rule has always been one treat per day, but a lot of the time we mis-communicate who feeds him and he ends up getting multiple treats per day. Now he is getting fat! To solve this problem, I made an automated treat launcher with his favorite treat (Greenie) that allows him to have only one treat per day. Now, my family doesn’t give him any treats and he can ask for a treat himself by pressing a button. Here’s a demo:

What it Does:

On startup the machine calibrates the elevator that holds all the treats by hitting a limit switch at the bottom of the elevator. Then, the encoder on the stepper motor starts tracking the position of the elevator. It moves up until a Greenie breaks a line break sensor at the top of the elevator. At that point, we know that a Greenie is in position to be dispened.

Once a Greenie is in position, a 24 hour timer begins and once elapsed, the launcher starts playing music to indicate it is ready to dispense. At this point, Griff usually comes along and presses the button to get his treat. When he presses, the catapult spins around to the “collect Greenie” position, the Greenie is pushed out by two servo arms and into the catapult, and the catapult spins back around and fires. After firing, the next Greenie moves into position, the 24 hour timer starts again and the cycle continues.

I also added features to improve the user experience. For example, we can detect jams and throw alarms when they happen. Here I manually force a jam by keeping the elevator lid closed.

We can also detect when the elevator is empty by reading from the line break sensor when the elevator is at the top of its travel. If the line isn’t broken then there isn’t anything in the elevator, and we can throw an alarm saying to replenish the elevator with more treats.

Mechanical Design

I did my mechanical design in Onshape. There are two main systems; the elevator and the catapulting differential turret.

Total

The elevator system is supposed to store all of the Greenies. I can fit enough for 9 dispenses. It is a pretty simple design; a closed-loop stepper motor geared up one to three to a lead screw. On the lead screw a plaform attached to two linear guide rails moves up and down. There is a limit switch at the bottom, a line break sensor at the top, and two servos with arms on them that push the Greenies out of the elevator. Everything is enclosed and airtight to prevent the Greenies from going bad.

Elsysiso

Elsys2

The turret system is a differential swerve style system. If the two input motors spin in the same direction, the entire planetary gearbox system moves. If they move in opposite directions, the coupling bevel gear moves and the catapult will change angles. The reason I used this complicated system instead of attaching an additional motor on the turret was because it was more challenging to do and seemed more fun.

Turret1

The blue arrow shows the torque path when the two motors are spinning in opposite directions

Turret2

When the motors are spinning in opposite directions:

View of the gearbox:

Turret3

Electrical Design

I did my electrical design in KiCad and made a small board to making the power wiring slightly neater. Having this breakout board also allowed me to use surface mounted terminal blocks so I could simply screw in the wire leads. I used two A4988 drivers for the Nema 14 turret motors and a Toshiba TB67s128ftg driver for the Nema 17 elevator motor.

PCB1

Here is the schematic. Not very organized but does the job.

PCB2

Here is a first test I did:

Process and Problems

I started with some early prototypes of the harder mechanism; the differential turreting catapult. I got the turret to work first:

Then I worked on integrating the catapult.

Afterwards, I started designing the elevator around the catapult. This way, I already knew the dimensions of the catapult exactly and could be pretty confident that there wasn’t going to be any unexpected interferences later.

Once the elevator was designed, I started building the whole thing, starting with the elevator and then working my way back to the turret.

Start

Elevator built and PCB mounted:

ElevPCB

Front polycarbonate installed:

ElevPoly

Turret frame started:

TurretFrame

Bearings for Turret and Belts Installed:

Bearings

Test fit for catapult:

Catapult Test Fit

Once everything was together, I had to test it with my biggest torsional springs. I was able to get about 20ft of airtime with a Greenie:

Some problems I encountered that I thought were kind of interesting:

Problem 1: Boolean logic precedence in Arduino

I fell victim to a classic boolean logic mistake that prevented a “block greenie” button that was supposed to stop greenies from being dispensed from working.

When polling for a button press (in the idle state), the program checks to see if it should allow a dispense using this line:

if(treatTimeIsUp()||firstCycleBypass||oneCycleBypass&&!blockFeed){ dispense = true; break; }

The problem with this, according to Chat, is that ! and && are higher on the precedence scale than ||. I thought this was pretty unusual because && and || are the two foundational operators of boolean logic and should intuitively be treated equivalently. I guess not, though, according to C++.

Blockfeed

Problem 2: How do you deal with bent Greenies?

I had a lot of trouble with jams at the beginning. A lot of the Greenies I got came really bent. Since they were bent, their effective height was much larger than what the elevator would expect them to be and the would get caught on this lip. I have prevented a good amount of the jams by chamfering this ledge, but I also enforced a sizing policy that only Greenies that fit within this template size that I made should be loaded.

Greenies would get stuck on the lip in the green box:

stuck

bent

Conclusion

I wasn’t able to detail all of the challenges that I had with the project here, but I was fortunate to have enough time to solve all of the biggest ones. I spent so much time on it that my year-end summary with ChatGPT was literally just this project. This was a fun learning experience and I’m looking forward to the next one!

Catapult Test Fit

Related albums

Sensorimotor Exploration Lab: Hand Writing Robot for Experimentation and Physical Rehab

Sensorimotor Exploration Lab: Hand Writing Robot for Experimentation and Physical Rehab

9 photos

VEX Robotics Worlds 2025: Managing Complexity in Mechanical Design

VEX Robotics Worlds 2025: Managing Complexity in Mechanical Design

9 photos

VEX Robotics Qualification 2025: Striving for Consistency

VEX Robotics Qualification 2025: Striving for Consistency

7 photos