Digital-to-Analog Converter (DAC) Not Working - Page 1
Forum section: electronics / repair

author: Shaydzmi
author_rank: Regular Contributor
timestamp: March 26, 2024, 11:53:43 am
content: Hi everyone,I'm having trouble with a circuit that's no longer functioning. To fix it, I need to understand how it works, but I'm stuck.From what I can gather, it seems to be a digital-to-analog converter (DAC) that uses a summing current method. I've been trying my best to understand its operation, but I'm just not getting it.Here's what I think it does: it takes a digital signal from the (74HC574N) chip, converts it to current, and then uses optocouplers and PNP transistors with resistors to control the amount of current. Finally, the OP07CP op-amp converts this current back into an analog voltage that gets sent to the VFD's analog input.I've tried to draw a schematic of the circuit based on my understanding (attached below).The problem I'm facing is that the output voltage is always around 11v, regardless of the digital input value. This makes me think there might be an issue with the circuit itself.I've already tried troubleshooting by replacing the OP07CP op-amp and the 2N5401 transistor with new ones, but unfortunately, the issue persists.I would be incredibly grateful if anyone could help me understand how this circuit works, or point out any mistakes in my schematic, especially anything that could explain the constant 11v output. Any insights would be greatly appreciated!Thanks in advance,Shaydzmi

author: m k
author_rank: Super Contributor
timestamp: April 05, 2024, 12:48:46 pm
content: Have you measured activities around optos?

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 05, 2024, 01:59:08 pm
content: Yes, they are on and off according to the binary output of the 74HC574N, I'm also sure of the functionality of the PNP transistors.

author: CaptDon
author_rank: Super Contributor
timestamp: April 05, 2024, 02:15:04 pm
content: What load is connected to the output terminals. The feedback loop won't work correctly if the transistor doen't have some sort of path to the collector. The whole output circuit is suspicious. Are you sure you have drawn the opamp and its connections properly? Also you don't show any node connected to the cathode ends of the opto's although you did say the opto's appear to be working.

author: CaptDon
author_rank: Super Contributor
timestamp: April 05, 2024, 02:22:12 pm
content: I can see the opamp output through the B-E transistor junction back to the inverting opamp input forming a unity gain feedback loop with a one diode drop offset but it seems any current coming to the emitter from the collector is really going to mess with the R2R ladder operation. That really is a strange output circuit.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 05, 2024, 02:27:35 pm
content: QuoteIt should be connected to the analog input of a VFD.QuoteI attempted to comprehend it, but was unsuccessful.QuoteI tried my best!QuoteI am quite confident that there are no issues concerning Optos and their associated transistors.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 05, 2024, 02:30:13 pm
content: Quote from: CaptDon on April 05, 2024, 02:22:12 pmI believe it is not an R-2R ladder.

author: CaptDon
author_rank: Super Contributor
timestamp: April 05, 2024, 03:48:28 pm
content: Look at the resistor values, 250, 500, 1K, 2K, 4K, 8K That is the very definition of an R2R ladder 8K being the least significant bit. I do agree the feedback circuit wrapped around the opamp is a bit strange. My best guess is that the R2R ladder voltage controls a variable collector current and uses the unity voltage gain coupled with significant current gain of the opamp / transistor to form a current control output. So it would sink a varying amount of current from the +d.c. supply rail through the external connection.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 05, 2024, 03:54:49 pm
content: I'm still not convinced that we have here an R2R ladder, I'm a beginner though!https://en.m.wikipedia.org/wiki/Resistor_ladder

author: m k
author_rank: Super Contributor
timestamp: April 06, 2024, 10:31:17 am
content: Check that the trimmer is actually trimming.Your 0 level is 510 ohms away from +V and 1 is 510 || 8k ohms.The trimmer is adjusting when that change happens and so flips the opamp.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 06, 2024, 11:38:00 am
content: QuoteI've tested it by rotating fully to the right and left, observing voltage fluctuations from 9.30V to 11.60V.

author: m k
author_rank: Super Contributor
timestamp: April 06, 2024, 01:57:09 pm
content: At some point when trimming the trimmer opamp pin 6 should start pulling down.Transistor's collector is floating when pin 6 is high.Connect few kilo ohms between output connectors and short opto pin 4 of 8k to GND.That will ensure your live situation and you can do standalone testing.When you short other equal opto pins to GND you can finally test all levels.But only zero level is adjusted.

author: CaptDon
author_rank: Super Contributor
timestamp: April 06, 2024, 02:16:14 pm
content: Can you show a schematic of what the circuit is driving? That circuit looks like it could be supplying a variable current output or working as a variable current sink down from the fixed +V rail. Depending on the load being driven you could see variable current with very little change in voltage across the output of the circuit in your supplied drawing. As an example, if the positive rail (The +12 of the floating supply) was connected to the emitter of a PNP transistor and you other output terminal in your drawing was connected to the base then the circuit you have shown could place a variable current of perhaps .1ma up to maybe 10ma and you would see very little voltage change across your output terminals. Perhaps .62v up to perhaps .7v when measured across the terminals. What is the real problem you are troubleshooting? Variable speed that doesn't vary? Variable brightness that doesn't vary? Perhaps the problem has nothing to do with this circuit you have shown since the two most important solid state devices have already been replaced and you have stated the optos are responding properly. You have replaced suspect parts with no improvement. Can you verify if the parts you took out are bad? They are probably good and your problem is elsewhere. If you don't believe the circuit is a true R2R ladder, then at least understand it functions like one. Each opto has twice the effect of the preceding one and half the effect of the next one in line and that is plainly obvious from the resistor values. The output of the circuit you have shown should produce 256 binary current steps, and perhaps not 256 binary voltage steps. We need more info.

author: r6502
author_rank: Regular Contributor
timestamp: April 06, 2024, 05:02:24 pm
content: Hi Shaydzmi,the schematic shows a constant current source. connect a resistor between the outputs, like shown below.test with a resistor of 100Ohm, and change the settings.Strange for me is R8 that seems to be really low? Would have expected to have it in the range of 8k. if you switch on Q2, the resistors R8 and R12 are more or less parallel, and the current throuh the output will de doubled and so on.I just saw, that som of the base resistors are 10k and there is also 1k (R23) shown is this correct?BR GuidoEdit: spelling and link for photo, remark according base resistors

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 07, 2024, 02:20:52 pm
content: Quote from: m k on April 06, 2024, 01:57:09 pmUsing 10K and 2.7K resistors, the output still fluctuates by a few millivolts, even when inputting bits from 00000 to 11111.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 07, 2024, 02:38:08 pm
content: Quote from: CaptDon on April 06, 2024, 02:16:14 pmIt's a standard analog input for a VFD, which in my case, has a 20KOhm impedance.QuoteI've measured the current with the load, and it's nearly constant.QuoteThe output is supposed to range from 0 to 10 volts; previously, this was the case, but now it's consistently around 11 volts.QuoteYes.QuoteYes, I believe they are good, but I cannot say for certain.QuoteNo, only 64 steps.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 07, 2024, 02:43:24 pm
content: Quote from: r6502 on April 06, 2024, 05:02:24 pmHi r6502,I tested with 2.7k, no results.QuoteNo, it's my mistake, they are all 10k.

author: m k
author_rank: Super Contributor
timestamp: April 07, 2024, 03:51:53 pm
content: Can you change opamp pin 6 level by adjusting the trimmer?With 2.7k and zero input bits you should have a voltage divider of 510 and 2k7, and some over the transistor.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 07, 2024, 03:52:55 pm
content: Quote from: Shaydzmi on April 05, 2024, 03:54:49 pmfrom minutes of understanding your circuit. it is R2R ladder, except active one. the resistor to ground in wiki is replaced with Q3 and anything between M01. Q3 will change resistance based on U4 output p6. if U4p6 goes low, it means to fully close (short low resistance) Q3 to make U4p2 low as well, if U4p6 goes high means it want p2 to be high... your condition p6 HI suggests p2 is too low wrt p3, they are probably out of balance, p2 cant reach p3's voltage level. i suggest probing U4's p2, p3, p6 whats going on while trimming R9. you probably need to change resistance values here and there to reach the balance, please note Q3 will always active (not infinite resistance) since OP07 is not rail to rail opamp so it's output cant reach exactly 12V. ymmv.

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 08, 2024, 10:21:28 am
content: Quote from: m k on April 07, 2024, 03:51:53 pmAdjusting the trimmer, U4 pin 6 goes from 8.00v to 13.43v, regardless of the bits input. I'm measuring pin6 with respect to Gnd (M0 -I)

author: Ian.M
author_rank: Super Contributor
timestamp: April 08, 2024, 11:13:37 am
content: It is absolutely *NOT* aR-2R ladder. What it is, is a binary weighted conductance resistor network, (+ R6, 510 ohms in parallel to set a 'base' current) sourcing current from the OPAMP's +V to its -in, which acts a a virtual earth, at a potential controlled by the +in which is biassed by the R9 pot, which thus sets the resistance to current factor. Q3 passes >99% of the balancing feedback current to the virtual earth through the load, acting as a controlled current source with a compliance voltage approx 1V below the virtual earth potential.As all the transistors are PNP and the whole circuit 'hangs' of the positive rail, to avoid confusion measure with respect to OPAMP V+ (bridge rectifier + out)!U4 pin 6 (OUT) behaviour is exactly as expected. Irrespective of the load at the M01 terminals, and the digital inputs, it should track the voltage at the R6 pot wiper, except one Vbe drop higher, till the OPAMP rails, approx 2V below its + supply. Therefore R6 should be ineffective for approx 1/3 of its wiper range, with the effective end being wiper towards the 7905 regulator output.The circuit's min full scale current is approx 13mA, and its max 43.5mA, adjusted by R9. To convert this to 0-10V at the M01 terminals it requires a load across those terminals of between 230 ohms and approx 750 ohms. I suspect it was originally designed as a 4-20mA loop sender, with R8 adjustable to trim to 4mA. To test it, simply connect a DMM on a 200mA range across the M01 terminals.Odds are its missing a load resistor across the VFD's input terminals. If the VFD has been replaced this is a prime candidate. Check the specs on the old VFD, if it had a 4-20mA loop input option, all is explained.Edit: corrected direction of Q3 Vbe drop offset.

author: m k
author_rank: Super Contributor
timestamp: April 08, 2024, 05:49:05 pm
content: Quote from: Shaydzmi on April 08, 2024, 10:21:28 amWhen 510 and 2k7 are dividing the middle point is 16% below +V.So you should be able to turn the transistor on and off.Maybe you should add a capacitor parallel to 2k7.Can you see any difference in Vce of the transistor when you adjust the trimmer?

author: Shaydzmi
author_rank: Regular Contributor
timestamp: April 09, 2024, 12:19:25 pm
content: Quote from: Ian.M on April 08, 2024, 11:13:37 amHey Ian.M,Spot on! You're absolutely right, this is a 4-20mA current loop circuit and it seems to be functioning as intended. Thanks for clearing that up.I was confused because all of my other boards (about 10) utilize the 0-10V method. This board, being the only one with a 4-20mA loop, certainly added to the confusion.And just like you said, the issue arose after the VFD replacement.Thanks again for your help! The board's working now, but I'm still curious about how it functions. Specifically, I'd like to wrap my head around the role of the op-amp in this circuit.Anyone else out there have some insight into how the op-amp works in this context?Well done Ian.M

author: Ian.M
author_rank: Super Contributor
timestamp: April 09, 2024, 01:17:31 pm
content: The OPAMP doesn't do much except correct for some sources of error!Q3 is pretty much a conventional single transistor current source, with its collector current set by its emitter current, which is determined by the resistors and the difference between the positive rail and its emitter voltage. Where it differs from the usual circuit, is instead of holding the base at a fixed voltage to approximately set the emitter voltage, it has an OPAMP driving the base to servo the emitter voltage to the voltage set point from the potentiometer. This cancels out the effects of Q3's intrinsic emitter resistance and eliminates any loading effects on the potentiometer, thus improving the linearity of the current source. It also cancels out Vbe variations with temperature, making the current source far more temperature stable.Unfortunately this improved accuracy and linearity is degraded by the Vce saturation voltage of the transistors switching the individual DAC resistors, which would ideally be replaced with logic level P-MOSFETs.