Tuesday, April 5, 2022

Another post about knobs

I decided to have a go at sourcing knobs again. This time I've tried to find factories or wholesellers, but it is damn hard. The problem it seems, is that I'm looking for the rarest element known to man - black knobs without a pointer and with D-shaft instead of knurled shaft.

I've been able to get in touch with a couple of vendors and one factory in the UK so far. 

Here is an overview:

Cliff Electronic Components Ltd

They produce and sell a large range of knobs, many of which are white labeled and sold by RS Components (RS Pro brand), Conrad and similar. 

Unfortunately, noone stocks pointerless knobs, much less D-shaft versions.

Example of what IS available

https://www.conrad.de/de/p/cliff-fc7233-drehknopf-schwarz-x-h-30-mm-x-16-mm-1-st-704510.html

From Conrad

From RS
But one thing can be learned from this - There is a series named KMR from Cliff that looks good - slightly rounded compared to what I'm looking for, but that's fine if I could get all knobs from them.

https://www.cliffuk.co.uk/products/knobs/rotary.htm#kmr12

After contacting sales at Cliff I got this:


It looks like I need the US version of D-shaft for my encoders. 

There are two problems - I can't find a small (10mm in diameter) version of the pots, and the MOQ per type is 2000. The 15mm one would cost me GBP 0.526 / each, the 25mm GBP 1.332 / each and the 30mm GBP 0.963.

I could actually see myself buying the 15mm one, if it wasn't for the fact that it differs from my other pots.

PMDWay


PMDWay sells a 40mm knob that looks like the ones I want: https://pmdway.com/products/40x19mm-aluminium-knob




Again, it has a knurled shaft and is also too big. Cindy from PMDWay helped me search for alternatives but were unable to find anything. She suggested commissioning my own from a manufacturer, starting at https://www.globalsources.com/electronic-components

I DID find a knob on globalsources earlier, but the vendor is no longer on there:

https://www.globalsources.com/si/AS/Ningbo-Best/6008852396046/pdtl/aluminum-encoder-knob/1168713794.htm



Action Hardware

https://actionhardware.co.uk keeps popping up in my image searches, particularly two knobs:


Unfortunately,  both are unavailable. They are however willing to help me do custom orders. The MOQ is 1000 and approximate prices between GBP 0.65 and GBP 1.50 /pce.

Ian at Action hardware says they stock parts similar to what I'm looking for and suggests KM-2100 and KM-2600:



CHK is CHK Electronics Ltd, https://www.chk-electronics.com/home.php, but the knobs are sooo similar to the Cliff ones that I amost think they are the same or related. On the CHK site I found these:



This knob looks perfect, so does this, but there are no drawings to tell me the sizes. (KM-2100 is 14mm according to Ian, but KM-2500 remains a mystery)


Aliexpress

All the knobs I've found so far has been from Ali. Here is a list of what I've bought that looks good:

JU-HIVOR

https://www.aliexpress.com/item/32843175222.html


These are perfect - but unfortunately knurled shaft as always. I've bought 100 of these and they are my fallback solution if I can't find anything. 17mm in dia and 14 mm high. JU-HIVOR could not help me find anything.

DIKAVS

I was able to buy a nice knob here, but it is too low and now it's unavailable too.


These are the best large knobs I've found - I snagged four 32mm and one 30mm ones, the last one they had. Knurled shaft of course, and nothing has appeared since. DIKAVS never got back to me when I asked for help either.



Luyu Store

https://www.aliexpress.com/item/4001093464710.html

Luyu has some reeeally good looking knobs, 10.2 x 16mm. Unfortunately, they are for switches and have 3.2mm square holes. It is possible to drill an 8mm hole and 3D print a D-shaft insert which is my fallback solution for smaller pots. Luyu did not get back to me when I tried contacting them.


Best Partner Mall

https://www.aliexpress.com/item/32952829517.html




These look great, but are too big for me and has that damn knurled shaft of course. 

Best partner mall have a lot of great knobs and I've bought a few alternatives from them too:

https://www.aliexpress.com/item/4000900076410.html

These are super nice! A bit costly but solid aluminum. If they had the same knobs in other sizes these would be my choice, even if they are quite expensive.

https://www.aliexpress.com/item/32921539254.html


Massive aluminum knobs with D-shaft. I consider using these for the main rotary encoder but it depends on what I find for the other knobs. Update: I actually bought mine from Warm Textile Home, see below


These are round shaft but that's ok for single pots. I liked that they did not look as much guitar knob.

Warm Textile Home

https://www.aliexpress.com/item/32802055908.html


This is the same knob as from Best Partner Mail and the one I actually bought.

CW Switches Electric Store


This one is a bit of a mystery to me. I think it is the same knob as Best Partner Mail but I can't see that I've ordered from them.

Anyway, They have been super helpfull in finding alternatives. They say they can get me the one in the lower right corner with D-shaft. The MOQ is 500 and price $0.89 which is ok.


The same for 30 x 17, MOQ 500 and $1.68:



Then they suggested 15 x 17 D-axis:



This is a perfect one. I will ask for price and MOQ, and if it is within reach I will most likely buy it. 

I have also inquired about 10 x 16, 17 x 17 and 25 x 17, but that's where the dialogue stopped.

Shenzen Hengda Electronics

While not black, this is an honorable mention: A 24mm alu knob that may be a good alternative for the waveshaper/filter knobs. I have 10 of them.

https://www.aliexpress.com/item/1005003184444519.html

https://www.aliexpress.com/item/4001039507025.html

I reached out to Shenzen and they asked me for pics and details about what I need, but so far they haven't gotten back to me again.

Changshenghong

https://www.aliexpress.com/item/32873353173.html


Changshenghong has two sizes of pots that will go nicely with the ones above, though the 34mm one is a bit tall. Also, they are hideously expensive so I haven't bought any. I have not yet contacted Changshenghong ab out other variations.


HIFIw / HIFIvv / Hifi amplifier spare parts center

While not the same as the other knobs, they have some good looking knobs that MAY go well with my other guitar-ish knob:

https://www.aliexpress.com/item/32620216429.html


I've ordered a couple of these, possibly for the waveshape/filter knobs

SENGTERBELLE HIFI Audio World

https://www.aliexpress.com/item/32819963066.html

These look like smaller versions of the one above. They may be too small for me but I wanted to check them out anyway.





Other producers

Mentor

https://www.mentor.de.com/bauelemente/en/portfolio-2/portfolio-knobs/



Mentor have a few series of good looking knobs. Some are available at Elfa and other vendors, even without pointer: 

https://www.elfadistrelec.no/en/rotary-knob-without-line-aluminium-o30mm-mentor-513-61/p/11077374

https://www.elfadistrelec.no/en/rotary-knob-aluminium-o24mm-without-indication-line-mentor-508-61/p/11077363?trackQuery=&pos=25&origPos=25&origPageSize=50


They seem to be set-screw/round shaft versions.

DuPPa

Not sure how I stumbled upon this, but I found and ordered some cool variations of the guitar knob, this one fits an encoder with transparent shaft and RGB led:




https://www.duppa.net/shop/aluminum-black-knob-with-ring/

I hoped these would look better in real life but they are, especially the gray ones, a bit scruffy. Not TOO bad though. Since the center cap is black I think I would go with the all black ones, so lets see how it compares to the other black guitar-knob-ish ones I have coming.

I did however try the gray one on a black background, and the result is pretty good, better than expected. The pics do not do it justice though



DIY

I posted a question about knobs on the Synth DIY list on facebook, and a friendly soul pointed out that I could have them CNC milled. He payed around 3 euros for the small ones, 4.5 for the middle and 5.5 for the big (in Sweden):



Final notes

Here's a quick comparison of some of the knobs
They all go fairly well with the black knobs. As long as there is some distance between the matte black ones and the guitar-ish ones they go together very well. I still lean towards the grey sandblasted one for waveshape etc as it is exactly the same as the black ones. We'll see.

I did another test on the 17x14mm black caps to see if I could get a tighter fit on a 6mm D-shaft (I have tried drilling a 6mm hole earlier and it slides on but there is no friction. This time I drilled one with a 5.7mm and one with 5.9mm drill bits. The 5.7mm does not work. The 5.9mm can be pressed on but it's too tight and I broke the cap when trying to pull it off. I think my conclusion has to be that it's not viable, which means that I either have to drill a larger hole (8mm) and add an insert, or just have a D-shaped insert, but in that case the small D-shape must create all the friction and I don't think it will work very well. All in all, If I can use the 15x17mm instead, I think that's the better option.



PS: Here is my post about custom D-shaft insert for the 10mm pot: https://atosynth.blogspot.com/2021/03/from-33mm-square-to-d-shaft.html

PPS: There are various inserts available but hard to find something usefull. Search for knob spring, d-shaft inserts, barrel spring, d-shaft knob adapter





https://forums.qrz.com/index.php?threads/retainer-d-shaped-and-flat-springs-for-radio-knobs.643669/
https://www.allelectronics.com/item/spr-14/metal-insert-for-1/4-half-moon-shaft/1.html

Another idea: Buy something like these and cut of the top: https://sharvielectronics.com/product/potentiometer-knob-3mm-d-shaft/



UPDATE:

I tried spraying the 3D-printed insert with rubber spray and it works great! The knob sits firm but is still possible to remove. I will leave it on for some days and then try removing it again.




The grip was actually so good that it pulled the insert out of the cap (it had not been glued). This also showed that the rubber spray leaked through the 3D print. After letting it dry i put the cap back on and now it sits firmly again. 

I also tried spraying the outside of another cap. It adds a good grip but also removes the nice aluminum finish, and as far as I know it's not particularly durable, so I don't think I'll do it. It's nice to fall back to though, should the pots be too slippery. I did a black spray and was not very light handed so the finish was not the best, but I am sure it can be improved. I could also try transparent spray but that was sold out.

Thursday, March 31, 2022

Saving the DCOs

I've posted about this before, but I did a crucial mistake in rev 1.4 of the DCOs. Unfortunately, I also ordered a full set of them (40x) and the microcontroller and DAC (DAC8830) I used have since become unavailable at JLCPCB, so I can't just order a replacement.

My mistake was that I reduced the resistor the DAC outputs through from 100k to 22k, thinking that it had to be less than 60k when in reality it should be MORE THAN 60k.

I need to replace R5 with a 60k resistor

Fixing this means desoldering at least one resistor, but after that I have some options.

The "correct fix"

The correct fix would be desoldering R3 and R5 and replace them with new 60k resistors. It is a bit finicky to do this, especially removing R3 will be hard. (UPDATE: Even this would not make the output perfect, see Update 3 below)

Easier fixes (?)

The DAC feeds into an inverting op amp with unity gain (Rf = Rin = 22k). 

By replacing only Rin with a 60k resistor, I would get an inverting amplifier that attenuates the signal to -Rf/Rin = -22k/60k = -0.37.

Unfortunately, attenuating inverting amps are known to self oscillate. The solution, as described here and here, is to put a resistor of the same value as Rf from the negative input to ground. 

There are a few ways to add this resistor. 

First, I may add it directly between leg 5 and 6 on IC3. It may be possible to use a 0603 resistor, or at least a 0402 directly, but it may be a bit hard.

IC3 pins 5 and 6 are in the lower right corner


Second, I may desolder R5 and put a tiny wire from the top pad to pin U1 (utility 1). Doing things that way means I could add a replacement for R5, as well as a resistor to ground, on the board the DCO plugs into. 

Charge current

Since the output from the inverting op amp now is much smaller, I also need to place a resistor in parallel with R1 to increase the capacitor charging current. I need to do this anyway, as the DAC output in my original design was 5V, but running the DCO from 3.3V means the DAC output now can never reach above 3.3V. 

Another option would be to simply amplify the DCO output. I do this right now on my prototype, I need to do some calculations and experimentation here to see what is the best solution.

Change nothing

The last option I have is to do a bit of measuring on the DAC output. When do we run into problems? Is the max 60kOhm load rule for the whole range or just for the higher values? Is it related to the output current?

If it is indeed current related, we may have a few options. First of all, maybe reducing the reference voltage, which in turn reduces the output current at max, is enough? 

Similarly, if the higher values are the issue, could I get away with using only 15 bits, leaving the MSB at 0? Testing is needed!

Update 1:

Measurements from the DCO



This is weird. I did a lot of measurements and calculations. The DAC voltages follows the pitch, no errors as we go up the scale (apart from some tiny errors at the bottom that may as well be with my probes).

However, I have connected 3.3V as Vref. According to my calculations this means the output voltages are off by 25%. BUT - when I replace Vref with 2.5V in my spreadsheet, I get exactly the output I see on the dac! The error is around 0.5%, and that's to be expected since I haven't included the slope part of the lookup. This is SO weird. I need to look at this again tomorrow.

Update 2:


Changing to a 2.5v reference made the max value drop from 2.17 to 1.66V (Expected is 2.84 and 2..16 respectively). The diff is still 23% and it is still consistent across the DAC range.

Next up: breadboard a new circuit and check if the output changes (and at what rate) when changing the resistor.

PS: the DAC output impedance is approximately 6.25 kΩ

Update 3:

I did some measuring during my lunch break, and the results are extremely uplifting:

I replaced the input resistor Rin and measured the DAC output for various values. Then my hunch told me to compare it to what would happen if we measured the mid point of a resistor divider between Vref and GND, where the top resistor is equal to the DAC output impedance (6.25k) and the bottom resistor is equal to Rin. 

The two voltage columns speak for themselves - it is clear that this is what is going on. This means that
- The output will probably be exactly the same between the various DACs I'm using
- Even if I changed to a 60k resistor, I would not get a perfect result

In other words, I can probably just leave the 22k Rin as it is, and compensate in the charging resistor part instead! This is just amazing!

Even better, I added a buffer after the DAC, to see if tapping the output for my wave player idea affects the output, and it absolutely doesn't :)

Update 4:

I tested connecting a resistor in parallel with R1 to increase the charging current. Originally I intended the max charging current to be 5V / 56kΩ = 89.3uA. Now the max DAC output is 1.94V if we use a 2.5V reference, so we need R1 to conform to 1.94V / R1 = 89.3uA, meaning R1 has to be 21725Ω. By putting a resistor in parallel with the current R1 we can lower the combined resistance - to get a combined resistance of 21.7kΩ the second resistor needs to be 35.5kΩ. If we choose a 36kΩ resistor, the combined resistance is 21.9kΩ and the current 88.6uA, fairly close to the ideal.

I tested this, and the wave amplitude instantly jumped to 9.4V (With a 3.3V reference, it passes 10V. The tops are cut off but I assume that is because the calibration output (connected to the microcontroller) is > 3.3V, I've seen this happen before).

So - all I have to do to make the DCOs work properly - with a 2.5V reference instead of 3.3V btw - is connecting a 36kΩ resistor in parallel with R1, and 75kΩ and 3.3kΩ resistors (in series, so 78.3k) in parallel with R7 to get the correct value at the MCU calibration pin - see https://atosynth.blogspot.com/2022/01/big-bug-weekend.html for calculations of R7




Increasing max frequency


Right now, the DCO has a range of 8Hz to 8kHz. I want to move this to 16Hz-16kHz (or 20Hz-20kHz).

This can be done either by decreasing C3 from 1nF to 500pF (560pF may be the closest option), or by changing the value of the resistor in parallel with R1:

We now need the max charging current to be 178.6uA, meaning R1 should be 10.86kΩ. The necessary parallel resistor would be 13.4kΩ. It is better to choose a slightly lower value than a too high one, so 12k may be the best standard value.

Update 5:

By swapping R1 with a combined resistance of 14.5kΩ and using a Vref of 2.5V I'm able to cover the full midi range (8Hz to 13.3kHz) with only 3 cent errors on the highest pitches. This does not leave room for pitch bend at top/bottom, but each note is exactly 512 steps up from the previous which is a nice number to work with in the voice controller.

Reducing to 9.1kΩ lets us add another 12 semitones, giving us a range of 5Hz to 21kHz, though I'm not sure it's worth it.

All in all, I think I should consider making a bootloader for the DCOs, there are so many things that could be changed after install, and having to manually change 16 (or 32!) of them would be a real pain.

Wednesday, February 16, 2022

Envelope time curve - midi mapping

After looking at the transfer function of the Little Phatty, I decided to redo the mapping for my XM8. In the same way as with the level function, I'd like to make it dynamically changeable, to be able to dial in the perfect transfer function per envelope.

The LP has an envelope time (per the manual) of 1ms to 10s (10.000ms).

The midi transfer function, with f(x) in ms, is thus

f(x) = 10^(x/(127/4)), for x=0 to 127


To get a changeable function, I looked at my previous work on envelope curves. I have a general function with built in steepness.

A function starting at 0,0 and ending at 1,1 with variable steepness can be written as

f(x) = a * 10^(steepness * x) - a

where

a = 1/((10^steepness) - 1)

Extending this to a case where we want a highest value for input and output, we get

f(x) = Y_max * ( a * 10^(steepness * (x/X_max)) - a)

where again

a = 1/((10^steepness) - 1)

Unlike the LP function, this starts at 0, since I use a 0-indexed time where 0 is the shortest possible time, around 1ms. If we want a different starting point, we get

f(x) = Y_min + (Y_max - Y_min) * (a * 10^(steepness * (x/X_max)) - a)



Sunday, February 13, 2022

Little Phatty envelopes

Envelope sustain level

I've been trying to make curves to map a linear pot to envelope sustain level. I've added a function that generates a dB-accurate mapping, with adjustable dB range, but I'm having a hard time dialing in a curve I find pleasing so I thought I'd have a look at what the Little Phatty does.

I took 128 measurements of the vol env output on my Little Phatty, one for each midi step. This is the result...


In other words, perfectly linear. I noticed that each step varies somewhat, so it is safe to assume that the internal resolution is much higher than 128.

Also, the pot is linear, midi 63 is straight up etc, so generated CV is 1:1 with the pot position.

The envelope CV feeds an LM13700 based VCA. It is in itself linear, but the control signal circuit may still change the envelope. I will have to simulate this to be certain, but since the envelope is in fact exponential in itself it is a good guess that control is still linear? But if so, the sustain level setting will not be very nice. I'll try that as well.


Update: Here is a plot of midi sustain value vs amplitude of a square wave:


It confuses me. In the beginning the output level increases rapidly, but then as we get higher the rate of change drops. But doesn't perceived loudness work the other way around?

Here is the plot overlaid on a recording of me turning the sustain pot fairly evenly:


It matches well so the curve is absolutely right. And it sounds ok too. In a way, it feels exactly like it looks, starting from the top things change fairly linearly until the pot is halfway (though it doesn't feel like it is HALF the volume. Then it drops much more rapidly.

I tried some new variations on my own synth. a 23dB curve, which (going down) ends at 2319, or 7% of max volume, sounds very linear to me. It is not fully off, so we may need to cap it at the lower end, which is exactly what the Little Phatty curve does - that one seems almost linear 3/4 of the way down. I tried doing something similar but it just doesn't sound good to me. I think I'll stick with the 23dB.

Closer look at envelope shape and times

While I had the LP hooked up I had a look at the envelope outputs. 



Shortest attack is 1.3ms, and the attack is linear

Decay to center is 3.9ms

Decay to bottom is approximately the same


Decay to 75% too



Release is in the same range, looks like approximately 5ms.



At 15, attack is 3.83ms

At 31, attack is around 12ms, or 10 times the fastest

At 47, attack is 38.3ms

At 63, the envelope looks like this:


Attack is 120ms, decay around 385ms and release around 460ms, pretty much exactly 100 times the fastest.



At 95, Attack is 1.2s and the others are similarly 100 times the shortest. Something interesting to note too is that the envelope keeps dropping even after the initial decay...

In other words, we have exponential growth from 1ms to 10s, quite expected really :)

(The actual transfer function is f(x) = A*10^(x/32), where f(x) is the level, A is the time at X=0 (1.2ms if we cheat a little) and x is the midi value).

The manual says the ranges for all stages are 1 to 10s. It seems that this is not quite correct for decay and release, but attack is definitely close.


One final thing - sample & hold

Oh, and a little thing I noticed while studying the Slim Phatty schematics - Sample and hold buffers use 1nF caps and LF353, multiplexed through DG408s. The signal looks more noisy than what I get, but that is though a long signal cable. The dac is DAC8581, which has a settling time of 0.65uS for a 10V change.