Digitally Controlled Variable Resistor
44RosinCore
Posts: 11
I need a circuit for a digitally controlled variable resistor to function as the frequency determining component in an astable 555 circuit. It is required to:
I could do it with a Binary Weighted Ladder, but I would have to calibrate the top end. Does anyone know of a way to do it with a R:2R ladder? Or is there an IC that I don't know about?
- vary from 1590K to 0K
- in 256 steps
- with a tolerance of +/- 2% or less
- be able to float in-circuit
I could do it with a Binary Weighted Ladder, but I would have to calibrate the top end. Does anyone know of a way to do it with a R:2R ladder? Or is there an IC that I don't know about?
Comments
Actually I got that wrong. The VR needs to vary from 2.5Meg to 0.
Another requirement is, the waveform needs to maintain a duty cycle of [very nearly] 50%, as the frequency is varied.
Here's the original circuit:
I need a direct replacement of the 2M5 VR with a digitally controlled equivalent. On that I can't budge
-Phil
Nope, because the idea is to digitally control an existing circuit (not all of which is divulged in the posted circuit diagram).
-Phil
Trust me, that's irrelevant as I need to apply the same technique [the one that I am optimistically anticipating ] to other parts of the full design that have nothing to do with frequency control. I'm hoping to find a way to implement a digitally controlled variable resistor that can work at the voltages prescribed (~18VDC), that can float in-circuit, has a range of 2M5 divided into 256 equal sized steps, has a fairly tight tolerance (>=2%), doesn't require a bunch of tweaking/trimming, and doesn't cost a bundle.
One of the reasons for this redesign is that every potentiometer in the value ranges that I need (2M5, 500K & 10K), that I know of (that isn't priced beyond reason) has a tolerence of 10% or above (typically 20%). Also, eventually, I want to be able to control it with a microprocessor. So, what I'm looking for is consistency and computer control.
OTOH, you could also make your own programmable resistor from an 8x analog switch (or eight MOSFETs) and eight binary-weighted 1% resistors. You would put the resistors in series and use the switches to short them selectively. Since the lowest value resistor is ~10K, the switch resistance would be insignificant.
Incidentally, you haven't stated whether, in general, the "resistor" has to pass current in both directions or just one. That could have a bearing on the final design.
-Phil
I get that, but in this case the application relies on the unique characteristics of the 7555 timer's output--just the right rise/fall time, and impedance. Also, the fact that it can function at the "high" voltage levels involved is a huge determining factor. Not to mention that I'm actually using a 7556 dual timer and doing a cascade sort of thing to distort the waveform with analog mixing between the two, etc. (with even more DCVRs involved), which would be difficult to reproduce any other way.
Yeah, I know--that's the very thing I'm trying to avoid--because, as the value of the resistors increases (up the exponential ladder) the precision also needs to increase. With 8 bits, wouldn't I need something like a .016% resistor* at the top of the ladder? To achieve that, I would need to either, some how, trim the resistors, or add trim pots that would have to be adjusted and which can go out of calibration with time, thermal stress, vibration, etc.
True, but I did imply it with the sample circuit--the 2M5 pot will need to handle small currents in both directions. Here's the sample circuit, again (which pretty much typifies all the cases):
BUT, I did find the AD5291 Digital Rheostat [DR] that can operate at voltages up to 33V, has 1% over all resistance tolerance with 256 steps. BUT it only comes in three values: 20K, 50K and 100K. I think I can get those to work for all the other DRs involved, so that still leaves the 2M5, which needs to be that high, because I need the dynamic frequency range with lack of duty cycle shift.
* If I did this correctly,
tolerance (t) of top most resistor (in %) = [(R/255)(P/100)/(128R/255)]*100
where R = total resistance and P = tolerance of the smallest resistor
This boils down to: t = P/128
For a smallest resistor tolerance of 2%, the resister at the 128 times position needs to be:
2/128 = 0.016%
Also, you are confusing absolute and relative errors. Percentage is a measure of relative error. Consider the case where you've got two resistors in-circuit: 1.28M and 10K (the top and bottom rungs). Let's say they're both high by 1%, so the top resistor is actually 1.2928M (an absolute error of 12.8K) and the bottom resistor is 10.1K (an absolute error of 0.1K). Summed in series, the net resistance is 1.3029M instead of the nominal 1.29M. And the relative error is (1.3029M - 1.29M) / 1.29M = .01, still only a 1% error.
-Phil
Yes, but .01 is 10K and 10K is a nearly 100% relative error in terms of the 10.1K value. In practical terms, a 1% error on the top resistor causes a non-linearity in the stepped resistance on the order of 1 LSB. So, what I'm trying to say (but faltering because I'm not a trained engineer and thus lack a full vocabulary) is, for there to be a maximum error in the linearity of 2%, the highest resistor needs to be within .016% relative error. Is there a better way of saying that? And, is my math incorrect?
So what about raising the cap value in order to use a commercially-available programmable pot?
-Phil
The problem with that is, in order to get the same immunity from duty cycle change across the frequency span, I would have to scale down the 47k5 resistor by a factor of 25 (2500K/100K) to 1.9K and that would raise the current load to around 5ma. This is a very unconventional circuit and the current levels are key to it's operation, so scaling probably would spoil the affect. Plus, it's battery operated, so it would severely reduce the operating time between charges. But, I'm considering giving it a try
Why not then simply use a 555 as an output buffer for a Propeller pin? From the looks of the Fairchild Semi datasheet I found, tying the control voltage (pin 5) to .3 volts should allow the 555 to level shift input on the trigger and threashold pins (pins 2 and 6) from a propeller. (loading pin 5 with the right size resistor should also work)
Otherwise I'd suggest taping a white LED to a CdS photo-resistor. With a sufficiently dark enclosure, the photo-resistor should be adjustable (via LED current) from 3.4Mohm to 910Kohm as shown in the schematic. This wouldn't be particularly accurate though, a feedback connection would need to be made back to the controlling processor to measure the actual frequency. (say a 1Mohm resistor from the 555's output [pin 3]) A photo-fet opto-isolator should be able to pull this trick too.
Lawson
http://www.datasheetcatalog.org/datasheet/fairchild/H11F3.pdf
Yes! That's exactly the kind of thing I was trying to get at. Use one of those with feedback from the 555 in a software-controlled PLL. Don't even think about the actual resistance values. The output frequency is all that matters.
-Phil
If you absolutely need to use a 555 (or similar flavor) ... then I'm with one of Phil's earlier posts. You can still directly control the 555 from the Propeller digitally! ... Pins 2 and 6 on the 555 are already tied, and if driven externally from a Propeller, then Pin 3 of the 555 shows an inverted state. BTW) Pins 2 and 6 of the 555 are inputs. If you need the voltage swing that the 555 offers, then a simple NPN transistor with a pull-up resistor to the 555's pins 2 and 6 would work AND correct the inversion that takes place.
Also to cope with higher voltages, you can also use the 555 at your lower voltage and configure it as a level shifter. Use pin 7 as an open collector output with a pull-up resistor to your higher voltage supply. Still as mentioned above pins 2 and 6 would be your input.
That's an awfully large range of adjustment though. Can you change the value of the capacitor so the potentiometer doesn't have to be so big?
Another idea is to use a servo or stepper controlling a physical potentiometer. Then you can choose whatever value pot you want!
Holy shift register, why didn't I think of that! That will work for the frequency control part of it. And it looks like I can use the AD5292s for the rest of it!
Thanks for all the help, everybody!
Interesting idea. I studied the data sheet and it appears that these are only resistive for small signal applications. Anything beyond around a tenth of a volt puts it into constant current mode (thus it's no longer behaving like a resistor). Also, I see no guarantee of consistency of voltage:resistance between devices. The whole reason for this redesign (i.e. going from 20% physical rheostats to, hopefully, 2% or less DRs, is for the adjustments to be consistent for each device I make (and to make MCU control possible).
Am I wrong?
-Phil
Yes, but how can feedback be applied to the frequency determining resistor in a 555 circuit (the resistor between the Discharge pin and the Threshold/Trigger pins)?
-Phil