summaryrefslogtreecommitdiff
path: root/portfolio/index.xml
blob: 07a9afb3d8f5511fb84b81520aace3e7cc340976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
	<title>ekd&#39;s Homepage</title>
	<link>https://erickhangdao.com/portfolio/</link>
	<description>Recent content in Portfolio on ekd&#39;s Homepage</description>
	<generator>Hugo -- gohugo.io</generator>
	<language>en-us</language>
    
        <atom:link href="https://erickhangdao.com/portfolio/index.xml" rel="self" type="application/rss+xml" />
	
	
	<item>
		<title>Watch Winder</title>
		<link>https://erickhangdao.com/portfolio/watch-winder/</link>
		<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
		
		<guid>https://erickhangdao.com/portfolio/watch-winder/</guid>
		<description>&lt;p&gt;A close friend of mine recently gave me a few watches, one of which being an automatic one. I&amp;rsquo;ve never owned one before, and upon learning how it works, it occurred to
me that I don&amp;rsquo;t really want to set the watch to the correct time everytime I wear it. Sure it might increase the lifespan since the mechnical parts are moving less often,
but I&amp;rsquo;m placing convience above it.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s this clip from the 2016 movie &amp;ldquo;Dr. Strange&amp;rdquo;, where the main protagonist before going out for a drive, opens a drawer to which a dozen spinning watches are placed.
I wanted to replicate this, so I did. Or at least, sharing my progress halfway into the project.&lt;/p&gt;
&lt;h2 id=&#34;design-considerations&#34;&gt;Design Considerations&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve never programmed in assembly before, so I wanted to make this project start with that. Now the architecture. AVR is probably the best bet here, there&amp;rsquo;s tons of 
resources available for it, and it&amp;rsquo;s widely popular for people taking the leap and ripping the MCU from an arduino. ATmega328p it is. Now for spinning the watch. This
device has to be silent, ie stepper motors with a Trinamic driver. I found this one with a silent step feature, TMC2100, seems pretty promising.&lt;/p&gt;
&lt;h2 id=&#34;layup&#34;&gt;Layup&lt;/h2&gt;
&lt;p&gt;Standard stuff with the schematic, just followed the data sheet for both the MCU and the driver. I decided to opt for barrel jack as the power input. 12V input, which
is compatible with this low power stepper I&amp;rsquo;m using.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/Schematic_1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;The layout was pretty tricky. I let my ego get in the way to see if I can do this board in only a 30mm by 20mm footprint. Once I got started, I immediately knew this
has to be a 4 layer board. No way in hell I can do this in 2. Here it is.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/Layout_1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;And of course a 3D Model:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/3D_1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;PCBs came in, I&amp;rsquo;d say they look pretty well done, reflowed all of the components on, the QFN trinamic driver was rather hard to touch up, since the parts were crammed so
tightly in. Here is the full PCBA:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/PCBA_1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;analysis-of-r1&#34;&gt;Analysis of r1&lt;/h2&gt;
&lt;p&gt;Obvious packaging mistake on my part&amp;hellip; Nothing like a slight-of-solder won&amp;rsquo;t solve. And it doesn&amp;rsquo;t hit a current cap when I power it on, so at least they&amp;rsquo;re no short circuit.
I got onto programming it, using avr-dude as the programming application, and AVRA as the assembler. Untested code that should theoretically work is on my 
&lt;a href=&#34;https://git.erickhangdao.com/watch_winder&#34;&gt;git server&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a tip in 2022: buy your chips right after you finish designing. Of course I forgot about the chip shortage, so I thought I could big-brain this situation by ripping
the ATmega328p off of an Arduino Nano I had laying around, which is luckily the same chip I designed for. Caveat is that there&amp;rsquo;s a bootloader preinstalled at the end of the
flash memory. I should have done more research into AVR programming, because turns out, you can&amp;rsquo;t mess with the boot loader if you program using UART, which is the only interface
that I designed headers for. Tried a whole bunch of different avr-dude configurations, no luck. Looks like I&amp;rsquo;m going to have to redo the board, and include header pins for SPI, which
I know now is the main way you should be programming this MCU.&lt;/p&gt;
&lt;p&gt;Also for some odd reason I suppose I was on autopilot when speccing out the filter caps for the TMC2100, and used the recommended 50V caps, when I know I&amp;rsquo;m only going to be 
using a 12V stepper&amp;hellip; So instead of paying 3 cents for a cap, paid 3 dollars.&lt;/p&gt;
&lt;h2 id=&#34;layup-of-r2&#34;&gt;Layup of r2&lt;/h2&gt;
&lt;p&gt;Finished layup of r2. More detailed change log is in the schematic. The main addition was the ICSP header to program the MCU through SPI. Honestly, I preferred the layout of
r1, but r2 is much cleaner.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/Layout_2.png&#34; alt=&#34;&#34;&gt;
&lt;img src=&#34;https://erickhangdao.com/portfolio/watch-winder/images/3D_2.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;//Be back in a few weeks&amp;hellip;&lt;/p&gt;
</description>
	</item>
	
	</channel>
</rss>