Op Amp transient analysis - Page 1
Forum section: electronics / projects

author: Vettett15
author_rank: Contributor
timestamp: October 07, 2019, 01:26:04 am
content: I created a lt spice model of my circuit which consists of an op amp in a unity gain voltage follower configuration which feeds a SAR ADC. I also included the flywheel circuit in front of the adc. There are two models, each one having a different op amp.The one labeled "bad" uses a TI 4111 which isn't really designed to handle the capacitive load my circuit has. I originally designed with this op amp before I knew the capacitance values. Thus I made a second circuit that uses an op amp with unlimited capacitance drive.Using the analog suggestion on how to measure phase margin I plotted the following.Not sure how to interpret these, it seems that the tlv4111 has more phase margin than the analog ada4807 which seems backwards to me given the load circuit. Any suggestions?I had some suggestions from others that said to put a 0.5V source in series with the non-inverting input to lift the inputs off ground and repeat the measurement... Didn't make a difference in the result.Method used:https://www.analog.com/en/education/education-library/videos/5579254320001.htmlTLV4111 model:drive.google.com/open?id=16f1DOy9MGa5eAqLpUB9AkA7d-5P2t6DKTLV4111 ac analysis:drive.google.com/open?id=1yB7cSt02a8esAloV1XLMuPj0H3VwHI5KADA4807 AC analysis:drive.google.com/open?id=1XzN9bI2dqWq7XrIicgfRNYllvPiZDeZM

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 07, 2019, 06:27:44 am
content: Try setting +in to 1.0V or something like that. As shown, the opamp is saturated negative and AC results are meaningless. Or, heh, they should be, but who knows if the model obeys the laws of physics or not.Capacitive load doesn't matter with a series resistor that huge. Offhand, I don't even know of any amps that can't drive a 6.8k load to a full 5V.Tim

author: iMo
author_rank: Super Contributor
timestamp: October 07, 2019, 06:46:03 am
content: The switches will not work in the AC analysis, imho.

author: Vettett15
author_rank: Contributor
timestamp: October 08, 2019, 12:11:11 am
content: I've tried it with .5v, 1v, 2v input and it doesn't change the results. One thing I just realized is the tlv4111 is only rail to rail on the output, they only spec it to Vd-1.5v on the input. I know I had the circuit on a bench and got the input to 4.6V so they must be pretty conservative. I just need to get an oscilloscope on the device to understand why I'm having issues with the tlv4111 if it's not due to the capacitive load.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 08, 2019, 02:59:19 am
content: Often they use a complementary input stage which changes over near +V. The input offset voltage changes suddenly (there will be a graph showing V_ios vs. V_cm), usually going out of spec -- but the amp continues to work normally.What issues are you having?Tim

author: Vettett15
author_rank: Contributor
timestamp: October 09, 2019, 12:22:28 am
content: Tim,Taking a quick step back here is the short version of my problem.Trying to digitize this old analog car sensor that provides a .25-4.7V voltage to the ECU which is a SAR DAC. I started with just an arduino outputting a voltage using a mcp4725 DAC. While I was building the design up I got some bad info that said the ECU was pulling 100 mA on the output of the sensor. Thus I convinced myself i needed a current buffer so I used a tlv4111 op amp.I tested the design both ways, with and without the op amp, on the car and it ran much better without the op amp which convinced me. So I took apart an old ECU to determine what the circuitry was in front of the ADC. This is when I realized it was a heavy capacitive load which could be the cause of my issue since it looks like from the datasheets the DAC is actually better suited to drive a large capacitive load than the tlv4111. In parallel with this I took my own amperage measurements and realized the ECU is only pulling 1mA or so and not 100.... So I started to look for better op amps, ones with less current output but could drive large capacitive loads. This lead me to ones like ADA4807. I was trying to simulate these in ltspice but it doesn't seem to be helping me determine what the issue is. I did make me realize the tlv4111 is only a railto rail output and not input. Although on the bench I can get it to 4.6V pulling 200 mA with a 5v supply and 4.6v on the + input. That is using only a potentiometer as the load.In short I'm trying to solve a problem when I really don't know what the underlying issue is. I'm trying to get my hands on an oscilloscope so I can use it while the car is running to know whats going on.Here are some details on my designhttps://www.eevblog.com/forum/projects/understanding-amperage-draw-on-existing-circuit/msg2707084/#msg2707084

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 09, 2019, 01:52:09 am
content: Ah.No worries about bandwidth, for it to need even 100Hz of bandwidth that poor sensor would be beaten to death (imagine the air pressure, and rate, to make it move that fast?).So you don't need a fast amp, and you don't need to worry about capacitive loading and bandwidth. Just stability, and I suppose some linearity.Use this circuit:R3 is big enough to ensure stability. Read the amp datasheet, it should say. Typically 50-200 ohms minimum for a non-C-load type (down to zero for a C-load type, obviously). R2 is relatively large, 10k say. R2*C1 time constant ideally should match R3*C3 (plus a contribution from the amp itself if this is near its own time constant, i.e. t ~ 1/GBW), but since you don't need the bandwidth here, it can be made quite large, i.e. around 2ms even (for ~100Hz bandwidth).If you're using the amp for some gain or whatever, not just a follower as shown, then take into account whatever else is connected to -in. That is, if you wire it for noninverting voltage gain, then +in is still the input, and -in is on a voltage divider; in that case R2 is the feedback resistor and there's another resistor from -in to GND. C1 is still where it's shown.Additional phase margin is also available by putting a resistor in series with C1, but this isn't very important, and is hard to adjust without an oscilloscope (or a need for best frequency response).Likely far more important is noise in the system. Be careful about connecting to anything other than the ECU connector. The connector has +5V and GND on it so you should not need to tie to chassis for power. Use shielded cables if possible, and tie the ground to a shield around the circuit if possible (and again, keep the shield insulated from chassis).Consider placing an ESD diode at the output. For a 5V system, a zener diode from GND to output (in parallel with C3), is probably fine. Ditto between GND and +5V. Don't forget local bypass on the 5V supply, too (say 0.1uF ceramic and 10uF electrolytic).Your diagram in the other thread, shows a capacitor on the ECU input. This can serve as C3, but there may be value in having one local too. In that case, leave the ECU alone, and put C3 in your circuit, of a comparable value (say 10nF, doesn't need to be huge).Then a ferrite bead or resistor in series with the output, to prevent the two capacitors from resonating with each other.Not all of these components may be necessary, and you can test without some, to see if they have any effect. The local C3 and the electrolytic bypass are probably on the optional side, but I would prefer keeping the zeners/TVSs, and the smaller bypass to keep the opamp behaving.You can see all of this in the simulation if you draw up the equivalent circuit. Treat the cable as a series inductance (about 0.3 uH per meter of length, on each wire in the cable). Treat common mode noise (like ignition noise, sparks from relays, etc.) as a voltage source in series with some impedance (generally ~50 ohms), coupled to the circuit appropriately.The coupling depends on the mode. It might be close enough to wire the source (VSRC + R) straight between grounds, if the offending source is nearby wires in a wiring harness. Or you might use some pF of capacitance, if it's coupled in through nearby proximity (e.g., a cable or box running near the ignition). Or it might manifest as a series transformer -- that would be wired as another trio of inductors in series with the cable's wires all coupled together, and to a 4th (a virtual primary winding), to which the source connects. This represents magnetic induction. Other tests are possible, given some physical model to represent. The main thing you will notice is, probing signals (with respect to SPICE ground '0') will all show the same noise on them, but not relative signals (i.e., a local signal against local ground) unless something has upset the balance (like capacitance from the circuit to chassis ground, due to it being in an open plastic box say, instead of a shielded metal box).But really, that's just ideas to play with, and beyond taking a few precautions, there really isn't much that should happen with an opamp and slow signals.So, what are youreallydoing? Buffering a potentiometer that used to be directly wired in? So it doesn't do anything? Buffering it through an Arduino (ADC + DAC) somehow? Is the ultimate aim to adjust the signal slightly e.g. to adjust mixture in operation? Craft a brand new ECU? (Could start with a Megasquirt or something, learn the codebase and start making small tweaks.)Tim

author: Vettett15
author_rank: Contributor
timestamp: October 09, 2019, 02:20:26 am
content: Tim,Appreciate the response, going to have to take some time to digest all of that. I've seen similar circuits to the one you suggest, i suppose one thing i'm struggling with is why do i not see issues in my ltspice analysis (ringing, low phase margin, etc) that shows i need to do make adjustments? Part of the reason i went down the ltspice route is to see what issues the circuit was having and then play with the values of R2, R3, C1, C3 and get an idea of what the ideal values would be. I should be able to white wire in the circuit you show to test it out when i get it installed on the car next, unfortunately the time i am able to actually test on a car is limited.Also, it is interesting you mention an ESD diode, in the ECU they tap off on the signal and go into a device (circled in red) that i believe is some sort of ESD diode? Never was able to find out any data on it, looks to be Bosch proprietary. In the picture below, i highlight in yellow the signal coming from the sensor and then circle in red the unknown device. R261 is 1Meg, R260 is 6.8k and C620 is 33nF.As to what i'm ultimately doing, the analog sensor tends to wear out over time (specifically the copper wears out the carbon resistor) thus i'm trying to make a sensor where i remove the original pieces (copper arm, ceramic board with laser etched resistors and the printed on carbon resistor that the copper arm swipes on) and replace it with a fully digitized setup. For it to feasible i need to leave the ECU design alone (i.e. don't change the flywheel circuit for the ADC) and work within the voltage that the original sensor gets.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 09, 2019, 04:05:38 am
content: Yeah, that's probably just an ESD clamp diode array (six up?), dumps into +V or GND when the input is outside that range. So the 6.8k limits the current dumped, and the 33nF in part acts to absorb ESD too.It's kind of the same circuit I suggested, just backwards, with the difference that they put the ESD diode inside rather than at the connector.Yeah, you shouldn't need anything beyond a sensor and DAC, and the passives to run them. Might not even need an MCU if they can be linked directly, otherwise it's a very simple patch job.Tim

author: Vettett15
author_rank: Contributor
timestamp: October 10, 2019, 02:09:51 am
content: There's a chance I'll be able to put the sensor on the car and have an oscilloscope. I plan on running with dac only and then one or two different op amps... I'll back Sunday

author: Vettett15
author_rank: Contributor
timestamp: October 12, 2019, 01:24:32 am
content: Got some interesting data today on the bench. I was able to get my hands on a usb oscilloscope so i hooked up both the OEM sensor (yellow trace) and my sensor with the TLV4111 op amp (blue trace).i manually opened the sensor's flap (rise in voltage), held it there and then let it go (spring loaded). Concentrating on the voltage drop because the springs between the units should be relative consistent.Note that the noise on the yellow trace is due to the oem sensor's carbon trace wearing out.I thought the most interesting thing was that the stair steps on the TLV4111 sensor looks like it takes ~12ms to change voltage, seems slow to me, no?Note these were done with no load on the output.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 12, 2019, 02:28:10 am
content: Looks like zoomed DSO with sinx/x interpolation turned off. In other words, instrument error, RTFM and all that; repeat the measurement at the zoomed-in setting and see if it's still smooth.Tim

author: Vettett15
author_rank: Contributor
timestamp: October 12, 2019, 11:08:22 am
content: Tim, if that was the case then why don't I see the stair step on on the oem measurement? Took them both at the same time

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 12, 2019, 11:18:36 am
content: Oh, they are on the same scales, aren't they?Beats me, but something's doing a sample and zero-order-hold operation.Tim

author: Vettett15
author_rank: Contributor
timestamp: October 14, 2019, 12:51:42 am
content: Well I put the new sensor on the car and immediately realized my first issue.... Looks like the ecu can only supply wmA while maintaining the voltage and my design pulls 29ma... The voltage is getting pulled down to 3.5v which causes it to not function properly.Somehow I need to figure out how to drop current consumption. The a1335 magnet sensor chip pulls 15 mA alone.