Zeroing CNC Mills With OpenCV

For [Jay] and [Ricardo]’s final project for [Dr. Bruce Land]’s ECE4760 course at Cornell, they tackled a problem that is the bane of all machinists. Their project finds the XY zero of a part in a CNC machine using computer vision, vastly reducing the time it take to set up a workpiece and giving us yet another reason to water down the phrase ‘Internet of Things’ by calling this the Internet of CNC Machines.

For the hardware, [Jay] and [Ricardo] used a PIC32 to interface with an Arducam module, a WiFi module, and an inductive sensor for measuring the distance to the workpiece. All of this was brought together on a PCB specifically designed to be single-sided (smart!), and tucked away in an enclosure that can be easily attached to the spindle of a CNC mill. This contraption looks down on a workpiece and uses OpenCV to find the center of a hole in a fixture. When the center is found, the mill is zeroed on its XY axis.

The software is a bit simpler than a device that has OpenCV processing running on a microcontroller. Detecting the center of the bore, for instance, happens on a laptop running a few Python scripts. The mill attachment communicates with the laptop over WiFi, and sends a few images of the downward-facing camera over to the laptop. From there, the laptop detects the center of the bore in the fixture plate and generates some G-code to send over to the mill.

While the device works remarkably well, and is able to center the mill fairly quickly and without a lot of user intervention, there were a few problems. The camera is not perfectly aligned with the axis of the spindle, making the math harder than it should be. Also, the enclosure isn’t rated for being an environment where coolant is sprayed everywhere. Those are small quibbles, and these problems could be fixed simply by designing and printing another enclosure. The device works, though, and really cuts down on the time it takes to zero out a mill.

You can check out the video description of the build below.

Continue reading “Zeroing CNC Mills With OpenCV”

Arduino Lighting Controller With Remote Twist

The time for putting up festive lights all around your house is nigh, and this is a very popular time for those of us who use the holiday season as an excuse to buy a few WiFi chips and Arduinos to automate all of our decorations. The latest in this great tradition is [Real Time Logic]’s cloud-based Christmas light setup.

In order to give public access to the Christmas light setup, a ESP8266 WiFi Four Relay board was configured with NodeMCU. This allows for four channels for lights, which are controlled through the Light Controller Server software. Once this is setup through a domain, all anyone has to do to change the lighting display is open up a web browser and head to the website. The creators had homeowners, restaurants, and church displays in mind, but it’s not too big of a leap to see how this could get some non-holiday use as well.

The holidays are a great time to get into the hacking spirit. From laser-projected lighting displays to drunk, animatronic Santas, there’s almost no end to the holiday fun, and you’ve still got a week! (Or 53!)

Build This Barn Door Tracker Today, Take Stunning Shots Of The Galaxy Tonight

Think you need some fancy equipment to get stunning shots of the night sky? Surely those long-exposure shots that show the Milky Way in all its glory take expensive telescopes with complicated motor-driven equatorial mounts, right? Guess again – you can slap together this simple barn door tracker for a DSLR for a couple of bucks and by wowing people with your astrophotography prowess tonight.

Those stunning, deeply saturated shots of our galaxy require a way to cancel out the Earth’s movement, lest star trails ruin your long exposure shots. Enter the barn door tracker, a simple device to let you counter the Earth’s rotation. [benrules2]’s version of the tool is ridiculously simple – two boards connected by a hinge. A short length of threaded rod with a large handle passes through a captive nut in the upper board.

A little trig allows you to calculate how much and how often to turn the handle (by hand!) to counter the planet’s 0.25°/minute diurnal rotation. Surprisingly, the long exposure times seem to even out any jostling introduced by handling the rig, but we’d still imagine a light touch and a sturdy tripod would be best. Those of you with less patience might automate this procedure.

It seems a lot to ask of a rig that you could probably throw together in an hour from scrap, but you can’t argue with [benrules2]’s results. His isn’t the only barn door tracker we’ve covered, but it looks like the simplest by far and would be a great project to build with kids.

[via r/DIY]

Character Generation In 144 Bytes

[Jaromir Sukuba]  has an awesome BrainF*ck interpreter project going. He’s handling the entire language in less than 1 kB of code. Sounds like a great entry in the 1 kB Challenge. The only problem is the user interface. The original design used a 4 line character based LCD. The HD44780 controller in these LCDs have their own character table ROM, which takes up more than 1 kB of space alone.

[Jaromir] could have submitted the BrainF*ck interpreter without the LCD, and probably would have done well in the contest. That wasn’t quite enough for him though. He knew he could get character based output going within the rules of the contest. The solution was a bit of creative compression.

bf-cs-3Rather than a pixel-by-pixel representation of the characters, [Jaromir] created a palette of 16 single byte vectors of commonly used patterns. Characters are created by combining these vectors. Each character is 4 x 8 pixels, so 4 vectors are used per character. The hard part was picking commonly used bit patterns for the vectors.

The first iteration was quite promising – the text was generally readable, but a few characters were pretty bad. [Jaromir] kept at it, reducing and optimizing his vector pallet twice more. The final design is pretty darn good. Each character uses 16 bits of storage (four 4-bit vector lookup values). The vector pallet itself uses 16 bytes. That means 64 characters only eat up 144 Bytes of flash.
This is exactly the kind of hack we were hoping to see in the 1 kB challenge. A bit of creative thinking finds a way around a seemingly impossible barrier. The best part of all is that [Jaromir] has documented his work, so now anyone can use it in the 1 kB challenge and beyond.

1kb-thumb

 

If you have a cool project in mind, there is still plenty of time to enter the 1 kB Challenge! Deadline is January 5, so check it out and fire up your assemblers!

 

Smartphone Will Destroy You At Air Hockey

Most of us carry a spectacularly powerful computer in our pocket, which we rarely use for much more than web browsing, social media, and maybe the occasional phone call. Our mobile phones are technological miracles, but their potential sometimes seems wasted.

It’s always a pleasure to see something that makes use of a mobile phone to drive some nuts-and-bolts hardware. [Jose Julio]’s project does just that, using the phone as the brains behind a robotic air hockey table.

Readers with long memories will remember previous air hockey tables from [Jose], using 3D printer components controlled by an Arduino Mega with a webcam suspended above the field of play. This version transfers camera, machine vision, and game strategy to an Android app, leaving the Arduino to control the hardware under wireless network command from above.

The result you can see in the video below the break is an extremely fast-paced game, with the robot looking unbeatable. If you want to build your own there are full instructions and code on GitHub, or if you follow the link from the page linked above, he sells the project as a kit.

Continue reading “Smartphone Will Destroy You At Air Hockey”

Detecting Water With And Without Headaches

In Texas — at least around Houston — we don’t have basements. We do, however, have bilges. Both of these are subject to taking on water when no one is paying attention. A friend of mine asked me what I thought of an Instructable that showed how to make a water sensor using a few discrete components. The circuit would probably work — it relied on the conductivity of most water to supply enough current to a bipolar transistor’s base to turn it on.

It is easy to overthink something like this, so I told my friend he should go with something a little more old-fashioned. I don’t know the origin of it, but it is older than I am. You can make a perfectly good water detector with things you probably already have around the house. My point isn’t that you should (or shouldn’t) construct a homemade water sensor. My point is that you don’t always need to go to the high-tech solution.

Continue reading “Detecting Water With And Without Headaches”

High-Quality Film Transfers With This Raspberry Pi Frame Grabber

Untold miles of film were shot by amateur filmmakers in the days before YouTube, iPhones, and even the lowly VHS camcorder. A lot of that footage remains to be discovered in attics and on the top shelves of closets, and when you find that trove of precious family memories, you’ll be glad to have this Raspberry Pi enabled frame-by-frame film digitizer at your disposal.

With a spare Super 8mm projector and a Raspberry Pi sitting around, [Joe Herman] figured he had the makings of a good way to preserve his grandfather’s old films. The secret of high-quality film transfers is a frame-by-frame capture, so [Joe] set about a thorough gutting of the projector. The original motor was scrapped in favor of one with better speed control, a magnet and reed switch were added to the driveshaft to synchronize exposures with each frame, and the optics were reversed with the Pi’s camera mounted internally and the LED light source on the outside. To deal with the high dynamic range of the source material, [Joe] wrote Python scripts to capture each frame at multiple exposures and combine the images with OpenCV. Everything is stitched together later with FFmpeg, and the results are pretty stunning if the video below is any indication.

We saw a similar frame-by-frame grabber build a few years ago, but [Joe]’s setup is nicely integrated into the old projector, and really seems to be doing the job — half a million frames of family history and counting.

Continue reading “High-Quality Film Transfers With This Raspberry Pi Frame Grabber”