John made a great video about this project above! For more info, check out the article we wrote below. Originally posted November 1, 2019.
If you haven’t heard of Grimsmo Knives (www.grimsmoknives.com), they make some of the most sought after, high-end pocket knives in the world by meticulously crafting every component that goes into their knives. A few years back, John Grimsmo invited me into their shop and I got to see firsthand the incredible work they do - they machine and finish every single blade, handle, pin, and tiny screw to ridiculous levels of perfection! John and crew do a great job of documenting and sharing their work as well, so check them out on YouTube if you haven't already. They use a Swiss-style CNC lathe to turn those tiny screws and pivots:
John laid out a project for this machine they'd been wanting to work on but hadn't had the time for, and I jumped at the chance to design and build a solution. He had a good idea of what he was looking for and provided the following requirements.
The problem: the lathe makes tiny parts automatically and spits them into a bucket. There's no way to tell what order the parts came out, which means they can't track process issues like broken tools midway through a batch of parts. In that case, for example, they would need to sift through the bucket and pick out all the bad parts produced after the tool break.
The solution: a 10 position carousel with bins to catch the parts as they fall off the lathe's conveyor belt. The carousel will catch a set number of parts in the first bin, then rotate to the second bin, and so on. A selector switch will allow the user to choose how many parts should end up in each bin, and a current sensor tied to a conveyor motor wire will sense when apart is run out of the lathe.
- 10 stackable bins, numbered, and removable from a base tray
- The base tray should function to catch larger parts on its own
- Selector switch provides 8 bin quantity options: 1, 2, 5,10, 25, 50, 100, or 250 parts per bin
- A current switch on the conveyor motor, which is 220VAC, 1PH, 0.21A
- The whole assembly should be bumpable and compact as it will stick into a narrow walking path
- Keep it simple and economical - this meant a simple open-loop stepper motor controlled by an Arduino
After a little back and forth, we had the project laid out - onto the design!
Always start with what you know - I had pictures of the conveyor chute and a nearby bracket, so I modelled them in Inventor first. John sent measurements of the bracket and it’s position from the chute lip so I could design the rest of the carousel off these. I made best guesses for the measurements of the actual chute and machine body, just to give myself some context for the rest of the design.
John had modelled the bins and sent me the Fusion file as a starting point. I remodelled them and they became the basis for the size of the machine. A simple tray was made to fit underneath the bins. I knew it would have to be connected to a stepper motor in some way, and that motor would have to be mounted in some way, but since I wasn't sure how I left the tray partially finished and moved on to the structure.
I considered a couple of options for the main structure. An entirely 3D printed body wouldn't be strong or accurate enough to be reliable long term. A welded steel arm bolted to the bracket would be overkill. I ended up going with an aluminum plate to carry most of the components - the tray, stepper motor, and electronics. Aluminum extrusions connect the main plate to the bracket, where an adaptor plate is needed. Extrusions are great for this sort of medium-duty construction since they're lightweight, rigid, inexpensive, and adjustable if the bins don't end up exactly where they need to be. Plus, they can be ordered cut to length from Misumi and just bolted together.
The drive system and bearing layout are closely tied to each other and are very important for the smooth operation of the carousel. I thought about a belt-driven system, where the stepper would be mounted off of the tray and a belt looped all the way around the tray for a large reduction. But a big reduction wasn't necessary here, so I opted to set the stepper in the center and go direct drive. I also considered a couple of bearings in the center for constraining the tray to the structure, but the bearings in the motor are actually sufficient for holding the lightweight tray. Where the tray needs support is along the edges, directly under the bins, which will be loaded with steel parts and may often be loaded off-center. Bearings in the central stepper axis wouldn't prevent the thin tray from bending down at the edges, so I positioned 5 bearings along the periphery, acting as rollers. Housings were created which would hold the bearings up through slots in the main plate, lifting the tray just a millimetre or so above.
That’s about it for the mechanics – I ended up making separate number tags for the bins after printed-on numbers didn’t turn out, and cut holes in the main plate for a selector switch and electronics mounts.
The simplest and most inexpensive way to run a small stepper motor and program some simple logic is with an Arduino. I chose an Arduino Uno and a common A4988 stepper driver to drive a Nema 17 motor. I also used an Arduino shield, which sits on top of the Uno and provides a convenient mounting point for the driver, and male pins so I could use rectangular connectors for the switch cables.
I quickly found an 8 position rotary switch on Digi-Key, which is also where I sourced most of the electrical components for this project. The current switch was a bit harder. The conveyor motor drew just 0.21 amps, and any current switches made to sense that size are meant to be soldered to a PCB. We needed a larger switch, but the lowest current sensing range I could find was 0.32 amps. To get around this, you just need to know how these sensors work: they actually measure the magnetic field generated around a wire, which is proportional to the current it’s carrying. Just like a solenoid coil, wrapping that wire around increases the magnetic field strength, multiplying it by the number of turns. So, we could pass the wire through the sensor once, loop it around, and pass it through again in the same direction, and the current switch will actually see 0.42 amps of current total passing through, which is enough to activate.
All that was left to do is figure out the connections between these components. The Arduino shield moves the 20 input and output pins from the Arduino up to its own pins which are labelled differently (since it was meant for a CNC machine, it has endstop pins, spindle control pins, etc.), so after some testing with a multimeter I had written down which pins on the shield were useable and what pin number they actually corresponded to. I picked a rectangular connector, contacts, a cable for each switch, a standard stepper motor, a motor cable, and a power supply.
Here’s the code, I’ll run through it briefly:
Parts of this was taken right from example code provided by Arduino, modified for this project. First, we setup all of our variables. Most of them just give the pin numbers names so the code makes more sense later. The others are switch states, the number of parts currently in the bin, and the number of parts that should be in each bin.
We then setup the pin modes, which tells the Arduino to treat them as either inputs or outputs.
In the looping section of the code, we first check the switches – whether the current switch is on or off, and what position the selector switch is in.
In the next part, we see if the switches have changed state since the last loop. If not, we don’t want to do anything. If we didn’t have this two step process, the code would count a part going in the bin for every single loop the current switch is held on, which would be many times per second. We just want to do something when the switches change.
If we see the switches have changed since the last loop, then we can do something. In the case of the rotary switch, we set the new target number of parts per bin to whatever the switch was turned to. For the current switch, we increment the count of the number of parts in the bin, and then wait a while. We have to wait a while because the conveyor motor runs on alternating current; it will actually flip the current switch on and off 60 times every second (60Hz AC) as the current goes up to 0.21A, then down to 0, and reverses direction for the next 0.21A. If we didn’t wait until the motor stops, we’d count a ton of parts in the bin rather than one.
Finally, if we reach the correct number of parts in the bin, we turn the stepper motor 1/10th of a revolution. The stepper driver is always provided with 12V, and has a Step pin and a Direction pin. The direction pin is always held high or low (+5V or 0V) for clockwise or counterclockwise, which was set earlier. Every time the Step pin gets 5V, it pulses the stepper one step. This stepper is built for 200 steps per revolution, so each step is 1.8°. The driver has been set to 1/8th microstepping, which means each step is actually split with some electrical magic into 8 by the driver for finer control. So, we need to pulse the driver 160 times for the 36° we need. The delay between pulling the Step pin high and low ends up defining the speed of the motor – if you wanted to control the speed in RPM or other means, you could code that in here, but we’ll just hard code it.
And that’s it! The carousel came together pretty easily. The tray, bins, bearing housings, and Arduino mount were printed and the other parts cut to size, drilled, tapped, and finished. I crimped the contacts to the cables and installed them into the connector housings (which is a pain) and soldered the rotary switch up. The fasteners were ordered in exact quantities from Fastenal and everything bolts together easily on the extrusions. After some testing, I headed to Grimsmo Knives to install the carousel.
I plugged my computer right into the carousel after it was bolted up and had a look at the code running. After some modifications, its timing was matched up to the lathe's conveyor motor. It turned out that the current switch worked without looping the motor wire around twice, so we left it at that. John has a great team; Angelo helped me test and troubleshoot, Fraser filmed everything, and the other guys were interested in the build and lent a hand as well.
This was such a fun little project, and the folks at Grimsmo Knives were just awesome to work with! John already has other ideas in mind, so stay tuned for more automation projects with them. And if you have any questions about this project, have something in mind for your own shop, or just want to chat, feel free to get in touch!