EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Eggord on February 25, 2021, 10:32:01 am
-
Dear All,
that's my first post here. I'm usually a software and optical guy (lasers, microscope etc.) but also enjoy a little bit of hardware stuff in my live (Btw: I love the youtube channel ;) )
Why i'm doing this:
I recently faced the problem that i have to alter an analog signal coming from an DAQ board depending on different triggers. By alter i mean i want to set the signal to GND for a certain amount of time. Because it is not possible to change the signal in software i thought i can do it with some simple TTL/CMOS chips. You are asking why it is not possible in software: The onboard memory of these DAQ boards are usually 2048 values. But i want to change specific values in an array of 24millions points (with some kind of pattern-so not completely arbitrary). Because timing is critical i cannot relay on windows to calculate the correct values on time and push them to the onboard memory.
My hardware solution consists of a counter, logic gate, "one-shot" () and a analog switch. There are some triggers coming in and are processed until the one-shot produces some pulses exactly when i want to set the signal to GND. That works actually pretty fine and i can fine tune the pulses in a range of 10ns (or smaller) without problem. I use the inverted output of the one-shot.
The problem itself:
So without any trigger/pulse the analog switch com is high and closes the switch, so that the signal goes through. If the one-shot sends a pulse to the switch opens. The output of the switch has a pulldown 1k resistor to GND, so that if the switch is open the signal goes to GND.
If i know look at output signal i see some kind of capacitor discharging signal instead of a nice edge (see attached photo; blue the output, yellow the input). But i want a a sharp edge. If i reduce the resister to 300 it gets better (see attached photo; blue the output, yellow the input) but then internal resistance of the switch plays a bigger role (voltage divider, so the output is reduced) plus i get some kind of feedback on the input signal. Both effects with lower resistors are well known. I just want to show that just going to smaller resistor is not an option. I'm not quite sure if this is just the "off capacity of the analog switch" or some other effects. There is no other capacitor connected to the switch. In fact the only capacitors is one for the one-shot, one 100nF between Vcc & GND on the other 3 ICs and one 100nF on the incoming Vcc-GND.
I'm curious if i can improve the signaling coming from the switch or maybe somebody know a better analog switch?
Thanks!
Best regards,
Jan
-
Use a SPDT analog switch (e.g. something similar to one unit of a '4053 https://assets.nexperia.cn/documents/data-sheet/HEF4053B.pdf). It'll open the signal path and connect the output to GND so you won't need the pull-down.
-
How big is your incomming signal from the DAC? Can the DAC drive a 1K load easily?
It looks like your DAC is seeing a changing load from which it has to recover. What is the load you are driving via the swtich?
Do you need a pull down- as suggested a spdt may be the answer?
The switch Ron is about 100R only an order of magniture lower than your 1K. The MAX323 is not really suitable for use as a high frequency high speed swtich.
It swiching times are in the 1us range. You may need controlled impedances at this frequqncy see MAX4221 for example.
Draw a labelled schematic, it so much easier to spot the problem. Name that DAC and will have a look.
-
You need to pull the switched signal to ground when and only when the switch is open, so you don't load the DAC such that it has to recover at the end of the control pulse, and so switch on resistance does not significantly influence the steady state signal level. There are plenty of ways of doing this, depending on the signal level, including Capt Bullshot's suggestion of using a SPDT swoitch IC, but as you have already qualified MAX32x series switches as having an appropriate voltage range, switching speed and on resistance for the application, one of the easiest for a single signal would be to replace the MAX323 with a MAX326, control inputs connected together to your existing control signal, and COMs connected together so it operates as a SPDT switch. Connect the signal source to NO1, ground NC2 and take the output from the joined COM1 & COM2. If you are switching two signals it may be easier to add a MAX324 to do the grounding switch, though at that point, personally I'd start trawling through distributor parametric searches to try to find a single chip multi-channel SPDT switch IC suitable for the application, and if it turns out you are stuck with MAX32x series, use two MAX325 to simplify the BOM and PCB layout.
N.B. If the existing circuit significantly loads the DAC output, you may need an extra switch to connect a dummy load resistor to the DAC when the signal switch opens to reduce the disturbance to a momentary glitch rather than an exponential RC recovery curve.
-
Thank you all for the quick reply!
I will try to go through each reply point by point:
@capt bullshot: As you properly guessed, i'm not familiar with SPDT switches. I will have a look at them if i can find a suitable one.
@Terry Bites: To your questions: the max incoming signal is ca 4V. I actually don't really know if the DAC can drive 1k load. The DAQ board is a NI PCIe-6321 (https://www.ni.com/pdf/manuals/374461c.pdf (https://www.ni.com/pdf/manuals/374461c.pdf)). The signal goes to a driver of a motor. I don't think it really "drives" a real load. No i don't really need a pull down. It was a workaround. because without the signal doesn't go down. I actually think the MAX323 can handle this frequency. I don't see anything against this in the datasheet (especially the 1us mentioned by you). But maybe i'm reading the datasheet wrong. I would be happy of you can point out how you see that it is not designed for these frequencies. I would need a PDIP IC so the MAX4221 is not suitable. I will draw a schematic later and post it her! I hope i answered everything.
In general i'm not glued to the Max32x series. The MAX323 had reasonable price, fast enough switching time(max 100ns), the voltage range was ok (single 5.5V supply) and was available in PDIP.
@Ian.M: So your saying, that the discharging is from the DAC? interesting i thought is is from the switch. I like the idea of a second switch to create a SPDT. I can actually use the second one on the MAX323, right?
If someone knows a "fast" PDIP SPDT switch. (with a reasonable price ;) ), let me know. Thanks!
-
You *COULD* use the second switch in the MAX323, but you'd need to invert its control input, and to avoid output glitches at one of the transitions caused by the switches momentarily both being on, equalize the propagation delays of the logic producing the inverted and non-inverted control signals from your single low-going pulse. Therefore I recommended the MAX325, as according to its datasheet (https://datasheets.maximintegrated.com/en/ds/MAX323-MAX325.pdf), its got a guaranteed min. 2ns break-before-make delay between its two switches if both are driven from the same control signal.
However for a proof-of-concept you can get up and running today, patch in a pair of XOR gates, one to invert with its second input tied high, the other as a buffer with its second input tied low to get complimentary control signals with somewhat balanced delays, and hook up the extra channel of your MAX323 in place of the 1K resistor.
I don't know if the DAC output is load sensitive to a degree that matters. If its properly buffered and you don't overload it, probably not. However you need to do the math (and if its close, the testing) to prove it isn't! According to its specs of 0.2 ohm output impedance and +/-5 mA output current capability that would be 1 mV error due to loading at full rated load current.
-
Yes i see your points. The invert is not a problem because i have the inverted output from the one-shot but the glitches might be problematic. But for a proof of concept this should be fine. I maybe go for the MAX4544CPA+. It's cheaper then the MAX325 and it is already a SPDT.
Thank you all very much!
Just because you mentioned the DAC output: I don't know if it is buffered but what can/should i drive with an DAC? I have another small project where i want put a "modular" voltage divider in the DAC output(same DAQ card). Funny: The modular part is switched again with the MAX323 (but not really time critical) :)
But is this a good idea to connect it straight to the DAC output? Some resistors will stay in the signal line even when the voltage divider is on "pass through". Or should i use a Op-amp as a voltage-follower before the divider?(Maybe also in this project?)
All the best,
Jan
-
"What can/should i drive with an DAC?"
Assuming a voltage output DAC, any load that doesn't draw excessive current from it and where you can either compensate for the voltage drop caused by the load current through the DAC's output impedance, or where the load impedance is enough orders of magnitude greater than the DAC output impedance for the error to be insignificant.
"Should i use a Op-amp as a voltage-follower before the divider?"
It depends on the DAC output impedance. The DAC on your card is buffered with an output impedance of only 0.5 ohms, so you don't need a buffer before the divider, especially if it presents a constant load to the DAC output. OTOH a buffer after the divider would let you use higher value resistors in the divider reducing the loading on the DAC, and also reducing the effect of the analog switches' on resistance. It is however a tradeoff as the more you need of: accurate unity (or other fixed) gain, low offset voltage, bandwidth, output range and high slew rate, the more difficult and expensive the buffer gets to implement.
-
So while a waiting for the SPDT switch (mousers delivery is delayed.....) i tried to just use the other output of the one shot to trigger the second switch on the MAX323. I know that is not ideal but i wanted to try it. The edges looks sharp but i get a swinging response on the output as well as on the input of the switch.(attached pictures: 1: blue=output yellow=input 2:yellow= most likely output blue=not sure what i probed there but shouldn't be input). As you can see the pictures where done a couple of days ago but i couldn't find time to post here (a pipe broke in our apartment :palm: |O )
I guess the swinging is an effect of the not perfect use of the switch?
I attached the schematic of what i want to do (Not included are the decoupling caps). In Short: Based on two trigger signals i want to blank (set it to GND) a signal for a variable amount of time (with resolution in the 10s of ns). Analog signal (also triggers but then from the DIO instead the AO) is from a NI PCIe6321. Output signal goes to a kind of driver. I guess it has a pretty high input impedance
If anybody has an idea for improvement or general a better idea. Let me know.
@Ian.M: Thank you very much for the explanation. Honestly i didn't understand everything. Could you point me maybe to some resources? i don't want to waste your time and ask questions over and over again (and some might sound stupid) THANKS!