Ultimate List of Tips, Tricks, and Tutorials for Fab Lab Students

This post is a not on a lot of techniques for using different types of machines and processes for making stuff. I’ve had this for years but decided to finally publish it. I’ll add to it periodically, but I figured others might find it useful as well. RIGHT-CLICK to open in new windows.

Laser Cutting:

Embedded Systems, Microcontrollers, and Arduino

Circuit Board design and Fabrication:

3D Printing:

Casting and Mould Making:

CNC:

Machines:

Mechanical:

Metal-Bending:

Miscellaneous:

 

 

================================================

My favorite Fabrication-related researchers:

Dr. Stephanie Meuller at MIT’s research group

Dr. Patrick Baudisch at Hasso Plattner Institute Human computer interaction reserach group

 

Teaching Research:

Sketchnoting basics

Graphic Recording

Sketchnote travel journal to get started

Control Theory:

Brian Douglas’s awesome youtube channel explains Control with some great examples.

Kat Kim has another great channel on Controls as well as other Electrical and Computer engineering examples and lectures

George Gillard has a great whitepaper explaining PID controls

Another great PID example is from this Reddit thread

Learning Math concepts:

MathVault – Learn higher-level (college-level) math concepts more intuitively

BetterExplained.com ADEPT model for learning math intuitively

Good sources of materials:

XXXXXXXXXXX    Todo when I’m not so busy or lazy: XXXXXXXXXXXXX

Add sections for PCL shapelock and other named plastics to ultimate FabLab list.

Also add cardboard modeling guy and nibbler tool

Add anodizing alum and titanium, bluing/blacking steel,

And interesting research I like with lasers  hydrographics and uv printers and metal hologram art

Loom and Guitar or Ukulele Strap Weaving

image

I became fascinated recently while browsing pinterest by examples by different weaving techniques. I began researching one method in particular called card weaving or Tablet weaving. Evidence shows it was used as far back as about 3,000 years in Europe. The fascinating part is that it is one of the earliest methods of algorithmic programming.

To do tablet or card weaving, you need to have some cards with holes in the corners. Through these holes, you pass threads of different colors. With every pass of the horizontal thread, you’ll spin the cards either forward or backward depending on what your pattern is. These designs are typically used to create belts or edging material for garments. Jess said this method was similar to making friendship bracelets. I wanted to build a ukulele strap for the ukulele Jess and I built a couple of years ago.

The first thing to do is create some cards. I used some larger-than-normal playing cards I got at the dollar store. These aren’t the best quality paper but they are glossy and slide across one another easily. Cut them to be square and I even rounded the corners with a corner punch to make sure they don’t snag on the corner when I spin them. I then used a hole punch to pinch a hole in each corner. I started with regular playing cards, but quickly realized that the larger the card is, the easier it is to use.You can see the steps below and the beginning of the cutting of the larger cards.

image      image

The next step is to have a loom. There are many different designs of looms. Some people simply tie one end of the strings to the back of a chair, and the other end to their belt which is the simplest method, however it isn’t easy to use. If you are just starting, this might make a lot of sense, but I was not successful with getting quality results this way.

Another loom design essentially uses a wooden box (box loom or rigid heddle looms) of some type that keeps about 2 feet of the threat taught, allowing you to weave easily. Here’s a version you can make out of PVC. Here is yet another PCV design. When you weave longer pieces, you can roll the threads onto spools at each end of the loom keeping the portion you are working on tight.

The loom style I chose to build was called an Inkle Loom.(Here’s a PVC inkle loom).  This is a traditional loom design that allows you to wrap the threads fully around a zig-zag path and tie the ends together to make continuous loops. To build this, I used the left-over parts from our Ikea Snigler crib hack shown here. I had half of  the crib wall sitting in the garage so I made a couple of cuts and screwed them together with 3” long screws (drilled pilot holes first of course).

image

image

It isn’t the most sturdy design as the dowels are mostly friction fit. A few have staples that somewhat hold them in. I can use it for this project and a few more without having to add additional support.

The next part that is required is the shuttle which holes the thread which is passed back and forth during the weaving process. I cut a piece of scrap clear acrylic on my bandsaw to look like a kite string holder and sanded the edges so they had a smooth radius. This makes sure it won’t catch other threads while weaving.

image

Now for the design I wanted to weave. I came across this particular pattern on pinterest from user Silvia Dominguez who has many great designs available.

card weaving pattern The way to read this chart is to look first at the little design on the bottom. It is 4 blocks high by 26 columns long.

imageEach column refers to one card or tablet. This means we will need to use 26 card (or tablets) each with 4 holes and threads through those holes. Each hole on the card should be labeled A, B, C, and D respectively and the color of each hole is listed from the bottom up in the design. i.e.
D
C
B
A

The design refers to the colors of each of the threads that are threaded through the each hole of the card.  I used 2 color of size 10 crochet thread. I got a light green and a darker green color to represent the grey and black of the design. Pull the strands out to the length of the finished object plug an extra 12-18 inches or so. For example, starting at column 1, it will use 4 strands of the light green in my case so I cut long lengths of thread for that card. Looking at a more complicated column, you can see column 4 uses two light threads and two dark threads, etc.

The next step is to thread the cards or tablets. It is very important how threads enter the cards. This is listed below each column. Depending on how they should be threaded, it is referred to as either a Z or an S. If you imagine your card on edge, the threads should come from the top of the loom into the card (top to bottom in the image below) If a card is a S card, all 4 threads enter from the left and exit the card on the right side. Here is a close-up of the rightmost column. You can see how all 4 of the threads enter the card with this angle\” like the middle of the letter S. This page (use google translate to read it) shows in detail with better graphics how this works.  image

Z cards of course enter on the right side and output on the right with an angle like “ / ”. 

The Z or S will allow the weave to be tight and you can actually tell the difference when looking at the end result.  If you have some of the threads on one card S and some Z, then the cards won’t spin and you can’t weave so be careful when doing this. Also, make sure to keep the cards in order.

Next wrap each set of 4 threads on the loom, zig-zagging on the dowels until you can just tie the ends of the strings together to make a continuous loop. The cards should be in the clear area (not inside the zig-zags). The threads should be a little taught. Not so tight that the cards can’t spin and not too loose that there’s a lot of slack in the threads. I actually ended up using a fisherman’s knot (basically two slip knots tied together) which allowed me to adjust the tension of each set of 4 threads as needed throughout the weaving process.

image

 

Once you put all the threads on, align the cards so that the A-D sides of the cards are facing you all facing you. Next wind some thread on the shuttle. I did about 4 times the length of the other threads. You only need one thread on the shuttle.

A little weaving nomenclature: The long threads on the cards are called the Warp and the thread on the shuttle is called the Weft.

imageImage Source: https://buddhajeans.com/encyclopedia/warp-weft-diagram/

The area of space that is lofted by the cards is called the Shed. To weave, you pass the shuttle through the shed, then spin the cards to zig-zag the warp over and under the weft. Once you’ve done this that horizontal line is called the Pick. To begin, literally just leave an extra 6 inches or so of thread off the shuttle and just pass the shuttle through the shed. Once you do this you need to turn the cards. That’s where the larger portion of our design comes into play.

card weaving pattern

Start at the bottom at row 1. Once you’ve passed the shuttle through the shed, you’ll spin the the cards either forward or back based on which pick you are working.  In the yellow section it will tell you which cards will move forward and which will move backwards. I chose this design for its simplicity.All the cards are moved in the same direction. More complicated designs get really crazy and hard to follow. In this case, pick 1 rotates all cards forward. Once you spin the cards, you need to beat the previous pick with the shuttle to make it tight, then pull the slack out of the weft thread before doing the next pick.

I came across this site which was this person’s first tablet weaving project as well using the same design. She linked to a dead link to where she first saw this design. I found the wayback machine’s cache of the site and it turns out they used the same colors I did! I found NorseGirl’s website which did this design and uses the same colors. so much for being original, haha.

Once I wove about 4 feet of material,  I cut off the excess leaving about 1 foot on the end where the cards were. Jess braided these into a cord (which seems to be a traditional method of finishing the end). One the other end, I sewed a hem so it wouldn’t fray on that end and then sewed it to a 1.25 inch strap slider. I only needed 1 and was able to get it at the local outdoors store for less than $1.

 

RGB565 to RGB888 Color Conversion

While working with Charlotte Latin FabLab students this year, we came across an issue. Alex was using a camera module for her Arduino project (ArduCam) that gave RGB565 formatted pixel data but she needed to convert it to RGB888. Though there are tons of posts on stackExchange about how to do it, I couldn’t find a simplified broken-down explanation of how it works to point her to, so I decided to write one.

RGB565 means there are 5-bits of data for the Red component of the pixel, 6-bits for green and 5-bits for the blue.  It looks like this:
pixel value =
RED= R4, R3, R2, R1, R0,
GREEN= G5, G4, G3, G2, G1, G0,  
BLUE= B4, B3, B2, B1, B0

But Remember RGB565 is stored as two separate values (VL and VH from the example code for the camera we used), with the low value on the left and high value on the right.
VL = G2, G1, G0, B4, B3, B2, B1, B0     VH = R4, R3, R2, R1, R0, G5, G4, G3

Some clever bitmasking can strip out each component color and place them into individual variables. We’ll AND the bits of the values we want from VL and VH with ‘1’ or ‘0’ depending on which we want at a given time.

Of course this has to be done for each and every pixel, and she had 320 x 240 in her original image.

This is a simple nested for loop that already used in the example code to read the data from the camera

for (int i=0; i<240; i++){

  
   for (int j=0; j<320; j++){
  
    //Convert the RGB 565 to RGB 888 of the pixel in the bitmap and store it as PIXEL data type in the new larger array.

  
    //Step A convert to the new PIXELS format

  
    ///Step B scale from 565 to 888

  
    }//end for j

  
 }//end for i

STEP A: Convert the color to a new pixel format.

Based on some example code, it’s best to create a structure to contain the R, G and B values:

typedef struct { 
unsigned char blue; 
unsigned char green; 
unsigned char red; 
} PIXELS; 

Then we need a large array to store the pixels of the new image:

PIXELS bigPIXELS [12] [12]; //the resulting RGB888 picture pixels are stored here

Then you can convert each pixel by using logic operations and bit shifting.

/*Blue is the easiest to see how this works so we'll do it first.
  
 The values for Blue is stored in VL So for example if VL = 1011  0101( blue = 21 in decimal) 
 to get the blue values all alone, we can AND them with 1s and AND the green bits with 0s 
 leaving you with an 8-bit number with only the blue data in the right spot. The result 
 is: 0001  0101  or 21 in decimal. 
*/
  bigPIXELS [i][j].blue =    ( VL & 0b00011111 ) ; //0x1F
 
 

/*Red is only slightly more complicated. We first get bits for red alone, then shift them 
 to the decimal point The 0b11111000 gives you only red data as before, but the digits 
 aren't in the right place. 
 
 There are place-holding 0s that make the value of red too big: 
 For example is VH = 1101  0110  The value of red is 26 in decimal here. ANDing as before
 would give you only 1101  0000, but if we convert this number to decimal, it =208, which 
 isn't right at all. Shifting to the right by 3 (>>3) moves the red value down to the 
 decimal point and gives you 0001  1010 = 26 in decimal in 8-bits
*/
  
bigPIXELS [i][j].red =   ((VH & 0b11111000) >> 3); //0xF8
 

/*Green is the most complicated as it has components in each VL and VH so we'll AND the 
 bits with 1s and then shift them to the right places, then we need to OR them to the correct spot
  
 VL = G2, G1, G0, B4, B3, B2, B1, B0  so to get only green values
 */ 

// since we don't use this variable for anything else, we can just dump the result of this operation back into VL
 VL&= 0b11100000 ;  // 0xE0  

 // VH = R4, R3, R2, R1, R0, G5, G4, G3  so to get only green values  
 VH &= 0b00000111; //0x07
  
 //Now shift the bits to the right places and OR them together to glue them into one number
bigPIXELS [i][j].green =  (uint8_t(VL) >> 5) | (VH << 3); //Shift lower 3 bits in VL to the decimal point, and shift the upper 3-bits in VH to their correct positions.

Great! Now we have our RGB values by themselves, now let’s let them stretch their arms to take up the full 8-bits that’s now available to them.

Step B: Converting from one colorspace to another is simply a function of scaling. You’ve already done this a lot actually. Any time you’ve read an analog input, then used that to control an analog output on arduino you’ve done it. Imagine a knob on the Arduino’s analog input. Analog inputs can read values from 0-1023 (10-bits) where 100% is = 1023. Imagine a single red pixel as an LED on an analog output. It can only take values between 0 and 255 (8-bits) where 255 is 100% brightness of the LED.

You can do the same thing here. In a 5-bit number system, 100% is when all bits are 1’s so it is 11111. This needs to be converted to an 8-bit system where 100% is = 1111  1111.

You use Arduino’s map() function to map the values from one scale(0-1023) to the other (the LED’s 0-255), however this is very inefficient and slow.

Since you know what the numbers are going to be for the scaling calculation, and they won’t ever change you can pre-calculate them for your code. You’re scaling from 5-bits to 8-bits for red and blue which is 0xFF / 0x1F = 255 / 31 = 8. For green you start with 6-bits and convert to 8 which is 0xFF / 0x03 = 255 / 63 = 4.  You could multiply these hardcoded numbers to scale red *= 8; green *=4; blue*=8; however since these are powers of 2, there’s a trick to make this code faster. Simply bit shift left. For each bit you shift, it is equal to a power of two so the code would be red and blue << 3 and green << by 2.

//If you want to see the RGB 565 values print them here, or comment out if you don't need them
Serial.print(" RGB565 =");
Serial.write(bigPIXELS [i][j].red);
Serial.write(bigPIXELS [i][j].green);
Serial.write(bigPIXELS [i][j].blue);

bigPIXELS[i][j].blue = bigPIXELS[i][j].blue << 3;//blue and red were 5-bits

bigPIXELS[i][j].red=  bigPIXELS[i][j].red<<3;

bigPIXELS[i][j].green =  bigPIXELS[i][j].green <<2;//Remember that green has 6 pixels to begin with so it only shifts 2 places

Now you can do with these as you please. Add a BMP header and print them to the serial port to be able to view this BMP image on your computer.

Serial.print(" RGB888 R= ");
Serial.write(bigPIXELS [i][j].red);
Serial.write(bigPIXELS [i][j].green);
Serial.write(bigPIXELS [i][j].blue);

 

Using LaTeX, Mendeley, and Bibtex in Windows

Most publications such as a Thesis, Dissertation, conference paper, Journal article, etc. have specific required formatting. We’ve all hit the point where we simply can’t get our word processor to format things the way we want, and we can’t figure out why. The way these apps work is to code in manipulations to raw text. It is kind of like HTML code in Micro$oft Word and LibreOffice formats. In fact if you have a .docx or .odt file, you an open them in an unzipping tool such as 7zip and see all the nitty gritty, including saved images, etc.

LaTeX is basically programming what a document should look like directly. You have to write code to tell the document where to create a subsection, bulleted list, insert images, even to italicize or bold something, but it (usually) gives you much more direct control over formatting.  All through college, I wrote only a few documents in LaTeX because honestly, it was a pain. It is not WYSIWYG editing at all. After you make changes to the code of your document, you have to compile it into a PDF document before you can see what the end result will look like. I avoided using it because I hadn’t found an editor I liked.  Now I have found a workable setup and I’ve solved a few problems for myself that I think might be helpful for others (as well as my future self).

Firstly, you must install an editor, as well as the compiler tools. There are many editors out there and two compilers.

Editor:

I tested several editors (namely Texmaker, TexWorks) but I settled on using TeXstudio.  Texmaker looks nice, but I had trouble getting it to display a recompiled version of my PDF. Texworks has a much more “Linuxy” feel, as it uses two separate windows to display the code and the resulting PDF.  Again, the winner for me was TeXstudio.

Compiler:

There are two LaTeX compiler setups. TexLive and Miktex. I had used Miktex in the past so I tested out TexLive with this installation.

Setup:

Open TeXstudio, then select “Options–>Configure TeXstudio”  then select the “commands” tab.  Here, we must tell TeXstudio where all the compiler programs live. The main thins to fill out are “LaTeX”, “PdfLaTeX”, “External PDF Viewer”, “BibTex”, and “Biber”.  Don’t worry about the other text in the file paths in my screenshot here, That’s automatically entered by TeXstudio when you select the path. Simply click on the file icon on the right hand side for each of these entries and drive to the compiler installation. Here you see that my texlive installation is directly on my C drive. Miktex can be installed the same way. Then wind your way through the fines until you find the “binaries” (which are the actual executable programs) in the “bin” folder.

texstudio

 

Templates:

Now you can start editing and compiling your paper. You can start from scratch, or if the conference or journal you are submitting your paper to has a template you can download, start there.  In my case, IEEE has templates available for download here. Now I recommend you go through a few tutorials  and play with some files like these before using a full-on journal template just to get your bearings with LaTeX. There are commented things in the template that you can add in (uncomment) and multiple ways of doing things you might want to do, so research is king.  Once you’ve written some of the paper and formatting code, compile it by clicking the “compile and View” button in TeXstudio.compile and display  You might need to compile the bibliography separately. For finer grain compiling options, click the “Tools”menu.

References:

You already know I love Mendeley, but you can actually get Mendeley to export a .bib file.  A .bib file is a list of all your references in a format called BibTex, which you can open in any text editor, even in TeXstudio.  The .bib file Mendeley exports is only as good as the data you entered in Mendeley, so make sure it is correct first! You can enter these reference entries directly into your .tex file (the code  you are writing describing your paper) or keep the references in the .bib file and import that file into your paper.   What is great is that you cite something using /cite{nameOfBibtexEntry} and LaTeX and BibTex do all the rest for you. It will enter the citation in the correct format, then it’ll generate your references section of your paper.  The format,  like MLA, APA, etc, is different for each conference, journal, and even discipline in which you are submitting. You can tell your document which format to use using some simple commands, however the template you download likely already sets you up for the correct format.  To get the name you must use in your /cite{} command, open the .bib file and find the entry you want to cite. The first name next to the @article{ tag is the name to use. for example:

In my bibtex file I have the following entry:

@inproceedings{Rao2003,
address = {New York, New York, USA},
author = {Rao, Ananth and Papadimitriou, Christos and Shenker, Scott and Stoica, Ion},
booktitle = {Proceedings of the 9th annual international conference on Mobile computing and networking – MobiCom ’03},
doi = {10.1145/938985.938996},
isbn = {1581137532},
keywords = {Vehicle,Wireless,ad-hoc,coordinate-based,detection,geographoc,routing,sensornets},
mendeley-tags = {Vehicle,Wireless,detection},
month = {sep},
pages = {96},
publisher = {ACM Press},
title = {{Geographic routing without location information}},
url = {http://dl.acm.org/citation.cfm?id=938985.938996},
year = {2003}
}

In my LaTex file, I might have the following line:

Ad hoc wireless sensor networks can be used to track vehicle locations as shown in /cite{Rao2003}.

Once I “compile and view” this document, it will generate a PDF with references automatically generated and in all it’s two-column perfectly formatted glory…. if all goes right.

NAND to Tetris Free Online Class at Coursera

If you are interested in electronics and haven’t heard of this class, where have you been?  This class is a great introduction to how digital electronics works and for the first time (as far as I know) they’ve opened it up to the public online. It is free to audit the course and they just started March 14th, so it is still Week 1! Here’s the introduction video for the class which gives a great overview of it.

So why is this class so great? Well it starts off with a single piece of electronic digital logic, think of it as a 2×1 lego piece.  Then you use connect some of these together to build other more functional lego bricks, like a 2×2 brick, then a 2×4 brick, etc. Eventually you end up building your own Central Processing Unit (CPU), then you learn to code it in Assembly language (the lowest human-readable programming language),  then you build up to eventually a full blown computer with keyboard and monitor connections that you can write video games like pong, tetris and slightly more complicated things. That’s about as close to starting from scratch as you can get.  The real name of it is “the Elements Of Computer Systems” but everyone called it “From NAND to Tetris in 12 easy steps”.  NAND is the type of digital logic gate that you start with.

I know it  sounds super hard, but it isn’t!

This class is so well laid out that you can do it in your spare time.

The first half of the book is on their website for free, but you can buy the book for about $30. That’s one of the cheapest textbooks I know of, and it is a really good book to have for reference. The Massively Open Online Course (MOOC) is free to audit, but if you want an official Coursera certificate showing you took it, it’s only $50 or so. Some workplaces let you use that for Professional Development credit. This is some of the most fun PD credit I know of. If you aren’t familiar with MOOCs or Coursera, imagine hundreds or even thousands of people all around the world watching videos that are released about once a week with a lecture and homework assignment. Everyone can communicate in an online forum to help each other out. You can even get your work graded (in some classes). Many courses are free, some you have to pay for. Coursera is one of many places offering these kinds of classes. Heck, MIT and other universities have been posting their courses online for free for years now. MIT will let you earn a fancy certificate too (for a cost).

My tips:  I used Logisim to build circuit and simulate the logic gates, but you don’t have to. All the software you need is available for free on the class webpage. If you are familiar with FPGA devices, you can build this computer for reals on a cheap FPGA development board like this guy. Either a Xilinx board with Vivado to build and simulate or Altera boards (<– warning, I’ve never used this one before) using Quartas software to design and simulate it should work. This little CPU isn’t super complicated. I warn that actually building it on one of these boards is no easy task, you’ll have to design stuff that is not covered in the class to get it to work with your particular board.

Join the class now before they get too far ahead!