Once a program has been debugged and works properly, it might be time to start optimizing it. A common way of doing this is a method called profiling – watching a program execute and counting the amount of computing time each step in the program takes. This is all well and good for most programs, but gets complicated when processes execute on more than one core. A profiler may count time spent waiting in a program for a process in another core to finish, giving meaningless results. To solve this problem, a method called casual profiling was developed.
In casual profiling, markers are placed in the code and the profiler can measure how fast the program gets to these markers. Since multiple cores are involved, and the profiler can’t speed up the rest of the program, it actually slows everything else down and measures the markers in order to simulate an increase in speed. [Daniel Morsig] took this idea and implemented it in Go, with an example used to demonstrate its effectiveness speeding up a single process by 95%, resulting in a 22% increase in the entire program. Using a regular profiler only counted a 3% increase, which was not as informative as the casual profiler’s 22% measurement.
We got this tip from [Greg Kennedy] who notes that he hasn’t seen much use of casual profiling outside of the academic world, but we agree that there is likely some usefulness to this method of keeping track of a multi-threaded program’s efficiency. If you know of any other ways of solving this problem, or have seen causal profiling in use in the wild, let us know in the comments below.
Header image: Alan Lorenzo [CC BY-SA 3.0].
We have semi-fond memories of string art from our grade school art class days. We recall liking the part where we all banged nails into a board, but that bit with wrapping the thread around the nails got a bit tedious. This CNC string art machine elevates the art form far above the grammar school level without all the tedium.
Inspired by a string art maker we recently feature, [Bart Dring] decided to tackle the problem without using an industrial robot to dispense the thread. Using design elements from his recent coaster-creating polar plotter, he built a large, rotating platform flanked by a thread handling mechanism. The platform rotates the circular “canvas” for the portrait, ringed with closely spaced nails, following G-code generated offline. A combination of in and out motion of the arm and slight rotation of the platform wraps the thread around each nail, while rotating the platform pays the thread out to the next nail. Angled nails cause the thread to find its own level naturally, so no Z-axis is needed. The video below shows a brief glimpse of an additional tool that seems to coax the threads down, too. Mercifully, [Bart] included a second fixture to drill the hundreds of angled holes needed; the nails appear to be inserted manually, but we can think of a few fixes for that.
We really like this machine, both in terms of [Bart]’s usual high build-quality standards and for the unique art it creates. He mentions several upgrades before he releases the build files, but we think it’s pretty amazing as is.
Continue reading “Polar Platform Spins Out Intricate String Art Portraits”
Long cables are only neat once – before they’re first unwrapped. Once that little cable tie is taken off, a cable is more likely to end up rats-nested than neatly coiled.
Preventing that is the idea behind this 3D-printed cable reel. The cable that [Kevin Balke] wants to make easier to deal with is a 50 foot (15 meters) long Vive lighthouse sync cable. That seems a bit much to us, but it makes sense to separate the lighthouses as much as possible and mount them up high enough for the VR system to work properly.
[Kevin] put a good deal of effort into making this cable reel, which looks a little like an oversize baitcasting-style fishing reel. The cable spool turns on a crank that also runs a 5:1 reduction geartrain powering a shaft with a deep, shallow-pitch crossback thread. An idler runs in the thread and works back and forth across the spool, laying up the incoming cable neatly. [Kevin] reports that the reciprocating mechanism was the hardest bit to print, as surface finish affected the mechanism’s operation as much as the geometry of the mating parts. The video below shows it working smoothly; we wonder how much this could be scaled up for tidying up larger cables and hoses.
This is another great entry in our 3D Printed Gears, Pulleys, and Cams Contest. The contest runs through February 19th, so there’s still plenty of time to get your entries in. Check out [Kevin]’s entry along with all the others, and see what you can come up with.
Continue reading “Geared Cable Winder Keeps Vive Sync Cable Neatly Wound”
It’s doubtful that the early pioneers of CNC would have been able to imagine the range of the applications the technology would be used for. Once limited to cutting metal, CNC machines can now lance through materials using lasers and high-pressure jets of water, squirt molten plastic to build up 3D objects, and apparently even use needle and thread to create embroidered designs.
It may not seem like a typical CNC application, but [James Kolme]’s CNC embroidery machine sure looks familiar. Sitting in front of one of the prettiest sewing machines we’ve ever seen is a fairly typical X-Y gantry system. The stepper-controlled gantry moves an embroidery hoop under the needle of the sewing machine, which is actually the Z-axis of the machine. With the material properly positioned, a NEMA 23 stepper attached to the sewing machine through a sprocket and drive chain makes a stitch, slowly building up a design. Translating an embroidery pattern to G-code is done through Inkstitch, and extension to Inkscape. [James]’ write-up is great, and the video below shows it in action.
We’ve seen a CNC embroidery machine or two before, but our conspicuously non-embroidered hat is off to [James] on this one for its build quality and documentation. And the embroidered Jolly Wrencher doesn’t hurt either.
Continue reading “CNC Embroidery Machine Punches Out Designs A Stitch At A Time”
Recently, one of [Eric]’s clients asked him to design a bottle. Simple enough for a product designer, except that the client needed it to thread into a specific type of cap. And no, they don’t know the specs.
But that’s no problem, thought [Eric] as he turned on the exhaust fan and reached for the secret ingredient that would make casting the negative image of the threads a breeze. He mixed up the foul-smelling body filler with the requisite hardener and some lovely cyan toner powder and packed it into the cap with a tongue depressor. Then he capped off the cast by adding a small PVC collar to lengthen the cast so he has something to grab on to when it’s time to take it out.
Bondo does seem like a good choice for casting threads. You need something workable enough to twist out of there without breaking, but rigid enough that the small detail of the threads isn’t lost. For the release agent, [Eric] used Johnson’s Paste Wax. He notes from experience that it works particularly well with Bondo, and even seems to help it cure.
Once the Bondo hardened, [Eric] made sure it screwed in and out of the cap and then moved on to CAD modeling and 3D printing bottle prototypes until he was satisfied. We’ve got the video screwed in after the break to cap things off.
Did you know that you can also use toner powder to tint your epoxy resin? Just remember that it is particulate matter, and take precautions.
Continue reading “Reverse Engineering Bottle Threads For Fun And Profit”
They hold together everything from the most delicate watch to the largest bridge. The world is literally kept from coming apart by screws and bolts, and yet we don’t often give a thought to these mechanisms. Part of that is probably because we’ve gotten so good at making them that they’re seen as cheap commodities, but the physics and engineering behind the screw thread is interesting stuff.
We all likely remember an early science lesson wherein the basic building blocks of all mechanisms laid out. The simple machines are mechanisms that use an applied force to do work, such as the inclined plane, the lever, and the pulley. For instance, an inclined plane, in the form of a splitting wedge, directs the force of blows against its flat face into a chunk of wood, forcing the wood apart.
Screw threads are another simple machine, and can be thought of as a long, gently sloped inclined plane wrapped around a cylinder. Cut a long right triangle out of paper, wrap it around a pencil starting at the big end, and the hypotenuse forms a helical ramp that looks just like a thread. Of course, for a screw thread to do any work, it has to project out more than the thickness of a piece of paper, and the shape of the projection determines the mechanical properties of the screw.
Continue reading “Mechanisms: The Screw Thread”
Wood can be the material of choice for many kinds of projects, but it often falls out of the running in favor of metal or plastic if it needs to take a threaded fastener. But with a little ingenuity you can make your own wood taps and cut threads that will perform great.
Making wood do things that wood isn’t supposed to do is [Matthias Wandel]’s thing. Hackers the world over know and use his wood gears designer to lay out gears for all kinds of projects from musical marble machines to a wooden Antikythera mechanism. Woodworkers have been threading wood for centuries , so making wood take a decent thread isn’t exactly something new. But doing it on the cheap and making the threads clean and solid has always been tricky. The video after the break shows [Matthias]’ method of cutting a tap out of an ordinary threaded rod or even off-the-shelf lag screws. He uses a simple jig to hold the blank so that flutes can be cut with an angle grinder. The taps work well in the materials he tested, and a little informal stress testing at the end of the video shows promise for long service life of the threads.
Wood threads aren’t suitable for every project, but knowing that you can do it might just open the path to a quick, easy build. This is a great tip to keep in mind.
Continue reading “Simple Shop-made Taps For Threading Wood”