The Ben Heck Show is brought to you by element 14. Visit element14.com/tbhs to learn how a purchase of $100 or more can get you a free subscription to Make Magazine, while supplies last.
In the year 2000, Ben Heckendorn built his first mod.
“Ben: We can rebuild it smaller, better, portable.”
Since then, he has continued his work helping those in need with creating new projects. If you’ve got an idea you’d like to see built, why not send it to The Ben Heck Show.
“Ben: Hello and welcome back to The Ben Heck Show. In today’s episode we are going to be building a pinball machine. We will start by installing a new CNC machine in my shop. We can use this to cut out the parts. Then we will work on the design, which will include useful tips for your own Cad-Cam project. By the way Cad-Cam stands for ‘Computer Aided Design-Computer Aided Manufacturing’. Finally, we will discuss how to use an embedded processor to control everything. If you have been interested in embedded processors in the past, this will be a great introduction to their use. Enough talk, let’s get started.”
“Ben: Here is the Shop-Bot CNC machine I ordered. It comes in a crate, some assembly required. This should be easy - most of the parts are either structural or electronic in nature. As we discussed in episode 2, a CNC machine is really simple. It is the software to run it that is complicated. Some assemblies come prebuilt, such as this Y-Axis arm. Most of the construction time involves putting the table together and keeping it square. The Y-Axis arm is a fixed size with rollers on the end, so we have got to make sure that the sides on our table are parallel so it will all fit together. Three layers of material are used to create the worktable. Now, we have to get everything up and running. One of the biggest dangers with CNC is the machine damaging its self or the routing bits. So we take everything slowly, first doing air-cuts before actually cutting material.”
“Dan: Do you want to do one on all four corners? Are there three more holes on there?”
“Ben: Yeah.”
“Dan: Just to see if it fits the table. Make the same in four inches from each corner.”
“Ben: Oh, got it, got it. I’m going to actually cut some material.”
“Ben: Our next step is to cut holes in all four corners of the table to make sure the machine can operate at its full 4 x 8 foot size. The top layer of MDF board is the sacrificial material, the work surface that will get banged up along the way. We have the machine drill counter-sink holes into this. That way, when we put the screws in to secure that table the heads of the screws will be deep below the surface, so we won’t hit them with the bit later on by accident; we do another pass to put small guide-holes aside the bigger ones. Then it is time to screw everything down. There is a casualty along the way though, the fan blades on my favorite drill just blow up out of nowhere.”
“Ben: Next crappy drill bit please.”
“Ben: The table is now securely fastened. Even if the bit digs into it a little it won’t hit the screws because they have been countersunk. We then test out the 3D functions of the machine by carving out a small replica of a Porsche. Not wanting to bore my friends to death, I do the next part later on by myself – surfacing the table. Wood is rarely completely flat so the machine skims off a thin layer to make it flat. This process takes forever, so I work on a customer’s single-handed controller in the meantime.”
“Ben: Now that the CNC machine is up and working – we can work on the cabinet designs themselves. We have our basic pinball design - however, this one is not at the right rotation. The machines are actually tilted forward a little bit - at about exactly negative 3.5 degrees, which makes the legs level down there at the bottom. The new thing we are going to try is having folding legs. Now, it might not be entirely obviously by this drawing but here is one of the new pinball legs. Inside the unit is going to be some square tubing, the leg will slide out of the tubing like this and then it will rotate on a hinge or a pin, which will be right there. Then finally, it will fold up under the unit. So the bottom leg goes vwoomp, voom; the back one goes vwoomp, thugump.
Now you might be thinking all the legs are going to hit each other, right? Wrong. If you look at the back of the unit, we have another line drawing here. You can see the back leg is going to drop down and slide over. Your back leg will do this – it will come down, it will come in a little bit, and it will go up and then the front one will just come up and they will sit side by side. So what we are doing here is we are making the machine fit within a small area. If we select all this stuff, we will see that it will fit under - 27 inches of height. I think it will work out pretty good, so the next thing to do is to actually route out this sucker.”
“Ben: The CNC machine is controlled by a laptop via USB. Currently this laptop is sitting on a table, which is fairly inconvenient. I have to go over to it, sit down, type stuff, select OK, blah, blah, blah. However, this laptop must be attached to the machine at all times, it sends commands and codes line by line. My solution was to design and cutout a rolling computer desk, which can hold the laptop, mouse pad, and power supply. I can type on it standing up and roll it closer to the machine when doing calibrations. It may look like something out of Sky-Ball, but it fits my needs perfectly.”
“Ben: Alright, it is all put together. I have a rolling table which will move the computer around to control the CNC machine. Now, on to pinball.”
“Ben: We are almost ready to route. We use a program called PartWorks, which is also sometimes called ReCard to generate the file to control the machine. We are going to use two bit tools, an inch bit – to drill the holes for the screws and some of the connection points, then a ¼ inch bit – to do the main cut outs around the edges. Let’s preview all tool paths to see what it is going to do when I route out this pinball machine. There are the screw holes, there are the notches to slide boards into, there are the inch holes which are air vents, and a coin door. Here is where the glass goes and then there are the shapes themselves, Bam! Done! Three points, swish.”
“Ben: It takes about an hour to cut out all the parts, but they do fit on a single 4 x 8 piece of MDO plywood. MDO is Medium Density Overlay, and has a solid paper coating on each side, instead of wood grain. A friend of mine suggested using it since we will be covering everything with graphics anyway. We talked about sliding legs earlier. Now we are routing the brackets for them. The end caps have grooves which help us align the pieces for easy assembly and also add strength. These brackets hold the square aluminum tubing where the legs will slide in and out of. We drill two holes in each aluminum tube and then secure it to the wooden bracket with machine screws. Now we will show an example of how the legs go in the cabinet.”
“Ben: Alright, so here is the tubing where the legs will fit in. This is a mis-engineering divot right there. So the legs slide up into the tubing like this, you can see there is a slot on the leg, so what happens is – this comes out like this, in theory. Then it rotates so it can fold up under the cabinet like that. It would seem that in true Ben fashion, I have made my tolerances too tight. To compensate for that, I have a tolerance compensation tool. Another engineering job well done. There you have it, we have designed, routed, and assembled a pinball machine cabinet. In future episodes we will come back and take a look at this build to see how it is progressing.”
“Ben: As I mentioned earlier, we won’t be able to finish the entire pinball machine in this episode – but we will get started on the programming which makes it tick, using an embedded processor. Our sponsor’s element 14 now carry a very popular type of embedded processor called the Arduino board. At the element 14 store, you can choose from Arduino Nano, Uno and Mega boards. This for instance is a Mega board. The difference between them is the amount of features and memory they have.
They are great for doing embedded projects where you want to sense or control the environments, such as robotics, RFID readers or perhaps, even a pinball machine. Plus, the development environment is a completely open source, so you can do it on Windows, Mac or Lennox. Check out all the Arduino boards at element14.com and check out element14.com/tbhs for details on how you can get a free subscription to Make Magazine while supplies last. This offer is only good in the United States, but you can check the site for other promotions in your region.”
“Ben: Now let’s talk about using embedded processors for this and other applications. Something large, like a pinball machine, could be controlled with a PC – but if you are making a smaller device a large, power-hungry PC isn’t the best option or even an option at all. That is when you turn to embedded processors. You get the logic of a computer, yet the small size of an integrated circuit. One popular platform is the Arduino. It is an open source development environment around Atnos line of 18 mega-processors. Once you buy an Arduino board, you can download the software and tutorials to run it at www.arduino.cc.
I am also a fan of the parallax propeller processor, which I used on my Bill Paxton pinball machine. It has eight internal processors, which allow you to do very easy multi-tasking – though the RAM is kind of limited. It can also output video, which can be useful for debugging. You can download their software at www.parallax.com. Let’s look at three examples of what you can do with these processors – input, output, and sound. Remember, these basics can be applied through all sorts of projects – I just wanted to get your creative juices flowing.”
“Ben: For my input example I will be using something we are all familiar with – a Nintendo 8-bit controller. Every notice how it has 8 buttons, but only 7 pins on the plug? How can that work? The answer is a ‘shift-register’. The controller contains a shift-register, which is an integrated circuit that converts parallel inputs, such as buttons, to serial data. The CPU sends a pulse on the latch line, this gets the button data into the register and ready to go. The CPU then pulses a clock line 8 times, each pulse retrieving a bit from the register. Bam, bam, bam, bam, bam, bam, bam, bam – the byte has now been transferred. Let’s take a look at this in practice with the NES controller. Here is a little demonstration – we have a Nintendo controller, and it’s shifting its bits into this. It is quite simple – you have up, down, left, right, select, start, B, A. So, yeah – the controller basically fits into one byte of data. That is how the Nintendo reads it and that’s how you can read a shift-register.
Now, it might not seem that useful to only read 8 bits or one byte from a shift-register, but what you can do is put them in series – like in this drawing. Basically what happens is as you shift out the bits from one shifter, it shifts them into the next shift-register. Kind of like a centipede. You could have four shift-registers in a row, and that would actually get you 32 bits – you can actually daisy chain as many together as you want, within reason. It just depends on the speed of accessing it with your program. So, if you have 10,000 shift-registers obviously it would take a longer time to shift out that data than one shift-register. But, with a high-speed processor you can daisy chain quite a few together and still get the data out pretty quickly therefore, giving yourself many more inputs than you have on your processor itself, or outputs – as well. You can use a shift register for an output in the same way, just reversed. The CPU has a number ready and send 8 clock pulses to put this data onto the shift-register. When the CPU pulses the latch line, the data appears on the output and can light LED, trigger relays, or whatever you want.”
“Ben: Here is a parallax propeller. I put this little board together myself, basically you have got the CPU, a crystal to drive the clock, and an e-prop to load the program and a little 3.3 power regulator. So what happens is you can hook up some power, I think that is like 12-volts. Then, it goes into the circuit and that is all there is to it. You also have this thing over here, which are SD cards. With all these embedded processors, you can go out on the internet and find library – such as a library which allows you to access the data on an SD card. This stuff is usually already figured out, so once you find the library you are good to go. Then we also have a little audio plug here, it looks like a mess because it is.
Then finally, you have this USB to serial adapter. Typically you need these embedded processors to be programmed for the USB. Usually the plug will be on the board itself, in the case of this one there is not much circuitry here so I had to buy this external adapter. There we go, right there it is ready to program. So now let’s move on to the program.”
“Ben: Let’s start by putting the audio clip on the SD card. I have my sound-forge program here, which I think is the oldest program I still use. I don’t know why I still use it, but I do. Heavy traffic, why not – look it still works. Then we need to make sure it is the right format to work on the SD card with the propeller. We are going to call this traffic and we want to make sure it 44/100hz, which is 44/100 samples per second, 16-bit stereo – okay, also known as CD quality. Okay, so the SD card with the data – you hook it up into the little processor, the processor is hooked up to my stereo so when that sound comes through we can hear it. Now we need to do the program, this is the propeller tool. It is the development environment for the propeller processor.
You can download it off their site, or if you are using the Arduino, they have their own development right here. Again, it is the same thing. You write out your code, and there are plenty of samples on the internet to get you started. You write out your code and then you upload it to your integrated circuit, and then it executes. So, let’s go back to the propeller here. I found an object which plays music off an SD card. All the work is pretty much done for us here, we just have to check a few things. The pins that it outputs on, that we hooked up the headphone jack to. We have to make sure that is correct, we actually used pin 16/17 – right. We go back up here, the first thing it does is – mount 0, which means we are going to mount the SD card and attach to pin 0 thru 3. Then there is a team here, called play. All we need to do is we need to call that – so we go play and our parameters, which is the string which has the file name – which was traffic.wav. Switch on the propeller, and hit compile. It sends it. It is kind of an over modulated sound clip, but as you can hear – it is playing off the chip.”
“Ben: That is all the time we have for today. Join us in the next episode as we build solar powered and kinetic powered chargers for some portable devices, such as the power-hungry android. We will see you then.”
The Ben Heck Show is made possible by our sponsors at element 14. For more information on all my projects and for a list of all the parts I used today, visit element14.com. We will see you next time.