CNC Toolpath Visualisation With OpenCV

[Tony Liechty] has been having a few issues getting into CNC machining — starting with a simple router, he’s tripped over the usual beginners’ problems, you know, things like alignment of the design to the workpiece shape, axis clipping and workpiece/clamp collisions. He did the decent hacker thing, and turned to some other technologies to help out, and came up with a rather neat way of using machine vision with OpenCV to help preview the toolpath against an image of the workpiece in-situ (video, embedded below.)

ChArUco (a combined chessboard and ArUco marker pattern) boards taped to the machine rails were used to give OpenCV a reference of where points in space are with respect to the pattern field, enabling identification of pixel locations within the image of the rails. A homography transformation is then used to link the two side references to an image of the workpiece. This transformation allows the system to determine the physical location of any pixel from the workpiece image, which can then be overlaid with an image of the desired toolpath. Feedback from the user would then enable adjustment of the path, such as shifts, or rotates to be effected in order to counter any issue that can be seen. The reduction of ‘silly’ clamping, positioning and other such issues, means less time wasted and fewer materials in scrap bin, and that can only be a good thing.

[Tony] says this code and setup is just a demo of the concept, but such ‘rough’ code could well be the start of something great, we shall see. Checkout the realWorldGcodeSender GitHub if you want to play along at home!

We’ve seen a few uses of OpenCV for assisting with CNC applications, like this cool you draw it, i’ll cut it hack, and this method for using machine vision to zero-in a CNC mill onto the centre of a large hole.

Continue reading “CNC Toolpath Visualisation With OpenCV”

You Draw It, CNC Cuts It

[Jamie] aka [vector76] hit us with a line-tracing plugin for OctoPrint that cuts out whatever 2D shape you draw on a piece of wood. The plugin lets you skip the modeling step entirely, going straight from a CNC-mounted webcam that reads your scribbles and gives you a Gcode toolpath in return. The code is on GitHub and there’s a demo video embedded below.

Under the hood, OpenCV is doing a lot of the image processing, including line detection, and the iterative “find the line” and “move the toolhead” steps really show off what computer vision can do. It starts off with a fiducial arrow for scale and orientation, then it mores the webcam around the scene. The user can enter the usual milling parameters: speeds, feeds, depth of cut, tool offset, milling direction, etc. And then it gets to work.

Right now, it’s limited to paths with non-crossing lines, and probably with good contrast and a nice dark line — all the usual CV restrictions. But mounting a webcam to a CNC toolhead and using it for various pathing problems really opens up tons of possibilities: visual homing, workpiece edge finding, copying parts, custom fitting odd shapes, and more. This project is clearly an invitation to keep on hacking, an appetizer. Once you see the girl pirate robot that [Jamie]’s daughter made, you’ll get the idea.

We’ve seen a similar OpenCV approach used for center-finding bore holes, but while we’ve seen a few webcams used with laser cutters, the CNC mill applications seem largely untapped. Let us know in the comments if you’ve got some other good examples.

Continue reading “You Draw It, CNC Cuts It”

Putting The ‘Go’ In Frisbee Golf With A Robot Launcher

If you’ve gone to a local city park lately, you might have noticed strange metal baskets on poles with chains dangling free. These baskets are spread out throughout the park seemingly at random. For the uninitiated, Frisbee golf (sometimes known as disc golf) is a confusing concept. You might not think it, but Frisbee golf can be a very big deal to some people. [Stuff Made Here] is back with a disc launcher that he hopes will put all the disc golfers to shame.

It’s no secret that we here at Hackaday are big fans of [Stuff Made Here], or [Shane] (he has his own tag after all), and for obvious reasons — the CAD design process, the careful machining and testing, and the extremely high bar that [Shane] sets for his projects. This one is no different, and it is a tale of iteration and scaling. He started out with a simple goal: break the speed record for a thrown Frisbee.

An initial design was decided upon based on high-pressure air pushing a piston to throw the Frisbee off of an arm. Initially, the arm was way too slow as the airflow was severely restricted due to air solenoids and pressure regulators. After fixing all those problems by fabricating his own solenoid and adding a secondary tank with no regulator, the arm started really moving. However, [Shane] wanted it to be able to be arm-mounted, so making sure the torque wouldn’t melt his arm bones was an important priority.

A counterbalance was added to cancel it out, but that ended up causing additional problems down the road, so the throwing arm had to be made as light as possible. The gripper mechanism had to be redesigned again and again as each time the speed was increased, a new problem arose. Turns out that small plastic discs being accelerated at many G’s tend to deform and slip out of their holders, no matter how well engineered. So [Shane] switched to a clever new design to pull the Frisbee along rather than push. It was too dangerous to really be handheld, and the only tests while he was wearing it were at very low amounts of pressure and power.

Testing it in a wide-open field at full power showed promise and while he had plenty of speed, he wasn’t able to beat the distance record. Breaking the distance record is much harder as Frisbees aren’t really designed with the sheer acceleration that [Shane] is subjecting them to, and they want to flip. Additionally, the Frisbees are lacking the spin that would keep them more stable, and what we do as humans is quite difficult to reproduce. Maybe a larger-scale version of this disc launcher could be made that accepts Frisbees?

It’s incredible to watch this contraption come together as each part needs to be designed and machined first by [Shane]. Video after the break.

Continue reading “Putting The ‘Go’ In Frisbee Golf With A Robot Launcher”

AR Display Shows CNC Lathe Operations In Real Time

[Kent VanderVelden] has come up with an interesting AR system to assist operators who are monitoring CNC lathes. (video, embedded, below) The idea is to first produce a ‘frozen’ video stream of the workpiece. This was achieved by placing a high-speed camera above the lathe, and triggering an image capture, synchronized to the rotational position of the workpiece. A high-speed rotary encoder, attached to the tailstock via a belt drive, feeds the current position into an Altera Terasic DE-Nano FPGA eval board. This is then compared to the position from another encoder, doing duty as an angular set point control. The resulting signal is used as the camera trigger to generate a video stream of just the frames where the angle is as selected by the operator, thus giving the impression of a frozen position. The video stream is sent over to a client device based on a Raspberry Pi 4 with a UPS hat, allowing it to be portable.

High speed rotary encoder driven via a belt

This video stream is overlaid with details of the current machine position, as well as the LinuxCNC G-code being executed and a graphical representation of the operation being performed by the machine. This combined video is then fed to a Vufine VUF-110 wearable, which is minimally invasive, allowing the operator to clearly see the machine of interest. As [Kent] suggests, there are many possible usage scenarios for such a setup, including remote monitoring of multiple operating machines by a single operator.

We’ve seen a few neat machine hacks over the years, here’s a nice project adding a programmable power feed to an old lathe, and since wood lathes are often missing out some DRO love, here’s a nice way to tell them that you care.

Continue reading “AR Display Shows CNC Lathe Operations In Real Time”

Tiny CNC Cuts The Metal

We’re no strangers to [Ivan]’s work and this time he’s building a relatively small CNC machine using extrusion, 3D printed parts, and a Makita router. The plans are available at a small cost, but just watching the accelerated build is fascinating.

You might think you could just attach something to an existing 3D printer frame that cuts like a Dremel tool. You can do that, but for most purposes, you need something stiffer than most desktop printers. You can see how solid this build is with multiple extrusions forming the base and very rigid axes.

Judging from the video, the machine made short work of some aluminum plate. Of course, some of that is in the choice of tool, but it appears the machine is stable enough to hold the workpiece and the tool stable to allow this sort of service. [Ivan] says the machine cost him about 600 Euro ($670 USD) and you need a printer that can create parts as large as 180 x 180 mm.

There are quite a few similar mostly 3D printed machines on Thingiverse, including some that have been through multiple versions. If you have an old 3D printer sitting around for parts, you may have nearly everything you need if you add some printed parts, presumably from your new printer.

We’ve seen plenty of CNC builds if you want to pick and choose your own design. Depending on your expectations, it doesn’t have to be an expensive project.

Continue reading “Tiny CNC Cuts The Metal”

Wire EDM

Bringing The Power Of EDM To The Home Shop

When you see something made from metal that seems like it would be impossible to manufacture, chances are good it was made with some variety of electrical discharge machining. EDM is the method of choice for hard-to-machine metals, high aspect ratio hole drilling, and precise surface finishes that let mating parts slip together with almost zero clearance. The trouble is, EDM is a bit fussy, and as a result hasn’t made many inroads to the home shop.

[Action BOX] aims to change that with a DIY wire EDM machine. In wire EDM, a fine brass wire is used as an electrode to slowly erode metal in a dielectric bath. The wire is consumable, and has to constantly move from a supply spool through the workpiece and onto a takeup spool. Most of the build shown in the video below is concerned with the wire-handling mechanism, which is prototyped from 3D-printed parts and a heck of a lot of rollers and bearings. Maintaining the proper tension on the wire is critical, so a servo-controlled brake is fitted to the drivetrain, which itself is powered by a closed-loop stepper. Tension is measured by a pair of strain gauges and Arduinos, which control the position of the shaft brake servo and the speed of the motor on the takeup spool.

Unfortunately, in testing this setup proved to live up to EDM’s fussy reputation. The brass wire kept breaking as soon as cutting started, and [Action BOX] never made any actual cuts. There’s certainly promise, though, and we’re looking forward to developments. For more on EDM theory, check out [Ben Krasnow]’s look at EDM hole-drilling.

Continue reading “Bringing The Power Of EDM To The Home Shop”

An OpenSCAD Library For All Your CNC Cutting Needs

While there’s always the edge case, there’s a strong likelihood that if you’re using OpenSCAD, you’re probably working on a CAD model that you intend to 3D print at some point. Of course that’s not to say this is all you can do in OpenSCAD, but it’s arguably what it does best. If you wanted to make artistic models, or maybe render what your new kitchen will look like, there are other tools better suited to such tasks.

But thanks to lasercut.scad, a library that [Brendan Sleight] has been working on for the last several years, we might have to reconsider our preconceived dimensional notions. Instead of designing parts for 3D printing, his library is all about creating parts intended for subtractive manufacturing. Originally (as the name implies) it was geared towards laser cutting, but the project has since evolved to support CNC routers, vinyl cutters, and pretty much anything else that can follow a DXF file.

This “clip” joint is great for acrylic.

The library has functions for creating the standard tricks used to build things from laser-cut pieces, like finger joints, captive nuts, and assembly tabs. If it was something you once saw holding together an old wooden 3D printer kit back in the day, you can probably recreate it with lasercut.scad. It even supports a pretty wild piece of rotational joinery, courtesy of [Martin Raynsford].

Don’t have a way of concentrating a sufficient number of angry photons at your workpiece? No worries. The library has since been adapted to take into account a parametric kerf width, which lets you dial in how much of a bite your particular tool will take from the material when it does the business. There are even special functions for dealing with very thin cuts, which [Brendan] demonstrates by assembling a box from sheet vinyl.

Of course, those who’ve used OpenSCAD will know there’s not an “Export for CNC” button anywhere in the stock interface. So to actually take your design and produce a file your cutter can understand, [Brendan] has included a Bash script that will run the necessary OpenSCAD incantations to produce a 2D DXF file.

[Brendan] decided to send this one in after he saw the aluminum enclosure OpenSCAD library we covered recently. If you’ve got your own pet project that bends some piece of hardware or software to your will, don’t be shy to let us know.