 I guess this is one of those, and now for something completely different talks, both in terms of the fact that we're going to sort of the other end of the philosophical versus actually sort of physically making and doing things continuum from the keynote we just heard. But also, this is the first time I've tried to give a talk about home shop CNC machining stuff in public before, and as a consequence, I've probably got too much material in here and it'll probably seem a little rushed before we're over with, but hopefully this will be sort of an interesting thing for everybody involved. Before I dive in, I'll figure out which keys to press one of these days. Just switch to the released version of Libra Office at Rocks, but I haven't quite figured out the presenter's console on the new version yet. How many of you have not heard me give a talk somewhere before? Gee, what a waste of all this material. I won't dwell on sort of who I am, you can look me up and find out all the Scuttlebutton photos with more and less facial hair and all that sort of stuff. I will point out though that I actually, I sort of intentionally didn't wear tie-deye today. I've enjoyed for the last year the fact that I've not only been a member of the board of the Linux Foundation, but I've been a member of the board representing individual members of the foundation. In that capacity, it's a one-year term, I have to be reelected, that's about to happen. If you happen to be an individual member of the Linux Foundation, I would certainly appreciate your support this year again, and I'll try to support you. So what's this all about? Oh, come on, you take advantage of your opportunities, Keith. So what's this all about? Well, my paternal grandfather was a machinist. He was the kind of machinist who had a job in World War I called being an engineer on a battleship, which meant there was a forge and he made engine parts when things broke. And if you sort of start with that genetic material and you throw in sort of my other past experiences, it's probably inevitable that there'd end up being another BDL turning a hobby into an open source project talks coming out of this. And on some level, this story now has been going for, wow, almost four years. It started with a large truck arriving at my house on the 26th of April 2007 and depositing that. That's a crate. It's a big crate. But let's not start there. Let's go back just a little bit farther. The basic idea of what I want to talk to you about today is this idea of computer numerically controlled machining, which is to use a computer to control the movement of a high speed cutting tool with a computer so that you can create useful bits of stuff out of bigger lumps of raw materials in a repeatable way. Over the last few years, there's been all sorts of interesting stuff and a bunch of talks by Vic Oliver and others here at LCA over the years about sort of new approaches to manufacturing creation, the various kind of printers, the RepRap, the MakerBots, all of these sorts of things. But frankly, there's still an incredible value in sort of more traditional machine tools and the fact that we now have all of the bits and pieces we need to be able to put together high performance, high quality machining centers for doing prototyping and creative work at home. My father-in-law did me a really good turn a few years back. He and I share an interest in amateur radio. He was at Amateur Radio Hamfest one weekend, saw something he didn't quite recognize on a table, but it had all sorts of cool looking mechanical bits. He bought it for almost nothing because the guy selling it didn't really know what it was. It turns out it was a little tabletop three-axis milling machine. And after he realized that that really wasn't his thing, he put it in the box and sent it to me. And it's this little blue thing in the front. It's, you know, about this big. But big enough that, as you can see, it's in the process of cutting a centering ring for a rocket. So I did actually figure out how to do interesting and useful work with this. It has some limitations, though. One of them is that little black blob up on the top of the milling column, it used a sewing machine motor as its motive power for the spindle. And it just used plain old, you know, US quarter 20 all-thread threaded rod pieces for its axes. So it's a very sloppy machine. It's hard to hold, a tight tolerance. It had essentially no power, just sort of gutless. And it used a little blue box on the back, has some transistors in it that allow it to be driven by synthesized phase stepping signals that were generated off a PC parallel port using a piece of DOS-based software that worked fine as long as there were no TSRs or anything else loaded that might ever cause there to be any cycles executed on something other than that program. Despite all of that, I did a lot of useful work with this machine. In fact, the early prototypes of our Altus Metrum avionics boards, I ripped the panels with the raw circuit boards up on this little mill. And I was able to hold a tolerance of one mill, which in our standard units in the US means 1,000th of an inch, or .001 inches, not a millimeter. That would not be exciting. But I did a lot of useful work with this machine. And these are the sort of things I was able to do it. It's centering rings for the rockets with fin slots cut in them to keep things aligned. And after a while, you notice there's sort of a replacement spindle thingy on the front of there. I spent $20 and bought a trim router from Harbour Freight, one of the importers of Chinese junk machinery. And it spins out on a 10,000 RPM or something. It makes a noise that would wake the living dead three counties over. But wow, it makes it cut a lot better. And as you can see, this was actually a day where I was using it to rip up one of these panels full of circuit boards down in the front. But 2006 was a good year at HP. And I got a bonus. And I decided I needed to spend a little bit of it. So I ordered this Chinese made bed mill that was specified and built to order for a little company in California called Industrial Hobbies. The problem is between the time I committed to purchasing this and when they actually sort of processed the order, the guy who was running the company decided that he'd had enough and he wouldn't get to do it anymore. And some folks on the east coast bought the company and proceeded to move all the stuff to, I guess it's New Hampshire they're in now. And so there was a modest delay while the company changed hands and the new guys learned how to run all the tools and make all the parts and so forth. And this particular mill was one that I ended up in effect sort of pre-purchasing out of the first container of milling machines that the new guys got from China. And if that sounds like it was all a little complicated, yes, there's about a five or six month delay of game in there. So you get the sense that even before BDL has hardware in his garage, this is going to be one of those projects. It has a pretty significant working volume though and the spindle motor on there is a kilowatt and a half or so, two horsepower in other units. And along with the base mill, I bought the CNC conversion kit from the guys who had designed this mill. They apparently started out making conversion kits for sort of bog standard Chinese bench milling machines, then realized that the mills they were buying weren't adequate to the task and worked directly with one of the Chinese factories to have them beef up the design, do a better job grinding the ways to get them more precise and all that. So this is not your standard go buy it in any random tool importer's Chinese mill. It's a little gruntier than that. But it's still sort of a basic manual milling machine that if you wanted to use it for computer control, needed conversion. And the thing that made this sort of interesting and exciting to me is that last thing, EMC-2. How many of you have heard of EMC-2? Are any of you actually using it? Man, you should be down and giving us talk then. Not really, I've spent a lot of time on it. But EMC-2, I'll talk a little bit more about, but this is a completely open source machine control system that was sponsored in large part by tax dollars in the US and it's pretty cool. So this is, unfortunately, I'm sorry it's kind of a fuzzy picture, just to give you an idea, these are some of the other bits that I got in the conversion kit. Those are sort of AXIS drive assemblies with the motors on them, big power supply. The one I have is a little bit different than the one in this photo, you'll see better pictures of it later. And then the thing that actually caused this project to take a whole lot longer than it would have otherwise are these little pieces in the bottom center. It turns out there were some little black box access control modules. And well, I don't know, I'll get to that in a minute. My brain kind of stopped there. So let me talk just a little bit about EMC. It was originally developed by a team at the National Institutes for Standards and Technology in the US and released into the public domain. It is actually a real honest to God example of code put in the public domain, not just released as open source. A lot of things have happened since then. When EMC first started, it was incredibly difficult to sort of get all the pieces together and make it work. But along the way, it's ended up sort of being rewritten to run on top of Linux with real time extensions. And it is now an incredibly flexible and powerful software system that's all available under the GPL. And the guys that maintain the code regularly and routinely put out updates, including an installation disk that's whatever the most recent Ubuntu LTS is with all the real time extensions folded in and the EMC stuff built on top of it. So you really can drop a CD and boot it up and be playing around with stepper motors or servos fairly quickly. One of my long-term objectives, of course, is to get all of this stuff running with plain old Debian, because having a machine that's not plain old Debian that I have dependencies on just kind of freaks me out sometimes. But the other thing I'll point out is that EMC's flexibility is not just in its ability to handle different kinds of motors and interfaces. It actually has a completely generic geometry computation system. And you can use it with robot arms. You can use it with hexapods and all sorts of other interesting joint structures for positioning things. It doesn't have to be nice orthogonal XYZ things such as I'm using my milling machine. And so there's a bunch of parts that make up EMC. And you hear a lot about this thing called HAL. And the first thing you have to do is a Linux person who's been around for any length of time is realized, no, it's not that HAL. And no, it's not the one from the cool movie either. This is a hardware abstraction layer at the base of EMC2 that's used to describe the connections between the real world and the software system. And also to connect together the inputs and outputs of the various real-time modules that you string together to cause certain things to happen. And fundamentally, it uses the real-time extensions to Linux to launch one or more parallel threads of execution, each one of which is started on a regular interval. So in my system, for example, I've got essentially a two kilohertz clock. And every time that clock fires, the thread gets executed, does a certain amount of reading inputs, recomputing suggested outputs, driving those outputs and then goes back to sleep. And it's sort of a classic real-time system in that sense in that you can't put more work on a thread that can be done in one clock tick of time or the system crashes. You can't, well, anyway, you get the idea. It keeps reaction one afternoon when hearing me talk about some of the challenges I was facing is, wow, that sounds really fragile. And that's just, well, yeah, but it does exactly what you tell it to. So everything's very flexible in module. I'm using the trivial kinetics module for motion control because I have nice, simple, orthogonal axes. And there's a user interface that's relatively new in the EMC world, by which I mean single-digit years, because EMC's been around a long time, called AXIS that I'm using for the user interface, and it's all pretty cool stuff. So let me talk just a little bit about one of the reasons this project ended up taking so much time for me. And that's the distinction between open and closed loop control. A lot of you probably get this, but many low-cost, low-end, home machining things or CNC routers operate in an open loop fashion. That is, the computer calculates how many steps or how much distance an axis needs to move, and it tells that axis to go there, and it assumes that it happens. And as long as the work that you're trying to cut isn't overpowering, the material's not so dense that you can't actually cut it as fast as you're telling it to cut, or something like that. And as long as all the electronics is working right, as long as the phase of the moon is correct, that will work. The problem is the moment you drop a step on a stepper motor or you have a servo motor that's trying to drive an axis that's a little stickier than usual or any of those things, you get off. And what I mean by getting off is, now where the computer thinks the cutting tip is isn't actually where it is. And all of a sudden, your circular center ring's come out oblong or they have little flat spots on an edge or something like this. And so I was highly interested in the more sophisticated, but not really all that much more complicated approach, which is a closed loop system, where you actually put a position feedback mechanism on each axis, so the computer can tell whether the axis moved as far as it commanded it to go. And EMC-2 allows for closed loop control, but an awful lot of inexpensive home machines just aren't set up to do it. And this kit that I got from the industrial hobbies folks was sort of an interesting in-between state that I'll talk about in a minute. The other interesting thing that sort of took a long time and made this not trivial is that I chose these servos instead of steppers. Now, what's the difference? Stepper motors are kind of motor that has its magnetic coils and magnets arranged in a way that when you put a certain voltage pattern on a certain set of leads, it moves by a finite amount of a rotation, a step. And if you want it to go farther than that, you then have to change the input. So you're basically generating what look like sort of square waves, feeding the different pins in phases carefully aligned relative to each other to cause the motor to turn continuously. But the software sort of thinks in fundamental units of steps. How many steps do I want to turn that motor to move that axis a certain distance? Servos, on the other hand, are just DC motors. They can actually even be AC synchronous motors. But in most home things, they're DC motors. And what that means is you need to sort of ramp them up in speed. You need to run them for waves and then you need to ramp them down at the end. And you need a position feedback system to have any idea where the axis is at any given moment. So servos more or less have to be run closed loop whereas steppers, you know, you can kind of get away with running open loop. But while steppers are fairly easy to interface, you can just take pins of parallel port, use transistor amplifier slash switch parts to get up to a reasonable voltage and current level to drive steppers directly or use more sophisticated stuff. So lots of people doing little stepper motor driver boards using picks and AVRs and things like that that are cheap and open source and all of that kind of stuff. You still don't end up with a closed loop system magically. And I really wanted closed loop servos. After dealing with the stepper based open loop, little machine, and you know, the number of times I ended up having to throw a piece of work out, go clean the axis drive screws, get everything lubricated just perfectly again and adjusted and then start over again. I really just didn't want to live that way. But that caused this to end up being a bigger project. Because what the industrial hobbies guys sent me in those little proprietary modules, which by the way were very popular, lots of people use them, they work great, I just don't want them, is that they're little black boxes that do the closed loop servo control thing on the sort of machine side. But on the computer side, they pretend to be steppers and they just want step and direction inputs and they don't provide any feedback about what's going on. So that means EMC sees this as being a dumb open loop system, even though you've got all the mechanics of the servo system downstream. My head wanted to explode. Didn't seem like fun, so I decided to do something different. The something different turned out after evaluating many, many options of different kinds of hardware that EMC has drivers for knows how to support. There's a company called KNJN that makes this little thing called Pluto P and I'll show you a photo of it here in just a second. It's basically just an Altera FPGA on a little board that hangs on a parallel port that you can talk to using the parallel ports EPP protocol. EPP basically turns an 8-bit PC parallel port into a bi-directional 8-bit bus and while it's not quite as whizzy as PCI, it does allow you in the FPGA to implement a structure that consists of a bunch of registers that you can read and write directly and so it looks like sort of a reasonable IO extension on the PC when you're done. And there's source and binary for the FPGA contents, all the bits to program the FPGA that are part of the EMC to Tree. As is true with most FPGA things, even though it's an open source for the FPGA, you would have to use Altera's tool set to turn the source into binaries. But, you know, we'll live with that. I also need to point out that the Pluto P itself is not a piece of open hardware, except it's an FPGA and some connectors and the documentation talks about which pin of the FPGA is connected to each of the pins of the connectors because of course you might want to program the FPGA yourself, that's the whole point. So while it's not explicitly an open hardware design, it's not licensed as one, it's a completely transparent design with all the documentation about the hardware that you could possibly want there and crazies like me could even decide to, you know, go design a compatible replacement board someday, you know, in my copious fear nanoseconds, right? That's what it looks like. Just a little things about this big cost 50 bucks or 60 bucks or something. And I don't, it has enough weirdnesses about how the connectors are laid out and all that, I don't actually think it's a great development board for FPGAs. It is cheap, that's got that going for it. But because somebody had already written the four axis servo control loop code to go on this FPGA, it was the obvious right answer and so I bought one of them. All right, well, so what do you get out of a Pluto P in servo mode? You get sort of up and down control signals that are going to be pulse width modulated. What that means is that you get pulses the width of which are proportional to the speed the computer wants that motor to run at. If you've ever played with DC motor control, PWM's a good way to do things by basically switching the full voltage on and off and having the duty cycle of the signal sort of control the speed you're trying to go. You get good torque even at low speeds and it makes the drive electronics fairly straightforward. It's a switching, you know, you're amplifying a switched signal and not trying to do some kind of a linear amplification process. But you need to have amplifiers of some kind to boost the 3.3 volt low current signals coming out of that little Pluto P FPGA into something and drive the motors. In my case, 60 to 80 volts DC at several amps. And if you haven't played with electricity again we are now well and truly into the be very careful this is kind of scary stuff zone. Fortunately out on a big web form and I hate web forms but this one is just too good if you're doing home machining stuff. This guy with a nick of Samco it's who it turns out hangs out on the EMC IRC channel has been super helpful to me recently. Started a big discussion thread and ended up documenting an open hardware PWM amplifier design that he did in the Eagle schematic and PC board suite and while Eagle itself is not free software you can download a free as in beer evaluation copy which is completely adequate to load up his design and dump out Gerber and NC files to send to your favorite board shop, which I did. And I sat around and populated a bunch of amplifier boards. And I won't go into a whole lot of detail on these. I will eventually have links to where you can find all of this stuff on the webpage just created during the keynote this morning to document this stuff. So this is kind of what I was aiming for. You've got a PC with this little Pluto P thing attached to it and then we have four axes each one of which consists of a PWM amplifier taking the signals off the Pluto P and jacking them up to a usable level to drive the DC motors. And then each of those motors is actually driving a mechanical linkage that does a sort of a belt driven gear reduction to the actual axis. And then on the axis itself there's a shaft encoder that gives me, when I finally did the math I get 20,000 pulses out of that encoder for each inch of travel down the axis. Or in other words, I should be able to be repeatable to .0002, I did the math right at five I don't remember inches which is a whole lot better than I actually care about being able to cut. So all of this is kind of cool but it ends up being pretty complicated because it's not just as simple as, oh, I want it to be here and it's here so do the subtraction and tell it to go that far. What you actually have to do is have a feedback loop that understands that things aren't perfect and that this is a mechanical system that has mass and inertia and all of those sorts of things. Fortunately there's a standard way of thinking about this out in the world called the PID loop where in effect you take the set point that you want to move an axis to and you look at where the axis currently is and then you break it up into a proportional and interval and a differential component which when you tune the coefficients on all of these will allow a particular motor driving a particular mechanical interface with a certain amount of inertia and restriction and all of those sorts of things to correctly move in a nice smooth way at a range of velocities and under a range of loads. If that sounds like there might be some knob twiddling and tuning involved, I'm not done yet. I'm to the point where the axes move and as long as I don't try to run really slowly things are okay and over time I'll get better at tuning. This is a little complicated but the rewards I think are entirely worth it. So at some point you end up with a computer running EMC2 and down here on the foreground is one of the PWM boards. I've got a slightly better photo in a minute but I did a lot of testing with a windshield wiper motor before I started playing with the big machine because some random guy on the internet designed an amplifier that I'm gonna hook up to big motors I spent lots of money on and that could kill me if I'm not careful. It seemed prudent to do a little bench testing with a tiny little motor first and I'm pleased that I did that. I learned a lot in that process. Here's slightly better photo. A guy I used to sit next to an old HP testing measurement when he retired left a huge pile of aluminum heatsink stock in his cube that the admin assistants didn't know what to do with. I haven't really known what to do with it for the last 20 years either but I knew if I kept it I would find a use someday. And so yeah, this is all hooked up and you notice there's a little masking tape flag on the windshield wiper motor. I had some code running for a couple of days to burn the boards in that was just sort of doing the wishy-washy thing, running the motor back and forth and when you first start out and the PID loops aren't tuned very well every time you go to start up the motor wants to like jerk and fly off the table because these are windshield wiper motors have a lot of torque. Good trick if you're building robots by the way, it's a good place to get materials. That one came out of a Saturn. But if you get the PID loop kind of tuned right it just sits in gracefully, it kind of flips back and forth and the motor doesn't ever move because you're smoothly speeding it up and slowing it down. If I sound a little rhapsodic it was the middle of the night I got it all working and it was one of those moments. Just to give you a sense of scale on the mill this is my son from 2007. His name's Robert and he's been to a couple of LCA's now. I'm kind of sorry he couldn't come with us this time because he didn't really love playing with the rockets but just to give you a little sense of scale of how big this machine is. Part of what I had to do was mechanical modification of the mill to install the axes, drive stuff and Robert took a whole bunch of photos. Unfortunately either can kind of see what's going on or you can see the big shower of orange sparks coming off the grinder and not both in the same photo. At some point though we ended up with the mechanical bits installed. And I kind of like this photo because you can see the big screw up underneath there that drives that axis. These are ball screws and if you've done any machine working stuff this is one of the elements of quasi magic that allows CNC things to work reasonably. Ball screws are interesting because those nuts actually have a little tube race around there and they're filled with ball bearings so that as you turn the shaft it's actually sort of a ball bearing joint that's being pulled back and forth. And one of the really tricky bits is that's a double nut because if you've ever played with mechanical things involving screws you know that the problem is you have to sort of decide which side of the screw thread you're pushing on. If you're going that way you're sort of pushing into this side when you turn around and go back in the other direction there's sort of a dead spot. You know even just in a car if you have the steering wheel held and you've been sort of turning right and you go back turn left particularly in older cars sometimes there's a little bit of a wiggle there you know that there's some slop in that system. And that's really nasty when you're trying to do computer control you'd like to get rid of it. The ball screws are interesting because with two nuts one pushing against each side the two nuts sort of pushing against each other you can take that backlash almost completely out of the system. The backlash in this system is now less than I can actually measure which is not to say it's all gone but it makes me really happy. But the whole process of mechanical conversion in this mill was getting all of the things that were sort of protruding in the wrong places grinded out of the way so that we could take out the tiny little manual drive acne screws and replace them with ball screws that are bigger in diameter and longer and all that kind of stuff. And that took a while, took a long time. Oh yeah, well no I never dropped any of the ball bearings on the floor I was better than that but there are some tricks to putting them on that will save you a lot to grieve. But then I also have aspirations long term of being able to cut big honking pieces of metal with full flood cooling which means I want to be able to do a splash enclosure kind of build the bathtub shower thing around the mill to keep everything from getting wet. So of course we had to weld up a suitable base for the machine and that always happens in the middle of the night. I wish I had picked up the camera more often that day. My daughter took some nice pictures of me but she actually did more than half the welding and I apparently never got a photo of her holding the welding stuff which was just too bad. She really likes to weld by the way. And so when that was all done we did move it into the room. One of the things that's kind of hard to tell here is that I had to take the doors off the hinges in order to get this into the room. I had measured carefully and knew it would fit but in the end I decided the right answer was to tear the wall down and change the door. And of course this thing needs a lot of power. I already have a sub panel in this room because it used to be where my old HP Series 300 server stuff with the washing machine size disc drives that took 15 amps at 110 each used to live. But I needed a different circuit so of course it's a little electrical. AC worked to be done too. And then the drive electronics for this thing end up taking up a certain amount of space and you really would like them in some sort of protective enclosure that protects you and them. So there's the big box I ended up mounting on the wall. That box is like this. And you notice the big red button on the front. At least one emergency stop switch please. I'll talk a little bit more about that in a moment. But then there's this base plate that goes inside the box to hold all the bits and pieces on it. And when I realized that my son and I had spent the better part of the day floor planning this and figuring out where to put things and getting everything marked. And then the better part of another day, drilling and tapping and cleaning that up and sort of getting it ready, it just sort of gives you a sense of scale on this whole thing. It's been a lot of work. Now another neat little sort of hack trick that the industrial hobbies guys taught me that I wanted to pass along. You notice that all the wires for the axes control stuff are running through this clear vinyl tubing. And it's using hose barbs everywhere to hold the ends of that. Slick trick. It means that you can run with lubricants flying all over the place off the cutting tools or with full flood cooling and you're not going to damage the wiring or get things shortened out. For the price of a hundred foot box of clear vinyl tubing, that's totally slick. And I'm very happy about that way that's working out so far. The only problem of course is that vinyl tubing is kind of static sensitive or generate, it builds up a static charge. I leave it high altitude in Colorado where it's dry. It makes Brisbane kind of exciting. And so I'm a little worried it's going to end up just being a total dust and swerve magnet but that's okay. And to give you some sense, this is what the Z-axis drive looks like. You notice there's a motor on the left with a small toothed gear on it. Sort of timing shaft style belt over to a larger toothed gear. And the trick is that little box up on the top is where the shaft encoder is. So I'm actually measuring the motion of the ball screw. It's not a linear feedback on the actual axis but the ball screw has almost no backlash in it. But any slop in that belt, any adjustment issues between it and the motor and so forth are factored out because we're actually measuring the rotation of the ball screw itself. And then of course that little Pluto P board's kind of cute but doesn't really have connectors that are all that useful on it. So I don't know, I spent a couple of long evenings wiring up a breakout board with a bunch of screw terminal strips. And fortunately that was all sort of not hard. The Pluto P driver documentation in the EMC tree in combination with the EMC integrator's manual has all the info you need to figure out how to break this stuff out and what pins ought to hook up where. But when you get four axes worth of amplifiers and a little Pluto P board and a big honking power supply to run the servo motors and that'll green board standing up is basically designed to put a big resistor across the servo motors when you hit the emergency kill switch so that everything comes to stop quickly, relay control boards, power supplies. That's a lot of stuff. I think Robert and I working together probably spent three days or so just putting wires in between all these pieces according to the schematic I'd drawn up. I will just say again, this has been an incredible learning experience for my little guy too. He's just turned 12 and he's totally happy soldering on things and in the process of fishing up photos for this I stumbled over a couple I really should have put in the greenhouse Arduino talk the other day where he sort of heads down in a hacking rich environment but in any case it's been total fun working with him on this. Let me talk just a little bit about the whole safety thing. I've sort of alluded to the fact that this is big sort of dangerous volts and amps and big motors and lots of mass. EMC has the ability to produce a heartbeat output, I call it, to drive something like a charge pump so that in effect there's a way for the hardware to tell if the software crashes and goes away so that you can shut down all of the electronics if it's no longer actively being controlled. I found a vendor of a cute little board that was designed to work with another software system called Mach 3 which is a commercial competitor to something like EMC2. It uses a little pick to detect an incoming signal and see if it's within an allowable frequency range and based on that to provide an enable, disable output. And then as I mentioned I've got this PWM brake board to kill the servos quickly. The problem is it didn't work and when I went digging into it what I realized is the Mach 3 guys generate a 13 kilohertz square wave as their heartbeat. Why the heck you need to wiggle a line that fast to know whether the software is running or not, it's beyond me. I assume it's because they've got some low level process that's running at some rate based on a PC's clock or something and it's just easy to do that. In EMC2 you can produce a signal that wiggles that fast but there's no useful part of my howl configuration that's running at a rep rate fast enough to wiggle a line like that. I wanted to run it at something more like a kilohertz and that would have been fine except that it's not an open source little module. I mean it's like, come on, we're detecting a square wave and generating a relay closure on the output. How hard could this be? It was the one piece of hardware in the entire system where I caved and said I'll just spend 25 bucks and get a cute little prefab module and it turned out to be something that I just had to completely reverse engineer. I sent the guy that sold it to me an email and said hey, here's my problem, I've figured out what the issue is. All I wanna do is change the boundaries of the sort of allowable frequency here. Can I have the source code or can you tell me where to poke in the binary to do that? And I got back one of those very nice, another nutcase is bothering me kind of emails. And so I sat up one night and I reverse engineered the PIC firmware and I figured out the one byte patch that was required to change the lower limit and I reprogrammed the PIC and it just worked and everything was great. And so being the kind of guy I am, I wrote up a little email saying, the problem wasn't really that I'm a nutcase. Here's exactly what I was trying to deal with and here's exactly the byte that needs to be changed and why I think this would be acceptable and acceptable change in your default firmware even for folks running Mach three. And his response was to say, wow, I'm impressed. You deserve a copy of the source code. I'm sorry, people unclear on the concept. And the sad part is I still don't have this source code. So I deserve it, yes. But it's okay, I already have it. It just doesn't have the original author's comments. It has my comments, which, you know, whatever. I will, part of the reason I'm creating a webpage for this is this deserves, well never mind. You get the point. So when all was said and done and we had the base plate mounted in the box, this is sort of what that looks like. I found a beat up old compact monitor in my pile and a wall mount bracket for it that it's a long story how I ended up with that. Put it up in the wall. You can see the 220 volt or 240 volt 20 amp or whatever it is circuit driving this thing. And then after I had the motion control working on all three axes, then I brought the spindle around to remount because I just knew that if I had the spindle there too soon I'd want to try and cut stuff before the machine was really safe to do that with. And the other thing is I'm just lazy. By waiting until I had motion control of the axes to bring that around, I actually used the motion control on the axes to remount it and lift it up. Laziness is a mother, right? This is the block of wood in which I made the first cuts. And this was only about three weeks ago, I guess. Two weeks ago, I don't even remember. It's more than a week. We've been here for almost a week. And the cool thing is once you finally get the axes sort of moving rationally and you plug in your hardware interface at the bottom of EMC2, my first cuts were a little off. And then I thought about it for a second. I said, oh, I wonder if the problem is that that quarter inch end mill isn't exactly a quarter inch in diameter. So I got out my calipers and measured it and it was 3,000ths of an inch too small in diameter. So I went back into the tool table and said, this one's 0.247 inches in diameter. And the next pair of cuts I made were spot on. Close enough that with the measuring tools I have, I can't measure how far off they are. They're certainly well within 1,000th of an inch. And so I've been playing with it some day. Though I've had a whole lot less time to play with it than I wanted. I put a block of oak in there that was left over from another project that I had sitting around in the garage. And I put a teeny tiny little mill in there and fired up a piece of code and let it run for a while. And my favorite logo. And in the end, I got something that kind of looks like it. But I got a lot of PID loop tuning to do. And frankly, I need a faster spindle to cut things as soft as wood. So what's next? Where am I? What's next? As I say, the servo PID loops are functioning. And as long as I run the motors, it's sort of modest speeds. The axes all seem to move fairly well. But I need to do some tuning in order to make the machine work at slower feed speeds so that I can cut softer materials until I get around to doing something in the way of an auxiliary spindle. A lot of folks, I know, have made brackets to mount something like one of those trim routers on the side of the spindle so that if you want to cut wood or plexiglass or something else soft like that, you can get a higher speed spindle and keep the main spindle for doing what it's designed to do, which is cutting big honking tracks out of steel. The other thing I really am starting to spend some time with, in the past all of my G-code programs driving this had been handcrafted or the results of little Python scripts emitting G-code. This guy named Dan Heeks took the OpenCascade toolkit and has built a full 3D CAD program. It's still got a few rough edges but I'm really impressed by Heeks CAD and I think it's gonna end up being my sort of design tool for doing more sort of high level 3D design in the future and there's an associated CNC module for converting 3D designs into tool paths that looks promising. I don't know how good this stuff is, I'm not using it much but I have committed to package it all for Debian so eventually hopefully I'll know something about it. I wanna add a servo driven rotary table as a fourth axis, that's why the electronics box has four PWM amp and feedback modules. As I mentioned, I'm eventually gonna end up doing full flood cooling. I put in lots of computer controllable relays in there so I can use G-code commands to turn the spindle on and off, to turn the coolant on and off and all those sorts of things. And just this morning I created this webpage, gag.com slash home shop where I will eventually get this talk and a lot of other information about that up there. So with that, I'm gonna stop. Thank you very much for your time and attention and hopefully we have a few minutes for questions. We've got about three minutes so maybe just two or three questions and then you can catch B-Dale at lunch. Yeah, I'll be around until Monday morning and come walk Fly Rockets with us Sunday if you want. Yeah, there's a couple over here, there's somebody back there. No worries. B-Dale, I've noticed the quality and openness of tools in hardware is really abysmal. You know, you see potted circuits and you see circuits with the part number sanded off the chips. Do you see that improving at all and do you think there's much we can do to affect it? You mean in terms of things for motion control and all of that or? Embedded systems in general. Well, so the interesting thing is I think it's true that we have been through a period where there's an awful lot of stuff where people are trying to obfuscate what's going on and this guy, I'm not naming the guy that I got the little board from because in fact he's been pretty nice to me. I just, his attitude about the source code for the little PIC microcontroller irritates me but I think there are a lot of folks who are just trying to eke out a little bit of a small cottage shop at home business out of selling bits and pieces to folks doing embedded systems work or doing machine control. I'm hopeful though because I see enough pieces now that as you can see I almost navigated this whole thing without having to use anything that wasn't an open hardware or open source design and it feels to me like we're close. One of the things I'm contemplating doing just as I, even though it's working and it's kind of cute in a one-off sort of way, I've been doing enough circuit board design lately that having this rat's nasty thing in the middle of my box of otherwise snazzy looking electronics for driving the mill irritates me and so I may very well have to do a Pluto P clone that's got the right breakout stuff and all of that and integrates this charge pump stuff and so forth at some point and the more of us who, and this guy Samco whose real name I don't actually know yet so I'm sure he would tell me if I asked. The work he did on coming up with this open hardware PWM amplifier turns out there are at least a dozen other people who've built his boards. Apparently I'm the first person to just send the design out to our PC board shop and get professionally made boards back. Everybody else uses their CNC mill to cut the copper to make the, well. It's a hobby, I mean this is a thing. This has been an immense amount of work but every aspect of this is for me, fun hobby time and a lot of it's been fun hobby time that my son or daughter, not so much my wife she's mostly the long suffering person and all of this but it's been more than just trying to get to an end for me and this whole process has been interesting. I'm planning to document more of what I've learned and hopefully what comes out of this is things keep getting better as more of us keep doing open stuff. Have you any plans towards tool changing in the future? So I'm actually using the Tormach tooling system which is a collet system that gives you a smooth Z reference plan so that when you manually change tools you get repeatable positioning of the length of the tool and where it is in the spindle. I've thought about automatic tool change but honestly for the, at least in the near term the aspirations, the things that I wanna make it's just not necessary and the EMC stuff is completely flexible about this. I've configured it to say I have a bunch of tools I'm gonna manually change them so it will pause the program and put up a dialogue box telling me it's time to put in tool number three next and you know. So that's a reasonable way to handle it in the short term. I have friends who are working on automatic tool change stuff for similar sized machines and certainly doable just not my passion at the moment. One of the ones I'm very interested in using is instead of using the DC server motors using brushless DC motors. Because at the same time that you're driving them you can also get a reference for how fast they're moving. Not a accurate position reference but it does give you a direct RPM reference of the actual motor. Right, yeah. There are folks playing with all sorts of different things. In my case I sort of made the decision to buy the industrial hobbies conversion kit which included some very nice non-brushless DC servo motors before I got sophisticated enough to think about that. And at this point honestly, while I've got some PID loop tuning and stuff to do my combination is pretty close to right now. The funny thing is for a long time I was confused into the belief that EMC would only drive steppers using a step and direction interface. And it was actually only in the process of diving into the deep dark vowels of the EMC to integrators manual in search of PWM tuning stuff that I realized that it actually supports about 14 or 15 different modes of outputting stepper drive stuff. And in fact, I believe I could configure it to drive my stupid little mill that just uses transistor switching apps for the phase leads on the steppers, two phases per. I think I could drive that directly from EMC at which point I could get rid of the ancient notebook that keeps failing that is the only one I have that has a parallel port and no network interface. And so I may find myself compulsively needing to do an EMC config for that at some point just to prove it works, but in all honesty as soon as I've got the new big mill sort of dialed in the chance that I'll ever feel motivated to turn the power on on the little one again seems remote. Any? Right. So we've got time to present you with this small gift. Thank you, be down. Thank you very much. Thank you very much. Thank you.