Electronic production 2.0

Update 06/07/21

Group assignment


here you can go to de Lab page to see the group assignment

Individual assignment


As always you can check all of the links at the end under "links and references"


This is a Re-do on this week assignment if you like to see what i did on facademy 2020-2021 you can check this link also avaliable under "links and references".


This assignment has diferent parts



New Gen ISP


DisclaimerUpdate 13/06/22


And all of the links will be together under the "links and references" part of this page


With another year comes another attempt to finish my Fabacademy2020 journey.


This year we had to made a programmer using the SAMD11C and the new attiny gen.


i've chosen the quentin's SWD programmer because it looks simple enough for a beginner like myself


Back to the index


My Weapon of choice


By this point in Fabacademy i've tried a lot of softwares to meet the necesities of my final proyect. but in order to meet the fabacademy requierements i'll leave in here two tutorials one using modsCE and other using Vcarvepro. from this point on i will use only VcarvePRO. because i use it often in my day by day work for the cnc router. And if i need to make some holes on my board for any reason mods does not have that feature.


Altough i've used mods for this assignment. i will not use it in other board.


Anyway....


For this tutorial i've made the brian's version of Fabtinny45 ISP and used a raspberryPI to programm the MCU using an Atmel-ICE and following brian's tutorial


you can see directly the tutorial on that respective part.


Back to the index


Bill of materials


Brian Does a better job explaining the details on his board i'll only repeat what he has done.


  • 1x ATtiny45 or ATtiny85 
  • 2x 1kΩ resistors 
  • 2x 499Ω resistors 
  • 2x 49Ω resistors 
  • 2x 3.3v zener diodes
  •  1x red LED 
  • 1x green LED 
  • 1x 100nF capacitor 
  • 1x 2x3 pin header

Back to the index


First Method: ModsCE


modsCE has a browser based toolpathgenerator (that's really handy 'cause you dont have to install another software)


i use firefox


first you enter this text on the browser


or click in HERE


and you'll see a white canvas and an icon that will tell you how to navigate


right click on the canvas will open the window on the image above. you'll have to select "program"


here you have to select "open program"


Here you'll have to select "PCB" under SRM-20 mill


this is the whole program on the roland machine don't worry you dont have to understand all of the blocks.


the first thing you'll need to do is to insert brian's traces png into mods.


you do this by clicking on the "select png file" on the read png block


HERE You can download brian's traces file


once loaded it should look like this.


Now, let's take a look on the Roland SRM-Relative block.


By default it comes conected with blue "wires" to the WebSocket device and WebSocket print like in the picture above.


you need to "unplug those wires by clicking in the "file" tag on the OUTPUT from Roland SRM-Relative block.


and then click on "file" tag on the input of the WebSocket device block.


Then to conect the output from the SRM-20 block to the save file block.


first you need to make click on the "file" output tag on the roland srm-20 block.


and then other click on the "file" input tag from the save file block.


when it done it should look like this.


this are the settings i used for the endmill we have in our lab.


this is the settings i used for the speeds and feeds


Now click the "calculate" button on mill raster 2D block.


you will be prompted with this window asking to save the file on your hard disk.


HERE You can download the outlines file from mods


then you can check the preview for this operation.


this is the overall vew of all the blocks conected.


now let's repeat the steps for the outline file


HEREyou can download my outline roland file.


You can download brian's outline file/a>


This is the preview you'll spect to see.


it's jus one line with diferent thicknes steps


this is the overall view of all the blocks conected


the parameters i used on the 1mm diameter endmill we have in our lab


the feed rate on the 1mm endmill


Back to the index


Second method: VcarvePro


This second method i'll describe here is for the same piece and at the end i will show diferences between the 2 postprocesors.


Of course this setting will depend on the machine, the material and the endmill used.


For this tutorial i'll use the same 0.2mm endmill for the traces and 1 mm endmill for the outline cutting and holes if necesary


This are the two endmills used for both modsCE and VcarvePRO.


HERE is the link to buy the 0.2mm endmill


HERE is the link to buy the 1mm endmill


SO....




In my windows PC i just press the "windows" key on the keyboard and type "vcarve" it should appear to launch the software once the installation process completed


HERE If you wish to install the vcarvepro software for yourself.


it has a really usefull fretrial which leaves you use all of the tools all the time you need. and the only limitations it's that you can not save the G-code file without a license.


Vcarve enviroment


Like any other software you can create a new file or open an old one. Let's open a new file click on "create new file" or "crear archivo" (sorry for the "spanglish" but that's the way the software deals with spanish.)


the STOCK material dimension and caracteristics tab.


for this example i'll simulate this stock dimensions but i'll depend on my real material. the thickness of my pcb stock ussually is between 1.5-1.7mm.


Once you click accept "aceptar" button.


It will change into the drawing tools tab "dibujo" at the bottom of the tab.


in the left side of the screen you can choose between all of the drawing tools like any other CAD software. (drawing tools,import 2D-3D files,transformation,Orientation and such).


the first thing we need to do is to import our images and convert the "PNG's" into curves.


we import images from our HDD from the button called "importa el mapa de bit para el trazado"


i uploaded both of brian's files.


automatically sends them to the center of the stock.


We need to move them to a position we want to carve (this way we can process more than one pcb at the time)


using the button to move objects "mover los objetos seleccionados " under the transformation category.


This is how i move the objects, First select the bottom left corner on the icon of the move tab on the upper left corner of the image above.


then type a 1mm in x and y direction under absolute coordinates.


as i'm going to use 1 mm of diameter on the cuttin endmill that's the minimum i need to set to not waset any of the stock (if i had more than 1 pcb i had to leave at leas twice the diameter of the cutting tool between boards to cut them).


the "adapta los vectores al mapa de bits" button will create the curves from the bit map image.


once you hit click it will open the vectorization tool on the lef side of the screen.


vectorization tool window.


this are the usual parameters i use when i'm converting curves from images. (the more resolution "DPI" you give for a png the more accurate the curve generation will be).


once you got that settings right click on the "previsualizacion" (1)button this will preview the curves and then hit "aplicar" (2)button to appliy the changes.


Once that's done do a right click on one of the curves (they're group together so this will ungroup them) and select "desagrupar vectores/desagrupar en la capa original del objeto"


Then eliminate the outer contour that you won't need


click on the line you want to delete once selected i'll change color you can right click and hit "eliminar" button to delete.


or simply click on the line and hit the delete key on the keyboard.


eliminate the bit map from the traces.png file


again right click/eliminar or delete key on keyboard


Now you'll see the outline.png file we imported as well (it was behind the traces.png from the start)


i used the same settings to convert the curves from this image as well.


let's repeat the process to delete the unnesesary objects


ungroup the ouline curves.


delete the outline of the image

3

delete the ouline.png bit map from the stock to leave only the curves.


close the vectorization tools window bi clickig "Cerrar" close button


this step is completly optional but it helps a lot when dealing with larger pcbs files.


let's create new layers for all of the curve groups we will need.


first click on the "capas" layer tab at the bottom of the screen


similarly like rhino or autocad you can manage all of your layers. just click "añadir nueva capa" add layer button to create a new one. and set a name for it


set a color to the layer


click on the black rectangle (it will change depending on what color you choose)


i found extremely handy to give diferent colors ot every layer.


change the curves to their respective layer


click to the respective curve or set of curves (holding shift while clicking you can selesct multiple).


right click/mover a capa/"selecciona la capa" right click/move to layer/"choose the layer"


now let's hide the outline clicking on the lightbulb over the desired layer


click and drag to select the rest of the curve (that will be our traces).


move them to the layer.


at the end it should look like this


Now it's time to manually create the offsets to the traces.


right click on the layer of the traces


choose:"Seleccionar los vectores para la capa" so select all of the curves within that layer.


go to the drawing tools tab at the bottom.


under the "desplazar y posicionar" orient category you should see "desplazar los vectores seleccionados" offset the selected curves button.


the offset tool settings


***since, we're using a 0.2mm endmill the minimum offset should be 50% of the diameter or 0.1mm lower than that will be a waste of time and bigger will not have smooth finish.


now it's a good time to create one layer for each offset.


with the curves selected "click derecho/mover a capa/nueva capa..." right click/move to layer/new layer...


new layer on the go.


choose a name and a color to each layer.


and repeat the steps from the *** mark on this tutorial.


until you have the offsets you like to process.


i've found 3 offsets to be more than enough to get a nice result (this will depend on your soldering skills though) more than that i belive is a waste of time lower than that you're more prone to make solder bridges on the smaller components like the MCU.


once you're done doing the offsets. you're ready to star to calculate the operations needed to generate de the Gcode. from the picture below


Let's jump to the CAM tab on the right side of the screen "trayectorias de herramientas" or toolpath generation tools tab.


Let's pin the tab on the workspace otherwise is a pain in the neck to loose that window every time you put your mouse on the curves.


the pin button is on the upper right side of the tab.


from here you can make a "vector like" toolpath for carving or cutting your boaards (for this example that's the only thing we'll be using.)


but we can also do a "raster-like" carving called pocketing


holes with a drilling operation


open curves carving (used in sign making with a V-bit ussually)


3D roughening and 3D finishing operations (when working with 3D models instead of bitmaps or 2D dxf files)


Click on the "trayectoria de herramienta de perfil" button in the pictue above.


let's make the cuting operation first.


the numbers on the picture above correspond to the numbers on the following list

  1. select the curve you want to process with this operation. 
  2. define the final depth of the cut. (in this case i want all of the stock to be cutted)
  3. select your cutter (i have presetted my 1mm endmill you can the the parameter in the picture below)
  4. define where you want the operation to be made (on,over or under the curve) and the direction conventional or climb (i've found this settings to be the ideal.)
  5. name and calculate (set a name that will be using for the output file.) and remember to set a proper safe height (10 mm in my case)

the setting on the cutting endmill


after that it shoul look like in the picture above.


now let's hide the outline curve on the leftside clicking the lightbulb and hide the operation by clicking onthe selection box on the right side of the screen on the operation we just made (on the toolpath category).


and select te first set of curves to process with another cam operation.


again right click on the layer and "seleccionarlos vectores para la capa" to select every curve on that layer with one click


again click on this operation


the numbers on the picture above correspond to the numbers on the following list

  1. select the curve you want to process with this operation. 
  2. define the final depth of the cut. (in this case i want 0.2mm wich ussually is the depth of the copper layer on the pcb.)
  3. select your cutter (i have presetted my 0.2mm endmill you can the the parameter in the picture below)
  4. define where you want the operation to be made (on,over or under the curve) and the direction conventional or climb (i've found this settings to be the ideal.)
  5. name and calculate (set a name that will be using for the output file.) and remember to set a proper safe height (10 mm in my case)

The settings on the traces endmill


Now, let's duplicate this same operation to the other offsets.


right click "duplicar" button to duplicate


repeat this until you have one CAM operation for each layer of offsets you've made.


in my case i have 3 offsets and the original set called "traces".


double click on the respective offset CAM operation.


select all of the respective curves for each offset layer. like in the picture above.


again,right click on the layer and "seleccionar los vectores para la capa"


once you have done all of the offsets CAM operations it should look like in the picture above all selected at once


This is completly optional but i've found really handy to merge all of this operations in a single one to generate jus 1 file of traces and 1 file of outline. (one for each endmill used.)


click on the "crear una trayectoria combinada" button to merge the selected toolpaths.


Select only the toolpaths you'll want to merge. like in the picture.


and give them a name for the final output file.


it should look like this (the merged toolpath is under the undividual cam operation that)


this is the merged operation selected.


aditionally we can stimate how much time will be using the Roland machine. select "tiempo estimado de mecanizado" button.


on "velc. rapida" set 240mm/seg that's the rapid speed when it's no carve.


Also optionally you can simulate the operation.


just click on the "preestrenar trayectorias" button.


Select the check box on every CAM operation you want to simulate.


click on "preestrenar trayectoria seleccionada" button to play the simulation


this is the simulation of the CAM


finally click on the "Guardar trayectoria de herramienta" button to save the g-code from every operation.


select the "Roland (mm)(*rol)" option under postprocessor and click on "guardar " button to save


Select a location to every file for the roland.


Finally this is the comparison between the two postprocessors


HERE you can download the Vcarve generated roland files


HERE You can download the vcarve editable file.




timelaps if an isp cutting

Make an in circuit programmers

Prepare the machine

Set your sacrificial layer


In order to save the roland to cut on the machine bed is necesary to make a sacrificial layer to place the PCB on and cut through MDF instead of Steel. That’s why i made my own sacrificial layer. The PCBS we have in the lab are 100X100X1.5 mm in dimesions so i cut out two 9 mm MDF about 100x100mm and glue them together using som PVA glue. Then place them in top of the machining bed using some double sided tape.


So since i used PVA glue and double sided tape i altered the new machining Surface and don’t know if it will be flat enough. Therefore i flatten out the Surface using the following method.

Set your zero on the sacrificial layer (method 1)


First i placed a 3 mm endmill on the SRM-20, place the machining Surface to flatten out. Opened the Factory software from Roland called VPANEL so i could guide the cutter to the desired place to start the cut.


The origin of this cut will start on the lower left corner like in the figure. Then clicked on the X/Y button on the right side of the VPANEL window in order to create a user origin for my piece.


Then with some help of a Little piece of Bond paper i placed between the endmill and the Surface of the MDF i started to jog the Z axis in X10 increments so i could’nt damage the tip of the endmill and stopped until felt some fricction on the paper. Then i was time to make click on Z button on the right side of the VPANEL window in order to create a user origin on Z in order to tell the SRM-20 where start cutting from.

2.2.- flatten your sacrificial layer


I did not had time to use some fancy CAD skills on this cut so i used the Factory software that came with the SRM-20 called iModela creator. Wich is a really basic (and a Little crappy CAD tool) from this software you can draw some basic figures like circles, rectangles and stars and by right clicking in it’s properties you can set the position and dimensions of the figures. I only use this software to flatten the sacrificial layer so i only draw a square and made it 100x100 and place it in the lower left corner of the drawing Surface. Then set the thicknes of the material. And the depth of the engraved cut operation.finally i clicked on the cut button where i set the tool diameter to 3mm and the type of material for this case i used the Wood (balsa) settings because is soft enough.


iModela workbench




setting the geometry dimensions




setting the dimensions on the material



Then checked the milling parameter but set it to default. And clicked on update origin to tell imodela where i put the user origins on the VPANEL finally i clicked on “CUT” button in the lower left corner of the screen.


WARNING


you only should do this if you already done the origin settings before otherwise you’ll end up hurting the endmill, the machine or yourself.


At the end of that operation you’ll end up with a completly flat Surface to work on your PCB traces and outlines.

2.3.- set your blank PCB board


now you have a flat Surface to work with, first you’ll need to clean your PCB blank board with some IPA (isopropil alcohol) to get rid of the dust and grease, other wise it will be harder once it is all cut out. Then place it on top of the sacrificial layer using some double sided tape in the side without copper.finally changed the cutter to a 60° “V” cutter.

2.4.-set your zeros on the PCB. (method 2)


Now, the copper is a nice conductive Surface and your cutter is made of som Steel alloy although Steel is’nt a good conductive it’ll be enough for some continuity tests with a multimeter. So grab a multimeter and place it on continuity test attach the end of a double alligator clamp to the copper Surface and the other end to one of the terminal on the multimeter. Now clip the cutting tool with other alligator clamps and the attache the end of that to the other terminal on the multimeter to closet he circuit. Start jogging the Z axis until the you hear the buzzer from the multimeter sound now that’s more comfortable than the paper method and more precise but you’ll always have to remember to unclip the aligators from the copper and the cutting tool otherwise you’ll end up hurting the machine or yourself. So, click on the Z button on the right side of the VPANEL window to create a new origin for this tool.

clamping the multimeter on the tool and the surface on the left the multimeter shows OL (open line), on the right it show a value of about 3 ohms it means you have touched the copper on the machine

WARNING


Make sure that your multimeter handtools and alligator clamps are outside the machine before start cuttin otherwise you’ll end up damagin something.


Now, you are ready to start cutting traces. Click on the “CUT” buttton on the lower right side of the VPANEL window. Click on “Delete all” button to erase all of the previous Works with the machine. Click on “add” and then select your .rml file i’ve created using Fabmodules.

And then click on “output” to start the machining.


the machine is done change the cutting tool to the 3mm endmill again and used the multmeter method to set a new Z axis origin. Then again click on cut/delete all/add/select the file /output to start cutting the outlines of the FabISP.

here is a timelapse of the flattening of the sacrificial layer

3.-solder the components on th isp


At the end of the machining process you’ll end up with something like this

at the end you will have a completly cut board just had to sand away the burs


At the end of the solderin process it should look like this...


although i decided to solder one that has offset number=0 (completly pealed the copper away)on modsCE.



Hopefully program the fabisp.


Back to the index


programming de ISP


At last finally i manage to get an ISP working. altough i had to do it from linux (i'm still not sure why windows refuses to do it) it is finally working and i use it to run a program on my echo board on "Embedded programming week".

How i did it


After all of my struggle to make my ISP on windows my friend Jonathan had the brilliant idea to use the raspberry PI we had laying arround in the lab.


The raspberry PI had already installed RASPBIAN OS wich is a mix From DEBIAN for raspberry's procesor achitecture.


I launched tha raspberry and hook the HDMI from the raspberry to a Projector.


The Setup

The raspberry PI conected to the projector



From there i launched the chromium browser and opened the brian's tutorial on how get running the Attinny45 based ISP he designed.


Since we have in our lab the Atmel-ice programmer. That's what i used to get it running.

The atmel ice already hooked up to the raspberry


The first was to download to the raspberry the firmware available on brian's page.


Brian states that in order to get it to work with diferent types of programmers you should open the "Makefile" inside the "*zip" file of the firmware and manually edit the line of code that talks about the programmer ("PROGRAMMER? =usbtiny" is the default)


First i needed a program to open the "Makefile" since i am currently using a debian based OS i went and installed "Bluefish" wich is a text processor like notepad ++, Sublime text or brackets.


and on line #19 (wich is highlighted on the screenshot) i replaced "usbtiny" with "atmelice_isp".

Bluefish screenshot of the "Makefile"

Then i had to open the Command Terminal wich is handly visible on the desktop.


Then as brian states in his tutorial, i typed the following command on terminal.


$ sudo apt install avrdude gcc-avr avr-libc make

The installations command

this instrucction set the installations for avrdude, gcc-avr, avr-libc and make programs.

The sanity checks


This steps are in the instaling AVR toolchain on windows because it's a little trickier to do but i recomend it if like me you've never with command terminal before


it is for checking if the programs are correctly installed.


Type


$ make -v


$ avr-gcc --version


$ avrdude


and you should see something like this

Sanity check 1 sanity check 2

The real deal


Then after the setup is complete here comes the part that's actually the burning of the flash an the fuses on the actual microcontroller.


i made sure with a multimeter that there was continuity between the the microcontroller pin an the spi header and the solder jumper was working correctly.

Actual board

First i plugged the atmelice to the raspberry PI and the AVR adapter from the programmer to the 2X3 pin header (SPI header) on the target board


The USB from the target board to the USB extension cord that was conected to the Raspberry

The conections betwwen the raspberry, the programmer and the target board.

Then i runned on terminal the folowing commands and gave the respective screenshots.


$make flash


$make fuses

Yet another sanity check


before i called a day i ran tha lsusb command just for checking if the fuses were set correctly (another sanity check if you want to see it like that)


$libusb


brian states that if you can see a "Multiple vendors usbtiny" in the list of usb devices you are ready to go.


if not also gives a little troubleshoot list.


$make rstdisbl


at this stage in the tutorial you have a programmer i just had to open the solder jumper on the board and plpug it into my windows pc and see if this was correct.


without solder jumper on the reset


correctly burned


As you can see in the picture above the ISP it's recognized by windows but in the "other devices" category and with a little warning sign on it.


before i actually attemp to program something with it i should install the right drivers.


Also on brian's tutorial but on How to set the avr toolChain on windows he talks about a little software called "zading" wich is a driver installer tool and it's really simple to use.


zading installed the driver for the ISPtinny for me.


with out this step is imposible to upload any sketch on any board.


after that the device manager on windows shows the usbtinny on another category and without any warning sign like in the picture below.


The ISP driver correctly installed using ZADING shoul look like this.


Back to the index


Programming Quentin's programmer


In here i'll leave the programming captures from 2022 and the steps required

Disclaimer


I use a Windows 10 based system the (flashing commands and general workflow of installation may vary for another OS)

  1. Download the png's from the fabcloud programmers repo.

  2. on the web browser just right click save image as...

  3. Process them either on mods or using Vcarve (I used vcarve as usual).

  4. if need help using vcarve you can follow the steps i said on brian's ISP


    HERE you can download my vcarve pro 9.0 file

  5. Get the rml files from your postprocessor.

  6. HERE you can download my Roland SRM-20 rml files

  7. Weed the excess of copper out of the board if needed.

  8. i ussually used 5-6 perimeters just to save time


    the rest if needed is manually peeled with the help of a box cutter or a precision knife

  9. Get that clean board stuffed.
  10. Test it with a multimeter.

  11. this will be diferent on every equipment the continuity test selector is also the diode testing feature you only have to press the button with the icon of a speaker if you see the little icon on the screen you're good to go


    while testing for continuity always check no continuity between V+ and V- first that's a common mistake. Then clamp one probe to gnd and look for any solder wires between every terminal on the MCU and gnd and repeat for V+

  12. Download an EDBG build for your operative system

  13. In my case i went into this pageit is jus a repo for the EDBG software

    ataradov Repo

    under installation there's a link


    that taked me to the prebuild files for windows

  14. Download an openOCD build for your system.

  15. HERE For windows users you also want to use a prebuild instalation file


    in my case i used the link for the zip file

  16. Download the Binary file for the programmer

  17. HERE you can download the binary file for the SAMD11C

  18. stuff everithing in the uncompressed openocd file under bin

  19. like this

  20. Wire

  21. For this i needed and usb extension, an external power supply a programmer and some jumper wires


    the programmer i ended up usingit's one swd programmer that my fabacademy instructor ivan hernandez sent me via mail


    this is mexico's programmer used to program queretaro's boards


    and use this pic from the fabcloud repo to guide myself through the conctions on quentin's programmer


    this was my setup

  22. Flash the board

  23. open a fresh window on windos CMD terminal. any navigate to the directory where you stored the edbg,openocd and freedap binary file. just like you would using git bash


    $ cd C:\Users\Fablabqro\OneDrive - Red de Universidades Anáhuac\Documentos\SAMDino\ocd\xpack-openocd-0.11.0-4-win32-x64\bin

  24. Test if it worked using EDBG

  25. now just plug the new board on the usb extension


    back in the laptop type the following command on yellow


    edbg-windows-r24.exe -l


    this will list the programmers conected to the laptop and if it shows the Alex Taradov Generic CMSIS-DAP adapter label you're good to go

  26. Enjoy that sweet brand new programmer.

Conclusion


It's been quite a struggle to do this remotely from queretaro and i do not have the freedom to travel to the lab on cdmx just to do this.


at the end i've made it with the support of my instructor ivan,nuria from fablab leon and obviously quentin's documentation and adrian torres documentation also from fablab Leon


Back to the index


Links and references


adrian torres documentation


quentin bolseé documentation

edbg page

openOCD general page

openOCD prebuild´s page

png

Vcarve pro9.0 file

rml's for SRM-20

freedap binary for SAMD11C

HERE to go to modsCE page

HERE Brian's original version of the FABtin45

HERE You can download brian's traces file

HERE You can download the outlines file from mods

HERE you can download my outline roland file.

HERE You can download brian's outline file/a>

HERE is the link to buy the 0.2mm endmill

HERE is the link to buy the 1mm endmill

HERE If you wish to install the vcarvepro software for yourself.

HERE you can download the Vcarve generated roland files

HERE You can download the vcarve editable file.

Jonathan's page

How to set the avr toolChain on windows

zading