analog inputs: op-amp + divider - Russian - now MCP6004

Hardware inside and outside of the ECU
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by AndreyB »

puff wrote:have you tried measuring output without divider? or changing divider for, say, 10K?
This from a person who has his own board to try? :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by puff »

unfortunately, i left it at home at my home town till spring - didn't think I would need it earlier…
Gone_AWOL
Posts: 7
Joined: Mon Mar 23, 2015 12:15 pm

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by Gone_AWOL »

Is this not a little OTT? I've joined up a little late to make comments I know... but a PD combined with an emitted follower if you really want a buffer is simple too and pretty cheap. You may well want the high impedance input that an opamp allows, but remember common mode noise loves having on input with high impedance too :)

Also your filters can be much more aggressive, Coolant and mat sensors change incredibly slowly which means you can be really nasty with your filters for these at least.
aneox
Posts: 3
Joined: Wed Mar 25, 2015 6:48 am

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by aneox »

russian wrote: Also checked with +12 power supply and Frankenso own 5v. This time I have perfect 5v power and same -0.6v offset on op-amp output.

Did you find an answer? Issue resolved?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

aneox wrote:Did you find an answer? Issue resolved?
Do not remember :( Probably not.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

Here are some measurements. I'm not sure why the op-amp is having trouble pushing to the rails, but this clearly shows it can't push to the rails. Now we need to figure out why it's failing.
op-amp_rails_problem.png
op-amp_rails_problem.png (13.31 KiB) Viewed 24629 times
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

I have added a 220pF between pin 14 and GND for cap Cl. I have also removed R214 to remove any potential loading issues. Still pin 13 measures 4.39V when it should read 5.00 V. The input amps are in the nA range and the op-amp can drive mA, so it's not getting loaded down.

Hmmm, it would appear that this type of rail to rail op-amp can't go to the rails. I see Vicr should limit the top end to between 4 and 4.2. So we are really lucky that it's going to 3.39v. From this datasheet http://www.ti.com/lit/ds/symlink/lmv324.pdf page 6
LMV324_Vicr.JPG
LMV324_Vicr.JPG (14.43 KiB) Viewed 24626 times
The solution for this has to be to get a rail to rail that will actually go to the rails, or live with the 4V max.
Welcome to the friendlier side of internet crazy :)
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by puff »

are they linear? does this mean, to stay with lmv324idt we would need to recalculate the voltage dividers?
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

The input can go for that range, the issue is the output. That ST chip is much better about actually being a rail to rail chip. Is .2V either rail close enough? See page 6 for VCC = 5V found in aneox's link. Snippet below.
ST_LMV324_rail.PNG
ST_LMV324_rail.PNG (23.2 KiB) Viewed 24621 times
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

I have checked the op-amps in the below noted specification. So far it looks like that ST chip is the best option. If we change the resistor divider to a 10kOhm instead of 3kOhm. The tolerance is .2V to 4.8V, but the typical is .04V to 4.95V. The footprint / module is a bit narrower than what we have. It could kind of be put on the existing pads, but would need to be change to be correct.

https://docs.google.com/a/jaredharvey.com/spreadsheets/d/1e3w4z06uDETFuuJsiw7TVaZ3DYvyex-itfM44Z2OVnU

Should we scale the input, such that we leave the door open for a variety of op-amps, or should we change to this ST op-amp? Are there other op-amps I should consider? Ultimately I get to decide, but are there any suggestions on what way I should go with it? I'm tempted to say we should scale the input, then scale the output, but I'm a bit less than happy with that as it would add to the tolerance stack up. In reality though, you are supposed to adjust your TPS min and TPS max and such, so I'm not sure the stack up is an issue.
Welcome to the friendlier side of internet crazy :)
DaWaN
Posts: 51
Joined: Sat Sep 20, 2014 6:54 pm
Location: Benschop, Netherlands

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by DaWaN »

kb1gtt wrote: Hmmm, it would appear that this type of rail to rail op-amp can't go to the rails. I see Vicr should limit the top end to between 4 and 4.2. So we are really lucky that it's going to 3.39v. From this datasheet http://www.ti.com/lit/ds/symlink/lmv324.pdf page 6
LMV324_Vicr.JPG
The solution for this has to be to get a rail to rail that will actually go to the rails, or live with the 4V max.
You learn every day.. Explains why they explicitly call it a "rail-to-rail output" op amp.

As it seems there are very few 'true' rail-to-rail input opamps, most of them seem to stay away 200mV from the rails..
My ubiquitous choice is usually the Microchip MCP6004 when it comes to rail-to-rail CMOS op amps.

The TI LMV934-N seems to have a true rail-to-rail input, but is a tad expensive.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

kb1gtt wrote:I'm tempted to say we should scale the input
Why scale the input? Is not 4.8/4.95 good enough?
DaWaN wrote:The TI LMV934-N
what is the full part number for our application?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

I think that's this guy https://octopart.com/lmv934ma.-texas+instruments-8313406 which then links to this datasheet http://www.ti.com/lit/ds/symlink/lmv934-n.pdf I see it notes the below.
op-amp.PNG
op-amp.PNG (20.81 KiB) Viewed 23508 times
I wonder why it specifies the input to be +/- .1V. Does that mean you need to drive to -100mV to get the output to the specified voltage? That spec seems a bit odd to me.

I need to look closer at this datasheet, but I think we might have a winner with this Microchip one DaWaN suggested https://octopart.com/mcp6004-e%2Fsl-microchip-419107 I need to look at the footprint to see how it might change the layout. I also need to review the other specs, but the rails claim to be only a 25mV offset, and the price is comparable to what we have. I wonder why the MCP notes .5V Overdrive.
op-amp_MCP6001.PNG
op-amp_MCP6001.PNG (8.87 KiB) Viewed 23508 times
I see the MCP datasheet notes several simulation software's. Perhaps we can simulate to see if the specs are tolerable.
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

Microchip offers this on-line simulation tool known as MINDI which is found here http://webdc.transim.com/DesignCenter/servlet/WizardServlet

I did a simulation of the MCP6001, which produced a low voltage of 0.18E-3 and a high voltage of 4.934. I think this is going to be much more tollerable than what we have in there now. I also see that MINDI notes several other op-amp options. I'll go add those to the rail to rail list for analysis. Here's the PDF results of the simulation.
Transim WebScope ®.pdf
(101.83 KiB) Downloaded 406 times
Microchip - Design Center.pdf
(193.64 KiB) Downloaded 405 times
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

I see the MCP6244-E/SL at $0.70 with a out min of 0.00303 and a out max of 4.916 However I see a significant delay in the simulation.
I see the MCP6274-E/SL at $1.50 with a out min of 0.00488 and a out max of 4.967
I see the MCP6004-E/SL at $0.50 with a out min of 0.00180 and a out max of 4.934

There are 3 of these chips on Frankenso, so that's a $1.50, $2.10 and $4.50 for total prices. I tend to think we need more precision at the high side than at the low side, think WOT. Is it worth the extra $3 to get that extra .033V at the top end? Also remember after the Vdivider, that's .016V at the ADC. I'm not seeing that slight difference to be very important.

Unless someone points me to a better option(s), I'm going to start using the 6004.

Online simulation PDFs attached.
Attachments
Microchip - Design CenterMCP627x.pdf
(193.51 KiB) Downloaded 371 times
Transim WebScope ®MCP627x.pdf
(101.37 KiB) Downloaded 376 times
Microchip - Design CenterMCP624x.pdf
(193.61 KiB) Downloaded 332 times
Transim WebScope ®MCP624x.pdf
(102.54 KiB) Downloaded 310 times
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

The sine wave simulation seems to show some interesting results. Seems there is a clamping issue with these op-amps. Seems the MCP627x recovers from clamping better. See attached simulation PDF's.
Attachments
Transim WebScope ®MCP600x_Sine.pdf
(110.25 KiB) Downloaded 281 times
Transim WebScope ®MCP627x_Sine.pdf
(109.76 KiB) Downloaded 272 times
Transim WebScope ®MCP624x_Sine.pdf
(109.99 KiB) Downloaded 257 times
Welcome to the friendlier side of internet crazy :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

With 1 each of MCP6244-E/SL, MCP6274-E/SL and MCP6004-E/SL, I get this frequency response.
AN_input_freq_response.png
AN_input_freq_response.png (2.86 KiB) Viewed 23445 times
Then set to clip at 200Hz, we get this from all three op-amps
AN_input_clipping.png
AN_input_clipping.png (9.86 KiB) Viewed 23445 times
Finally I measure with 5V on the input with a DMM on the op-amp output, and I measure
MCP6244-E/SL = 4.92V
MCP6274-E/SL = 4.96V
MCP6004-E/SL = 4.92V
Low side on all of these measured around 20mV from the GND rail.

So I proclaim, that we should use the MCP6004 that DaWaN suggested.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

kb1gtt wrote:So I proclaim, that we should use the MCP6004 that DaWaN suggested.
i"ve just placed an order for a bunch of MCP6004-E/SL from Avnet Express (see https://octopart.com/search?q=MCP6004-E%2FSL), once I get those would offer them as an upgrade for existing boards.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Simon
Posts: 3
Joined: Thu Mar 26, 2015 5:14 pm

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by Simon »

You could also use an opamp connected to a higher voltage.
This would also help with accepting analog signals up to 12V without being clamped in the op amp inputs...

I don't recall having seen 12v analog signal, but i did not get in the details of a lot of sensor ( wideband O2 for example).
I know on my car the cruise control uses a tension divider witch multiple resistor value for each button and i think it is hooked on the 12V.
Edit: Cruise controls signals are analog 0-12v by the manual...
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

I wonder how much smaller would this module be if we use TSSOP package op-amp and 0603 resistors?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

Not much smaller, as the analog stuff is minimal and on the back side of the PCB. The digital stuff which is on the front side it what's taking up the space. To help keep a good noise floor on the analog stuff, I'm using the internal GND plane to help shield and protect against digital coupling.
Welcome to the friendlier side of internet crazy :)
User avatar
RasPL
Posts: 24
Joined: Thu Oct 15, 2015 6:44 pm
Location: Poland

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by RasPL »

Not about op amp or voltage divider but maybe is time to replace all double schotky diodes to some clamping unit like TL7726 (HEX CLAMPING CIRCUIT, SOIC-8) or similar ?
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by kb1gtt »

The datasheet I found for the TL7726 seems to be minimal. I think it's a $3 that includes 12 rail clamping diodes. it appears it's providing the same clamping diodes we currently have. That's about $0.50 per channel, purchased in qty's of 6. The BAS70-04FILM we are currently using is less than $0.40 per channel, it's on a per channel basis and being in it's own package allow optimal placement. Catching surges wants to happen close to the harness connector. A single package would likely force you to move the protection farther away from the connector.

I kind of like this suggestion from SuperTek http://ww1.microchip.com/downloads/en/AppNotes/AN-D11.pdf it costs a bit more but offers better protection. I like this approach, as pretty much any device has these rail clamping diodes for ESD purposes. We added larger external clamping diodes to help prevent damage to the smaller diodes that are internal to the op-amp. This suggested protection from Supertek limits the current that would pass through the rail diodes which would prevent them from getting damaged.
Welcome to the friendlier side of internet crazy :)
Horsty
Posts: 31
Joined: Fri Oct 07, 2016 10:38 am
Location: Cologne / Germany

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by Horsty »

Can I use two BAT41 instead of the double schottky?
Vbr and If seems about right.

http://www.vishay.com/docs/85659/bat41.pdf
Track: Audi Coupé Quattro R5 Bj. '89 | 2.3 Liter | 7A | 170 bhp | Perlwhite L0A9
Daily 2014- : Volkswagen Lupo Bj. '99 | 1,0 Liter | ALL | 50 bhp | Flashred LP3G --> conversion to AEX 1.4 8v 60 bhp --> conversion to AEE 1.6 8v 75 bhp
Rhinoman
contributor
contributor
Posts: 256
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK

Re: stm32f4 MPU module LQFP 208

Post by Rhinoman »

kb1gtt wrote: I'm kind of dream of little boxes that you connect to the analog input sensor or digital outputs all connected with a digital bus, perhaps CAN or optical.
The SENT protocol is designed for interfacing sensors to ECUs.
User avatar
mobyfab
Posts: 139
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France

Re: stm32f4 MPU module LQFP 208

Post by mobyfab »

It's probably simpler to use a LIN Bus :)
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by kb1gtt »

About analog, I also agree getting into digital would be nice. However it's an analog world, and the sensors are analog. Some key sensors are the MAP (Mass Air Pressure) sensors, or alternatively the MAF (Mass Air Flow) sensors. These are typically analog sensors. There are some MAF's out there that convert the signal to a PWM, but I think that was only Ford and only for a very limited number engines. About 95% of these OEM sensors are analog.

I'm kind of dream of little boxes that you connect to the analog input sensor or digital outputs all connected with a digital bus, perhaps CAN or optical. However baby steps.
Welcome to the friendlier side of internet crazy :)
User avatar
mobyfab
Posts: 139
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by mobyfab »

kb1gtt wrote:The input can go for that range, the issue is the output. That ST chip is much better about actually being a rail to rail chip. Is .2V either rail close enough? See page 6 for VCC = 5V found in aneox's link. Snippet below.
ST_LMV324_rail.PNG
Using the same opamp on my design, I have the same behavior, about .2V.
Also using 10K resistors dividers driving the STM32 ADC on the output reduces the GBWP to around 100kHz.

MCP6294 seems a better choice but it's like 3 times the cost.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - now MCP6004

Post by kb1gtt »

Yeah, this entire rail to rail is not really rail to rail is kind of a pain. If we were to look at the dynamic accuracy, not just the DC accuracy, we would likely see some skewing as we approach the rails. Basically if you run like a 10kHz 1mVp-p signal at 0.2Vdc you'll likely see some skewing, even though your DC issues happen at a lower voltage. We luck out as this skewing is not a huge deal for our low frequency inputs.

I seem to recall that I tested like 4 or 5 op-amps when we made the decision to switch to what we have now. I recall we found one that was something like 20mV or 50mV closer to the rail, but was like 4X the cost. I also seem to recall it was the same pin-out so if someone wanted to spend an extra couple bucks they could change to that op-amp and get slightly closer to the rails. However we decided that for the extra couple bucks, the difference of 0.200V vs 0.180V to 0.150V was not worth the money. Especially sense most signals are 1V away from the rails any how.

I also recall that there are some op-amps out there that have very small internal rail voltage generating circuits, such that they generate like 1V above and below the provided rails. By creating this internal virtual rails, allows those near rail circuits to be true rail to rail. Basically it allows them to deal with bias currents, which is what causes the issues at the rails. However those are rare and very costly. I recall they were like 20X the cost and hard to find. Also good luck that they don't go obsolete and have sourcing issues.
Welcome to the friendlier side of internet crazy :)
Post Reply