<h1>Electronics Production</h1> <h4>Wednesday February 14, 2018</h4> <div style="width:40%; float:right"><video width="100%" autoplay loop controls><source src="media/week5/fully-assembled.mp4" type="video/mp4"/>Your browser does not support the video tag.</video></div> ## Pre-assignment blog bit This weekend was a bit of a catchup. I'd usually be out <a href="media/week6/mark-twain.jpg">exploring but instead spent the weekend in the lab</a> getting a head start on some of the projects I am planning to build in my time in Dubai. I'd been revising my final project to be more interesting to look at and also incorporate a bunch of new skills I've learned so far. I know a lot of people go into this course already knowing what their final project should look like, but I'm more the type to throw myself in the deep end and figure out the solution as I build and learn. That's not to say there's no planning involved, but I'm really reserved about drawing a picture of it before the concept has matured. I'm pretty glad I did this too, since there's a bunch of small things I didn't anticipate I'd learn about and I'm hoping to add them to my project. I started with some simple sketches and block diagrams, and did a few validation tests and I'm pretty comfortable now that what I'm planning to do can be done. The proverbial "<a href="https://www.youtube.com/watch?time_continue=1&v=ja7QxgHOYL8">Iron Chef</a>" ingredients I have to use are a bunch of bridge rectifiers I bought in Shenzhen and a brushless motor. How I fold all that together into a neat dish to impress the judges is the challenge. <div style="width:50%; float:left"> <img src="media/week5/gears-simple-test.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week5/gears-post-cut.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week5/gears-pre-assembly.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week5/gears-bottom.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week5/gears-top.jpg" style="width:33%; float:left; padding:5px 5px 5px 5px;"/> </div> <br> I did some testing on a gearbox over the weekend and it came out pretty good. I will need to order the correct fasteners and bearings but I'm pretty happy with the result so far! Not sure if I mentioned but this was a design I used for a racecar a long time ago that I've modified for use this year, I might get a chance to talk about how it works another day. <br> Finally the box - I had been trying to build a case for the project so I am able to take it home! I decided to print it from orange ABS and I'm really loving the texture and the way it prints, it's like smoothing out peanut butter <a href="https://www.youtube.com/watch?v=lH7dpxzl138">but not the oily type</a>. <br> I did some impact testing (informal, I banged it against a bench vice) and figured out where it needs strengthening and where weight and print material can be minimised. I got it down to a 155 gram print per section including support which is considerably lower than previous iterations (around double+ that). <br> Print material wastage is a big worry where I'm from, not so much in this lab but I also don't want others to miss out on the chance to print with peanut butter (orange ABS). <br> <div style="width:50%; float:right"> <img src="media/week5/impact-testing.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> <img src="media/week5/box-redesign.jpg" style="width:50%; float:left; padding:5px 5px 5px 5px;"/> </div> <br> <br> <br> ## What's this (week) all about then? So this week was pretty awesome for people who haven't even touched an electrics before. It's an easy but comprehensive way to learn how a circuit board works and all the components that go into it without the daunting task of having to design one! <br> It's also realy challenging and satisfying to solder SMD components, even if you've never done it before. Personally, this isn't new to me but it's always real exciting to see people picking it up and enjoying themselves. <br> Funny though, I managed to burn my finger this week not through soldering but by trying to toast a sandwich in the sandwich press. I guess in some ways it's nice to be reminded I'm more engineer than human. <br> So what we needed to do was use the CNC milling machine to produce a PCB and then populate and solder the board. Lastly we program the board to get it ready for use later on in the course. <br> I also gained an appreciation for parts management this week - it's a problem that's plagued prototyping labs for decades. During my trip to China I visited LabZero which had small ring binders with sleeves for parts in them. Those manufacturer's "sample books" aren't new but seeing one has inspired me to one day build a personal parts sleeve book so that people can have (and manage) their own inventory for parts. Perhaps it could also be used for individuals' tools as well like tweezers and magnifying optics. ## Enough chit-chat, let's make some things ### Machining the example board <img src="media/week5/post-mill.jpg" style="width:40%; float:left; padding:5px 5px 5px 5px;"/> To machine the board we used the example Fab ISP designs from <a href="http://fabacademy.org/2018/docs/FabAcademy-Tutorials/week4_electronic_production/fabisp.html">the tutorial</a> on the archive and turned a *.png into g-code with <a href="http://fabmodules.org/">Fab Modules</a>. The Fab Module (assumedly) does edge detection or vectorisation to figure out which areas to cut and which to leave. Our machine was a Roland SRM-20, which is a pain to get in and out of especially if yOU HAVE ARMS 😡 There's no emergency stop on this machine, so you'd want to be pretty confident with your ability to click PAUSE while the tool is potentially crashing into something it shouldn't. I don't recommend using a trackpad for this. Most of the machine is pretty self explanatory - it has it's own drivers and interface, however one thing that wasn't obvious was how to set the Z-axis origin. To do this you have to loosely lock the tool right in the collet, lower the Z to near the bed, then (while holding the bit) loosen the collet, lower the bit to the surface of the part and then tighten the collet (while still holding the tool down to the part). Now you set the Z-axis origin using the interface, and BEFORE YOUR HAND LEAVEs THE MOUSE you move the Z-axis back up a few mm just so it doesn't drag the tool across the surface and bend it. This could happen because you forget the tool is still touching the part when you go to check your X/Y origin or whatever. The Roland machines like to eat *.rml format files. To get the file from *.png to *.rml we use Fab Modules, written by Neil. It interprets the black areas of the *.png image as areas to remove, and white areas as areas to keep. We use two passes with a tool change in between - one with the 1/64" end mill bit (that's ~0.39mm for sane people) for the traces and one with the 1/32" (roughly ~0.79mm) for cutting through the board. We use a larger bit (1/32) for cutting because it can cut deeper and faster and whereas the smaller bit (1/64) can fit between the traces and pads. The settings are generally pre-filled for the Roland machines, since they're pretty consistent. The cut depth for traces is 0.1mm just clearing the copper layer. If you have an uneven work surface you may want to cut at 0.2mm, or run two passes at o.1mm just to make sure you clear the copper. I also do two-to-four "offsets" to clear excess copper, as this makes it easier to solder without accidentally bridging nearby copper. You can set the offsets to infinite (by using "-1") and this would clear all the black areas of the *.png in the final board, however it takes considerable time. Another setting I use is "stepover", which is the percentage of the width of the tool that will overlap the previous offset. It's 50% at default, but setting it to less can make for wider offsets thereby saving some time. Going below 33% in my experience leaves a poor finish and some copper swarf which can cause shorting problems later so I stick to between 33-50%. For cutting through, since the bit is thicker you can cut three passes at 0.6mm, since the thickness of the FR1 blanks are 1.7mm thick. After the settings you click calculate and make sure the toolpaths look like they should. The tool should pass between all traces/pads at least once. If your traces are closer together than the width of the tool it won't cut it. Then you save the output, which comes out as a delicious *.rml . <div> <img src="media/week5/hello.ISP.44.interior.png" style="width:33%; float:right"/> <img src="media/week5/hello.ISP.44.traces.png" style="width:33%; float:right"/> <img src="media/week5/hello.ISP.44.png" style="width:33%; float:right"/> <legend>"These are the files for the venerable ISP (from the tutorial linked above)."</legend> </div> After this you go back to SRMPlayer and just hit cut on the file you want. Very simple. ### Stuffing the board <img src="media/week5/soldered.jpg" style="width:40%; float:right; padding:5px 5px 5px 5px;"/> So I thought Wendy was talking <em>design speak</em> when she called it <em>stuffing</em>, but apparently that's a perfectly ok thing to say. I'm fine with this.. I really am. I just think that there are perfectly descriptive names for this process such as 'PCB-A (PCB assembly)', or 'populating a PCB'. Look, it's ok. It's not that bad a word to call it either. I've had a modest amount of experience soldering mid-to-large parts from through hole components to high current cables (and gear shifter cables). I'd also done a bit of SMD but I hadn't really had the need until now and I've gotta say I don't know why I put it off for so long! It's actually super easy, but there are some common misconceptions for first timers about soldering. 1) <em><strong>You can use the soldering iron like a paint brush</strong></em> No. Please. Solder is a solid when it's cold, and a liquid when it's hot. If you wanna be moving that stuff around you just heat it up to the point that it flows where it wants to. If you don't agree with that then find another way, because once you've spent all that time 'painting' your solder where you need it it will all melt back where it wants when you try connect it to a component! Moving the iron around in the solder rarely helps and you're just exposing yourself to the risk of shifting or un-soldering something important! 2) <em><strong>You need three hands to solder</strong></em> Well, this is actually true. Sometimes you need four, and a bionic eye. This misconception is understandable; How are you supposed to hold the part, solder, soldering iron and the board?! It's ok. Breathe. Soldering is about flow, zen, whatever - you have to relax and switch tools carefully. Tape the board down if you can, double sided works well. Sometimes, tin the part or parts you want to join. Other times, tack the part in with a blob of solder accumulated on your iron. Take one pad at a time, adjusting the parts to be right before soldering the other side of it in. Just make sure to re-work the first tack solder before you move on as usually your first join is not of great quality. <img src="media/week5/copper-swarf.jpg" style="width:40%; float:left; padding:5px 5px 5px 5px;"/> 3) <em><strong>Using the end of the tip to solder</strong></em> For fine components, you should. But most of the time, you need better surface area to make reliable joins. Think about what's going on here, if the tip of the iron is touching the pad you have a tiny point of contact for transferring heat. If you use the side of the iron, you get a lot of contact area and it will help you to ensure the parts join fully. Another trick is to add a small (and I mean small) blob of solder to the end. The blob forms a "blob" between the iron and the pad and allows HEAPS more contact area to heat up the part quicker. 4) <em><strong>Cleaning the iron before you put it back in the holder</strong></em> It's just habit for some. But soldering irons like their tips wet, because the solder and resin combo itself prevents oxidation on the tip and also. This significantly increases the lifetime of soldering tips, which is especially important in educational institutions. <legend><em>Having said all that, it's still a patience-testing proces. <strong>Remember, be one with the solder. Be the solder. You ARE the solder. Don't do anything solder wouldn't do.</strong></em></legend> Interestingly, after having finished stuffing the board I did my multimeter test and failed between V+ and Gnd. If you look astutely at the outer trace of my board you can see an 'eyelash' of copper swarf from the machining process was bridging the outer traces and held in place with stray flux. It's always sensible to inspect the board, and use optics if you have them. The photo above was taken with a 10x monocular which after having used it I will definitely consider adding one to my kit. ### Program the crap outta it One thing that's really handy to note: <img src="media/week5/tutorial-clarification.JPG" style="width:60%; float:right; padding:5px 5px 5px 5px;"/> Ok, so here we go. Plugging the board into Windows gives you a device not recognised error. This should be ok, since you haven't yet told the FAB Tiny what it is yet. That, and Windows also has no idea what to do with it either. Also when you plug anything new in (including from aliexpress) make sure to have your nose switched on. You need to be able to smell for problems! My mentor from Australia <a href="http://fabacademy.org/archives/2015/as/students/harmsworth.daniel/index.html">Daniel Harmsworth</a> and I once devised an alarm clock for engineers that would emit the smell of burning silicon. It would be possibly the most effective non-violent alarm clock ever invented. Anyway I've been following <a href="http://fabacademy.org/2018/docs/FabAcademy-Tutorials/week4_electronic_production/fabisp.html#windows">this tutorial</a> which obviously you would be too. But Wendy gave me the heads up that I need to visit <a href="https://gitlab.fabcloud.org/academany/fabacademy/2018/class/wikis/embedded-programming-on-Win10">this wiki first</a> . Read the tips here first before going to <a href="http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/windows_avr.html">these instructions</a>. Since there are many students already writing tutorials I'm not going to hold your hand through it. If you have any problems you'll wish you'd read these, the most useful information I have found about this project were at these links. <img src="media/week5/fabisp%20programmer%20software.JPG" style="width:40%; float:right; padding:5px 5px 5px 5px;"/> So for those of you who just want to get through this here's the dry instructions with links: + Install Git for Windows + <a href="http://www.microchip.com/avr-support/avr-and-arm-toolchains-(c-compilers)">Install AVR Toolchain (AVR 8-bit 3.5.4 for Windows) </a> Download the 15.2Mb file and extract it to C:\Program Files + <a href="http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/make-3.81.exe">Install Gnu Make </a> + <a href="http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/avrdude-win-64bit.zip">Install avrdude</a> and extract it to C:\Program Files + Update your path (advice taken from <a href="http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/windows_avr.html">this write-up</a>) You have to tell Windows where to locate all the tools you've just installed. Go to Control Panel \ System \ Advanced System Settings (in the left pane) \ Advanced (tab) \ Environmental Variables Select Path \ Edit, and add these C:\Program Files\avr8-gnu-toolchain\bin C:\Program Files (x86)\GnuWin32\bin C:\Program Files\avrdude + Go <a href="https://learn.adafruit.com/usbtinyisp/drivers ">here</a> and install the drivers for USBtinyISP + Download <a href="http://zadig.akeo.ie/">Zadig</a> and install it <img src="media/week5/edit%20environment%20variables%20path.JPG" style="width:40%; float:right; padding:5px 5px 5px 5px;"/> + Download the <a href="http://fab.cba.mit.edu/classes/863.16/doc/tutorials/fabisp_programming/fabISP_0.8.2_firmware.zip">firmware</a> and extract it + Go into the Makefile (using Notepad++, Brackets or anything else non-standard for text editing). I actually couldn't find it for ages, because the tutorial made me download everything before doing it so I didn't know to look inside the firmware folder. You won't have this problem, because you literally just downloaded it. You don't have to be as confused as I was! + Find the following lines: <em>#AVRDUDE = avrdude -c usbtiny -p $(DEVICE) # edit this line for your programmer</em> AVRDUDE = avrdude -c avrisp2 -P usb -p $(DEVICE) # edit this line for your programmer Uncomment the one referring to usbtiny and comment out the one talking about avrisp2. <img src="media/week5/fab_isp_wiring_cable.jpg" style="width:40%; float:left; padding:5px 5px 5px 5px;" alt="Fab ISP usbTiny wiring cable programming image for search optimisation"/> + Now wire up your kit. When I did this, I couldn't find any images of two FabISP's programming each other. I also couldn't tell if you were meant to plug in a USB cable to the second board, since every photo *just* cropped out the USB port. Every photo!. Anyway because I'm kind the hint is to look at the labelled circuit traces and orient your rainbow cable so that V goes to V and Gnd goes to Gnd (kinda obvious, but even most Electronics Engineers wouldn't even think to check). And for those of you who (like me) digest information 1000's of times faster by Google image searching instead of reading I've included a photo and hopefully search engine optimisation kicks in so you can find it. Let me know if that's what brought you here! + Lastly I found I couldn't set the fuse without the other ISP being powered by USB. Once again, couldn't find any clarification on whether this would cause problems (I am already down to one out of two USB ports on my programming machine!) + Navigate to the firmware folder in bash and do: make clean make hex make fuse make program Check for errors at each step. Make sure to have both boards plugged into USB when you go to set the fuse. Wendy showed me this excellent write-up by Zaerc which is exactly the same thing I did after poking around heaps so if you get stuck make sure to read <a href="http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/windows_avr.html">his version CAREFULLY</a>. You'll notice what we've done is really similar except that I've gone through and updated the links with more recent resources. ### Didn't get around to: I was going to try the Fab TinyISP and an FTDI but the link for the files for TinyISP were broken and I couldn't find anything that was ready enough for FTDI that I could use with Fab Modules As a fall back plan I was going to cut a FabISP out of copper since we have both the copper and epoxy tapes but I'm not super sure that we have enough blades for the vinyl cutter so I'm gonna leave it. Lastly, I was going to see if I could draw my own board and machine it. This would require learning a circuit design package. Two most applicable softwares for my career will be KiCad and Altium, which I have both of and have used but never actually needed to design something with. I'm pretty intent to do this but this week has just been full on. We've got a mini maker-faire next week so stay tuned for a special edition next week! <div style="width:100%; float:right"><video width="100%" autoplay loop controls><source src="media/week5/mini-maker-faire.mp4" type="video/mp4"/>Your browser does not support the video tag.</video></div>