Electronics > Projects, Designs, and Technical Stuff

Tear me apart: Relay Step Attenuator

<< < (4/5) > >>

BurnedResistor:
Adding on to the previous comment, some more stuff regarding resistor-choice and loading:

All attenuation stages are designed to operate with 10k of output load and present 10k of output load to the previous stage.

I did some python-tooling-around to get a feel for this.

Here is the attenuation this design provides at all steps (128 of them), into a 10k load:



I calculated this by actually solving the network at dc and seeing what kind of division it provided, so this is taking into account the small differences in load each of the stages will see due to imperfect resistor values.

so that gives the following absolute error in attenuation at all settings:



By itself, I calculated each stage to provide the following amounts of attenuation into a 10k load:
-0.5db stage:       -0.50201922 db
  -1db stage:        -1.01080154 db
  -2db stage:        -1.9471043   db
  -4db stage:        -3.86249197 db
  -8db stage:        -7.95564109 db
 16db stage:       -15.8991872  db
-32db stage:      -31.70163312 db


There is some error but I can live with it.. I actually don't really care that the attenuation provided is precise. I actually care much more that each consecutive attenuation stetting (so for example going from -31.5db (0111111) to -32db(1000000)) actually still represents a decrease in attenuation. I don't want to turn the volume down a notch and have it increase..... I can live with it not turning down exactly 0.5db though :)

This is the difference in attenuation in each setting going from 0 to full attenuation:



So increasing the attenuation one notch will always yield an increase in attenuation by between -0.45 and -0.65 db. That is good enough for me.

(This is not taking into consideration resistor tolerances yet, still working on that math/simulation...)

Lastly I also simulated the attenuator with different output loads:



Like I said in my first post. It looks pretty rough, but as long as it sees 10k+ the 'step delta' (idk if that is the right word, 'difference in attenuation between steps') still seems to be at least all negative.

I feel pretty confident about the choice of resistors in 10k, but I am less sure of 10k as my value for my output load:

Like I said, I would rather have the resitance the device sees at it's output be higher than hat I designed for, and online I saw some designs using 10k, but I am not sure if it is a good move, hence the adjustment resitors at the output, to increase the load from say 40k to 12-20k.

BurnedResistor:

--- Quote from: floobydust on March 26, 2020, 04:31:47 am ---G6K relays are classified as "signal" type which seems to mean under 2A. I've used the Omron G6K-2P for low levels and they aren't so great, some have dirty contacts and need a beating to clean off the oxide. They also are problematic in reflow, the legs frequently haven't soldered well as the relay body seems to block heat. A few production runs ended up with dirty contacts after reflow which I guessed was due to off-gassing, as the relays are sealed. The relay is OK for switching power. Would not use for a step-attenuator.
You need a relay with AgPd contacts, and a minimum switching capacity specification that is uA, not A.

--- End quote ---

I see. Hmmm... So yeah, start looking for a different relay.


--- Quote from: imacgreg on March 25, 2020, 11:16:46 pm ---I designed a commercial pro audio product that used a relay based attenuator similar to what you are describing. I would advise not relying on a hardware solution to the mis-match relay on/off time problem. It can very easily be handled in firmware and may require some tweaking, which is much easier in code.

--- End quote ---

I think software is going to be my best bet here, yeah.
Do you remember/have access/can share what relays you used?

BurnedResistor:

--- Quote from: WattsThat on March 25, 2020, 09:33:03 pm ---Another factor that will affect relay turn on speed is your choice of switching transistor. The 2N7002 is an older part with a very high Rds and it wouldn’t be even my third or forth choice for a 3.3 volt application. Have a look at the data sheet and you’ll see the Rds is off the graph at 3 volts. Most times I’ve seen the 2N7000 series parts used is because they’re still available in through hole versions. Since you’re using surface mount, you have lots of options with hundreds of more modern, lower gate voltage parts.

Having a quick look at the DigiKey parametric search pops up the lowly BSS138 as an okay choice but not a lot of excess current capability, the DMN3730U looks better at .75 amp rating with lots more logic level one and two amp devices in the sot-23 footprint.

--- End quote ---

I know they arent great but I have a bunch at home from another project, so I thought i could use those ^-^
I will most likely try it with them, and if the switching speed really is an issue I can always change them...
Thank you thought.

OldEE:
Since there will be no wetting current, and that's important, have a look at Panasonic Electric Works DS2E-S-DC3V relays.  They are designed for small signal work and have gold flashed silver contacts.

The yellow case stands out and can be seen in all sorts of low level switching applications.  AT one time they filled with argon but I see no mention of this in the data sheet.


To minimize magnetic coupling from the relay coil and it's traces into the signal traces, where possible, have them at 90 deg to each other.  Likewise the coil inside the relay should be oriented so that the end of the relay is 90 deg. to the signal traces.

On the 3V3 line for the relays consider using a much larger capacitor to handle the inrush current.  Also consider a separate regulator for the processor.

duak:
BurnedResistor,

Whew, good! Your explanation of the design algorithm and presentation was clear.  I was working on my reply late last night and could not get the numbers to agree.  Now, after some sleep, it all works.  Looking back, I now see that I took each stage in isolation and not seeing the minimum load, assumed an open circuit as the worst case.

This attenuator has 0.5 dB steps that are hard to discern by ear with real source material.  I expect that as long as the progression is monotonic, it will work well.
 
I have an idea for an optimization of imacgreg's recomendation to mute the output during stepping.  If it turns out that muting is noticable,  the firmware could mute only when the more significant stages change state. 

Cheers,

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod