## FabAcademy Journey Part II
Somehow, I managed to luck out on my way here. I got the escape seating on the plane over, which also meant I got to sit next to the nice flight attendant and pick up tips on where to see on my long stopover in Helsinki.
On my adventures a friendly Finn named Pekka saw me stopped on the corner with my map, and offered me a lift. He was driving some kind of red old-school coupe like it was the weekend 😅, and we got chatting about how every phone he's owned was made by Nokia (famously Finnish!).
As it happened I hadn't planned to stay anywhere that night, just make my way around the city without sleeping. It was a 20 hour stopover and I foolishly had faith in the world that there would be somewhere warm to be homeless for the night before my connecting flight. Little did I know that this guy, Pekka, ran a serviced apartment business for short stay travellers, and it was right in the low season for him.
Amazingly, he lent me the key to an apartment right near the station! He took me to meet his family and have some dinner, and then took me on a short tour of the city. That night I had a whole two bedroom apartment to myself, and got to put my bags down and explore the snow at night 😄.
It was hectically cold, and the very first time I had ever seen snow! I'd never even been in negative temperatures before (apart from a short stint working the freezer at Woolies, a grocery store chain in Australia). It was utterly fascinating and a magical experience.
Prior, I'd only ever seen snow in the movies - some kind of white sand that falls from the sky during christmas. In Australia the typical christmas cards happen on the beach with Santa wearing shorts and sunnies. For those of you in the upside-down land of the northern hemisphere you can imagine it like if the sky-sand falling from above just came from below instead.
Turns out snow is suuuuuper cold and makes you wet if you don't shake it off. Also it falls into your eye which is mildly more annoying than when rain does the same thing. About 2/10 for discomfort where 0/10 represents having nothing land in your eye and 10/10 would be somewhere around chilli flakes.
The next morning after an unexpectedly cozy night in Pekka's generous apartment, I travelled up to Aalto University to visit Solomon in the Fab Lab there. It took me a while to find it, and it turns out I'd walked past it a few times while exploring the snow. Unfortunately Solomon wasn't in that day, but one of the Technicians, Nicholas, was happy to show me some of the projects he was working on.
I made my flight to Reykjavik afterwards and it was surprisingly short. An abrupt end to the grey and gloomy trip was descending through the clouds to see an island in the arse-end of the Atlantic ocean. Coming off the plane there was bugger all anywhere (Iceland is the only nation to have a lower population density that Australia).
The highland rock was volcanic and crusty and I could very easily imagine wandering far from the trail and sticking your foot into the Earth. Not 'earth' as in dirt, but 'Earth' with a capital E like the hot lava layer that most land masses like to keep some distance between. From what I learned after reaching my hostel was that the skin of the Earth is so thin in some places here that they just stick a pipe into the ground and get unlimited hot water.
Wendy and I used to joke about the Emirates having three taps - two for hot/cold water and one for the oil. In fact, the water here comes in only two taps but you certainly don't need a kettle as an appliance in your home!
I waited for directions from Frosti Gislason, to get to the Vestmannaeyjar - the small island underneath Iceland where I would spend the remaining 3ish months. Frosti was the lab manager at Fab Lab Vestmannaeyjar, being one of the earliest members of the Fab Academy and working very hard (and successfully!) to raise labs all over Iceland and the surrounding islands of the Nordic Region.
Getting an answer from him about the best way to proceed proved tricky. There were two ways about it, I would either rent a car and drive to the ferry or I could take a plane depending on his answer. It turns out he had trouble giving me an option because of the weather.
In Icelandic they have a saying that translates as: "If the weather allows". I found that quite profoundly similar to the Arabic saying "Insh'Allah," which means "If god wishes," so I found them significantly culturally similar concepts in humility and finding peace with the situation.
In lieu of being knowing what action I was going to take, I made contact with Bas Withagen, a former Waag Society member placed in as the lab manager of Fab Lab Reykjavik. I'd actually seen a lot of Bas before meeting him in real life, he is very active in the lectures and seems to be Neil's go-to guy about embedded matters. We drove around a bit and got a bite to eat, introducing me to the smokey-town of Reykjavik.
It took me three days of travelling to the airfield (sometimes twice a day) to see if the weather was going to allow us to fly. Apparently that was the norm, I was in a group of people that would visit the airfield ready for the flight only to be turned back - they would only know half an hour before the flight because the tower had to call the landing strip on the island to know if it was clear enough to land!
But on the third day, it was to be so 🙄🔫 What a struggle! I certainly found out how expensive Icelandic taxis are.
I was very relieved to finally make it to the island. This was the start of a new chapter, or Part II if you will for my Fab Academy Journey.
The lab on Vestmannaeyjar was situated on the side of a volcano one of two on the island. In fact, one of those two volcanoes went off in the 70's causing the island to increase in size by about 20%. So it was an active hot zone there and it was quite apparent perambulating through the town that precisely half of it was missing having been destroyed by the lava.
The town is only 4000 people (one of the biggest in Iceland!) and half of the island itself is airfield. It's not a lot of space to explore but after the expansive deserts of the Emirates I was fairly excited about this new type of adventure.
Frosti is a very funny guy, having taught at the high school and working in the innovation department for Iceland for probably decades. The three active Fab Academy students in the lab this year are Bergþóra, Bára and Birita, who were very lovely and accommodating to this stranger from a different world 🙏
I'm very grateful for the first part of this adventure, and I'm equally as excited for this next stage of new things, places, cultures, languages and of course, Digital Fabrication!
## What's an Output Week?
Output week is that one special week of the year where Fab Cadets get to make something relating to output of a microcontroller. I had initially had grand intentions of catching up this week (ha-ha) and was curious about programmatic DAC and perhaps Charlie-plexing.
The DAC was inspired by the Raspbuino side project where it would form the output stage of the Copycat circuit. Since that had pretty much nothing to do with my final project requirements after revising my proposal I decided it would be postponed until I'm in a better position to pursue it.
Since coming to the realisation that there's not much time left and I have quite an ambitiious final project ahead of me I decided to get a start on a Voltage Boost circuit and some basic Stepper Motor control.
I also dabbled in Brushless ESC control, but since it really only involves some servo pulse control to set the speed there isn't that much to talk about. But I did get some excitement out of that 400W motor I bought in Shenzhen!
### Voltage Boost Circuit
Based on a magic spell (circuit) that Gabriel showed me, with advice and much patient explaining from Brett, along with the Carlduino I made in Eagle a few weeks before I decided to formalise a voltage boost circuit.
Admittedly, this hadn't struck me as an output device until I got bored with the CopyCat circuit last weekend. I also really hate to go back to Eagle for this one but I'm slowly learning where to spend my patience with it.
There's two new major things that I learned that eased my frustration from my last encounter with Eagle that would make me consider using it more often.
I complained in Week 9 about how I broke the backwards annotation context while using Eagle and it took me many years to recover, but I found out the right way to avoid that is instead of switching windows to get between the PCB and Schematic you click on the board-to-schematic buttons. It's not horrible anymore!
The other thing is absolutely amazing; Altium had this wicked feature where traces would push other traces around in order to route wires. As it happens Eagle also has this - I just hadn't selected it! It makes dense routing really quite fast.
It still kills me to move around the UI and panning just isn't working out for me, but I do like how fast it is to get large nets and groups of traces going. KiCad still does a better job with keyboard shortcuts, scrolling, panning and dragging though.
If there was a better FAB footprint library I would lean a lot more towards KiCad still.
The voltage booster circuit features a couple big players, and is easily the heaviest circuit board for it's size I've ever seen especially considering it's not packing a heatsink. It's running a 6.5A inductor (yeah I picked the biggest one in the inventory), a large MOSFET and two 4700uF electrolytic capacitors.
From my tests I was able to boost from 1.2V up to 12V fairly comfortable, and only showed signs of draining at one of the high-powered brushed DC motors (it drew about 4A and sucked the voltage to 0 according to the display on the bench supply).
Once again I had to use the 0.01" bit for the chip footprints, and that still needed to trick Fab Modules into thinking the bit was 0.22mm . I still haven't figured out what Neil meant by being able to machine that footprint with a 1/64" bit. Perhaps that would involve modifying the library footprint, which sounds like a job for somebody else 😂
This circuit is a particularly satisfying one, and you can quite easily set the set-voltage up to the rating of the capacitors (in my case, 25V). I believe I have the schottky diodes correctly in parallel with shunts, so it should be safe to operate up to 1.5A, or more with bigger schottky's.
The inductor might be the next limiting component, at 6.5A.
### Stepping into Stepper Motors
I'd shied away from advanced output control in general but there's no better time to get a ridiculous amount of learning done than during Fab Academy. Stepper motors have become increasingly more a part of my life, from CNC machines to 3D printers, and I was getting to the point where I should just grow up and take them on.
It turns out they're really NOT as bad as I thought, especially from the sheltered environment of Arduino and it's libraries. There are two that I know of now, 'Stepper' which is the default included with the IDE, and "AccelStepper" which is a little more advanced and takes advantage of ramp rates and simultaneous motion control.
For now I stuck with Stepper, but probably later will want to move up to the more comprehensive features of AccelStepper.
For my final project which you can read about in Week 18 I will need to use three stepper motors. Two of these are on pre-loaded lead screws on the Z- and Radius-axes, and the motor used for the Theta-axis is in direct angular-drive. In order to achieve the holding torque and angular resolution I decided to try a 3D-printed gearbox.
Thankfully a guy named Kevin Lee had written a gearbox generator for NEMA-17 sized motors, and courteously posted the project on his website. It's quite effective, and I hope to perhaps one day contribute to his work perhaps by reducing backlash and increasing mounting options for his design.
####Example board and progamming
To start out I machined Neil's board from the archive. As this was my first encounter with having to actuate a stepper motor I simply wanted to know what was involved.
After machining his board, the stepper motor wouldn't step reliably. In order to pursue the cause of this problem I went on to try and write my own code. I used the examples from the Arduino Stepper Library.
I gained some insight into how bipolar and unipolar stepper motors are wound and their operation from Robert Tran's Fab Academy page (very useful). They happen to be very intuitive to understand.
Another thing that everyone seemed to be talking about was "microstepping". I decided I wouldn't venture that far this year, but it is really interesting to understand what goes into some of the more complicated stepper drivers. Here's a couple useful reads I found from Arduino github, Jan, Rahul from Trivandrum and some code that supports microstepping.
I did a lot of things to try to solve the problems I was having, and in the end I can't quite tell which of the methods I used fixed it fully. But I did try many things and learned a lot about the system just trying to debug it. The biggest contributor to bad steps was incorrect coil-direction from the driver to the motor, the temperature cut-off built into the A4953 chips, poor heat-sink contact and floating output pins.
You can see in the images (left) that I went a bit crazy with the heatsinking and capacitors, I ended up soldering a bunch of the sprue offcuts of FR1 board to the sink on Neil's board in order to keep the temperatures from rising so fast. Then I decided to use one of the blower fans I bought in China to keep the whole thing under control. It worked pretty well after that.
####First design board
After discovering a lot about how the motors are controlled, I decided to set up a modular stepper driver that could be mounted to the back of a NEMA-17 stepper itself, and then optionally have a fan mounted to it to keep it stable. I had a 2x5 header on there so another motorcontroller could provide direct signals to each coil driver H-bridge.
Having felt how hot steppers can get even while sitting idle, I wanted to try to have some of the excess airflow from the fans be used on the motor. I cut a bunch of holes through the driver board, however I didn't really like the design by the time I was finished with it.
The good news though, was that it was easily able to drive the motor smoothly.
####Second design board
I tried a second design that focused less on secondary airflow and put the drivers directly in the stream of the fan. It felt so easy but at the same time I was trying to kill too many birds with one stone and so I gave up on maximising the airflow effectiveness.
The second layout was the same schematic but laid out square as opposed to diagonal like the last one.
I managed to get my analog joystick to work and control the stepper however while I was troubleshooting some stutter the stepper driver overheated. I didn't get the chance to take a video of it because my phone was on charge. I was bummed because when it was working it was pretty satisfying, you'll just have to take my word for it.
This was the only board to do this, and due to lack of time and not being particularly blown away by the design once again I just I moved on to the next board.
####Third design board (Using every pin of the ATmega328P)
With this last board I decided to try and incorporate all three stepper drivers on one board. It's probably around the same size as three separate boards but the wiring is simple and using the 328P simplifies my programming and library support.
It's not the best method but I found it more interesting to give it a go at this stage.
It actually only took me a few hours this time to set the PCB up, since I went with the two-sided copper. Using another layer is pretty much cheating to me, but since I used every pin of the 328P I reasoned that this would be acceptable.
After machining the 328P triple stepper board I realised a number of issues with both manufacturing and wiring.
Alignment - I had intended to flip the board and then use the diameter of the 1/32 tool to space it evenly around the edges. Unfortunately this week Frosti had taken our local wet/dry vacuum cleaner "Jarvis" for a walk so I wasn't able to effectively clear the FR1 dust and prevent contamination of the double sided tape.
Next time for flipping I would probably just shift the flipped *.png down and to the left by 0.79mm and hope for the best. As you can see from the images (right) the top side machined beautifully, but the bottom completely moved and so some holes were horrendously off the mark.
Another issue I forgot to account for was that the double sided circuit blanks are actually 0.1mm thicker than single sided, because of the additional layer of 0.1mm copper. This meant that my through cuts and via pockets didn't fully penetrate the copper on the opposite side of the board. This was highly annoying among other things.
Lastly with the board I realsed since I was machining from both sides, by the time I was done with it the circuit wasn't very rigid any more. This probably wouldn't cause issues but potentially something I should keep in mind if I decide to design such a large and twistable two-layer circuit board again.
#### Update: Day 3 of circuit board bender
I ended up conceding with the double-layered copper just so as to not waste the precious material, and instead I machined two single-layer boards and pinned them back to back using the vias and some single-core wire.
It took me quite a few hours to assemble this board, the vias took longer than expected though I'm quite good at them now. Also the 328P and A4953 chips being on opposite sides of the board certainly didn't help.
After populating that bad boy I plugged it in and encountered some smoke-test issues. The magic smoke that's meant to stay inside the circuit came out twice and I had to surface every ounce of forensic testing I've ever had.
It was quite difficult to track down the tiny amount of smoke that was being emitted, and I was certain that repeatability was going to diminish significantly over the number of tests. I wasn't quite committed enough to touch the board given how hot regulators and motor drivers can get so I brought out the ordnance.
The FLIR showed very intense temperature at the voltage regulator, and knowing that this would be the number one culprit I took it straight off and replaced it flipped.
I'm well aware of the inconsistent footprint numbering with SOT-23 packages and so my first instinct was to see if the part overheated when installed backwards. Gladly removing it and installing it it backwards generated no heat, but interestingly the multimeter showed no voltage on the other side. This, was quite strange.
After much further sanity checks I decided to double check the labelling on the parts tray. I pulled out a few samples from different strips in the tray and found they had different part numbers...
Interesting I hear you say? Really not, at the time.
After this I was quite satisfied with smooth stepper control (big surprise for me, given my luck!) Heat dissipation was highly effective and the blower fan covers all six H-bridge chips nicely. One thing that was a bummer (though I had it coming) was that since loading up the pins on the 328P as far as they would go, the serial readout doesn't work when you're driving the middle stepper.
It's ok though, for testing I'll just disable that motor so I can calibrate all my sensors etc. and then switch it back on when ready.
A major programming hiccup that occurred was that I had wired the last motor to ADC7 assuming that all analog pins can be used as digital outputs in a pinch. Turns out this was not so, for the one pin I chose to do that on, and so I had to franken-surgerise a transplant between ADC7 and ADC0 which was adjacent.
Actually, both ADC6 and ADC7 don't have an output driver and so are "analog only" pins. Interestingly reading the forums it appears there are some pinout diagrams that didn't show this so many people have made the same mistake.
This was made even more ridiculous by the fact that the single only via that runs under the 328P chip is in fact, ADC7. What a dick.
I ended up running a wire around the board as it was literally the only option.
But it doesn't end there, as luck would have it I ran into a problem accessing ADC6 and ADC7 from the Arduino environment. This was because those pins aren't actually present on the Arduino UNO and meant that I wasn't not intuitively able to access those two pins even though
I spoke to Bas about it and basically I had two options of how to fix this - either unlock the eightanalogpins variant in boards.txt, or use Neil's code that fires up the MUX manually to read inputs.
I was pretty keen on learning both, but on close inspection with Neil's code (below) it really wasn't looking that easy to work with :(
// init A/D
ADMUX = (0 << REFS2) | (0 << REFS1) | (0 << REFS0) // VCC ref
| (0 << ADLAR) // right adjust
| (0 << MUX3) | (1 << MUX2) | (1 << MUX1) | (1 << MUX0); // 20(PB4-PB3)
ADCSRA = (1 << ADEN) // enable
| (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); // prescaler /128
ADCSRB = (1 << BIN); // bipolar mode
// initiate conversion
ADCSRA |= (1 << ADSC);
// wait for completion
while (ADCSRA & (1 << ADSC))
// send result
chr = ADCL;
//put_char(&serial_port, serial_pin_out, chr);
chr = ADCH;
//put_char(&serial_port, serial_pin_out, chr);
These links really helped me unlocking ADC6 and ADC7. I had a hard time finding fruitful information about it anywhere, so here's to sharing in the hope you don't go through the same incredible pains I did!
Basically after all this I gained a fair amout what's referred to as "Tribal Knowledge". The type of stuff that isn't in datasheets and very deeply hidden from regular development requirements. Of course, I have a long way to go yet, but it's interesting to be reminded how unrefined things can be just a few metres from the AVR highway that millions of people have walked.
Design files for this week can be found at Design Files.