How to Make Almost Anything - Fall 2022
I recently graduated with a B.S. in Computation and Cognition from MIT and I am currently an MEng student in the same field. My research involves designing devices for monitoring and learning from biosignals in the Traverso Lab.
Academically, I am interested in brain-computer interfaces and human computer interactions. Personally, I am interested in making cool art and things. I hope to combine those interests in this class!
This week I got familiar with CAD and designed a possible final project. I am interested in making a theremin that doubles as a funky-sounding instrument and light display. I did lots of research on existing theremin designs and I was inspired by the flat antenna design as opposed to the typical straight pole antennae. I love colorful designs so I also wanted to incorporate some sort of rainbow or bright colors to the body of the theremin. I started by doing some rough sketches, starting with a typical theremin appearance.
Then I tried to incorporate the plate antennae into the design along with a different body shape that uses colorful acrylic rings.
I thought about incorporating LEDs into the inner ring of the colorful discs to make the edges of the acrylic illuminate depending on what notes are being played and at what volume.
Finally, I replicated these sketches in CAD. I used parameters to later be able to easily manipulate the dimensions of the components.
I decided that I wanted to make a sticker for my laptop. I spent more time than I probably needed to looking for pretty clipart images of pineapples and pigs on the internet. Once I found the perfect pineapple and piggy I removed the backgrounds and made them solid black for the vinyl cutter.
With my images ready to cut, I sent them to the computer associated with the vinyl cutter and opened up mods. After setting the origin on the machine and locking the vinyl roll in place, I sent my piggy.png to the printer to cut. The resolution on the image wasn't the best, resulting in only about 72 dpp and a tail that looks more like a blob or a butterfly because it was too thin and ended up snagging on the cutter.
Then I sent my pineapple image to the printer. Roland rolled out the vinyl way more than I expected and was taking a long time to cut. It was at this point that I double checked mods and saw that the image somehow ended up being 14"x14" instead of the intended 3"x3". Oops. I resized the image and sent it back to Roland to cut anew. The big pineapple will make a nice feature on the wall in my dorm room. Lesson learned: always check the dimensions before cutting.
When it came time to apply the smaller pineapple sticker to my laptop, things were going smoothly until I tried to remove the transfer paper from the vinyl. The adhesive on the transfer paper seemed to be stronger than the adhesive on the vinyl so pulling the transfer paper from my laptop also brought with it the tiny pieces of my pineapple sticker. With a little help and words of encouragement from Anthony to be patient and shear from a sharper angle, I was finally able to apply the sticker prominently to the back of my (pine)apple laptop.
After looking at a variety wooden construction kits online, I was inspired first by a carousel design which seemed a bit too complicated for me, a beginner at CAD, to complete in one week, so I instead opted for a simpler (and looking back, still somewhat complicated) design-- a ferris wheel. I looked at many different ferris wheel designs for inspiration and even considered building a motorized ferris wheel, but I ran out of time to feasibly get that done this week. A manual ferris wheel would have to do.
I started by sketching the face of the ferris wheel. I also watched videos of wooden ferris wheel construction kits to get a sense of what other parts I would have to design. The other components I had to design were the carts, the bench seat/bench back, the axle for the carts, the connectors for between the wheels, the legs, and the axle connecting the legs.
In order to make this design easy to change dimensions as needed, I parametrized many of the dimensions. These parameters allowed me to easily make adjustments to the overall size of components, to adjust for the thickness of the cardboard, and to account for the kerf of the laser when designing press fit joints.
As another way to make my design easy to modify, I tried to design symmetrical components using mirroring and circular patterns and other similar constraints that would allow me to make changes as needed in one place that propagate to symmetrical parts of the design. This ensured that when I changed the parameters, all desired dimensions are changed everywhere and not just in one place. This made it a little less tedious to adjust notch sizes that were present about 40 places in my design.
Once I had designed my components, I projected the 3D parts into a 2D simple sketch which I then saved as DXF files so the laser cutter would have a clear outline to follow. I prepped the DXF files in Correl by making all of the lines red so the laser cutter would cut them and not raster them and I sent them to "print". Once in the laser cutter settings, I adjusted the power of the laser to 80% and the speed to 16% (More on this later). I started by cutting out some of the cart pieces to test if my joints would be snug enough. I cut out two moon carts and 2 bench pieces (the seat and back were identical). Once I cut these, the joint was not snug and the bench pieces easily fell out. I realized I had forgotten to adjust the joint dimensions to account for the kerf of the laser. So I went back into my design and made the notch holes smaller and the notches bigger by half the width of the kerf (which I had calculated to be around 0.3mm). With this adjustment made, I cut out the pieces again and thankfully they fit together snugly.
The next piece that I tested was the center axle of the entire ferris wheel. The axle is made up of two identical joints that fit together to form a cross-shaped axle. When I cut these I realized that the orientation of the piece respective to the direction the the cardboard matters. When the length of the axle was cut parallel to the cardboards inner supports the legs of the joint for flimsy and fell apart. This is because the size of the legs were on the same scale as the spacing of the corrugation in the cardboard. By rotating the piece 90˚ in Correl, making the corrugation perpendicular to the corrugation, the axle piece was much stronger and fit together snugly with its identical counterpart. I kept the orientation of the cardboard in mind when cutting out all other support pieces (connectors, cart axles, legs).
I wanted to make sure that the carts would swing freely on their axles, so I tested these pieces next. I cut out a single cart axle and this is when I realized that I had made the loop on the top of the cart too small. I accidentally made it the size of the notch that the axle would fit into and not the width of the axle itself. so i adjusted the size of the cart loop accordingly, leaving a few mm of wiggle room so that the axle would fit through and leave enough room for the cart to swing. With this adjustment made, I cut and tested out a single cart and successfully made it swing!
Finally it was time to cut the frame of the ferris wheel (wheel faces, legs, and base). When I first loaded the wheel onto Correl, I quickly realized that I had made the face of the wheel larger than the largest dimension on the laser cutter bed. So I went back into my design and reduced the overall dimensions of my design, which was mostly painless due to the parametric and symmetrical nature of the design, but I did end up having to make the carts smaller to make sure that they cleared the connectors holding the wheel faces together. With these adjustments made I was able to cut out the wheel faces, as well as the remaining pieces of the ferris wheel.
I arranged these remaining pieces as compactly as I could in the drawing software to minimize waste and sent them to the laser cutter. This went mostly successfully except for the times when the laser didn't cut all the way through the cardboard. This seemed to be due to the warping in the cardboard that meant that its height varied relative to the laser in some points. To account for this, I reduced the laser speed which allowed it to fully cut through the material. To avoid doing entire cuts over, I also had to use the utility knife to get some pieces out that the laser hadn't fully cut through.
With all the pieces cut, it was time to assemble them. After I had cut out the wheel faces, I realized I had forgotten to double check a very important dimension: the center through hole for the wheel axle. I had arbitrarily set it when I first started designing and never set the diameter of this hole relative to the design parameters. I realized this late Tuesday night and didn't want to waste more cardboard to fix it so I decided that I would eventually sand down this hole so the axle fits freely through it, but for now I just used a wooden dowel that works just as well (for the most part).
With the ferris wheel now fully assembled, I gave it a spin. Miraculously, it worked (for the most part). I was able to spin the wheel around the janky axle and the carts swung freely. The moon carts did not clear the connecters so they were getting stuck, but that can be easily fixed by reducing the dimension of the star by a mm or two, which I will eventually do with an exacto knife.
The group assignment, where we characterized the lasercutter's focus, power, speed, rate, kerf, joint clearance and types, can be found on the EECS group assignments page.
This week's assignment involved making an in-circuit programmer with a microcontroller. This would mean that everyone would be making exactly the same thing which made getting help and troubleshooting easier this week. After watching two other people go through the milling procedure on the OtherMill, I felt like I had the process down. I did refer to Dave from time to time to make sure, but over all I had a good sense of what to do. The steps I followed are listed below:
The group assignment, where we characterized the design rules for the Roland Mill (we were unable to get the linetest to mill on the OtherMill), can be found on the EECS group assignments page.
The process for 3D scanning was relatively straightforward. I placed the Revopoint scanner on a table at around eye level. Then I sat in a swivel chair and slowly rotated, allowing the scanner to scan my face from one ear to the other. The scanner has a difficult time capturing dark surfaces so it did not capture my hair at all nor my irises and pupils very well.
After saving the mesh from the Revopoint software, I opened the file in mesh lab to see if I could take a closer look at the scan. There I was able to toggle between the mesh that made up the shape of my face and the texture that gave it color.
In order to design something that could not be made subtractively and inspired by the hinge idea, I decided to make a figurine that has arms and legs that swing freely in the figurine's body. I settled on a mushroom figurine with long arms and stumpy legs. Here is the first design that I came up with:
The arms run through a hole that runs all the way through the body of the mushroom. The legs sit in a ball and socket joint. The offset between the arms and the arm hole is about 2 units and around 3 units for the legs.
To minimize sagging overhangs, my first print required a substantial amount of support material. This was mostly to support the mushroom cap and arms. ( I used the Prusa printer and Prusa Slicer to print the mushroom man).
Once the print finished, I could immediately see some areas, namely the mouth and eyes, where the overhangs sagged due to a lack of support material (and using a 90˚ overhang in the design). Another area that sagged was the arm hole since support material can't easily be removed once in there. Also, the arms and legs ended up being too thin as the snapped off when I tried to remove the support material. One leg did miraculously survive and the ball and socket joint successfully held the leg in place like I wanted it to.
To mitigate the issues in the first print I made some adjustments to the design. I increased the thickness of both the arms and legs and increased the clearances between the overhanging parts, including the armhole, and mouth. I also cut the eye holes out an angle in an attempt to minimize sagging (and to make sure the eye pieces that I printed on the stratasys in black would fit in there snuggly and easily). I also adjusted the orientation of the figurine in the slicer software. I thought that this would help reduce support material and reduce dramatic overhangs.
These adjustments made all the difference in the second print. My little mushroom man came out looking like a little piece of wood from the layer lines, an unexpected bonus feature of laying the print on its back. The new print had minimal sagging and far less support material, which was way easier to remove than that of the first piece. After a little sanding and a coat of paint, my mushroom man stood victorious, arms swiveling and legs swinging.
The group assignment, where we characterized the design rules for the Prusa and Stratasys 3D printers, can be found on the EECS group assignments page.
This week I worked on redrawing the ATSAMD11C hello.D11C.echo board. I spent some time before I started designing looking for fun shapes to mill my board into. I had a hard time settling on an idea I was excited about so I decided to just get started on drawing my schematic in Eagle (through Fusion so I could easily import the FAB library from the HTMA fusion group).
fter arranging all the components and making all the necessary connections on the schematic, I went to the .brd file to start routing and making the physical arranging of components. To avoid some headache, I tried to match the existing orientation and connections made on Anthony's sample board in the HTMA group files. Once I had routed all of the connections, I thought the LED was perfectly placed to shape my PCB into an angler fish.
To get the shape of an angler fish, I found a silhouette png image and then converted it to a DXF file using an online file converter. Then, from within Eagle, I navigated to the Automation tab, selected Run ULP, and used the import-dxf script to import a scaled DXF file to match the size of the components.
With a new board outline, I had to rearrange and reroute some of my components. One major change I made was replacing the USB-A connector with a micro USB in order to maintain the shape of the fish tail. This came with some unanticipated consequences though. The pin order mirrors that of the USB-A connector, so all the connections I had initially made crossed over inconveniently. Instead of trying to rearrange the entire board. I decided to add some 0Ω resistors to create bridges over the crossed paths. I figured this might also make the board look more visually interesting.
Once all the components were placed, I ran the DRC to ensure that my design could actually be cut by the endmill. Thankfully I only needed to adjust some routing to ensure proper clearances, but otherwise my design was ready to go. I loaded the brd file onto the Othermill and 45 minutes later, I had a beautifully milled angler fish.
I carefully soldered on all the components, taking special care with the tiny pins on the the micro usb port.
I forgot to solder down part of the connector resulting in it tearing off the traces when trying to plug in the usb cable. Instead of milling a new board, I decided to do board surgery by soldering on some magnet wire to reinstate the micro-USB traces. This was a very time-consuming and tedious process and I would definitely consider milling a new board and soldering all the components again instead next time. Also, I forgot to strip the ends of the magnet wire before trying to solder them on, which made the process even longer than it needed to be. Anthony helped me out by reminding me to do that and by helping me solder on the last two pieces of magnet wire that were proving to be more difficult to attach than I would have liked. To ensure that no more board surgery was necessary, I added some hot glue over the newly attached traces and around the sides of the micro-usb connector to add some structural integrity.
After attempting to program the board I realized that not only was my programmer not working but that my anglerfish board was not making a consistent connection at the micro USB port. I was able to use a different programmer to get the bootloader on my board, but after that, I was not able to consistently see the board on the ports of my computer. I did not have time to mill an entirely new board, so I decided on a janky solution. First I attached wires to the GND and 5V traces that would have come from the microUSB traces, hoping that I could use a 5V power supply and that the data line traces were still connected to the micro USB connector after the board surgery.
This turned out to not be the case. So I made an even jankier solution by adding wires to the data lines as well, milling a new USB connector, and connecting the wires to that. Finally, I was able to see the board as a port on my device consistently and I was able to upload the echo-hello-world program.
In the future, I will be milling a new less janky board and going back to the more reliable USB connector. I will also be milling a new programmer board so I can avoid having to go into lab to program any future boards.
The group assignment, where we observed the operation of a microcontroller using the test equipment in our lab, can be found on the EECS group assignments page.
This week I was inspired by my younger brothers to make a rocking arch that they could play on. I searched online for inspiration and found that rocking arches also double as climbing arches and as a table. I used dimensions from these existing rocking arches as a reference in my design. My final design was made up of 11 simple parts. A solid arch with handles that would form the table top, an open arch with handles, and 9 slats that would hold the arches together. I also added 0.25" dogbones on all the inside corners using this Fusion plugin. To ensure that the slats would fit snuggly into the notches, I gave them 0.0025" of clearance on either side.
With the parts designed and assembled in CAD, it was time to figure out how they would be cut by the CNC mill. To do that I made a sketch of the 4'x4' OCB panel and went into Fusion's Manufacturing view. I created a manufacturing model that I could modify without altering the original design (changes in the original design would propagate in the manufacturing model). I then edited the manufacturing model and used the arrange tool to lay the pieces flat and to ensure the best use of space on the OCB panel.
The next step in the CAM process was to create a new setup for each job that would run (i.e. one for each panel of OCB). For each setup, I specified the coordinate system of the job as well as the dimensions of the stock and it's coordinates with respect to the manufacturing model. An important step is setting the z-axis at a zero offset from the bottom of the model.
Next, I created a 2D contour for each tool (1/4" and 3/8" endmills) in each setup. The larger endmill was used to cut the larger less detailed parts of the job, while the smaller endmill was used for the more detailed areas like the dogbones. The first thing to setup in the 2D contour was the tool size and feed/speed specifications. These specifications are shown below:
Once the tool was selected, I went to the Geometry menu in the 2D contour setup. I selected the contours on the bottom surface of the model that I wanted to mill to ensure that the machine would actually cut through the material and not just move along the top surface. I also specified where I wanted to place tabs on pieces that would otherwise become detached during the milling process and could possibly become a projectile if left unconstrained. The only pieces at risk for this were in the holes for the handles. For some reason Fusion would only allow me to manually place one tab here (so these parts would be nailed down especially well before the milling process).
For the 1/4" tool 2D contour setup I also had to turn on rest machining to make sure that it wouldn't try to cut where the 3/8" tool already had. Additionally, this tool was set up for multiple passes in the heights menu, for a max depth of 1/4". Also, at first, the simulation did not show this tool cutting the dogbones in the notches inside the arches, so I turned off "Lead-In" in the linking menu and this seemed to solve that issue.
Finally, these setups were exported as G-code and we setup the machine for milling. The first step in the process is to nail down the stock to the milling platfrom using plastic nails that will not interfere with the job. The nails were placed evenly on the platform, ensuring that the OCB was firmly secured down. Next, I put the 3/8" end mill into the machine, securing it tightly in the collet. With a new piece of OCB and a new tool, I had to home the x, y, and z-axes. I placed the metal homing piece on the bottom left corner of the OCB and homed each axis (between tools I only needed to rehome the z-axis).
Now that the mill was oriented, I imported my first job. There were some parts (the slats) that had no tabs that would probably fly away if not secured, so I found them by moving the mill to them and putting additional nails in those areas. Next, I secured the dust catcher, turned on the air compressor, and started the job at 50% speed. Anthony and I listened for anything that sounded out of the ordinary and turned up to the speed to 100% when we didn't. Once the job finished I switched to the smaller tool, rehomed the z-axis, and started the next job. (X2 for the second OCB panel).
Once everything was cut, I pried the OCB off of the platform with a crowbar. Thankfully they came off easily and had minimal onion skin. I removed the remaining plastic nails by breaking them off with a hammer and I filed the tabs off as well as some of the areas with onion skin.
With all the pieces cleaned up, I tested my press fit joints by putting the slats into the arches and they thankfully fit snugly. I then secured the slats in place with wood glue and set the rocking arch in table form with heavy objects on top to hold the pieces tightly together.
The rocking arch successfully rocked on it's own. I am not convinced that it can support the weight of an adult but I think my younger brothers could gently climb or rock in this. At the very least it is a functional table. In a future iteration I would probably use higher quality wood to reduce the risk of splinters and broken nail bit protrusions as well as to ensure that the slats won't bow/break under the weight of a person. With OCB I probably could have doubled up on the thickness of the slats and the size of the notches and that would have made the arch much sturdier. Wooden dowels would have been another good alternative for the slats.
The group assignment, where we tested the runout, alignment, fixturing, speeds, feeds, materials, and toolpaths for our machine, can be found on the EECS group assignments page.
This week I recreated my anglerfish board from Week 4 and made it so the LED atop the fish's head would light up when the button is pressed. I decided to ditch the micro-USB connection and opted for a normal USB connector instead. As a result, this design had far fewer 0Ω resistors as jumpers. Also, I had trouble altering the fish's tail into a rectangle by combining two separate line drawings together while maintaining a closed polygon for the board outline, so I had to carefully manipulate the existing outline into a rectangle. This left some extra lines that I had a hard time getting rid of so I just left them there and decided to break this piece off after the board was millled. In retrospect, I could have altered the anglerfish outline with a usb tail before importing it into Eagle instead of trying to manipulate it after the fact.
As I seemed to have misplaced my programmer board, I also decided to mill and stuff a new one to program my LED board.
When it came time to program the boards, I ran into the issue of not being able to use my programmer to program the anglerfish board. A capacitor on the anglerfish board would get very hot whenever I attempted to do so. This would not happen when I programmed the board using the Atmel programmer. After further debugging, I found that ....TODO
Now with the bootloaders on each of the boards I wrote a program in the arduino IDE that would allow me to recognize a button press and toggle the LED. This involved reading the datasheet and determining how to talk to the pins associated with the button and LED in code. I also initialized the pin connected to the button with a pull-up resistor so that the pin would not be floating when the button was not pressed.
This program halfway worked on the first try. I put in a print statement to indicate when the button had been pressed as well as to indicate the state of the LED pin before and after the button press. Seeing that the button presses were being recognized and effectively toggling the LED pin, I was confused as to why the LED was not turning on.
I tested first to make sure that the LED itself still worked, so I connected it directly to 3.3V and found that the LED did indeed turn on. I then double checked my code, and found nothing obviously wrong with it. So I had Anthony inspect my board for anything that could be causing this issue. He quickly noticed that the LED pin on the microcontroller was floating less than a mm above the copper pad underneath it. This was quickly fixed by adding a bit of solder to the joint. With the microcontroller pin securely in connection with the LED, pressing the button successfully made my little anglerfish glow!
The group assignment, where we compared the performance and development workflows for other architectures, can be found on the EECS group assignments page.
This week I had big aspirations of making a cast of my brain from an MRI scan and then of my car. After finding that these would take much longer than I had time for this week, I decided instead on molding and casting a waffle with butter on it to use as a new keychain for my car keys. I found a simple stl of such a waffle online and then added a loop to the side of it so I could use it as a keychain.
With a completed model, it was time to see how the waffle would fit into the block of machining wax. I first created two compartments that each half of the waffle would sit in. I split the waffle along it's large circular face (similar to how a waffle maker would). Each compartment was a bit more than twice the height of the waffle and each left a border of around 1/8" from the edge of the wax block. I also added two sets of holes and tabs that would make aligning the silicone molds much easier when casting the final product.
After completing the CAD, I setup the CAM. I created a new setup, using the 3"x7"x1.5" wax block as the stock to mill into. Then I set up both adaptive and pocket clearing with the 1/4" flat end mill using a spindle speed of 15000 rpm and a cutting feedrate of 120 in/min. This was the first rough pass that would clear out the bulk of the material. I also set up an adaptive clearing and contour path with the 1/8" flat end mill to clear out the bulk of the material in the smaller spaces that the larger tool couldn't get to (like the holes in the waffle) with the same spindle speed but a cutting feedrate of 100 in/min. Next I setup a parallel pass and pencil toolpath to clean up some of the finer features of the waffle. This tool was not small enough to capture all of the details (like the lines separating the four waffle quadrants) so I added one more pencil path with the 1/16" end mill.
The CAM predicted that the entire machining time would be almost 30 minutes. In reality, the entire process, including the three tool changes, took almost an hour. I forgot to take a picture of the wax block after the pass with the 1/8" tool, but here it is after the first rough cut and then again at the very end.
I used a file to touch up some of the smaller details of the mold. There were some stray hairs of wax left after the milling and filing which I removed by melting them back into the material with a hot air gun. I waved it quickly over the material to avoid melting features accidentally.
Next, I prepared the oomoo for filling the mold. After mixing 1-to-1 parts A and B of oomoo for over 5 minutes I poured as slowly as I could into the lowest corner of the mold. Sometimes more than I intended to poured out and the mixture also seemed to thicken as I was pouring it. These combination of factors led to many air bubbles forming in the oomoo. Anthony recommended painting the oomoo into some of the deeper features to prevent that so that is what I did on my second round of oomooing.
The second round of oomoo gave me much better results. Once the mold completely cured, I popped it out and cut a vent hole that I would eventually pour my casting material into.
To start off, I thoroughly mixed 100 parts hydrostone powder to 32 parts water that I would eventually pour into my mold. I rubberbanded the mold halves together, carefully aligning the tabs I created and poured the hydrostone mixture in. I poured slowly to avoid air bubbles. Once the hydrostone cured, I removed it from the mold. I did this three times. First in the original mold which I quickly realized that I did not pour enough hydrostone into, resulting in a partially eaten waffle. The second and third times were in both the original mold and the second mold (which I painted a layer of oomoo in the deep features). These resulted in complete waffles, one with many artifacts from the bubbles in the mold and one without.
I then filed off the extra material from the mold seams and the vent hole. With the waffle all filed, all that was left to do was paint it and put it on a key ring!
Ideally, I would make this keychain out of metal. So, if there is time later this week I will cast a metal waffle.
The group assignment, where we reviewed the safety data sheets for each of the molding and casting materials,and made and compared test casts with each of them, can be found on the EECS group assignments page.
This week I wanted to see how I could develop the input devices that I would use for my final project, namely the capacitive plates that would control the pitch and volume of the theremin. I decided to test out a capacitive sensing circuit using two copper plates (made from the same material that we mill our boards on #TODO) as the antennae that would control the pitch and volume of tones coming out of a speaker. Since this program would possibly use many pins and memory on the µcontroller, I decided to transition from the SAMD11C14A to the SAMD21E18A so I would have more GPIO pins and memory to work with.
I wasn't sure exactly where to start on making a capacitive sensing circuit so I searched for some references online and on the course site. I first referenced fellow EECS section's Seung Hyeon's website to see how she made her capacitive sensor during embedding programming week. This led me to the methodology of connecting the capacitive plate to two pins, one for transmitting a square wave, and another for sensing the changes in the charging of the capacitive plate by adding a resistor. Changing the distance of one's hand to the plate will alter the time constant of the RC circuit on the sensing pin. This change in time constant means that the signal that is read on the sensing pin is a delayed version of the transmitting square wave. Comparing these signals allows us to use the capacitive plate as a variable capacitor that varies directly with the movement of your hand. Another resource I found, was this youtube video which uses the same set up to make a capacitive sensor theremin.
With these resources, I was able to design a capacitive sensing circuit that makes use of the SAM21E. I referenced the datasheet to ensure that all of the sensing pins were analog pins and that the output pin for the speaker had DAC capabilities, which would be useful next week during output week. Once the schematic was done I spent longer than I would have liked routing the traces and only ended up using 3 0Ω resistor bridges. The final schematic and traces for the capacitive sensing circuit is shown below:
I then milled and stuffed the board following the same processes used in past weeks. Using 1µF bypass capacitors and 10MΩ resistors for the capacitive sensing pins. On my first pass milling the board, I realized that I had not cut deep enough, so I adjusted the cut depth and ran the job again.
The next step was to program the board. First, I programmed the bootloader on the the board and then figured out how I would go about capacitive sensing. The youtube video I found uses code that makes use of a capacitive sensing Arduino library in order to sense capacitance changes. After trying to use this library however, I quickly realized that it runs on an avr architecture and not a SAM architecture, so I could not upload that program to my board. I decided to instead use the method used by Seung Hyeon. Here are the respective programs and their outputs on the serial plotter (only for the method that worked).
This sensor only worked when I touch the capacitive sensor, so I am going to try adjusting resistor values and the delays in my code to see if the sensor will work from a greater distance.
The group assignment, where we probed an input device's analog levels and digital signals, can be found on the EECS group assignments page.
This week, I added a speaker to my capacitive sensor from last week. After reviewing my schematic with Anthony, I removed some extraneous resistors and add and gain amplifier and speaker. The schematic and finished setup can be seen below:
When first testing the board, I quickly found that the speaker and capacitive sensor connectors on the 2x2 jumper were pulling the traces up off the board. To remedy this I strengthened the joint with hot glue.
Last week, the capacitive sensor only showed a response when I touched the sensor directly and did not vary with proximity like I wanted. I tried to take a closer look at the sensor read pins so I could get a closer look at the time behavior of the signal and time my delays accordingly. In attempting to look at these signals on the oscilloscope, I accidentally shorted the reset pin to ground via the ground clip on the oscilloscope probe. This prevented me from seeing anything on the scope because the microcontroller was constantly reseting. Once I realized this (with Anthony's help), I moved the ground clip to a different part of the board.
Once this problem was solved, another arose. My laptop stopped recognizing my board, and therefore I could not upload any new programs or use my board properly. I tried reuploading the bootloader, and although the terminal said that the bootloader was successfully programmed, no computer would recognize that my board was plugged into it. Finally, Anthony used Atmel Studios the completely wipe and reprogram the bootloader onto my board which finally restored it to it's original status.
Now that I was able to look at my board with a scope, I learned that the interesting changes in the sensor values based on proximity were happening on a time scale less than 100µs. I also learned that Arduino's analogRead() function takes over 400µs to read a pin. This is too slow to capture any of the interesting behavior happening at the sensor. In order to deal with this I found a library, avdweb_AnalogReadFast, which reduces the read time to 21µs. This delay gives just enough time to capture the changes in the charging of the capacitive plate sensor as the hand's proximity to the sensor changes.
I implemented sound generation in two different ways. In both case I mapped the raw output of the sensor into values that represent audible frequencies. The first method I used was the tone() function in Arduino. I directly input the mapped frequency into the tone function. The tone function outputs a 50% duty cycle PWM signal at the desired frequency. The second method made use of the wave generation functionality of the SAMD21. I referenced Quentin's capacitive touch piano and synthesizer code in order to figure out how to use the waveform generator. It requires using the timer capabilities of the chip. This implementation resulted in a slightly cleaner output, but both signals were pretty noisy. (I ran out of time to implement the volume control capacitive sensor, but the final project will make use of capacitive sensing in order to modulate pitch and volume).
The noisiness in the output is a result of the noisiness of the capacitive sensor input. The documentation for the AnalogReadFast library recommends an input buffer to make the ADC conversion more stable. I decided not to make a new board in order to add this input buffer, but would do so for future iterations of this board.
The code I used is shown below:
The group assignment, where we measured the power consumption of an output device, can be found on the EECS group assignments page.
This week I decided to use an ESP32 to try to remotely control an RGB LED. I used both Neil's Hello World board and this person's work as a reference in my board design. The final schematic can be seen below, as well as the traces I used to mill my board. I forgot to save the PCB with routing before Fusion 360 crashed but not before I saved the traces I needed.
I milled my board on the Roland and stuffed it. I accidentally put on the wrong 6-pin connector (female instead of male).After trying to remove/replace it and accidentally tearing up the traces slightly, I instead used magnet wire to reconnect a severed trace and hot glued the original connector down back into place. I found some male-to-male dupont wires to connect my board to the FTDI cable needed to program and power the board.
Next I found an example wifi scan sketch to make sure that my board was working as expected. When trying to upload the sketch, I got an error message that said that Arduino could not find python in order compile the sketch. After reading some forums, I found this one which explained how to fix this issue. One change I made was to replace "python" with "python3" as shown below:
# From
tools.gen_esp32part.cmd=python
"{runtime.platform.path}/tools/gen_esp32part.py"
# To
tools.gen_esp32part.cmd=/usr/local/bin/python3 "{runtime.platform.path}/tools/gen_esp32part.py"
Now that Arduino could talk to python, I was finally able to upload the test code and see the wifi networks available in EDS.
Next I wanted to see if I could control the RGB LED on my board via wifi. I used this tutorial as a reference. I started by updated the pins of my LED in the code, adding a third output pin, and uploading the sketch . I was able to successfully control each individual LED color by connecting the ESP32 to the same network as my laptop in the code (my mobile hotspot, ESP32 only supports 2.4MHz, not 5GHz), navigating (in my browser) to the IP address of the board presented in the serial monitor, and then clicking on the toggle buttons for the respective LED.
The group assignment, where we sent a message between two projects, can be found on the EECS group assignments page.
Using my board (ESP32 + RGB LED) from last week, I wanted to user to be able to select any color they want to display on the LED. In order to vary the contribution/brightness of each LED, and therefore generate any color, I needed to implement PWM. I found this tutorial which explains how to use the PWM functionality of the ESP32. I also found another tutorial that explained how to set up the web page and to turn the user input into the color displayed by the LED.
First, I had to initialize all of the variables I would need for using the wifi and PWM functionality of the ESP, as well as indicate the pins that each LED corresponds to. The PWM was set up for 5000Hz and 8-bit resolution.
Next, was the html for the webpage. Here, the entire webpage was set to be a gradient of all the colors (adjusting in size based on the user's screen size) and a function is defined which captures the rgb values wherever the user clicks/touches.
Once the rgb values the user has selected are stored, the handleRoot() function uses PWM to write them to the LED pins.
The setup and loop functions make use of the variables and functions described above.
Here is a demo of the remote color picker for the RGB LED in action.
The group assignment, where we compared as many tool options as possible, can be found on the EECS group assignments page.
This week the EECS section ventured to create a drawing machine. The subsystems of this machine were the hardware and software. The hardware involved designing and building the core-xy gantry + frame as well as the toolhead + z-axis motor. The software tasks included designing a user-interface, an image-to-coordinate converter, as well as a coordinate-to-motor action program. I focused this week on helping with the designing and building of the corexy gantry.
We based our design on Neil's UrumbotXY. One main difference between our design and Neil's design was the rolling mechanism for the core and center rod of the corexy system. We instead used the design used by Jake's Clank Linear Axis. We 3D printed the pieces needed to accomplish this but quickly found them nearly impossible to remove from the raft that they printed on. After a team effort in raft removal and sanding we realized that the print quality was not ideal for the smooth motion we wanted our corexy system. We reprinted the parts and found that will these also needed some sanding, they were far more useable than the original parts we printed.
We started by fabricating the parts needed to recreate the UrumbotXY. We laser-cut the hardware we would need to attach bearings and motors to the rest of the frame. We also made a fun portrait of Neil while we waited for our 3D prints to finish.
When we tried to assemble the frame, we discovered that the pieces we cut were too large to fit the rolling mechanism along the 20mm aluminum extrusions. So to fix this, Yuval adjusted the design and made it smaller. We wanted to get a good fit, so we test cut this new design in plywood to determine the exact dimensions we would need. We found the correct dimensions that made the bearings fit nicely on the frame and cut the final pieces in acrylic.
The next step was fixing the frame to a wooden board. This involved drilling holes into the board and aligning the frame we built on top of it.
With the frame in place on the board, we were able to attach all of the motors, bearings, and string that would eventually move the core once the motor drivers were programmed. We did a manual test run of this movement by manually spinning the motors. After this successful proof of concept, all that was left to do was build and attach the end effector and to program the motors, tasks which others were working on in parallel.
Once these tasks had been completed we were able to successfully draw an image of an imperfect orange!
This week I learned how to make computer-automated embroidery! I decided that this would be a good opportunity to get started on Christmas gifts so I decided to embroider a handkerchief for my girlfriend with her favorite flower and initials on it. To get started, I found some reference images of the flowers and then drew them out in Adobe illustrator. I wasn't sure how the Inkstitch/Brother PE Design software worked so I decided to isolate each different color in the image into their own layer.
After the demo, I tried to use the Inkstitch extension for Inkscape, but found that I was having trouble turning the lines I had drawn into stitches. So instead, I opted for the proprietary Brother PE Design software. I ended up not really needing the layers I had drawn and also quickly realized that I some of the detail (such as thin shading lines) that were originally in the drawing would be lost.
I started by importing the black outline layer from my drawing into the Brother Design software.
Then, I used the "Cut out to Line Image" functionality by selecting the black outline and setting the thinning process to "Less". This ensured that I would be able to keep the varying thicknesses present in the black outline (putting this setting at more would have resulted in a single line over the center of my outline rather than a line on either side of it).
Now that the outlines were in place, a running stitch is automatically placed over those lines. These could be deleted (leaving dotted lines as boundaries for adding stitches or fills) or left in place. I initially left all of these original stitches in place but ended up deleting some of the stitches that hid some of the smaller details in my design (using the line stitch tool). I used the region fill tool to essentially paint bucket style fill areas with the colors I wanted. The colors I selected were placeholders for the software to prompt a thread change during the embroidery process. The machine has no way of knowing what color you have actually put in. This was the final result:
This software also has a realistic preview option were you can see what your final result should look like.
Once I was happy with my design I moved over to the layout software where I imported my design from the design software (I don't understand why this needs to be 2 separate apps) and saved it as a PES file. I put this file on a flashdrive and into the Brother SE1900 embroidery machine.
Before I could embroider my handkerchief I had to set it up in the embroidery hoop that comes with the machine.The handkerchief material is pretty thin, so I cut two lengths of this stabilizing material and ironed it onto the handkerchief to give the needle something more substantial to grab onto when embroidering. I laid the material in the hoop, adjusting the hoop size to allow the material in. I tightened the hoop to secure the material in place and then pulled on the edges of the material to pull out extra slack, making sure not to pop the hoops apart.
Before I put the hoop on the machine, I made sure that the bobbin thread was in place in the bottom of the machine. I lifted the pressor foot and secured the embroidery hoop in place. With the pressor foot still up, I loaded the first spool of embroidery thread following steps 1-9 labeled on the machine. The last few steps auto-threaded the needle which I thought was very cool as I find threading a needle to be a very tedious process.
Next I found my file on the machine interface. I aligned it with the lower left part of the hoop. There is also a feature to adjust size, but Tom doesn't recommend scaling your design from the machine (it does not change the stitches, just the spacing between them).
The entire process, including changing thread colors, took just over 30 minutes. Here's a time lapse of the machine in action.
In the final product, the tension in the threads/material left some gaps between some of the fills, especially between the green and black sections. I think this has to do with how thin the handkerchief material is.
After trimming the jogging threads with little shears, here is the final result!
Theremin that uses two LC variable oscillators compared to a fixed frequency oscillator to generate a pitch and adjust volume respectively.
Reach Goal: include light display that responds to theremin playing
During my freshman year of undergrad, I took a freshman seminar where I ambitiously hoped to build a theremin. The problem was I didn't have a solid foundational electrical engineering or fabrication background, so I did not accomplish very much towards that goal. Fast forwarding to now, 4 years later, I have a degree in EE and far more fabrication experience, especially due to this class.
I began the ideation phase by looking for existing DIY theremins online. I found many kits but the one with the most extensive documentation was the OpenTheremin. I closely followed their circuit design, but made some changes to more closely fit my needs and supplies. For the form factor of the device, I was inspired by the flat plate antennae and handheld nature of the Harrison Instruments 302 Theremin. In the end, due to time constraints, I ended up having to simplify my design a lot and ended up abandoning the Open Theremin design, opting for a simpler design, using Neil's transmit-receive step-response capacitive sensing board as a reference.
Full inventory and cost break down is shown below:
I sketched out a design concept before I had selected parts as well as a final design concept once I had completed my part selection.
Once the final week came around, I had to seriously downscale my original plans and ended up with a much simpler single plate design.
I decided that I would make an acrylic box that would frame the capacitive plate and house the electronics, including a simple user interface (power switch + on LEDs, volume knob, user coupling electrode, and a power cable). I CADed the box so that I could eventually use projections of the 3D surfaces as dxf files for the laser cutter to cut an acrylic sheet. I decided to use press fit joints to join the walls and bottom of the box together. The front wall had holes for the press-fit power switch, the volume potentiometer, the coupling wire, and for the speaker (many little holes formed a grating that the speaker would sit behind). The back wall had a small notch for the power cable. The sides and bottom had notches/tabs to fit into the rest of the walls. I also designed an insert for the box that would hold the electronics in place. It has a slot for the PCB, a path for the power cable, and notches for a speaker holder to fit into.
I wanted to avoid wasting acrylic so I decided to make a few test pieces to check the press-fit clearances I would need for the joints, power switch, and speaker. I also wanted to see what size hole I would need for the potentiometer.
I quickly cut these parts and tested my joints, finding that the speaker and power switch needed around 0.015 mm of clearance to fit snugly. I found that the potentiometer fit through loosely with about 0.132 mm of clearance. I quickly realized that the acrylic was too thick to secure the potentiometer to the acrylic with a nut and washer as I had originally planned. Finally I tested the press fit joints of the box and found that 0.56 mm of clearance made for some snug joints. (These clearances to not include adjustments made for the laser kerf).
With these tests done, I cut out the acrylic box pieces and quickly discovered that the clearance for the press fit joints were not enough and led to small cracks in the acrylic. The reason for this is that my test pieces notches had very thin walls to they had some amount of flexibility that the actually notches did not have. I also quickly realized that I had made my sides and bottom not wide enough to fit the capacitive plate. I increased the clearances and side lengths accordingly and recut the walls and bottom of my box.
These new pieces fit somewhat loosely together, but this was a problem easily fixed with super glue on the joints. I sanded the inside walls so that they would diffuse the lights from the LED strips better and then assembled the box. The capacitive plate that sat on top was just a spare piece of 8x6" FR1.
The design was based mostly on the OpenTheremin schematic. In order to recreate this design, I had to find many parts on Ultralibrarian and SnapEDA and import them into fusion. This was the basis of the Pitch/Volume, mixer, autotune, and DAC circuit designs.
The amplifier/speaker circuit was based on the design from week 9. When selecting resistor values, I had to consider clipping, so I chose resistor values that would prevent this (TODO verify R values).
I modified the power source circuit by doubling the programming cable (FTDI) as the power source. I also designed in the option for an alternative power source in the event that I want a battery powered theremin. In order to prevent alternative power sources from frying my computer, I added a diode that prevents current from entering the VCC pin on the FTDI cable (it can only exit).
The system performs best when the user and the system share a common ground, so I also included a static-wrist band into the design that would create such a system ground.
I also modified the user interface from the original design. In order to simplify the programming, I needed to use a microcontroller with an AVR architecture, so I selected the ATTiny3216. In an ideal world I would have used an ATTiny3217, which has more pins, but these seemed to be out of stock. Due to limited pins I removed one of the potentiometers (which controls Timbre) as well as an RB LED and a fancy touch button. I replaced the USART and MISO programming jumper with the FTDI cable. I removed a control voltage jack that OpenTheremin uses to enhance the functionality of the theremin as a MIDI device (a functionality I don't need). I added some switching mechanisms for power, mute, switching between audio outputs, and switching between program/run. I also added an LED strip that lights up when the system is powered on.
Everything above is not super relevant because I ended up changing my system design during the last week. I ended up using a modified version of my capacitive sensing design from input devices week. After doing some testing with my board from week 8, I found that the signal from the single plate capacitive sensing was very noisy so I switched to two plate sensing (1 RX plate and another TX plate) which resulted in much cleaner results especially with signal averaging.
The RX plate signal is centered around 1.65 V using two 1MΩ resistors. I added a volume potentiometer to feed into the opamp/speaker circuit from output devices week. I added a header with 5V and GND pins for powering the LED strip. I replaced the male USB connector with a female connector (which I later realized was a mistake). I also intended to add a power switch but I ended up forgetting to.
PCB FabricationDue to the complexity of the board, I had to include some vias and traces on the bottom of the board. This was the first time I had milled a double-sided board. The process was a bit more involved than a single-sided board, but not terrible. The steps were: locate x-y with fixture screwed in with upside down tool, lower left justify to mill traces and holes in top, and lower right justify to mill traces and outline in bottom. I forgot to switch to 1/32" PCB conservative so I ended up with rougher traces which left some copper strands that caused shorts.
Once I cleaned up the traces and cut any shorts that weren't milled, I was able to start stuffing the board. I intended to use rivets to stuff the vias but I quickly realized that the holes I drilled were way too tiny. Instead of rivets, I was able to run a wire through all of the vias and solder them into place on both sides. For the header pins, I tinned the traces on both sides, tinned the pins, and then used the hot air gun to push them into place (this did cause some melted plastic, but all the necessary connections were in place).
Again, everything above is not really relevant since I redesigned the board. Once I milled the board and began stuffing, I realized several errors I made. First, I realized that I forgot to add a power switch, which I remedied by cutting the 5V line near the USB connector and soldering on wires to both sides of cut which I would eventually solder to the power switch. Also, I accidentally dropped my board, which loosened the header pins I had soldered on for the volume potentiometer, ripping up several traces. I was able to salvage this by soldering on three more wires that I would solder to the potentiometer. For these loose wires, I put some hot glue around them to add some strain relief.
The silliest mistake I made was realized when I tried to power my board. I thought I could power my board with a USB-A to USB-C cable but the cable I had didn't seem to let power travel in the direction I needed (USB-C to USB-A). I also learned that USB-A to USB-A cables aren't very common. To remedy this I was thankful for mistakes I made during embedded programming embedded programming week. I had used a micro-USB connector which tore off traces when I didn't add proper strain relief so I ended up milling a simple microUSB to male USB-A PCB. I used this board plus a deconstructed USB-A to micro-USB cable (cutting off the microUSB end) to create my own frankensteined male USB-A to male USB-A cable.
With a constructed box and finished PCB it was time to integrate the electronics with the packaging. I attached the power switch into its hole (the switch I bought already had press-fit flexures), I secured the potentiometer to the front wall of the box with hot glue, I secured the speaker in place with a speaker holder I had laser cut to fit into the bottom insert, and I threaded the power cable through the path I had created in the bottom insert and out the back wall of the box.
The too short sides of the box that I had originally cut turned out to be a very convenient place to secure the LED strip to. They were just short enough to fit snuggly between the front and back wall, angled such that they would further diffuse the LEDs. I cut the LED strip into smaller strips and stuck them to these extra pieces of acrylic, being careful to arrange them such that I could reconnect the strips in series. With the help of my girlfriend, I soldered on some small wires to connect all the LEDs back together, and placed them inside the box.
The last step was to add the capacitive sensing elements. I attached the RX pin (sensing pin) via a wire to an 8x6" piece of FR1. I attached the TX pin to a small wire that fed out of the front of the box that the user could touch or clip to in order to use the theremin. I secured the sensing plate to the top of the box with hot glue (to allow for easy removal in case I needed to debug the internal electronics at some point).
The code I used was a modified version of Neil's step response code. I found this source which implements a simple theremin. I modified the code by taking more samples to smooth out the sensing some and by adjusting the pins that are being written to/read to account for the two plate capacitive sensing. I also included the wavegen synthesis code from Quentin's capacitive touch piano to generate a smoothed square wave at a frequency determined by the sensed capacitance. I attempted to map these frequencies to discrete notes to try and enhance the sound quality of the instrument but I could not quite figure it out before the project was due.
The operating principle behind the capacitive sensing is best summarized by the readCapacitiveSensor function I used which discharges and then charges the TX plate and then reads the RX plate. The RX plate is coupled to the TX plate via proximity, so the charging time of the RX plate varies as its proximity to the TX place changes, resulting in a variation in the read capacitance.
The goal of this project was to make a capacitive sensing instrument which I successfully did. I had hoped to add more features such as lights that respond to the playing as well as a volume controlling plate, an option for audio jack output, and a potentiometer for modifying the playable frequency range of the instrument. In the future I hope to be able to implement my original design and make a more visually appealing instrument.
A great deal of this class and this project was made possible by Anthony's patient support and guidance and willingness to answer my many many questions.