Jump to content
Zen Mod

Glavolomka za matematicare

Preporučeni Komentari

Taj nisam, zasigurno

 

imam na umu neki line stage , u kojem treba da napravim varijabilnu otpornost, pocev od 100K do 398R (390R kao standardna vrednost je dovoljno blizu) , u 48 koraka , gde je svaki korak u vrednosti tacno 0.8912 od prethodnog ........ sto prakticno predstavlja step od 1db

ono sto ja ni u loodilu ne znam da resim je - ukupan broj otpornika u matrici , kao i matricne cinioce za svaki korak

pretpostavljam da je nekome ovo igranka i razbibriga , kao za mene crtanje stampi, ali , avaj, za mene bas i nije

 

 

 

Principle sshot.png

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

a moze i nesto ovako, mada bi vise voleo malo veci broj releja u paralelu nego releje u seriju

ignorisati vrednosti otpora na prilozenoj slici

 

prilozena i tabela E24 standardnih vrednosti (R,10*R,100*R,K,10*K,100*K,M)

 

 

 

principle 2.png

E24.png

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

o je, tnx Shonne na trudu

znam Kolbrek-a , ona slikica i jeste sa njegovog sajta

ali , Kolbrek daje ili Rin ili Rout const, a ono sto je meni od interesa je slicna matrica ali sa postavkom kako nacrtah

dakle, ne 4-krajnik, nego 2-krajnik

 

kontam da se prilozeni xls moze prilagoditi da izracuna on o sto meni treba, ali za to treba znati i math i excell

no way da pod stare dane i to ucim**,  dosta mi Arduinisanja :)

 

*ce abandon ako treba :rofl: 

 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima
2 minutes ago, Zen Mod said:

o je, tnx Shonne na trudu

znam Kolbrek-a , ona slikica i jeste sa njegovog sajta

ali , Kolbrek daje ili Rin ili Rout const, a ono sto je meni od interesa je slicna matrica ali sa postavkom kako nacrtah

dakle, ne 4-krajnik, nego 2-krajnik

 

kontam da se prilozeni xls moze prilagoditi da izracuna on o sto meni treba, ali za to treba znati i math i excell

no way da pod stare dane i to ucim**,  dosta mi Arduinisanja :)

 

*ce abandon ako treba :rofl: 

 

@vladd je matematicar, a ne samo pricalica, cini mi se. :)

moze da se poigra sa excell...

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Gledam..

Lakse mi peske, jednog po jednog...problem je da se odrzi koeficijent reda, 0,89 uklapanjem u standardne 1%

Ako na R2 stavi 820K, paralelno sa 100K se dobije 89,13K

E sad, R3 kada udje u igru, da li on nastupa prema R1+R2 ili se R2 otkacinje iz kola...pa su R1 i R3 tu da naprave 79,42K(paralelno bi isao oko 380K)

Ako bi se ponovo stavio paralelno 820K, prema 89K(R1+r2) dobio bi 80,28k, sto je skoro 79,43K...tu oko 1% Ali je tako gomila osetljivih paralelnih komponenti u signalu...

Izabrati sta manje generise sum, npr...

 

P,S,

Znaci svaki sledeci je 0,8912 od prethodnog, a R = R1xRe/R1-Re, vrlo to brzo opada, tesko da ce imati puno koraka do 300 oma

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Sa tim uslovom -1dB isa 48 koraka biće ukupno slabljenj -48dB.

Da li je to dovoljno slabljenje?

Verovatno bi odličan skok bio -1.2 ili 1.4 dB.

Treba računati na 47 koraka, a prvi 0 dB.

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

dovoljno je slabljenja, i stvarno treba da bude samo promenljiva otpornost

ne razmisljaj o atenuatoru, razmisljaj o I/V konverziji

 

mada, da se dodje do matematike, lako je onda preracunati i 1.2db ili 1.5db , to si u pravu

 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima
22 minutes ago, vladd said:

 

 

P,S,

Znaci svaki sledeci je 0,8912 od prethodnog, a R = R1xRe/R1-Re, vrlo to brzo opada, tesko da ce imati puno koraka do 300 oma

vidi, u to malo matematike sam siguran :)

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

anyway, odavde : http://www.eijndhoven.net/jos/attenuator-calculator/index.html

 

javlja mi se da bih mozda mogao da krenem peske sa ovin vrednostima, povezano kako meni treba, kao 2-krajnik , ako podesim vrednost na nekih 20k, constant input

64 steps, matrica tako diktira

peske mislim- da vidim da solve matricu ukljucenosti releja :rofl:

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Pa onda je recimo nesto prostije

Ako je R1 100k, racunamo ga kao n=1,

onda je je n-ti otpornik Rn= R1 x 0,8912 exp (n-1)

Drugacije receno, sedamnaesti otpor je R17=R1x 0,8912exp16, 100k puta 0,89122 na sesnaesti...

Drugi je prosto r1 x 0,8912(exp na prvi stepen)

I tako dobijes tabelu otpornika, ili prosto zamenis u gornjoj formuli za Re

 

P.s

 

Po toj racunici 64-i step je 0,8912 na 63-i sto pomnozeno sa 100K daje 70,54 oma....

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Logarithmic Attenuator Calculator</title>
  <meta name="author"  content="Jos van Eijndhoven">
  <meta name="keywords" content="calculator attenuator resistor switch relay relais relays logarithmic ladder network potentiometer audio">
  <link rel=StyleSheet href="../style.css">

<style>
  table {border: 0px; border-spacing: 0px;}
  td {text-align: center;}
  tr.schematic {font: 11px Verdana, Arial, Helvetica}
  td.SchemTop {background-image: url("table-topresistor.gif"); text-align: center;}
  td.SchemBot {background-image: url("table-botresistor.gif"); text-align: center;}
  /*td.tbCol0 {background-color: #ffffff;}*/
  form{margin-bottom:0em;}
  table#left td{text-align: left;}
  table#left th{text-align: left;}
</style>
<script type="text/javascript">
var nStages=6;
var E12 = [1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2, 10];
var E24 = [1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0,
		   3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1, 10];
var E96 = [1.00, 1.02, 1.05, 1.07, 1.10, 1.13, 1.15, 1.18, 1.21, 1.24, 1.27, 1.30,
		   1.33, 1.37, 1.40, 1.43, 1.47, 1.50, 1.54, 1.58, 1.62, 1.65, 1.69, 1.74,
		   1.78, 1.82, 1.87 ,1.91, 1.96, 2.00, 2.05, 2.10 ,2.15, 2.21, 2.26, 2.32,
		   2.37, 2.43, 2.49, 2.55, 2.61, 2.67, 2.74, 2.80, 2.87, 2.94, 3.01, 3.09,
		   3.16, 3.24, 3.32, 3.40, 3.48, 3.57, 3.65, 3.74, 3.83, 3.92, 4.02, 4.12,
		   4.22, 4.32, 4.42, 4.53, 4.64, 4.75, 4.87, 4.99, 5.11, 5.23, 5.36, 5.49,
		   5.62, 5.76, 5.90, 6.04, 6.19, 6.34, 6.49, 6.65, 6.81, 6.98, 7.15, 7.32,
		   7.50, 7.68, 7.87, 8.06, 8.25, 8.45, 8.66, 8.87, 9.09, 9.31, 9.53, 9.76, 10.00];
var eSeriesN = 12;
var eSeriesVals = E12; /* link to one of above arrays */
var attenuationdB=1.0;
var attenuationRatio=Math.pow(10, -0.05 * attenuationdB);
var attenuatorType = 0; /* 0: constant input, 1: constant output resistance */
var resistance=10000;
var multipliers = ["u","m","R","k","M","G","T"];
var stageOrder = [1,2,3,4,5,6,7,8];
var RTopNominal=new Array(8);
var RBotNominal=new Array(8);
var RTopRounded=new Array(8);
var RBotRounded=new Array(8);
var MaxInRes = new Array(10);
var MinInRes = new Array(10);
var MaxOutRes = new Array(10);
var MinOutRes = new Array(10);
var minAtt = new Array(10);
var maxAtt = new Array(10);

function getRValue()
{
  resistance=prompt("Enter constant stage resistance",f2rvalue(resistance));
  var lnum = resistance.length-1;
  var lastchar = resistance.charAt(lnum);
  var basenum = resistance.substr(0,lnum)
  if (lastchar == "R")
  	resistance = resistance.substr(0,lnum);
  else if (lastchar == "k")
  	resistance = resistance.substr(0,lnum) * 1000;
  else if (lastchar == "K")
  	resistance = resistance.substr(0,lnum) * 1000;
  else if (lastchar == "M")
  	resistance = resistance.substr(0,lnum) * 1000000;

  var resTxt = f2rvalue( resistance);
  document.getElementById("user-R").innerHTML=resTxt;
  calculate();
}

function getdBValue()
{
  attenuationdB=prompt("Enter Stage attenuation in dB", attenuationdB);
  if (attenuationdB < 0.01 || attenuationdB > 21)
  	attenuationdB = 1.0;
  attenuationRatio = Math.pow(10, -0.05 * attenuationdB);
  document.getElementById("user-db").innerHTML=attenuationdB+"dB";
  calculate();
}

function getStageOrder(orderLongString)
{
  defaultPerm = "1,2,3,4,5,6,7,8";
  defaultPerm = defaultPerm.substring(0,2*nStages-1);
  
  if (orderLongString == "Default")
    orderLongString = defaultPerm;

  if (!orderLongString || orderLongString=="")
    orderLongString = prompt("Enter stage order", defaultPerm);
	
  if (!orderLongString || orderLongString.indexOf(",") < 1)
	return;
  var orderStringArray = orderLongString.split(",", 8);
  if (orderStringArray.length < nStages)
	return;
		
  var newStageOrder = [1,2,3,4,5,6,7,8];
  var testStageOrder = [0,0,0,0,0,0,0,0,0];
  for (i=0; i<nStages; i=i+1)
  {
	newStageOrder[i] = parseInt(orderStringArray[i]);
	if (newStageOrder[i] < 1 || newStageOrder[i] > 8)
	  return;
	testStageOrder[newStageOrder[i]] = 1;
  }
  // test if the converted string array really described a permutation:
  var sum = 0;
  for (i=1; i<=nStages; i=i+1)
    sum = sum + testStageOrder[i];
  if (sum != nStages)
	return;
		
  // all OK: install the new permutation
  var stageOrderLabel = newStageOrder[0].toString();
  for (i=1; i<nStages; i=i+1)
    stageOrderLabel = stageOrderLabel + "," + newStageOrder[i];

  if (stageOrderLabel.substring(0,2*nStages-1) == defaultPerm)
  	stageOrderLabel = "Default";

  stageOrder = newStageOrder;
  document.getElementById("user-Order").innerHTML=stageOrderLabel;

  calculate();
}

function selectESeries(index)
{
  if (index == 0)
  {
    eSeriesN = 12;
	eSeriesVals = E12;
  }
  else if (index == 1)
  {
    eSeriesN = 24;
	eSeriesVals = E24;
  }
  else if(index == 2)
  {
    eSeriesN = 96;
	eSeriesVals = E96;
  }
  else
    eSeriesN = 0;

  calculate();
}

function selectAttType(index)
{
  attenuatorType = index;
  var topRow = document.getElementById("trSchemTop");
  var botRow = document.getElementById("trSchemBot");
  if (attenuatorType == 0)
  {
	topRow.cells[1].style.backgroundImage = "url(table-topresistor.gif)";
	botRow.cells[1].style.backgroundImage = "url(table-botresistor.gif)";
  } else
  {
	topRow.cells[1].style.backgroundImage = "url(table-topfirst.gif)";
	botRow.cells[1].style.backgroundImage = "url(table-botfirst.gif)";
  }
  calculate();
}

function selectNStages(index)
{
  nStages = 4 + index;
  var topRow = document.getElementById("trSchemTop");
  var botRow = document.getElementById("trSchemBot");
  var nomAttRow = document.getElementById("trNomAtt");
  var errAttRow = document.getElementById("trErrAtt");

  for (i=5; i<=9; i=i+1)
  {
    var col = document.getElementById("tbCol" + i);
  	if (i > nStages+1)
    {
	  topRow.cells[i].style.visibility="hidden";
	  botRow.cells[i].style.visibility="hidden";
	  nomAttRow.cells[i].style.visibility="hidden";
	  errAttRow.cells[i].style.visibility="hidden";
      topRow.cells[i].style.backgroundImage = "none";
	  botRow.cells[i].style.backgroundImage = "none";
	  col.style.width = 100;
	  //Hmm.. like to set width to 1, doesn't work in Chrome...
	} else
	{
	  topRow.cells[i].style.visibility="visible";
	  botRow.cells[i].style.visibility="visible";
      nomAttRow.cells[i].style.visibility="visible";
	  errAttRow.cells[i].style.visibility="visible";
	  col.style.width = 100;
	
      topRow.cells[i].style.backgroundImage = "url(table-topresistor.gif)";
	  botRow.cells[i].style.backgroundImage = "url(table-botresistor.gif)";
	}
  }
  topRow.cells[nStages+1].style.backgroundImage = "url(table-toplast.gif)";
  topRow.cells[nStages+1].innerHTML="";
  nomAttRow.cells[nStages+1].style.visibility="hidden";
  errAttRow.cells[nStages+1].style.visibility="hidden";

  // reset stage order to default
  stageOrder = [1,2,3,4,5,6,7,8];
  document.getElementById("user-Order").innerHTML="Default";

  calculate();
}

function configRlx2()
{
  resistance = 350;
  document.getElementById("user-R").innerHTML=resistance;
  document.getElementById("selectESeries").selectedIndex = 0;
  selectESeries(0);
  document.getElementById("selectNStages").selectedIndex = 2;
  attenuationdB=0.95;
  attenuationRatio = Math.pow(10, -0.05 * attenuationdB);
  document.getElementById("user-db").innerHTML=attenuationdB+"dB";
  document.getElementById("selectAttType").selectedIndex = 1;
  attenuatorType = 1;
  selectNStages(2);
  getStageOrder("3,4,5,6,2,1");
}
function configRlxPassive()
{
  resistance = 27000;
  document.getElementById("user-R").innerHTML="27k";
  document.getElementById("selectESeries").selectedIndex = 0;
  selectESeries(0);
  document.getElementById("selectNStages").selectedIndex = 2;
  attenuationdB=0.96;
  attenuationRatio = Math.pow(10, -0.05 * attenuationdB);
  document.getElementById("user-db").innerHTML=attenuationdB+"dB";
  document.getElementById("selectAttType").selectedIndex = 0;
  attenuatorType = 0;
  selectNStages(2);
  getStageOrder("Default");
}
function configAtt08()
{ // passive attenuator, Feb'08
  resistance = 8900;
  document.getElementById("user-R").innerHTML=8900;
  document.getElementById("selectESeries").selectedIndex = 2;
  selectESeries(2);
  document.getElementById("selectNStages").selectedIndex = 2;
  attenuationdB=1.0;
  attenuationRatio = Math.pow(10, -0.05 * attenuationdB);
  document.getElementById("user-db").innerHTML=attenuationdB+"dB";
  document.getElementById("selectAttType").selectedIndex = 1;
  attenuatorType = 1;
  selectNStages(2);
}

function ERound( val)
{
  if (eSeriesN == 0 || val <= 0)
    return val;
	
  var logval = Math.log(val) / Math.log(10);
  var Rnum = Math.round(eSeriesN * logval);
  var Decade = Math.floor((Rnum / eSeriesN) + 0.000001);

  while (Rnum < 0)
  {
    Rnum += eSeriesN;
  }
  var Rinx = Rnum % eSeriesN;
  var normVal = eSeriesVals[Rinx];
  return normVal * Math.pow(10, Decade);
}

function f2rvalue( val)
{
  if (val==0)
	return "0";
  if (val < 0)
    return "-??";
	
  var powof10 = Math.floor(Math.log(val)/Math.log(10) + 0.000000001);
  var powof1000 = Math.floor(powof10/3 + 0.000001);
  
  if (powof10 < -6)
    return "~0";
  if (powof10 > 13)
    return "inf";
	
  var suffix = multipliers[powof1000+2];
  var normval = val * Math.pow(10,-powof10);
  var roundval = Math.round(normval * 1000) * Math.round(Math.pow(10,powof10 - powof1000*3)) / 1000;
  return roundval + suffix;
}

function RParr(r1, r2)
{
    var r1f = Math.pow(r1, 1.0);
	var r2f = Math.pow(r2, 1.0);
 	var rp = (r1f * r2f) / (r1f + r2f)
	return rp;
}

function getStagePower(i)
{
	// argument i should be in the range 1 .. nStages
	var stageRank = stageOrder[i - 1];
	// stageRank gives a permutation result, between 1 .. nStages
	return Math.pow(2,stageRank - 1);
}

function calculate()
{
  var topRow = document.getElementById("trSchemTop");
  var botRow = document.getElementById("trSchemBot");
  var nomAttRow = document.getElementById("trNomAtt");
  
  // set nominal and rounded resistor values
  for (i=1; i<= nStages; i=i+1)
  {
  	var stagePower = getStagePower(i);
  	var AttenuationRatioNominal = Math.pow(attenuationRatio,stagePower);
  	if (attenuatorType == 0)
	{	// const input
		RTopNominal[i] = resistance * (1 - AttenuationRatioNominal);
		RBotNominal[i] = resistance / (1/AttenuationRatioNominal - 1);
	} else
	{	// const output
	    if (i == 1)
		  RTopNominal[i] = resistance / AttenuationRatioNominal;
		else
		  RTopNominal[i] = resistance * (1 - AttenuationRatioNominal) / 
			               AttenuationRatioNominal;
		RBotNominal[i] = resistance / (1 - AttenuationRatioNominal);
	}
	RTopRounded[i]= ERound(RTopNominal[i]);
	RBotRounded[i]= ERound(RBotNominal[i]);
	
	topRow.cells[i].innerHTML = f2rvalue(RTopRounded[i]);
    botRow.cells[i].innerHTML = f2rvalue(RBotRounded[i]);
	nomAttRow.cells[i].innerHTML = (attenuationdB * stagePower)+"dB";
  }

  var cumulativeAtt = 1.0;
  var switchedRes = 0;
  var switchedGain;
  // set final load resistor
  if (attenuatorType == 0)
  {
    RTopRounded[nStages+1] = 0;
	RBotRounded[nStages+1] = ERound(resistance);
  	botRow.cells[nStages+1].innerHTML = f2rvalue(RBotRounded[nStages+1]);
	document.getElementById("maximumLoadRes").innerHTML = ".";
	switchedRes = resistance;
  } else
  {
    RTopRounded[nStages+1] = 0;
	RBotRounded[nStages+1] = resistance*100; // just high
  	botRow.cells[nStages+1].innerHTML = "Rload";
	document.getElementById("maximumLoadRes").innerHTML =
		"for an Rload of "+f2rvalue(RBotRounded[nStages+1])+".";
  }
	
  // calculate resistance min/max ranges
  MinInRes[nStages+1] = RBotRounded[nStages+1];
  MaxInRes[nStages+1] = RBotRounded[nStages+1];
  MinOutRes[0] = 0;
  MaxOutRes[0] = 0;
  for (i=nStages; i>=1; i=i-1)
  {
    if (attenuatorType == 0)
	{
      var rp = RParr(RBotRounded[i],switchedRes);
	  switchedRes = RTopRounded[i] + rp;
	  switchedGain = rp / switchedRes;
	  cumulativeAtt = cumulativeAtt * switchedGain;
	}
	
	MinInRes[i] = Math.min(MinInRes[i+1], RTopRounded[i] + RParr(RBotRounded[i],MinInRes[i+1]));
	MaxInRes[i] = Math.max(MaxInRes[i+1], RTopRounded[i] + RParr(RBotRounded[i],MaxInRes[i+1]));
  }
  for (i=1; i<=nStages; i=i+1)
  {
    if (i==1 && attenuatorType!=0)
	{
	  MinOutRes[1] = RParr(RTopRounded[1], RBotRounded[1]);
	  MaxOutRes[1] = MinOutRes[1];
	  
	  switchedRes = MinOutRes[1];
	  switchedGain = RBotRounded[1]/(RTopRounded[1] + RBotRounded[1]);
	  cumulativeAtt = switchedGain;
	} else
	{
	  MinOutRes[i] = Math.min(MinOutRes[i-1], RParr(MinOutRes[i-1]+RTopRounded[i], RBotRounded[i]));
	  MaxOutRes[i] = Math.max(MaxOutRes[i-1], RParr(MaxOutRes[i-1]+RTopRounded[i], RBotRounded[i]));
	  
	  if (attenuatorType!=0)
	  {
	     switchedGain = RBotRounded[i]/(RTopRounded[i] + RBotRounded[i] + switchedRes);
		 switchedRes = RParr(switchedRes+RTopRounded[i], RBotRounded[i]);
         cumulativeAtt = cumulativeAtt * switchedGain;
	  }
	}
  }
  document.getElementById("minimumInRes").innerHTML = f2rvalue(MinInRes[1]);
  document.getElementById("maximumInRes").innerHTML = f2rvalue(MaxInRes[1]);
  document.getElementById("minimumOutRes").innerHTML = f2rvalue(MinOutRes[nStages]);
  document.getElementById("maximumOutRes").innerHTML = f2rvalue(MaxOutRes[nStages]);
  
  // Actual attenuation from rounded resistor values
  var fullAtt = 20 * Math.log(cumulativeAtt) / Math.log(10);
  var AvgStepSize = -1.0 * fullAtt / (Math.pow(2,nStages) - 1);
  fullAtt = Math.round(fullAtt * 10) / 10;
  document.getElementById("attenuatorMaxAtt").innerHTML = fullAtt + "dB";
  document.getElementById("attenuatorPositions").innerHTML =
  	Math.pow(2,nStages);
  
  // calculate attenuation stage errors
  var errAttRow = document.getElementById("trErrAtt");
  var minRes, maxRes;
  for (i=1; i<=nStages; i=i+1)
  {
	var linearizedStageAtt = AvgStepSize * getStagePower(i);
    if (attenuatorType == 0) // const input
	{
	  minRes = RParr(MinInRes[i+1],RBotRounded[i]);
	  maxRes = RParr(MaxInRes[i+1],RBotRounded[i]);
	  maxAtt[i] = Math.log(minRes / (RTopRounded[i] + minRes));
	  minAtt[i] = Math.log(maxRes / (RTopRounded[i] + maxRes));
	} else
	{
	  minRes = MinOutRes[i-1] + RTopRounded[i];
	  maxRes = MaxOutRes[i-1] + RTopRounded[i];
	  maxAtt[i] = Math.log(RBotRounded[i] / (RBotRounded[i] + maxRes));
	  minAtt[i] = Math.log(RBotRounded[i] / (RBotRounded[i] + minRes));
	}
	maxAtt[i] = 20 * maxAtt[i] / Math.log(10);
	minAtt[i] = 20 * minAtt[i] / Math.log(10);
	
	var errAtt = maxAtt[i] + linearizedStageAtt;
	if (Math.abs(errAtt) < Math.abs(minAtt[i] + linearizedStageAtt))
	  errAtt = minAtt[i] + linearizedStageAtt;
	errAtt = Math.round( errAtt * 100) / 100;
	errAttRow.cells[i].innerHTML = errAtt + "dB";	
  }
  AvgStepSize = Math.round(AvgStepSize * 1000) / 1000;
  document.getElementById("attenuatorStepSize").innerHTML = AvgStepSize+"dB";
}
</script>

</head>

<body onload="selectNStages(2)">
<h1>Logarithmic Attenuator Calculator</h1>
<p />
This calculator provides configuration data for <i>logarithmic stepped attenuators</i>
or <i>logarithmic ladder networks</i>. Such relay-plus-resistor networks are used for volume
control in audio electronic devices, as a replacement for traditional analog potentiometers.
This page aims to provide practical help for configuring this type of attenuators.
For a more theoretical description of their operation please have a look at
this <a href="http://en.wikipedia.org/wiki/Logarithmic_resistor_ladder">wikipedia page</a>.
<p />
This calculator does not just provide the <i>nominal</i> (or ideal) resistance values
for these attenuators. It also proposes a rounding of resistance values to the industry-standard
E-series of values, and it subsequently calculates the deviation from ideal behavior as result
of this rounding.
<h2>Design input parameters</h2>
<p />
<table id="left">
<tr >
<td>Stage constant resistance:</td>
<td><button type="button" onclick="getRValue()" id="user-R">10k</button></td>
</tr>
<tr>
<td>Stage attenuation:</td>
<td><button type="button" onclick="getdBValue()" id="user-db">1.0dB</button></td>
</tr>
<tr>
<td>Choose resistor values from:</td>
<td>
<select id="selectESeries" onChange="selectESeries(this.selectedIndex)">
  <option>E12</option>
  <option>E24</option>
  <option>E96</option>
  <option>any value</option>
</select>
</td>
</tr>
<tr>
<td>Attenuator type:</td>
<td>
<select id="selectAttType" onChange="selectAttType(this.selectedIndex)">
  <option>Constant input resistance</option>
  <option>Constant output resistance</option>
</select>
</td>
</tr>
<tr>
<td>Number of stages:</td>
<td>
<select id="selectNStages" onChange="selectNStages(this.selectedIndex)">
  <option>4</option>
  <option>5</option>
  <option selected="selected">6</option>
  <option>7</option>
  <option>8</option>
</select>
</td>
</tr>
<tr>
<td>Stage permutation:</td>
<td><button type="button" onclick="getStageOrder()" id="user-Order">Default</button>
</td>
</tr>
</table>
<h2>Design Result</h2>
<p />
<table border="0" cellspacing="0" cellpadding="0">
<colgroup id="tbCol0" span="1" width="30" height="50"></colgroup>
<colgroup id="tbCol1-4" span="4" width="100" height="50"></colgroup>
<colgroup id="tbCol5" span="1" width="100" height="50"></colgroup>
<colgroup id="tbCol6" span="1" width="100" height="50"></colgroup>
<colgroup id="tbCol7" span="1" width="100" height="50"></colgroup>
<colgroup id="tbCol8" span="1" width="100" height="50"></colgroup>
<colgroup id="tbCol9" span="1" width="100" height="50"></colgroup>
<tr id="trSchemTop" class="schematic" height="50" align="center" valign="center" >
<td align="right" valign="bottom" bgcolor="White">in</td>
<td class="SchemTop">15K</td>
<td class="SchemTop">15K</td>
<td class="SchemTop">15K</td>
<td class="SchemTop">15K</td>
<td class="SchemTop">15K</td>
<td class="SchemTop">15K</td>
<td class="SchemTop"></td>
<td class="SchemTop"></td>
<td class="SchemTop"></td>
</tr>
<tr id="trSchemBot" class="schematic" height="50" align="center" valign="center">
<td align="right" valign="bottom" bgcolor="White">GND</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot">15K</td>
<td class="SchemBot"></td>
<td class="SchemBot"></td>
</tr>
<tr height="25"><td></td></tr>
<tr ID="trNomAtt" align="center" valign="center">
<td align="left">Nominal attenuation:</td>
<td>32dB</td>
<td>16dB</td>
<td>8dB</td>
<td>4dB</td>
<td>2dB</td>
<td>1dB</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr ID="trErrAtt" align="center" valign="center">
<td align="left">Maximum deviation:</td>
<td>0dB</td>
<td>0dB</td>
<td>0dB</td>
<td>0dB</td>
<td>0dB</td>
<td>0dB</td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<p />
<table>
  <tr>
    <td>This attenuator provides </td>
	<td id="attenuatorPositions">-</td>
	<td> positions ranging from 0 to </td>
	<td id="attenuatorMaxAtt">-</td>
	<td> with average stepsizes of </td>
	<td id="attenuatorStepSize">1dB</td>
	<td>.</td>
  </tr>
</table>
<table>
  <tr>
    <td>Input resistance ranges from</td>
    <td id="minimumInRes">-</td>
    <td>to</td>
    <td id="maximumInRes">-</td>
    <td id="maximumLoadRes"></td>
  </tr>
  <tr>
    <td>Output resistance ranges from</td>
    <td id="minimumOutRes">-</td>
    <td>to</td>
    <td id="maximumOutRes"></td>
    <td>.</td>
  </tr>
</table>
<h2>Constant input versus constant output resistance</h2>
<p />
In a conventional analog potentiometer, the <i>input resistance</i>
is constant: this is the value of the resistance between both end points.
Its <i>output resistance</i> varies with the position of the sliding contact:
when the contact is near either end the output resistance aproaches zero,
and somewhere in between the output resistance reaches a maximum of 1/4 of the input resistance.
This behavior somewhat resembles the <i>constant input resistance</i> stepped attenuator:
the output resistance varies with the selected attenuation. However, the relation between
attenuation-level and output-resistance is significantly more complex:
a high attenuation (low output signal) does not imply a low output resistance.
This attenuator type requires a final load resistance that is identical to the
input resistance of each stage, which is included in above design.
<p/>
The alternative design option provides a constant output resistance over all attenuation levels,
but has a variable input resistance. Its first stage is configured slightly differently to establish
the selected output resistance. A final load resistance can cause extra attenuation which is not
accounted for in above numbers. Note that the uniformity of the attenuation-steps remains correct
even if the applied load resistance would be chosen relatively low.

<h2>Linearity errors</h2>
<p />
Each stage should provide an attenuation of exactly 2x the number of dB's of its subsequent stage.
If this 2x ratio is not accurately maintained, the attenuation step sizes from one level to the next (the <i>stage attenuation</i>)
do not remain exactly uniform. The above design table provides calculation estimates for
such non-uniformity as step-size deviations (errors) from the design average step-size.
Fortunately, for audio applications,
the human perception is not very critical for such non-uniformity.
For an average step-size of 1dB, uniformity errors of 0.3dB seem perfectly acceptable.
Note that the ear <i>is</i> sensitve for small differences in attenuation between a left and right audio channel.
Obviously, the two channels can easily be matched (for instance with 1% accuracy resistors),
irrespective of attenuator nonlinearity errors.
The obtained channel matching is far better then conventional analog 'sliding' potentiometers.
<p />
When using resistors from the <i>E12</i> or <i>E24</i> set of values, it requires some experimentation with this calculator
to find a <i>resistance</i> and <i>stage attenuation</i> pair that shows good uniformity.

<h2>Design examples</h2>
<p />
An example attenuator configuration as used in the
<a href="http://www.vaneijndhoven.net/jos/relaixed2/" target="_blank">relaixed2 design</a>: <input type="button" value="Show me" onclick="configRlx2()" />
<br/>
(except that the final two stages were configured somewhat differently.)
<p />
Or the constant-input-resistance attenuator from my new
<a href="http://www.vaneijndhoven.net/jos/relaixedpassive/" target="_blank">Relaixed passive attenuator</a>: 
<input type="button" value="Show me" onclick="configRlxPassive()" />
<p/>
Or from my <a href="http://www.vaneijndhoven.net/jos/switchr/design.html" target="_blank">
passive attenuator</a>, revision Mar'08: <input type="button" value="Show me" onclick="configAtt08()" />

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4201075-1']);
  _gaq.push(['_setDomainName', 'vaneijndhoven.net']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>

evo ti ceo kod stranice... ko je dokon treba u java kodu da prepravi da imaš 48 stages ;)

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Ima puno preduslova, a Zenu ne treba konstantna impedansa ulaza.

I za tu kompleksniju opciju je kalkulator mama, 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

a jok, zaebato :rofl: 

 

 

 

 

odavde, sve moze da se iskoristi, nista mozak, samo pamet : http://www.vaneijndhoven.net/jos/attenuator-calculator/index.html

 

OVO!!.png

 

 

 

caka je kako da se veze , odnosno treba citati nocom , dok misli blude nepovezane  :smesna:

 

pise lepo, uzmes constant input impedance, calc ti da sve ranges ..... - i Rin i Rout ....... e , caka je u Rout

napodesis da dobijes Rout kako tebi odgovara, ali moras da povezes da tebi odgovara

 

a tebi odgovara ovako:

 

PRINCIPLE.png

 

gotov poso

sd samo treba napraviti tabelu - LTSpice pomaze za racunanje , sta je to , svega 64 cases

onda to valja upisati u Excell i posortirati

nekako cu upisem , SP300B me nekad ucio kako se to radi , al nema sanse da se setim

ce njega smorim da mi sortira tabelu po otpornosti opadajuce

:Viannen_loungelizard:

 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Do sutra sam opravdano van kuće.

Imam izračunat R2R atenuator za 2*50kohm balansirani. Taman 100k nebalansiran!

Izračunao sam za korake 1.2.   1.3.  i 1.4dB. 

Potrebno je šest releja sa preklapajućim kontaktima za nebalansirano.

Ako se koristi običan rotirajući preklopnik imam nacrtanu i diodnu matricu za upravljanje relejima.

Ako sutra nije kasno i ako neko nema pametnije rešenje, voljan sam...

 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Hvala MIcane, odmaraj u ovu vrucinu  :cheers:

 

uradio sam vec pola, nacrtao u LTSpice vrednosti, kod generatora stavio label U/I , ja glumim releje i po 2^6 matrici idem i upisujem sta mi izbaci Spice

nisu vrednosti kriticne za izracunati, no moram da ih sparim sa matricnim slucajevima, to je 50% posla, tj podataka

 

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Postoje jako velike vrednosti koji same po sebi proizvode visok sum, plus sklonost da indukovane smetnje vrlo malih struja pretoce u primetan napon...

Ona inicijalna sema je meni najsimpa, svaki sledeci je manji od 100K, nema paralelisanja.

Ali je najbolja ona koja zavrsi posao.

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

ma jok, kako god okrenem  - sa ovim calculatorom, Rin const, Rout Const, kako god ih povezao , no way da dobijem dvokrajnik sa linearnim porastom/padom otpornosti 

 

ene , il cu nadjem 6bits calculator.... mada je to pre solver sto mi treba , il ce ne nadjem

rano sam se poradovao :rofl:

al, nema veze, bar sam bio happy ko malo majmunce bar 3 sata

Podeli ovu poruku


Link do poruke
Podeli na ovim sajtovima

Kreiraj nalog ili se prijavi da daš komentar

Potrebno je da budeš član DiyAudio.rs-a da bi ostavio komentar

Kreiraj nalog

Prijavite se za novi nalog na DiyAudio.rs zajednici. Jednostavno je!

Registruj novi nalog

Prijavi se

Već imaš nalog? Prijavi se ovde

Prijavi se odmah

  • Članovi koji sada čitaju   0 članova

    Nema registrovanih članova koji gledaju ovu stranicu

×
×
  • Kreiraj novo...