📜 ⬆️ ⬇️

On the issue of restrictions

Your false happiness is a dynamic process. He is unsatisfied in principle. First of all, we are talking about genuine, fundamental happiness. Its conditions are determined by a single word.
- Which one?
He waited - and waited.
- Restriction ..

The topic of this post was prompted to me by young colleagues who came up with a question about the linearity of the scheme, which we will further consider. When I answered their question and explained that the zero rule of the engineer had once again proved to be infallible and “There are no miracles in the world”, the next question, how to do it right, I suddenly had difficulty with the answer. After some reflection, I came to the conclusions that I am going to share. But let's order.

The research topic will be a simple resistive voltage divider, which in this particular case is intended to change the voltage range in front of an analog-to-digital converter (scaling).

So what problems can be associated with such a simple device?

For a start, a little simple theory. We formulate the problem - there is a voltage that needs to be measured and it changes from Umin to Umax. There is a microcontroller with built-in ADC (it could be an external device, it does not matter for the case, but the severity of the wording is preferable), which is able to accept the signal from U1min to U1max. It is necessary to ensure the transformation of the input voltage U into the voltage at the input of the ADC U1, which can be implemented with a simple mathematical formula:
U1 = (U - Umin) * (U1max - U1min) / (Umax - Umin) + U1min

There is a more beautiful equivalent formula U = U1min * (Umax - U) / (Umax-Umin) + U1max * (U-Umin) / (Umax-Umin), but here we are not talking about beauty, but about physical realizability, but with it is not too good for the Lagrange polynomial.
')
The question of determining the values ​​included in this formula immediately arises - if for the maximum input we can get data from the TK (I hope you have it), then for the minimum it is not so simple and there is room for imagination - should we measure negative values ​​and etc. Of course, it is possible by directive to set the minimum voltage to zero, but in this case we can lose significantly in accuracy, if in fact the input voltages of interest are in the range, for example, 20-50V. And for the input signal of the ADC, there is also uncertainty - I know how the rail-to-rail amplifiers are implemented (recently, quite unexpectedly, I found a similar device in the Microchip line, I really didn’t think they were doing this) and I’m not sure that standard MK done exactly what is needed - but here we can (and should) believe the documentation until we see the opposite. And if the documentation indicates a lower measured value of 0V, then the upper one will usually be Ucc-0.5V or so and in any case the measured voltage at the input should not exceed the voltage of the ADC support, if Vref is taken as the latter, then it is usually 1.2-2.5V and always below the supply voltage (pay special attention to the variation of this parameter in the documentation for the MC, it is very significant, but more on that later).

Let us return to our formula and if all of us (of course, after analyzing the problem) assume that Umin = U1min = 0, then the expression will get the form U1 = U * U1max / Umax, and under the condition k = U1max / Umax <= 1 this transformation can be performed on a simple resistive divider, for which we will need resistors with a ratio of nominal R / r = 1 / k - 1, from where the restriction to k <= 1 is immediately obvious, since in our universe the negative ratio of nominal resistors can hardly be realized ( of course, if we are talking about a passive scheme).



It seems that everything is clear and understandable, but a new restriction comes into play - you cannot just take and get in the general case the necessary ratio of resistors. The fact is that fixed resistors are produced well-defined nominal values ​​from the standard series and this means that neighboring resistors, for example in the E24 series, differ by a factor of 1.1 (in fact, at 1.10068, but we don’t need this accuracy, because otherwise we have dealing with precision measurements and fasting is not about them at all - everything is very, very not easy), and this means that any possible ratio of resistor values ​​will be a power of this number and intermediate values ​​are impossible in principle. For example, if we need to attenuate the input signal 5 times and the corresponding desired ratio of resistors 4, then we can get either 3.83 or 4.21 using the E24 series. Which of these values ​​should be preferred - depends on the situation and inner conviction - if you agree to lose a little (10%) in the value of the low-order category over the whole range, then choose a lower value, if you consider an acceptable 10% error in the upper part of the range, something more. My personal opinion in the general case is undoubtedly a lower value, since in this case the error is predictable, monotonous and compensable, but you decide.

That's when making a decision we should not forget about another factor - in the ideal world, resistors have exactly the value indicated on the package, but in real there is still a deviation, and it is 5% or 2.5% or 1% (or 0.1% , if you are rich Pinocchio) for each of the two resistors.

Fortunately, our calculation formula is successful from the point of view of accuracy and we should not multiply the error of the resistor by 2, however, it cannot decrease, therefore 5% for conventional resistors "take out and posit". And taking into account the initial deviation of the ratio of nominal values ​​from the desired result, the result may deviate from the required by as much as 10%. Therefore, in this particular case, with the required ratio 4, we have to choose the ratio 3.83 and make sure that 3.83 * 1.05 = 4.012 is within the boundaries of the required value 4 (as we agreed, we neglect less than one percent error, since the measurements are not precise) all input voltage range is guaranteed.

At the same time, we must clearly understand that the possible deviation of the transfer coefficient from the adopted to the implementation can be - + 5% for a given resistor accuracy. If we are not satisfied with this result, then we should either use more accurate resistors, or build a more accurate composite resistor from less accurate ones (I had a post about that) or use a trimming resistor.

What I mean when I talk about the trimmer, and not about the variable resistor, although these are subtleties of terminology - the fact that fixed resistors have to perform the main work on the formation of the transfer coefficient, and the variable resistor can only change it, and not too much ( those are the maximum 10%). Why we should do just that, although we could confine ourselves only to a variable resistor of the appropriate value - there are many reasons for this, I will give only a few.

1. Initial values ​​- immediately after the correct assembly, this part of the circuit will start to work with acceptable parameters, and is guaranteed not to put a signal on the stops and not to overload the source, no matter how the engine in a variable resistor would stand.

2. Easy to understand - just look at the scheme to understand the transfer coefficient of the nominal values ​​(taking into account the comments on the nominal values ​​below), otherwise you will have to separately indicate the required parameter in the form of text (although I still recommend doing it anyway, the information is superfluous can not be).

3. The ease of adjustment both after assembly and after replacing the key elements of the measuring unit (for example, MK, or external support), since the values ​​of the reference voltage, if you have not applied high-precision components, will float from instance to instance very significantly.

And finally, I highly recommend multi-turn resistors because of their adjustment accuracy and insensitivity to mechanical and climatic influences (those who repaired black-and-white TVs realized that the rest just believe - it was just a plague, not variable resistors, and their resistance could change from a sidelong glance), the more they are quite accessible and not too expensive (although, of course, more expensive than permanent ones).

Now about nominal values ​​- one more consideration should not be overlooked - the same ratio of nominal values ​​of resistors (and, accordingly, the transfer coefficient) can be obtained with different nominal values ​​and different (but coordinated) multipliers, so which ones should be chosen?
First of all, it should be noted that the input resistance of the divider circuit will be at best R + r, and at worst R, and we should strive to increase this value. Therefore, the multiplier should be as large as possible, even if we have a low-impedance signal source, we do not need to carry extra current from it. On the other hand, the larger the resistor, the worse things are with noise, so you should think carefully before leaving tens of mega. In addition, you should consider the limitations of the input circuit of the ADC, it usually imposes requirements on the maximum allowable output impedance of the signal source, due to the need to recharge the input capacitance. And finally, for very large nominal values, it is necessary to calculate and take into account the voltage drop at the input resistor from the leakage currents of the MK inputs, and they are not at all zero. Therefore, it seems to me an acceptable factor of hundreds of kilos or meters, although the truth is always concrete and you may succeed in a different way.

Now about the nominal values ​​- I strongly recommend taking the smaller resistor with a nominal 1 factor (10 kΩ, 100 kΩ, 1 MΩ), because then, just by looking at the circuit, you can immediately calculate the division factor in your mind. For the case under consideration, 380 and 100 kilos can be offered, or 3.8 and 1 meter. Since we take the disadvantage, the variable should be added to a larger resistor, its value should not be less than 10% of the nominal DC resistor, otherwise we will lose (in the limiting case) in the range, the limit from above is due to practical considerations, we do not want to catch 24 kilo on a 10 meter resistor, even if it is multiturn. And one more thing - we separate the variable from the measurement point by the input resistor, otherwise we can get the effect of the tuner capacity on the results, which we don’t need at all, these and many other subtleties can and should be read in Robert Pice’s magnificent book “Fault detection in analog circuits "(" Goodbye, Sweet Prince ").

Now about another important component of the input divider - the capacitor (I hope you have not forgotten about it). Despite its obvious usefulness, not all schemes have this element present, which is very sad. The fact is that the scheme without it is simply wrong, since it is impossible to use an ADC without an input filter (low-frequency if you are working in the first Nyquist zone or a bandpass for all other cases), because the result becomes unpredictable. Of course, you can put different types of digital filters after the ADC, but if there is interference in the mirror channel in your circuit, then you cannot (from the word at all) get rid of it by post-processing. Well, the presence of a capacitor in the input divider does not exactly require you to allocate additional MK resources for signal processing.

Of course, you are not going to work outside the first Nyquist zone, otherwise you would not read such simple posts, so we will install a low-pass filter, and this is easily achieved by switching the capacitor in parallel with the smaller resistor. Since the capacitor is absolutely necessary (if I did not convince you, then "you just believe, and then you will understand"), it remains only to resolve the issue with its face value. Everything is obvious here - it should be increased as long as it is possible, but no more than that - by the way, a pretty universal rule, it’s a pity that I didn’t invent it.

Translated into engineering, this phrase means that our input divider should significantly attenuate out-of-band signals, but should not introduce significant distortions on the fundamental harmonic of the measured signal. You did not think about this parameter and do not really understand what it is about - you are not alone in your delusions and this is sad. Most (the stress in this word each puts itself, based on the level of misanthropy, I am inclined to the letter "o", although the letter "a" is also not happy) some young engineers at best believe that this is half the time sampling rate, the rest do not believe anything at all. But this is a key parameter in the development of the measurement system, and we had to make a start from it. So, the cutoff frequency of our input filter should be several times (at least 2 but better 10 times) higher than the above main harmonic, and for signals of complex shape even more.

Considering that the cut-off frequency is expressed as fs = 1 / (2 * Pi * r * C)> = 10 * fo, from here we get the value of the capacitor C <= 1 / (2 * Pi * r * (2..10) * fo ) - another argument in favor of increasing the multiplier of resistors, we get the same cutoff frequency with a smaller capacitor, but also a reminder that if the resistor is too large, we get a low cutoff frequency and, accordingly, the distortion of the main harmonic even on parasitic capacitances. Pay attention to the size of the letter denoting the resistance of the resistor - this is exactly the value of the smaller resistor, and not the input one, which follows from simple calculations that, unfortunately, did not fit in the margins of my tablet. In fact, there should be a resistance of r * R / (r + R) resistors connected in parallel, but to simplify we leave only the smaller one, especially since the picture does not fundamentally change from this - we are very far from the resistance of a large resistor and even further.

This should not be forgotten, especially when your divider is relevant in the tens, for example, when measuring the mains voltage, otherwise you will have unpleasant surprises.
Well, at the end of the topic, we calculate the value of the capacitor with a divider 380 per 100 kilos and a sound frequency range (3300 Hz) C = 1 / (2 * 3.14 * 100e3 * 2 * 3.3e3) = 10 / (2 * 3.14 * 2 * 3.3) e-9F = 240 pF and estimate the frequency range with a parasitic capacitance of 3 pF - for a sinusoidal signal, it will be 150 kHz (in fact, much less and that is why).

Let us ask ourselves the question - what will be the transmission coefficient at a frequency that is 2 times lower than the cut-off frequency ... somewhat unexpected 0.89, that is, a decrease of 10%, which should not be neglected. But for a frequency 10 times less than the cut-off frequency, everything is much better - 0.995, that is, the transfer is very close to ideal - that’s why we have 10 times the cut-off frequency. All this is true only for the filter of the first order, but we are not considering anything more complicated yet.

We ended up with resistors and a capacitor (the latter maybe not one, but we’ll leave the frequency response compensation schemes for another post, although the topic is extremely interesting and I do it with a slight regret) and consider the last component of the circuit that is discussed in this post, namely the zener diode, since everything we considered earlier could not lead to non-linearity of the amplitude characteristic of the direct current (and, strictly speaking, also with respect to the alternating current). Obviously, it was he who was the cause of the problem that we were discussing, since all other possibilities were already excluded. First of all, for what the Zener diode appeared on the circuit - its task is not to allow the ADC input stage to be overloaded when a voltage higher than the maximum expected values ​​appears at the input, that is, this element together with the input resistor creates a series voltage limiter.

Of course, in this case (when an overvoltage occurs), there can be no talk of linearity, and it is not required, since we are out of the working area, but non-linearity also took place at voltage values ​​within the expected values. At first I didn’t quite understand the question and explained that it was necessary to provide a guaranteed stabilization current in order to get a guaranteed voltage value, but then I got to the bottom line. The fact is that the idea of ​​an ideal Zener diode, whose CVC is shown in the figure, can in no way be transferred to the real world, where the Zener diode does not work quite (not at all) like it does on this graph. And how exactly it works is described (must be described) in the documentation.

Let us turn to this source of information for a 3v3 device (a specific BZX84 device, but not better with others) and what we will see there is first of all a stabilization voltage at a strictly defined current through the device, and in normal documentation we should see the minimum and maximum value ( we can still see the typical one, but, frankly, I don’t really understand why I might need it), if we see the maximum and typical or minimal and typical, and even less typical, then for the Zener diode this is clearly not enough and we will take Dena consider the documentation is not normal. I don’t dare to advise what to do in this case, the only right decision is not to work more with the products of this manufacturer, but in life there is always a place for exploits, so it’s up to you.



In this case, we are dealing with normal documentation and we are given both necessary (in fact, three, but the third we do not need) values, and for different types of devices from the point of view of accuracy, and we can plot them on the IVC graph - points 1 and 2. Immediately, we note that these values ​​do not contain any information on the behavior of the device at a current other than the specified one, and should not enter on the shaky ground of conjectures and assumptions. You can, of course, look at the graph of a typical IVC, but, as I said above, consider typical values ​​(and graphs as well) - “this is about nothing”. Therefore, let us pay attention to another parameter — the current through the device at a voltage of 1 volt, for which the maximum current value is set, and this is quite enough to plot point 3 on the graph and postpone the segment of possible current values ​​from it down. In this case, we must decide on the lower boundary of this segment, since we have not set the minimum current. A good value would be zero, as in the framework of passive devices, a negative current with a positive voltage appears to be nonsense and a similar solution looks natural. These considerations are purely theoretical in nature, since in our case and at our scale we see only a point on the graph. Now we can build a whole family of possible characteristics (green lines) passing through the marked points, and only a few of them will be linear and there is no reason to prefer one of them to the other. The only thing that we should avoid in our assumptions is negative resistances, since their physical nature is somewhat mysterious (at least for me, you may have a different opinion).

, — 1 , . , ( ) , , . ( , - ), , ( , 1-2-2'-3-3), , , . , , , 1 ( , ), , , ( ) . , , , . , — .

— , (« »), , , 1 . — , 10 . — , , , , , . , , (« , »), , .

— , , , ( ) , . , , ( , - , ), , :

1) - ( , ),
2) ( , .., ...),
3) ( Vcc+0.7, , ),
4) 5 , ( ), . , , , . — , . , , -, , (, ), , .

The second solution is to make the influence of the Zener diode unimportant, for which the resistor should be reduced so that the shunting effect of the Zener diode is not noticeable. Given that the dynamic resistance of the Zener diode at 1V is 600 ohms, and near the stabilization voltage of 80 ohms, you will have to choose the resistance of a smaller resistor to ohms, which seems to be somewhat impractical.

— ( ), ( ) . , 0.7 (, ) . , ( , , ), , .

, , — 431 ( , , — 0.2% 50 1% — ) , , , ( , , ).

, , — ( , , ), , 1 2.5 . , , , , , 1 2.5. , , 4, . , , , , , — , ( ) .

, , ( ) . , ( ) 133, ( ), 307, , , . , (, , 307 ) , . , , , .

( , ) , , . , , , — , — «» . , , .

( - ), . , , , , 0.7 . , , .

— , ( , ) , , ( ) . , , , , , .



— Rv. , Rv <= ( Uv — Uf) / If = (36-3.3)/5-3 = 6.5 (, ) , . — , , , , , ( ). , , , . , , « — », - , , , .



Now we will do it - watch your hands.

, 0-3-3'-2. , , . 1 , , , . 3, , , , . 3' ( , , , ) ( ). , , 3-3' , , — . , ( ) ( ) , ( ). k1 = Rv / (Rv + R1) >= r / (r + R), R1 <= Rv * r / R, 600 * 11 = 6.6, .



— , , , , . , ( , , ), . , ( ) , , , ? , , , . , , , , , (« , »).



, « » 431, . — , , . — ( ) , , , . .

Those who have already read my posts will not be surprised, but for my beginning readers I will immediately say that the “weeping of Yaroslavna” will begin now. Yes, I like to speculate on the degree of greenness of grass, but you first read my opinion, then look at the sources, then make your own, and only then condemn (or join).

So, we start the discussion documentation on 431.

, , ( ) . 20 , ( - ON, Motorola, NSC, TI — , , , ) , ( , ). :

— ( , , 10 , , ), ( , , );
— ( , , , , , );
— ( , 40 , );
— - 10 , — ( );
— , 0.4 1 ( , , 10 ) — « , ».

— , , , , , , , , , . , — 19, 1 10 , . .

Indicate the stabilization voltage, or differential resistance, or the deviation of any of these parameters from the nominal value in the range of the collector currents, starting with the minimum stabilization current, and I will be completely satisfied. But this is not done - from the word at all.

( «», , ), , 1 . , -, , , -, ( ) . , , , — . ( , , – ), , , (, ) , .

, 1 , , , , , , .
, , 431 .

, « , », , , , , « , ».

Source: https://habr.com/ru/post/328084/


All Articles