Dropping Marbles With Millisecond Accuracy

All eight version of the drop mechanism
The road to the perfect marble dropper

[Martin] of the band [Wintergatan] is on his third quest to build the ultimate musical marble machine, and that means dropping marbles with maximum reliability and precision timing. Working through several iterations, and returning to first principles, he engineered a marble gate that can drop marbles with a timing standard deviation of 0 ms.

[Wintergatan]’s first two machines, Marble Machine and Marble Machine X gained significant attention, but their complexity was their undoing. As it turns out, a Rube Goldberg machine that makes music has a lot of potential failure points, and both machines proved too temperamental for the live stage. The third version, Marble Machine XT (T for “touring”) needed to be re-engineered for simplicity and reliability to be practical on the road.

[Martin] broke the marble machine concept down to its key components, of which the marble drop gate is the most obvious. Using a pair of contact microphones to record the moment of release and impact, he can measure the timing with precision. The first design had a standard deviation of 3.91 ms, which is not nearly enough for us to detect by ear, but is not up to [Martin]’s standard for “tight music”. It used a clock-type escapement mechanism, where the wheel is the release gate. After reviewing his measurement software and compensating for drift between the software components of his setup, the measured standard deviation was reduced by 1 ms. Another breakthrough was to remove any guiding surfaces below the gate and let gravity do all the work. The 8th iteration proved to be the winner and used the escapement arm as the drop gate and wheel to hold back the queue of marbles.

Coming from an arts background, [Martin] had to learn a lot of engineering lessons the hard way. Looking at the videos on his YouTube channel, it seems like he is taking the lessons to heart, and we look forward to seeing the Marble Machine XT come to life.

40 thoughts on “Dropping Marbles With Millisecond Accuracy

  1. Interesting experiments.
    I wonder about the orientation of the sensor, which is at an angle of approx 45 degrees wrt the speed vector of the ball (which is vertical). Any horizontal speed component of the ball will result in additional error (componetn to the right: shorter time, component to the left: longer time. I think the sensor should be perpendicular to the velocity, in order to avoid this additional error source.

    1. Sure there might be more error in that orientation, but the sensor is not moving during the test, so the error should be consistent, and therefore not affect his measurements. He is not looking for an absolute measurement, he is looking for a relative measurement.

    2. If you watch the video, he concluded the same (with help) and made the sensor flat. Problem with the flat sensor is that you loose control over bounce direction .
      . see the video ;) its all there.

      Martin is doing an amazing job and is super interesting to watch. As per article, he’s painstakingly learning, the had way, shat it is to be an engineer. Many of his failures and failing methods equally apply to software engineering as well and its interesting to see this mapped to mechanical engineering. So many things ring ‘so true’.

  2. One of my arduino projects was a replacement engine ECU for vintage ferraris, where the original ECU was no longer made and existing ECUs were hard to come by and the silicon would eventually fail over the course of decades.

    Using interrupt routines at the register level, I was able to get the spark timing (and advance) to within 7 uS of the correct value.

    It’s important to not use the typical arduino libraries, learn how to program the registers directly, and make some informed coding choices when handling interrupts. It’s not hard, and if you can do that the precision of a typical arduino chip is well within the definition of “perfection” for most applications.

    As an AI researcher, I’ve had to do exactly what he describes in the beginning of his video: go back to basics, check your assumptions, and develop logically from there.

    I can perhaps make some suggestions that might inform future efforts: Firstly, he is assuming that his data is caused by a single gaussian/normal/bell curve, and at least one of his histograms appears to be caused by 2 bell curves. If your data shows two (or more) clear peaks separated by a trough, consider that your data has two separate causes. If you rerun the experiment once or twice more, and the separate peaks are still clearly visible, then look for two causes instead of one.

    On the subject of 2 causes, I might suggest looking into the individual vanes of the release mechanism. A friend attempted to 3-d print 4-inch tall dice of various configurations (basic D&D dice, including 4-sided, 8-sided, and so on). He found that none of the dice had evenly random sides due to non-symmetries in the 3-d printing process. When measured, even the D4 die had clear non-random tendencies of certain sides over other sides.

    If the vane gear of the release mechanism is printed in a non-symmetric manner, which will happen if the gear is circularly symmetric but the 3-d printer is X-Y cartesian, perhaps one side of the vane is more flexible than the other, or perhaps certain vanes of the gear release differently than other vanes, or one side is slightly warped which pressed the balls slightly harder against the side of the sluice so that they have more friction coming down, and so on and so on.

    A vane gear cut from uniform material instead of built up by adding material might make a more uniform system. (And be more expensive, more difficult to rapidly test, and all sorts of other disadvantages.)

      1. You sure?

        7000 rpm is 116.67 1/s x 360° = 42,000 °/s. Multiply by 7e-6 seconds and you get 0.294° instead of 17°.

        7 microsecond resolution is about 112 machine instructions at 16 MHz. You should be able to do that easily with lookup tables with time to spare.

      2. The original Ferrari could do 9000 RPM. That’s 150 RPS, and in 10 uS that’s .0015 of a revolution, which is about half a degree. So the Arduino could keep timing to less than half a degree at high RPMs.

        (You forgot to convert from RPM to RPS.)

        You’re also citing a number without a baseline for comparison. The original Ferrari ECU was way less accurate than the modern Arduino chip – we measured variations of spark advance of as much as 5 degrees of rotation at 1000 RPM, which appeared to be random variations. The Arduino chip was far superior to that.

          1. I still have all the working code and PCB schematics. In a sad turn of events, the person in charge got brain cancer and had to give up the project; at the time, his cancer was considered inoperable and he was given somewhat less than 2 years to live. This was in 2009.

            At the time, Ferrari 308 ECUs had to be scavenged from wrecks and could run you somewhere North of $7K to purchase. We figured that we could build/sell replacements for $2K, and sell maybe 100 to 150 of them.

            Also, megasquirt was just getting started, and came out with a Ferrari version soon after. I don’t know if this would still fly as a product.

            I found this nugget in the code. I can post the whole project to GitHub if there’s any interest. Contact me if interested.

            //
            // Experimentally determined latency for the OCR1 match is 48-51 ticks.
            //
            // Subtract this amount form the compare to get within 3-5 ticks accuracy.
            //
            #define OCR1_LATENCY 45

        1. Even if this project is less relevant because of Megasquirt et al, precision timing is useful for many many applications outside of automotive. I would definitely like to see an article on your Ferrari project, even though I’m never going to replace a Ferrari ECU… And of course now we have been warned in advance that a bunch of the comments will say sonething like “derp should have used a Megasquirt!” :-)

          Sorry to hear about the other part of the story.

        1. That’s why you use a patch loom. I’ve done it on plenty of collectables and classics, gut an old ECU with the correct connector for the car, wire it to a modern ECU along with any support circuitry required. Plug and play and can be reverted to original if required. I’m not doubting the op made his arduino-ferarri but this is a tried and tested method I personally know examples of going back to the late 90s, my first vehicle recieving this treatment in about 2001 after seeing the success of others.

  3. I wonder about mounting a solenoid through a ring magnet and having the balls fall in from a shoot, get attracted to the center of the magnet, then knocked far enough by the solenoid for the magnet to let go. No need to make a gripper. Just add a plastic end to the solenoid that blocks the next ball until it retracts, a bit like a nibbler.

  4. I love what Martin has been doing. I was a Patron for 3 years before he quit the MMX. The decision to abandon the MMX and start a new one was polarizing in the community and many people walked away hopeless that Martin would ever produce a working machine. While I do understand that the MMX was fraught with issues and the leaps Martin has made in CAD, CAM, and learning design principles begs for a new design from the ground up, I am worried that Martin’s perfectionism always poses a threat over getting past the goal line.

    1. The first one was super hacked together. It kind of worked. Sort of. Made a neat song but really had a lot of bugs. Second version was an upgrade but still had a number of issues and took a really long time to create despite that. Third version potentially is nice and that is representative of the truths of actual hardware construction and troubleshooting but there still has a lot of work to go do.

      This whole thing still takes a long time and he is not the only one working on it either. Really do like his work but would like to see a finished version that truly brings many material upgrades. At least he can produce some content and hopefully is being paid something reasonable but guessing it will be quite a while before this version is finished and not sure what his goal is once he presumably completes this version.

      Quickly reprogrammable would be a great feature such that you could just press a button rather than having to swap things out to change songs. Not dropping balls or sort of playing songs but not always really working correctly. Able to be truly automated. Not made of materials such as wood that are going to swell or change size. Robust yet able to be moved around more easily. Designed such that every single fabrication step is not super custom and a HUGE time sink to create.

      Sure there is more but even coming out with some new interesting songs would be nice to hear as well. Still appreciate what he did but definitely some room to improve on the next generation as well and no idea when that will happen or what other catchy songs he can produce with it.

      1. MM classic: Proof of Concept. Your quick python script or whatever ‘would this even work’. Show this to your (product) manager and the machine I’d done right? Just some spit and polish :p

        MMX: prototype. Used both as your road to product and test/refining some details. (P)M now thinks its done. Production? Scalability? Related ability? Automated tests? It works, it looks great, let’s ship it!

        MMXT: the real thing, using proper methodologies etc. Maybe a bit too much gold plated etc maybe more like aircraft design (has to be super reliable on stage). (P)Ms hardly see this as they stop at the previous step :p

        He’s really trying to do (in the end) what any engineer wants to go in the end. Learning like a PM ththat, no, its not done yet just cause it plays some tunes.

    2. Yeah I stopped watching when it turned into full 30 minute videos on experiments in fine tuning things that don’t matter and dissertations on systems engineering. I’m glad he’s doing something he likes and that he can find people to pay him to do it, but I’m out.

        1. What he’s paranoid about, and I can understand the apprehension, is that he’s not just looking to make a one-time studio video with this machine. He intends to pack it up, and take it on tour, doing live shows with the machine. And that’s where every hiccup, every gotcha, every overlooked mistake will come back to haunt you. If the Marble Machine breaks down live on stage, he can’t keep people waiting for half an hour while he gets it operational again, like he did for the original video. It has to play multiple songs in a set, to the same standard as the rest of the band, without a break. Thousands of marble drops a night, and without a single jam… That’s not easy. Especially as the original machine was a disaster, by his own account.

          1. I’d argue you can deal with technical problems live on stage, it happens even to the bigger bands with great roadcrews from time to time. Folks might be a bit annoying having to listen to the backup band play for a bit or something, but its hardly the end of the world.

            And from the testing he did on the MMX I’d agree with Odour de solvent above, it was good enough. At least in marble dropping and catching, the rate at which it can recycle marbles may have become an issue, though only on high tempos, so if the machine can’t take 175bpm for more than 2 mins without emptying some channels its a song writing constraint not a true failure of the machine.

          2. I see Martin’s point how the MMX could never be turned into a touring machine. Every moving part creates an opportunity for failure. When a failure does occur a diagnosis is not likely to be forthcoming as swiftly scanning through such complicated mechanisms made of tiny parts on a stage with harsh overhead lighting all while an audience looks on sounds like the stuff of nightmares. Assuming that a broken or loose part could be identified and a replacement is readily available, many components are so cramped and would require significant disassembly just to gain access. None of this is feasible on they fly and that threat is enough for Martin to lose sleep every night.
            I support Martin moving on from the MMX, but personally it would have provided some closure to many following contributing to the project if Martin had at least composed and performed a song or two on the MMX before getting rid of it. I know that he had some family stuff to attend to and maybe for himself it was best to just scrap it and move on.

          3. Under that sort of thinking @Spencer I don’t think a marble machine can ever be a touring machine – the very basic element of how it works means thousands of marbles moving around, requiring many parts to shift them to drop them in time, catch ’em and recycle ’em ready to go again. Its not possible to build a marble machine without huge numbers of moving parts and potential points of failure.

            But what you can do, and for the most part IMO MMX achieves is being designed such that failures are almost impossibly unlikely to be anything other than minor inconvenience rather than a more terminal breakdown… Combine that with proper maintenance checks to the schedule – presumably between venues disassemble enough to check/replace all the wear prone parts, add any lubricant etc, and set the tour up that ever nth performance has a longer pause where you can strip it entirely for a deep clean and replacement of all the wear surfaces even if they still look good.

    1. All real world measurements are quantized, and he’s referring to the fact that the variance was within 0.5 of whatever resolution he had for the measurements.

      You appear to know the math, but obviously don’t have real world experience with measurements.

      1. you obviously don’t know me. And that’s ok.

        No, he claimed the standard deviation (not variance) was zero. Not “less than 1 ms.” Not “all measurements fell into a single bin, so standard deviation can’t correctly be computed.” Not “measurements were dominated by quantization noise.”

        Maybe 1 ms is ample precision for his tests. That’s fine. But all real world measurements have non-zero uncertainty, and any measuring instrument has non-zero uncertainty. And if you’re *measuring* that uncertainty, as he’s doing here, you better have a measuring device up to the task, or state up front that the uncertainty is less than you can measure.

        It’s naive, sloppy, or deliberately misleading to say otherwise.

  5. He’s making the same mistake as he did with MMX: design components to solve systemic problems, e.g. where he has zero rigidity in sub-systems he fixes the end result, gets it to work, then it stops working the moment he changes something else in the sub system.

    I hope he figures out before he spends another 2-3 years building a system full of lash and slop and expecting precision timing all along.

    MMX was good enough in all regards, including it’s organic beauty and engineering. It had a soul.

    The new one will just be a machine…

    1. For me the mistake is he hasn’t actually set out many of the required design goal upfront (at least that I know of).
      Just how ‘tight’ does the music need to be, being the big one hes bashed his head against so many times – until you have a number to target you have no idea if you are wasting your time. Why make the gates 0.0001 more precise if you are already well within the 0.1 required to make the whole system run within the tolerance.

      I’d think everything on the MMX other than perhaps the magnetic lift is more than capable of exceeding a sane requirements document… The demonstrations of most of the parts and those long stress tests shedding so few marbles are rather suggestive its a very very usable machine.

  6. The machine work is super nice to watch, and it was a great way to keep moving forward during the pandemic, but …

    I miss the music! Wintergatan was very unique, I have their only album (with a signed card :) and listen to it frequently, but I wish there was music coming out. Paradis is my favorite, btw.

    1. Consider checking out the music by Detektivbyrån. Martin and Molin are both in it (and perhaps others from Wintergatan?). Their music is similar in many ways.

      I enjoyed them anyway!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.