Whip Cracking Machine

I’ve wanted to build a machine that breaks the sounds barrier for a while. One of the classic ways to break the sound barrier is with the tip of a whip.

So, to build a machine that cracks a whip. First i bought an 8ft whip, and had all my co-workers give it a try. Watching everyone attempt it gave me lots of information about how a machine might be able to achieve this. At first, i thought that the wrist action would be really important. It turns out that a lot of wrist rotation isn’t actually all that important, and that the whip can be cracked with and without much wrist.

Additionally, it actually doesn’t need a lot of energy to snap. Occasionally people got a small snap behind themselves when “resetting” the position of the whip before another higher energy attempt.

Additionally, Smarter Every Day made a great video all about the physics of supersonic whip tips. He had an expert whip-cracker on hand, but i intend to build one. His Schlieren high speed setup created really beautiful results, and is an inspiration for the visualization in phase 2 of this project.

Phase 1

So, with a vast array of human techniques, i set out to build a machine.

I knew i wanted a linkage system, to help with the jerk required to set up the wave, but also to add a little showmanship to the machine. It should kinda-sorta look like a human arm.

To get the fine control i’m looking for, i expect to need a servo motor system. As a motor geek, i wanted to dive into this side of things, and see what the inexpensive options are.

I’m investigating using an Odrive motor controller, which allows the use of high power hobby motors and mated encoders to get closed loop control. It’s not a super mature controller, but seems to have all the basics, and is open source for digging in deep if it becomes necessary.

So far i’m getting good results with the Odrive. Without a load, but relatively conservative limits on the maximum current (25a), i’m seeing 5 revolutions of the motor (1/2 revolution on the gearbox shaft, as needed for the mechanism) completed and settled in around 200ms. I’d simulated 250ms without stopping, and that got the tip of the whip machine to ~15mph. I’m not really sure what’s needed for the machine, but my intuition says this will be plenty. Setting up the wave seems to be more important than the peak handle speed. The linkage will create the majority of the jerk that should develop a wave. The peak speed reaches 300rpm on the output shaft .

Top graph shows velocity in encoder pulses. There are 8192 pulses in a revolution.

Middle Graph shows motor current, which shows both the draw and regen/brake current pulses.

Bottom graph shows the commanded position (red) vs actual encoder position.

Time per marked division is 0.2s(=200ms)


Another arm of my investigation into motor control is real industrial gear, cobbled together from ebay. Most of that is still in the mail. Updates soon…

Phase 2

Once the basic mechanics are worked out, there are a lot of interesting opportunities to play with the results. Many require lots of repeat-ability, and their efficacy will depend upon the degree of repeat-ability.

  1. Time-delay triggered Schlieren photography. The user gets knob to dial in the delay, which will show a different part of the whip crack. Still flash photography means high resolution, and short flash duration means crisp images. If repeatability is very very high, then a sequence of photos at almost arbitrarily close timings would create a high framerate video of the whip crack.

  2. Tuning of the whip mechanics could be done with a feedback loop, and an evolutionary solver. Adding a microphone would allow the controlling computer/microcontroller to get feedback on the loudness of the whip crack (or lack thereof), and that could be integrated into a tuning algorithm with the servo motion/speed/acceleration/jerk etc. Watching the machine “learn” to crack a whip with some visualization could be really fun, and a break from constant whip-cracking.


Build

As a first step, i opted to build a simpler, non-linkage based system. Motion relationships are more direct, and if i could get that working, i’d make the linkage version for a showier experience.

I had some initial success with snaps from very, very simple control commands (rotation positions, pauses), but a huge lack of repeatability or consistency. The way the whip was laying prior to the motion seemed to have a large influence on the outcome, so that will have to be controlled more than i expected.

IMG_20191007_225148.jpg

I designed a few easy couplers that would allow using cheap shoulder bolts, bronze bearings and angle aluminum to make a very adjustable linkage. Since i’m very unsure of what’s appropriate, it felt smart to allow lots of adjust-ability. It’s also something of an Modus Operandi for me, it seems. One thing to be careful of, of course, is creating impossible linkages and driving into those. Additionally, if a pivot where to become loose, sometime after assembly the linkage might change shape, and mechanically lock. Scary, but i think i can design in stops or additional channel nut screws. With smart servo control, i should be able to detect situations that are needing much more torque than the first few runs, and shut it down electrically in those cases.


v2 - It “learns”?

As part of the tuning process, i wanted to explore a solution that would find the right parameters by itself.

I have no idea if a twist of 180* is better than a twist of 160*. I have not idea what the right speed, and acceleration numbers are, to get the optimal, reliable bullwhip snap.

I started out using DEAP, a python library for Evolutionary Learning. This didn’t really give the results i was looking for, mostly because it seemed to want to use a sexual reproduction model, where i really wanted an asexual mutation.

I ended up writing my own simple algorithm that created a generation of tests, each with randomly generated test settings. The program would cycle through those individual tests, running the whip machine with each setting. It listens for the maximum volume of the resulting motion. The next generation would consist of the top X percent of the previous generation, unchanged, as well as a set of mutated versions of the top performers. Each parameter would be mutated by up to Y percent from the parent’s parameters.

Rinse, repeat for a Z number of generations.

The code is running on a headless Raspberry Pi, and a graph of the current tuning parameters is saved at the end of each generation. These graphs are available to understand how the tuning evolution is going, and what parameter values the algorithm is setting on.

I’ll be playing with the number of tests in each generation, as well as the number of generations once i have i whip on the machine, and can see if it can really, actually tune itself. That would be pretty exciting.

This graph was make without a whip attached (my landlady lives downstairs, so, you know). The max sound it’s attempting to optimize for is the clunk of the end of the travel with a sharp deceleration. There is quite a lot of inconsistency, for various reasons. i’m hoping it will improve with a whip attached.