Total Pageviews

Thursday, July 20, 2017

My Hi-Fi Raspberry Pi DAC project. The Build Phase

    This is part two of my Raspberry Pi DAC project. If you  want to know how this came about, you might want to read part one

So, the fun begins.

The PCB are here!

     Oh, happy day!.

  I ordered my PCBs from PCBWay, and they're not half bad. Pads look OK, the footprints for the TPA op-amp, which had me worried a bit,  turned out nice and so did the solder mask.

Of course, the first thing was to check and see if the PCBs actually fit the Pi....and they do. Phew!

Next up for inspection, the PSU boards:

Lovely. Except, this is the last time I order black solder mask. Every speck of dust is visible, the flux residue looks horrible on it and you can't see anything if the light is not at the right angle.

That being said, let's start assembling these things.

I don't own a hot air station, but I do have a digital controllable hot air gun. Soldering the PCM5242 was easier that expected and that kinda built up my confidence. But, like always, Murphy stuck out his head and had a say in the soldering of the TPA op-amp.

Because it only has 2 pads on 2 of its sides, it made it especially difficult to keep it on the pads. Every time I came closer that 10 cm with my hot air gun, it just blew it off my board.
It took me about 40 minutes of frustrating work to finally get the TPA to stick and reflow properly.

    My method consisted of applying some solder to the QFN package and a little to the pads on the PCB. Garnish everything with tons of rosin flux and voila!
 Just be careful, because if there's too much solder on a pin, the surface tension when the it reflows will keep the package from leveling out on the board or leak out and short to adjacent pads, if the part is slighly moved or pressed.
    After checking for shorts on the DAC and op-amp I went on to solder the rest of the components on the Pi hat

Next up, the PSU boards. These have fairly large components, so they were no trouble at all.


    No, this one isn't about an uninterruptible power supply... I just messed up. Some keen-eyed readers (you the few, the proud, the EEs) might have spotted in the schematic (or, if you haven't, you will now) that the DIN pin of the DAC is atually tied to the DIN of the Raspberry Pi. Yeah, that should have been the DOUT pin on the Pi.

    The Pi has DIN on pin 38 and DOUT on pin 40. My DAC is tied to pin 38....I can personally guarantee you that this set-up won't work.
Why did I mess up? inconsistent data on some Pi pinouts on the web. That and I was too much of an eager beaver to get the board done so I didn't bother  to check more than 2 photos online

    But, like always, I found a nice easy fix for it. I wasn't really  in the mood to cut the trace to pin 38, so I lifted and isolated the pad to R14 going to the Pi's DIN, then soldered a wire from the resistor, to pin 40. There. Problem solved.


     I've seen enough fancy DACs on Google's searches to instill in me the conviction that I needed to put everything in a nice anodized aluminium case.... minus the blue LEDs. I hate those, but they seem to be on everything these days.

    Ok, micro-rant over. So, I had to fit a Rasberry, its own PSU and two oversized linear PSUs.
Loca suppliers didn't have  the size or look of what I wanted, so I went shopping elsewhere. In France, actually. I mean, they make fancy everything there. Fancy cheese, fancy wine, horrible cider (interesting story here), fancy aluminium cases. Perfect!

    The case I got was from Audiophonics. I'm in no way affiliated with them, these guys seem to  have everything  audio and audio related.  My case was about 35 Euros and is 280 x 158 x 48 mm (L x W x H) which is just about the right size to get everything squeezed and allow for some cable management. Some might call this luck. I call it engineering.

Oh, the feet I also got from Audiophonics. They're just plastic, but they certainly look the part.

Testing, testing... Is this thing on?

    If a picture is worth a thousand words, then here's..... well, a few thousand words for you.

The cobbled stuff you see on that perf board is a single-ended to differential signal converter. It sounds fancy, but it's just 2 amps in an inverting and non-inverting configuration. This is to test the TPA6120 op-amp to see if everything got soldered on properly.

    In the scope pics, the yellow trace is the input signal (before the differential converter) and the blue and pink (or magenta? hell if I know) are the outputs of the TPA. The dark blue trace (the lowest trace) is the output of the op-amp. One channel only.

You might recognize the beast that is the  Interstate Electronics generator in the pics. I'm happy to say that it's running quite nice for its age. It has the occasional hiccup at power-on, but nothing a little hard rest can't cure.

Tying up loose ends

    I stuck a heatsink onto the TPA6120 op-amp because during my tests with an open case showed that the op-amp will heat up to 55 degrees C and stabilize at this point. I figured that once it'll be put in its enclosure, together with all the other heat sources, it might get a little too toasty for long term reliability, therefore, I give you the pic above.
  The grey square is a silicone pad. Even though the heatsink is anodized aluminiun, I just wanted to make sure it'll never touch the resistors next to the amp. I've laso added heatsinks to the Pi's chips as well. Those are underneath the DAC hat.

    Being  the paranoid guy that I am, even though the PSUs are mounted on 3.5mm nylon standoffs, I thought I'd play it extra safe and add some isolation between the case and the through-hole pins carrying live mains.

    Another important thing would be the DAC output filter.  The data sheet for the PCM mentioned using 1nF NP0/C0G caps.  Now, I'm no audio guru, but  an electric guitar mostly sounded as if it wanted to come at you and cut off you ears with a bread knife. The 3dB point of the filter with the original 1nF caps was 422 KHz, so I changed these to 2.2nF caps, decreasing the bandwidth to ~300 kHz.
  This is what LTSpice told me, so that's what I'm tellng you now.
    It made for a much cleaner sounding audio experience, especially on the highs. The issue was most likely caused by intermodullation products making thair way into the audio range. By reducing the filter's bandwidth, some of the haronics were attenuated, rendering a nicer, cleaner sound.
    I might consider going all the way up to 3.3nF caps just to see what happens....
 Oscillators, anyone? get your free oscillators here!!


    Well, if youre wondering about geeky stuff like THD and noise performance, you're not the only one. I lack the proper equipment, but I do plan to build me some  nice THD measurement unit.
  Quoting the THD figures from the DAC's datasheet isn't that relevant, but might I remind you that the supplies for the DAC and op-amp are linear ones and the DAC's channel outputs are differential, so the only significant part, susceptible to noise pick-up is the op-amp itself. But because it has a high PSRR and the ground loops are (I think) on the  small side, there is a fair chance that the distiortions on the audio output of the hat might be quite low.
    Untill I find the equipment to make real world measurements, I can only say that to my ears, the DAC hat is a success. A 196 KHz, 24 bit  song sounds prety impressive, so for now, this is where things stand

Volumio Set-up

    Well, there are lots of places online detailing how to get your Volumio up and running. So why not add another one the list?
    OK, so it's pretty easy. Just go to the Volumio download page and get the latest build. That will be in a .zip format and inside that there will be a .iso file.
After you've formatted you SD card  (I formatted mine as a FAT32) you plug it in and write the image to the card.
Hold on, it's coming.... For writing the image file, I used Win32 Disk Imager. It's basically "point and shoot", so there's no reason to go into further details.

....and here comes the fun part. Once you write your .iso file  (not the .zip, like I did...doh!) just plug the card into your Raspberry and you're on your way.
  Of course, once it boots up, you have to access it. I only access mine over LAN, so I don't know much about the wireless set-up, but I can assure you that once it's all booted up, you can go and write in your browser http://volumio.local/playback and you should be in like Flynn...
  On the off chance this doesn't work, you'll have to go into your router and see what devices are connected to it. The DAC should come up as "Volumio". Then just access it via its IP address.


    Let's say you want to share the folder "Music".
  If you have a NAS, just type in its IP address and the name of the file you want Volumio to play from. Do not leave the "Alias" field blank. You have to write something there or the sharing won't work. And, whaterver you do, please DO NOT share files with spaces in its name (e.g. My Music). It screws up the sharing somehow. I wasted an entire day with this crap. Just use underscores (e.g. My_Music) It'll save a lot of freakin' time.
    If you are just running a version of Linux on your NAS, select "nfs" from "File Share Type". However, if you're running Samba, then just leave the default "cifs"

    Ok, so you're no that fancy and  just have a PC. No problem.... just do the same procedure as mentioned and leave the default "cifs" in the "File Share Type". If by any chance you have a user and password for you PC, then just write these in the appropriate fields. But really, who does that? Who has a passworded PC at home? That's no security, that's just a waste of time. You want security?  Then run Linux on your PC. Everyone in the house will hate you.

Final thoughts

    I ended up building two almost identical DACs, one for me and one for a friend of mine. The only difference is that while I used a Raspbeery Pi 2 B+, his was a Raspberry Pi 3.
Our choice of web players was Volumio, which worked on both versions without a hitch.
Also, because the Pi 3 has built-in Wi-Fi, I added an antenna for it in the back of the case. If you need some more info about how to do this, you can check out this article. It has a lot of nice pictures regarding this mod. Also, if you're going to do this, u.FL connectors are a pain to solder, so if I were to do it all again, I'd go with just soldering a coax cable to the Pi's PCB and tack it in place.

    Like always, you can see the whole album of this build here. Hope you like what you see and if you want to comment, leave one below.

    Later edit:  The DAC has been so far running non-stop for about a week and everything looks OK. The op-amp did start heating up as soon as I gave it power, so that heatsink really helps. I want to do a thermal profile of the DAC to see how it behaves in the long term, therefore I'm searching for a way to do some temperature data logging. I'll  probably do a post on this as well, in the future,

Disclaimer: The stuff from TI I bought myself. I'm in no way affiliated with them. It just happened that they have the kind of parts I  needed

Wednesday, June 14, 2017

My Hi-Fi Raspberry Pi DAC project. The Design Phase

    I'm in no way an audiophool audiophile, but I do like to listen to good music coming from a nice bit of quality engineered speaker and amp.
I've had a Sony CD player ( CDP-X303 ES ) for a while now and while it's working nice, it has a huge drawback.
I have to buy a truck load of CDs just so that I can listen to my favorite songs. I tend to have a variety of preferences, mostly based on my mood, that's why I tend to listen to anything from Michael Jackson to  Linkin Park and from Run DMC to Eminem. And anything in between.

     It's much more convenient to download ahem.... BUY my favorite tracks and store them on a drive and listen to them from some kind of network DAC. It's also easy on the mind to know that if a track has some kind of artefacts in it, (Sone CDs I bought have these) you just delete it and downl.... buy another. Unlike CDs, where you just have to live with the thought that something you paid money on  has random shitty, thunderous noises on it. 

PS: Don't buy the Michael Jackson CD albun "The Essential Michael Jackson" from Sony Music. You'll be trully regret it if you do. At least, I did.

A Networked DAC

    So, first of all, I need a board that links whatever DAC I'll make, to my LAN at home, so I can access the songs. And  it'd be nice to also play them.
   It'd be even better if I don't have to spin a whole board for this, so I'm thinking something along the lines of an Arduino or Raspberry Pi.

    I want to be able to play stuff like FLAC or WAV at something like 192 to 380 Kbps, 24 or 32 bits. Also, the few DACs that can handle these bit rates have an I2S (no, it's not a typo) interface, and conveniently enough, a few platforms have an I2S  bus available.
  One such platform is the Raspberry Pi. It's  cheap, has a ton of processing power and best of all, there are a lot of debians and ready-made software for it, covering almost anything you can think of.
  Another option would be the Odroid., which also has enough umph for the task at hand.

  For those cringing at the sound of using platforms like these for Hi-Fi, please keep your composure.  Your finely-tuned ears can't really tell the difference between a 1000 $ DAC and an embedded platform with a good DAC on it (except if the latter is poorly designed). 
  Now, having said this, please excuse me while I go put on my flame suit.

    My decision went in favor of the Raspberry Pi platform just because I happened to have one around.

A quick search for a Raspberry debian that can handle all you music via a network interface will produce the following results:

 - Volumio
 - Rune Audio
 - Etc.

    There are a lot of web players out there that do  the same thing. My personal choice was Volumio. Why did I choose this over the others I hear you ask ? Well, because this was the first result that popped up on Google.

Which one... Hmm...

    So, having solved the networking part, now all I need is a DAC that can do everything I want i.e. up to 382 Kbps at 32 bits.
A friend of mine did a similar project and he used the PCM5242 from Texas Instruments. It has a very impressive spec sheet, both in performance and in size. But the size is mostly due to its internal DSP. Yep, this DAC also has an  mini DSP inside. Wicked! That opens up a whole new world of opportunities.

Where's the rest of it?

    Anyone looking at the datasheet for this can plainly see the banner on the front page, where it says it has  a DSP inside it. But if you go on further, you start  to see that the datasheet is incomplete. It's missing some of the data on the DSP registers. Bummer. Plus, if you want to program it via an interface, you need TI's Pure Path Studio software...which can not be downloaded from anywhere. You have to send the guys at TI a mail with a request for it.

    Also, take note that there are a few commercial Raspberry shields out there that have the PCM5242. These claim it has a DSP inside  it, which is correct. Unfortunately, if you want to use it or program it, or do anything with it, other than just convert bits to sound, you're on your own. You basically have to create your own library for the PCM's DSP so you configure every bit of it.

    But let's not let this small drawback keep us from implementing what would be a very capable DAC
  I'm going to build one to see how it sounds and how it behaves and if I like it, I'm going to design another version where I try to use the internal DSP and actually put the whole thing to use.

Actually designing stuff

    Ok, so let's see how we're going to do this.
First thing's first: a normal I2S interface uses 4 wires.
 - A master clock, to time the whole thing - MCLK or SCK;
 - A bit-rate clock, BCK, that tells the DAC what bitrate the song is being played at, i.e. you sampling frequency;
 - The data line, DIN
 -  And a signaling line  - LRCK - to tell the DAC which frame of  data is for the right channel and which is for the left one.

Fig.1  I2S Bus with all 4 signals.BCK is derived from the MCK

Fig.2  I2S Bus implementing only 3 signals. MCK is 
internally reconstructed from the BCK

    Normally, the master clock would have to be set so that it is a multiple of the BCK. This means that with most network  DACs (I'm talking about the system as a whole, not the DAC chip itself) you need to have an external clock feeding the DAC directly, or an interface IC, (bridging something like USB - I2S) when an interface conversion is necessary. This is kind of cumbersome and adds a lot of parts to your BOM.
  If you are curious, you can have a look at XMOS's line-up of chips. There are some that go up to 192 k.

    But the PCM5242 only needs one clock - the BCK. It can take this and rebuild the master clock with an internal PLL, thus saving a lot of board space and simplifying the design.

   The 5242 can work either in Hardware mode, or Software mode.
 Hardware mode is kind of a stand-alone thing. You just feed it 1s and 0s from an I2S bus, then it converts them to sound. Easy. You also have some pins with which to control signal attenuation, and that's about it. I'm over-simplifying, but you get the point.

    Software mode is where the magic really happens. You still use the I2S bus, but you can also do soft muting on the DAC, you can control the volume in much finer steps, set PLL frequencies, write internal registers and also, my favorite, control the DSP. All this through an I2C or SPI interface. Your choice. Or, rather my choice, to be exact.

  The prototype is going to just run in HW mode. I don't want to deal with writing any internal registers and doing power ON/OFF sequences and stuff like that. At least, not just yet. I just want to see it work....or to be more precise, to hear it work.

Down to the nitty-gritty

    Ok, so having settled on hooking the DAC so it works in Hardware Mode, what other egineering stuff do we need, to make this thing work?

    My Sony amp has 1 Vpp inputs, but from what I've seen, it can tolerate higher peak-to-peak voltages. Up to 4 or 5 Vpp. I actually scoped a Sony 339ES CD player and got as much as 7Vpp.
 But for safety's sake, let's choose a maximum output voltage of 2 Vpp for the DAC hat.

  The DAC itself can output either 4.2 Vpp or 2.1 Vpp levels. So, let's go with the 2.1 Vpp.
Now, I'm kind of weary about powering the amp's input directly from the DAC, so  I want to put a buffer between them.
 Because I'm lazy,  and don't want to mess around with op-amps possibly oscillating like crazy, I'm going to go with the TPA6120A2 audio amp as the buffer. That's the one in the DAC's data sheet.

  Thus, the final output will have a level of about 4 Vpp (the amp's minimum gain is x2) but we can solve that with some extra attenuation from the DAC. For this, you just implement the table below so that your signal has the needed level.

Analog and digital power supplies design

3.3V PSUs

    The DAC needs both an analog power supply and a digital one, both 3.3V. This isn't such a big deal. But I can sure as hell try and make one out of it.

    One can easily fit a small SMPS or two on a Pi hat. The problem is however the noise these will generate. Ok, this, and the fact that some audiophiles will cringe at hearing the words "SMPS" and "Hi-Fi" in the same sentence.
    I want everything to be as clean as possible, noise wise, so my solution was to split the power supply from the main DAC board. Not only that, I went a step further and split the analog and digital supply, each having its own board.

    Having this configuration however can be more detrimental than helpful. One might be tempted to think that a current's return path would be that of least resistance to ground. And that is correct.. But where that ground is, that can be a bit tricky to find.
  In the set-up I proposed, the ground is not the one on the DAC hat i.e. the PCM's GND connections. It's the one way over on the PSU. So, the actual path would be DAC → about 5 cm of wires (2 inches for the non-MKS lovers) → PSU GND
With such a large loop area,  it's an open invitation to a whole lot of noise pick up, no matter how quiet the actual PSU is.

 I tried to mitigate this by having the PSUs regulate down to 5V for the PCM's power rails then have an additional LDO on the Pi hat itself, to do the rest of the work down to 3.3V. This  (I'm hoping) will "bring back" the GND return path to the hat. The current loop this set-up creates is the shortest possible.

To split o not to split, that is the question

   A recurring issue in this Analog-meets-Digital world appears: how to manage the digital and  analog ground planes for the DAC?
Having both an analog and a digital rail, how exactly do you route the grounds on the board so that you get the lowest possible EMI and the least amount of noise pick-up on you signal lines? Do you split them clear through the middle and place the DAC right on the center line? Or do yo just make on continuous plane?

  There are lots of articles  dealing with this exact issue, and depending on when it was written, you might get some diverging answers.
I have come across a couple of articles that explain the issue very well.
One is this article, which kind of gets you on the right path. If you need to go deeper down the rabbit hole, I recommend reading "Grounding in mixed-signal systems demystified", parts 1 and 2, from Texas Instruments.

  Following the general direction from these articles, I decided to only join my grounds under (or close to) the PCM DAC and exercise the right routing technique so that I have no analog signal wires crossing the digital ground or vice versa.
  Now, for this design, it's pretty easy to get things right, it's only going to be a two layer board and there are only 4 ICs and some passives on it, but for other designs, it can get messy when routing signal lines across the PCB, and keeping  the traces in their right ground plane can cause you some head aches

Cap selection

  No, I don't mean electrolytics. That's a discussion for another time.  I mean SMD ceramic caps. As in MLCC caps.

In this design, there are a few places where caps really matter, despite being used mostly for bypassing.

    The 3.3V regulators on the DAC board are LP2992 LDOs. Yes, Texas Instruments again. Now, these are advertised as having very low noise, and to achieve this, the datasheet recommends using some very low ESR caps on the input and output  and NP0 or C0G caps on the Bypass pin.
   My personal choice was to go with X7R caps for the 5V input and 3.3V output caps. The rest of the bulk capacitance will be on the PSU boards.
These have much lower ESR than electrolytics and behave much better under DC bias than X5R caps. Tantalums are on my naughty list and try to avoid them as much as possible. They don't take voltage spikes that well and their ESR isn't really that low.
    Also, the X7R material is less sensitive to changes in capacitance due to temperature and/or DC voltage (compared to X5R, that is).

  NP0 and C0G dielectrics are literally in a higher class than X7R / X5R. While one might use the latter in normal bypassing applications, the NP0/C0G can be used in filters, or for setting precise time constants. If you were to plot a frequency vs capacitance chart, you'd get pretty much a straight line from DC to about 10 MHz and a somewhat linear temperature coefficient.
This makes them very useful for, say.... some nice RC filters that go on the output of a DAC. And it just so happens that we have some of these between the DAC's differential output and the op-amp's input.

  You can find a lot of info about this on the net, so I won't bore you with too many details. You can check out this document I found in haste, while deciding which type of cap I should use. It's got graphs and tables in it , so it must be good.

Hardware Mode configuration pins

  Like I mentioned earlier, the PCM5242 can be used in Hardware Mode or in Software Mode, making it a very flexible design.

  First off, to put the DAC in Hardware mode, pins 24 and 23 need to be pulled low.
Now, there aren't many control options left. You can choose between a 2VRMS output or a 1VRMS output by making pin 21 Low or High, respectively (i.e. 1V out for AGNS high).

  I've already talked about the attenuation output pins so that's the important bits taken care of.
What's left is to set pin 16 Low, because we don't want any de-emphasis, and if you don't want to hear any hissing in your speakers when nothing's playing, then you'd want to set pin 1 Low.
There, that about covers it.

Schematic and PCB Layout

    If you're interested in building something similar or just want to have a look over the schematic, you can go to my GitHub  project page. There I have all the documents relating to this project. Feel free to download and/or use the desing as you might see fit.

  The laying out of the PCB went pretty much as I'd expect it for this simple design. Like I wrote, I opted to do the joined AGND and DGND sollution.
Unfortunately, because I wanted the bypass caps for the DAC as close to the pins as possible, I didn't have ena clear way to split the ground right beneath the DAC, so they're joined in two locations, either side of the DAC

     This may look weird, but I don't think it impacts the noise performance of this thing too much. But, if you believe otherwise and have more experience than me, then please leave a comment below, I'd really like to hear some nice explanations.

    So, basically, this is what I'm expecting to get from the PCB manufacturer. Except in black. It's going to be gorgeous.
Oh, and for those of you wondering what those holes on the bottom of the picture are.... wel,, I figured I'll just solder the audio output cable straight to the PCB. And to firmly hold the cable there and not put pressure on the solder joints, I figured I'd zip tie the cable to the PCB. A bit flakey? Maybe. But I  didn't want too many metal to metal interface between the output of the DAC and the input of my speaker amp. I may possibly be dellusional here, but hey... I like to experiment.

  The PSU layout also went snoothly and looking back, I could have squeezed both PSUs onto a single board or two smaller boards than the ones that came out. Next time I'll know better.

    Now, all that's left is to wait for the boards and parts to arrive.

  If you would like  to read on about how I put everything together, tested this and how it all turned out, the second part of this build is here.

Disclaimer: The stuff from TI I bought myself. I'm in no way affiliated with them. It just happened that they have the kind of parts I  needed

Tuesday, April 4, 2017

Transformer Coil Winding Jig

     If you can do it, then why not over-do it. At least that's what I did with this project. It started out small....just a simple motor, stick a bobbin on the end of it then wind away to you heart's content....Naaaa!

I need to control this...

Indeed, I do. And since  this will be a "hand winding" operation, it implies that both hands will be preoccupied with the....well, winding, of course. Therefore, who's going to control the motor? 
And since humans happen to have four limbs, an obvious candidate to fill in the position would be - a means of a pedal. Ergo, I need to make myself a foot pedal to properly control the motor. And not just an ON/OFF kind of control. No no no....I want speed control.

Choices... so many choices....

    Ok, so how about the heart of this thing? The motor. What kind of motor should I use? Well, a DC motor from an electric drill would have been enough. But like I said, why not overdo it. So, I had a Stepper motor driver available. It's an AMIS-30543 stepper motor driver that can do up to 3A per coil. Works for me.

   Now what kind of stepper? Some might think, "a NEMA17 stepper would do it". Not! 
From my pile of steppers, of course I went ans picked the biggest  most powerful stepper I had. It's a NEMA23, 3Nm  stepper motor. You might think it's overkill. But Since I do a lot of SMPS and high power stuff, there will come a time when some 0.7mm or 1mm magnet wire will have to be wound. And that requires a lot of torque at low speed. Yes, an electric drill ca provide that. I know, I know. I just don't want to use that.

Strange things are afoot

    Now for the control part - The pedal.
I initially though I could do the pedal with springs... big powerful springs. Of course, that didn't really pan out. The spring itself was OK, but the wire setup would either get snagged or the wire (guitar string wire) would stretch out and  wouldn't tension the spring properly.
    But, being the engineer that I am, I often get inspiration from things around me. This time, it was a cupboard door hinge that used a telescope to help raise and lower the door. BINGO!

I went to the hardware store, bought two of those furniture telescope things, came home, threw away the spring and wire and mounted the new mechanism. And it worked. Brilliantly, I might add. It feels just right. The pressure i have to put on the piston feels just about right. And it's very smooth and controllable.

The two nuts sticking out  in the middle of the pedal will eventually get replaced by countersunk screw...eventually.

The base is made out of  15mm (590 thou, for those that still refuse to get with the program) thick resin impregnated fibres (cotton fibres, I think). Atop of that is a square polycarbonate piece, that holds the hinge. The pedal itself is made out of some kind of  5mm thick fibre-glass resin material.

If you're wondering about the routed edges and other stiff going on on the bottom black piece, well, don't They were already there. (I'm not that lucky as to posess a milling machine....yet)

Now, I mentioned earlyer that I also want to have speed control.
That is done with a regular 10K potentiometer and a rack and pinion set.

The parts were designed and printed by yours truly. Ok, only designed.. my 3D printer took care of the actual printing part.
 The travel of the pedal actually matches to the 3-quarter-turns of the potentiometer. If you want to know how I did that....luck. Pure, dumb luck.
I thought I'd have to do some iterations before I got things to properly mesh (radius of the rack, number of teeth, pedal travel) but somehow I got it all in one go....

Or maybe not...

Keeping count of things

120...121...122...130... Obviously, it's not an improvement to hand winding if there isn't a way to keep track of your turns.
That shouldn't be too hard. The whole jig is already controlled by an Arduino, and it still has a lot of free pins. So let's use them.
   And since the motor happens to have an extended shaft out the back side, why not stick an infrared light barrier and a small wheel with a slot in it, on the shaft?
 When the motor makes a full turn, it lets some light pass, the Arduino increments a counter on a display....Perfect!

The wheel was 3D printed and you can find the STL and Solidworks files for it right here.

Putting all of it together

I had to build some kind of stand, for the motor. Once again I used some 15mm black resin impregnated fibre material  and some 15mm thick polycarbonate scraps that I had.

The stepper was bolted to the frame with M4 screws.

It may not look like much, but the whole frame, once everything was tightened down is verry sturdy and can take quite a beating from that stepper.

The black cylindrical thing is a home-made shaft coupler. I had some black delrin around that I bore on either side, to allow the 6.35 mm stepper shaft to couple to some M8 threaded rod. To keep the shafts from turning inside the coupler, I drilled  two 6mm holes in the side of the shaft coupler then put in some brass inserts. Two M4 screws go into the inserts, locking the shafts to the coupler.

On the threaded rod I put some nuts as spacers and some Gardena hose adapters of some sort (the grey plastic things), that just happened to be the right shape to keep the ETD49 bobbin in place.

 I've also cut a slot in each of the grey plastic retainers and filed a mating pertrusion in the metal washers so that they wouldn't slip and turn ith the main stepper shaft. Of course, the plastic thingys will eventually be replaced with some proper 3D printed retainers, but who knows when that will be.

Sharing is caring

All the files for this build can be found on my GitHub page. These include the code for the Arduino, the SolidWorks and STL files for the optical rotary thingy and whatever else I may find useful to throw in there.
As always, you can enjoy the full splendor of crappy quality pictures of the build here.

google-site-verification: googlee8a41f51abde7545.html