5. Electronics production

This week, we will learn to make PCB boards. I don’t know anything about electronics, but Henk said this is ok— we only need to follow instructions closely this week, it is more about learning the process of production than how to use electronics. We all made the FabTiny Brian ISP, which is described below. We started with a tutorial on the small milling machine.

Using the Small Milling Machine

Our machine is a Roland MDX 20.

machine

Although it can be used to mill molds or other small objects, we only use it for PCB boards in our lab. These are milled on a copper plate with a .1mm layer of copper on top. The boards here are FR1 boards, which means that they have a backing of paper phenol.

machine

To send prints, we use Mods on the computer next to the mill.

  1. To open the current version, click on the “start-server.sh” icon on the desktop. machine
  2. Select “run in terminal” in the window that pops up. machine
  3. This will open both terminal and firefox Terminal will display that it is opening terminals in different ports. The ports are boards attaching to different devices. We are only usijg the device server today. This information typically will not need to be engaged with directly to mill. After Mods is started, the machine turns on and goes to its starting place. It is attached to a device called ttyUSB
  4. In firefox, click on Menu > Programs > Open Program machine
  5. In the list of machines, click on PCB under the MDX 20 machine
  6. Within mods, you can start by opening an SVG or PNG in one of the two first modules. Click on “select File” within one of these to open your file machine
  7. We store these in the folder “Fablab 2020.” The white area of the image should be where we want there to be copper.
  8. Go to the Settings module that feeds into the Mill Raster 2D module and select either mill traces 1/64 or mill outline The settings module has 3 categories: Mill traces 1/64, Mill outline 1/32, and Mill traces 10. We will choose from only the first two. These commands will send a set of default settings to the Mill raster 2D module. machine
  9. In the Mill raster 2D module, set the offset. This number determines the number of traces the machine will make around the perimeter of the copper in your design. We are setting offset to 4 for the tutorial.
  10. Stepover sets the distance between lines, set as .5 so that there is overlay between the traces, ensuring there is no leftover copper. 1 would set the distance between each new trace to the same as the diameter of the trace. machine
  11. Direction allows us to choose between climb and conventional. We typically use climb.
  12. Leave Path merge at 1.
  13. Set Path order to forward.
  14. Hit calculate to generate the path/ g code that the machine will use. Hit view a new tab will open showing the toolpath. Clicking view in the View toolpath mod will also show you the path that the machine will take. machine
  15. In the Roland MDX 20 milling machine mod, you can change machine settings. machine
  16. Set speed to 1.
  17. Go to Websocket serial mod. We use this mod because we use a serial to USB cable at Waag. See that socket is Open. If not, click on open. This means it is connected to the device.
  18. From the Websocket serial mod, Click send file.
  19. Now go to the machine. We will return to mods to set origin.

Setting up the Machine

  1. Have the machine in view machine
  2. Unscrew the base. The base is made of an acrylic bed with a sacrifical copper board attached.
  3. Check if there is any tape left on the sacrificial board as it affects the depth of the cut, so it must be completely removed.
  4. Remove tape first with the metal scraper, then with solvent, which will be above the machine. Wipe off any paper dust with your hand.
  5. Get a new board from the drawer.
  6. place it face down on a towel and apply double sided tape to the entire back of the board (6 stripes)
  7. Place it exactly on the corner of sacrifical material, then put the whole base face down on the towel and use force to make sure the board is stuck.
  8. Screw the plate back in
  9. press view to exit view mode, it will travel to starting position
  10. Once here, put in a milling bit. To do so, hold the bit between ring and middle fingers with palm facing up. Push up while tightening the bit from the side with a screwdriver, using your other hand. Push the bit all the way up.
  11. Go back to milling machine module in mods and move to origin. This can be adjusted by sight, should be at bottom left corner of board, Usually around x: 10, y: 10
  12. Bring z axis all the way down using the tool commands on the machine.
  13. Loosen the screw by hand using the same technique used when installing the bit. Lower it until it is touching the copper. Wiggle the bit in case there is dust between it and the board.
  14. Rotate the file under the Read Png mod if necessary. Remember to hit Calculate again after any adjustment.
  15. Write down the x, y origin you are using in case your print fails and you need this information.
  16. From the websocket mod, hit send file. Milling will begin.
  17. When milling is complete, vacuum up the dust produced in the process. There should be a hand vacuum next to the machine.
  18. Now we will cut out the outline of the board. Go back to mods upload the outline file.
  19. In the Set PCB defaults mod, choose Mill outline
  20. In mill raster 2d set offset to 1. (we only need to cut it out with one line) If we hit view, we can now see that it is a 3d cut following a single path. The depth is automatically set with the mill outline default.
  21. At the machine mod, set speed to 4. We can move faster now as the outline does not need to be as precise.
  22. Change the bit in the machine to (bigger). Change it using the same method described above. Push the new bit in all the way up.
  23. Push the z axis all the way down. Now push it up a tiny bit, so it has enough room to go down still to cut through the board. Allow the new bit to fall gently to the plate surface.
  24. Go to websocket and send the file.
  25. Once it is done, use the screwdriver next to the board to try to move the board. If the cut was successful, it should wiggle. Push it out from the board.
  26. Check the board under the magnifier. Scrape off copper from the edges. Depending on the board, you may also have to remove some parts of the copper to prevent shorting. We printed a USB board, and Henk showed us how there is a small bit of copper on the end of it that needs to be removed.

Notes When cancelling a job on the Roland, make sure to hit close port, close socket on mods in addition to hitting cancel. On the mill, hold both tool up and tool down after hitting view, and you will see the light blinking. Let go after holding it down for a few seconds, then wait until you see the light stop blinking. It is now ready for a new job. You will have to hit open port open socket on mods to be able to send the machine to origin again.

Soldering

General Soldering Notes:

  1. Before starting, make sure you have tweezers in PERFECT condition.
  2. Wet the sponge on the base of the iron, touch the iron to the wire, then clean it on the sponge before you begin.
  3. The technique is always to touch iron to the board, add the wire, remove the wire, then remove the iron.

The wire we used this week:

Now, how to solder the Brian board:

  1. Clean the board. Solder doesn’t stick to oil. We can wash it with handsoap and water in the kitchen, and dry it with a paper towel. If it is still rough under the magnifying glass, we can “sand” it with the same paper towel.
  2. Place the board on a piece of office paper. It should still have double sided tape on the back. Fold the paper over and press the board into the paper so that it sticks. This way, we can move the paper when soldering and not have to touch the board itself.
  3. Get the iron and thin wire out. Have the guide for the “Brian” board from this week’s class link on the Fabacademy website.
  4. We will attach the ATTINY45 first. It has a small black dot on Pin 1. Make sure this is positioned in the bottom left corner (ground?)
  5. Solder the corner with the dot first. Head the copper it will attach to, add a bit of solder there, remove the wire, remove the iron.
  6. Place the board down. Solder the cable coming from it to the drop of solder we have just placed on the board. Look at the other side of the ATTINY and see that all of the prongs are aligned with the copper on the board. If it is, solder the opposite corner to anchor it. Now continue to sodler around the whole chip.
  7. Now solder the Res 10 q. These are orientation free. For these, we put some solder down, then place the resistor on the solder. Now push down with the tweezers, and touch the iron to the solder again. Now add a drop of solder to the other side of the resistor.
  8. Now other reisstors. These still have no orientation, but make sure they are facing up so that the label is sbowing.
  9. Now Zener diodes–they have orientation.
  10. Now the green LED—these have green marks on one side.
  11. Now the ISP readers.
  12. Add solder to the paths at the end
  13. There was a blob we had to solder and desolder

Group Assignment

Group Page

Complete with pictures at the above link, the steps we followed are outlined here:

-characterize the design rules for your PCB production process

For this assignment, Henk told us to mill 4 PCB boards. We would use both a one flute and 2 flute 1/8 mm drillbit, and cut a board in both climb and conventional on each bit. Hyejin downloaded the .png file from the fabacademy website.

  1. Hyejin attached the one flute 1/8mm drillbit to the mill by holding it the way henk had instructed us–using a flat hand with the bit between middle and ring fingers, and using the allen key with the other hand. This is the same way the bit should be held as it is removed from the machine, so as to prevent it from falling.
  2. Mods was already open, so we did not have to open it. Normally, the process would be to click the start-server icon on the deskto that Waag uses to load mods, then select Menu > Programs > open program > Mdx 20/PCB in the firefox window that opens.
  3. We imported the png file in the read file png mod.
  4. In set PCB defaults we chose the mill traces default. We accidentally changed the speed in this area to 1- but this is not where you change the speed! We caught the mistake and changed it in the Roland MDX mod instead.
  5. We went to mill raster 2d and used the default settings imported from clicking mill traces: Offset: 4 Stepover:.5 Path merge: 1 Direction: Climb Path order: Forward This means our first test will be with one flute and climb.
  6. We hit view in the mill raster 2d mod and we were not sure if the image showed 4 traces, even though we had set offset to 4 and we had learned that offset determines the number of traces. We set offset to 1, hit calculate, and viewed the new image. Comparing both, we could see that we did, in fact, have 4 lines the first time.
  7. From here, we went to the Roland MDX 20 mod and again checked that our speed was at 1.
  8. We went to the python websocket port and clicked open port and open socket to make sure the socket was open. Though we normally use Websocket port and not Python websocket port at Waag, we had to use the python websocket today because of connection errors.
  9. We discussed if we should send file or not at this point- Henk did accidentally send the file at this point in our tutorial, but Tessel had written down that after doing so he said “not yet!” We went to the machine to set the origin first.
  10. On the machine, we hit view. The drill and board went to their home position.
  11. We first brough the z axis of the head all the way down using the down tool button. We were scared to start setting x and y because it seemed possible that when we brought the bit closer to the board, it would collide with it. Hyejin thought she could push the bit higher when she had put it in, so we decided to try to push it higher to be safe.
  12. Back on the Roland MDX 20 mod on the computer, we started to adjust X and Y origin. We realized that the x placement of 17 from the last cut was fine, and we set y to 40. So our origin was (17,40).
  13. We then brought the z up a tiny bit so that the machine would have room to drill into the material, then lowered the bit to the surface of the material.
  14. We hit send file on the python websocket port. It started milling successfully.
  15. After it was done, we vacuumed up the dust and started the next board. We decided all we would have to change would be the direction and origin
  16. In the Roland MDX 20 mod, we changed the origin to 17,55 to move the drillbit to a fresh part of the board.
  17. We changed the direction to conventional in the Mill Raster 2d mod.
  18. We hit calculate, checked the port was open, and sent the file. Done with one flute!
  19. We installed the 2 flute 1/8mm bit using the method described in step 1. Note: There are two holes for the allen key on the drill head. Only one tightens/loosens the drill bit. It is easier to do this if the hole is facing out—you can turn the drillhead until it does, even if you feel some resistance.
  20. We set the direction to climb, changed the origin to 17, 70 and hit send file.
  21. We noticed that although the mill was moving, it was not actually cutting—maybe we had not lowered the bit enough.
  22. We hit view on the machine, cancelled the job on the computer, and tried to hold down tool up and down at the same time as Hank had instructed us to do if something went wrong. This should clear the machine’s memory. We tried to do this several times but every time we hit view again, the machine would start trying to mill the old job. Henk came over and showed us how after you hold up and down at the same time, you have to wait for the light on the machine to stop blinking. This takes much longer than expected, because the machine is running off of a microcontroller.
  23. After this, we hit move to origin again on the Roland MDX mod. We set the Z axis again by lowering it completely using the machine’s tool controls, raising it a tiny bit, loosening the drillbit, and lowering it until it touched the material. This time, we held down the drillbit as we tightened it to make sure it did not move up at all.
  24. We hit send file- it worked! We waited, and vacuumed up the dust after the machine completed the milling.
  25. We had to do the 4th cut in the morning and Henk had cut a board before we arrived, so we had to change the bit again. We inserted the 1/8mm 2 flute bit.
  26. On the computer, we hit mill traces in the settings mod, speed 1 in the Roland MDX mod, and conventional/Calculate/view in the Raster 2D mod.
  27. We set X and Y to 17, 85 and hit send file from the Websocket Python serial.
  28. Again we waited and vacuumed up the dust when we finished.

From our results it looked like both one flute and climb produced smoother lines in more detail. In order of producing results that most resembled the .png, we ranked the milling:

  1. One flue/climb
  2. One flute/conventional
  3. Two flute/climb
  4. Two flute/conventional

Weekly Assignment

make an in-circuit programmer by milling and stuffing the PCB, test it, then optionally try other PCB processes

For this week’s assignment, we had to make our own ISP. Henk recommended we start with the Brian board, the same one he worked on during the local lesson. I largely followed the steps noted above from the local lesson, I will again outline what I did here:

First, I prepared the machine.

  1. The base was already detached from the machine, and the sacrificial material was already bare and the tape had been cleaned.
  2. I grabbed the copper board I would mill and placed it face down on a towel, applying tape across the entire back
  3. I lined up the corner of the board with the corner of the sacrifical material. I then turned the entire base over and applied pressure to seal the new baord to the base
  4. I screwed the board back in
  5. I unscrewed th .4mm bit that was left in the machine, and replaced it with the .8mm bit
  6. I pressed view to send the machine to default position

  7. I downloaded the .png file on the computer that runs mods for the mill and saved it in projects/nathan

  8. I opened mods using the start-server icon on the desktop, and clicking Run in terminal > Menu > Programs > Open Program > Roland MDx 20/PCB
  9. I selected my file from the load PNG module
  10. In settings Mod, I chose mill traces 1/64
  11. In the Mill raster 2d Mod, I chose
    Offset 4
    Stepover.5
    Direction Climb
    Path Merge 1
    Path order Forward
    
  12. I hit calculate and viewed the toolpath- all looked correct
  13. In the Roland MDX machine mod, I set speed to 1
  14. I went to the Python websocket and clicked open port, open socket
  15. I set X and Y of the origin to 10,10 in the machine mod and clicked send to origin. This was off, and some of the board had already been used, so I had to adjust it to 17,50.
  16. I adjusted the Z axis by pushing the drillbit as far up as possible and locking it in. I then lowered z all the way, and then back up a tiny bit. I let the drillbit drop until it was touching the surface of the copper.
  17. I hit send file in the python mod.
  18. It worked! Now I had to cut the outline
  19. I changed to the .8mm drillbit
  20. I downloaded the outline file to projects/nathan and loaded it into mods
  21. I now selected the Mill outline default. In raster 2d mod, I changed offset to 1. I changed speed to 4 in the machine mod, and hit calculate. I sent the file from the python websocket mod
  22. I vacuumed up the dust and put the machine in view mode. I unscrewed the plate and I tested that the board would wiggle with a screwdriver, then pried it out.
  23. I scraped the board off of the sacrificial board, and then scraped the tape off. I then rubbed it down with solvent, then used my hand to get the paper towel dust off.

Soldering

  1. Done with the machine, I had to scrape the excess copper from my board, especially the bit on the tip. I rubbed the sides with paper towel to sand it. I then washed my board, getting ready to solder.
  2. I placed the board on a piece of paper and it stuck from the remaining tape.
  3. I loaded up the guides to help me solder: Brian board. Henk said to only take out one type of component at a time so as not to lose them. He also started with the ATTiny45 in our tutorial, and finished with the 6 pin board, so I decided to do the same.
  4. I immediately ran into trouble soldering—I didn’t understand that I did not have to touch the wire directly to the iron, so it got a bit messy, as the wire would melt onto the iron, and I would hold the iron on the board for too long. I ended up burning off part of the copper, so I drew a new path with the solder.
  5. After that, the process went smoother. I figured out better soldering technique (hold the iron on the patch of copper, then touch the wire to that patch)
  6. I next attached the resistors_ first the 10ohm, then the 499, then the 49. I attached them by first placing a dot of solder where I would place them, holding the chip down on top of the solder with the tweezers, and melting it into the solder with the iron. After that, I would solder the other side.
  7. I next attached the zener diodes with the same method described above, making sure the line was in the right direction.
  8. I attached the capacitor with the same emthod described above- this had no orientation.
  9. i attached the Leds with the same method, making sure the cathode sides went in the right direction.
  10. Finally, I attached the 6 pin head, anchoring one corner then the opposite corner first, and then soldering all the other connections.
  11. I created the bridge where instructed to and thickened the USb contacts with some solder. I also added tape to the underside of the board to thicken it.

Programming the board

Before I got started programming myself, Hyejin tested my board on her computer- it lit up, so that was a good sign! but she couldnt run “make flash” on it. This was the same issue she was having, so she thought it might have been her computer. I was now going to try to run it on my own computer.

I followed the instructions from the Brian board site and downloaded CrossPack. I then downloaded the firmware source code. I didn’t really understand what all of this meant… so I looked at the Crosspack website and noticed that their tutorial matched the process described for building the Brian board. My understanding is that Crosspack is a development environment for the firmware for microcontrollers, and that firmware appears in a specifically formatted hierarchy of directories and files. I still did not totally understand what I was doing this week, but decided it was more important to get everything done.

I downloaded the firmware pack from the instructions, and tried to run make. However, I got the following error: I googled this error and saw that many arduino users faced the same issue after updating to MacOSX Catalina–it was not compatible with 16bit development, only 32bit. (Dont know what this means either) As this seemed to raise a whole host of issues and I thought programming the board would be quick, I asked my friend, who was still running an earlier version of MacOS, if I could use her computer. I downloaded crosspack and the board’s firmware successfully, and ran make successfully as well. However, when I plugged in both my board and the programmer from Henk, I got the following error:

This was the same error I got on hyejin’s computer. I tried to run the command several more times, then decided to wait until I was back at Waag to work on this more.

At Waag, harm recommended I install brew tap osx-cross/avr && brew install avr-gcc to make it work on Catalina. After doing this, I was able to run make.

I also got an important tip from Henk, he instructed us to use an avrdude command which hadn’t appeared in the guide:

$ avrdude -c usbtiny -p t45

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9206 (probably t45)

avrdude: safemode: Fuses OK (E:FF, H:DD, L:E1)

avrdude done.  Thank you.

This established a connection with the board we made that the machine would not establish previously, which is why we got the “could not find” error. Henk told us this tells the computer to go through the usbtiny device connected to your computer (the programmer board) and looks for a tiny45. When it finds it, the command appears successful and it shows the device, it is the one above that says (probably t45).

After Henk showed us this and my machine established a connection with my board, I think I got confused and thought I had now successfully run make flash. Because of this, I immediately ran make fuses then make rdstbl. These commands both ran successfully, so I thought I was good to go! But then… my board would not show up under USB devices when connected to my machine. Henk connected it to his Linux computer to see what came up in the dmesg dialog:

I kept getting this error. I tried adding more solder, and pressing down on each connection with the iron, but nothing helped. Then Henk asked to see my terminal window… we looked through all of my make flash commands and noticed that they all failed! I had gone straight from establishing a connection with the board to make fuses and make rdstbl. So… I had blocked my board from more programming without ever programming it. I had to replace my ATtiny

Next time, I will know what each of these commands do before I run them.

make flash installs firmware on the Attiny

make fuses creates hardware connections

Henk showed us how to remove the microcontroller with a heat gun. I soldered on a new one, repeated the process of running

avrdude -c usbtiny -p t45
make flash
make fuses

This time, I disconnected the USB and checked that it was showing up on my computer before I ran the command to close circuits. It worked!

I ran make rdstbl, checked that the device still showed up, and asked Henk to check on dmesg again. All good, finally.

Then, as described in the Brian board instructions, I removed the J1 bridge in order to make the board a programmer!

Summary

This week was strange because, at the end of it, I still did not have much of an idea of what I had made or how it worked, but Henk assured us this was normal and we only needed to go through the motions of milling, programming, and debugging this week. Electronics production is a bit intimidating- both the mill and soldering are time consuming processes that can easily go wrong. Looking forward to getting a better idea of what i made this week in later electronics weeks.