F103 Wideband Controller

Hardware inside and outside of the ECU
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Mon Mar 28, 2022 9:08 am
The nernst sense is used for two things:
  • The DC component is used as feedback for the pump controller. The pump is servoed to maintain 0.45v DC on the Nernst cell.
  • The AC component is used for internal resistance measurement of the sensor, which is a proxy for temperature (the sensor is roughly an ideal voltage source in series with an NTC thermistor). The heater is controlled to maintain the set peak-to-peak AC on the nernst sense voltage, something like 50mV peak to peak, off the top of my head.
Try testing with a bench PSU set to 0.45 volt with a 300 ohm resistor (the target ESR for an LSU 4.9), and that should work. 100 ohms is also a bit low to test with - 100 ohms means we've massively overheated the sensor. 300-2000 works very well in my testing.

The difficulty with measuring ESR down near the bottom rail isn't a very big deal, since the sensor has to be very very rich (with an undriven pump - as soon as we drive the pump it pops up to 0.45v). I think this is actually the purpose of the 20uA bias current (copied from the CJ125, in our case a pullup resistor on Un to 3.3v) - when the sensor is high impedance (cold), they pull it up far enough that we can sense the ESR. Once the sensor is hot and the ESR low, we closed loop control the voltage in to the range we know we can sense.
AFAIR lean AFR will output voltage close to zero. So this can possibly affect sensor warm up with stopped engine when atmosphere air is in exhaust pipes.

BTW do you now where to get Ri vs t diagram for LSU4.9? I was able to find only for LSU4.2.

Anyway I just don't like diff amps couse it needs high precision resistors, input buffers/low output R sources and so on. For me ac-decoupled inverting or non-inverting opamp is much simpler. If this cascade is used for internal resistance measurement only - I will try non-diff variant.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

Dron_Gus wrote:
Mon Mar 28, 2022 9:29 am
AFAIR lean AFR will output voltage close to zero. So this can possibly affect sensor warm up with stopped engine when atmosphere air is in exhaust pipes.
Correct - high voltage means lean.

We transition from open loop (heater ramp) to closed loop (PI heater, PI pump control) at 500 ohms ESR. Worst case, the sensor is exactly 0 volts (doesn't happen in real life even in free air), so it forms a 500 ohm lowside, 60k ohm high side divider from 3.3v to ground, which results in about 30mV. That's high enough that we can glean some useful information from the sensor. Even if we can't accurately measure the temperature there, we don't need to. If we measure the sensor's ESR at 500 ohms, but we can only see the "top half" of the AC, the actual ESR is more like 1000 ohms. That's still hot enough that the sensor will *work* when we go in to closed loop, which essentially instantly pops the DC component of the nernst voltage up to 0.45 volts.

tl;dr, there's no situation in which we actually NEED to measure those negative voltages, because we can force the nernst voltage up using the pump before that happens.

Have a look at the Nernst voltage vs. ESR traces as the sensor warms up in this post: https://rusefi.com/forum/viewtopic.php?p=41518#p41518
Dron_Gus wrote:
Mon Mar 28, 2022 9:29 am
BTW do you now where to get Ri vs t diagram for LSU4.9? I was able to find only for LSU4.2.
The curve is: https://github.com/mck1117/wideband/issues/18

The sources prefer to not reveal their identities at this time 8-)
Dron_Gus wrote:
Mon Mar 28, 2022 9:29 am
Anyway I just don't like diff amps couse it needs high precision resistors, input buffers/low output R sources and so on. For me ac-decoupled inverting or non-inverting opamp is much simpler. If this cascade is used for internal resistance measurement only - I will try non-diff variant.
The DC component is required. That's how we get feedback for the pump controller. AC measures temperature (ESR), DC provides feedback to the pump cell controller. Review the theory of the sensor here: https://rusefi.com/forum/viewtopic.php?p=38282#p38282

Those resistors in your snip don't need to be 0.1%, by the way. Dave specified them when he didn't know better, and we've since decided that 1% is plenty good, and likely even 5% parts would work. The F0 module I originally designed uses only 'jellybean' 1% resistors.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

By the way, this is very very similar to how the CJ125 works internally. It uses some sample+hold stages (AND ANOTHER DIFFERENTIAL AMPLIFIER) synchronized to the AC injection instead of an ADC, but it works fundamentally the same as this circuit.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

mck1117 wrote:
Mon Mar 28, 2022 10:08 am
Those resistors in your snip don't need to be 0.1%, by the way. Dave specified them when he didn't know better, and we've since decided that 1% is plenty good, and likely even 5% parts would work. The F0 module I originally designed uses only 'jellybean' 1% resistors.
And if you don't believe me, solve for how much temperature error you'd get in the worst case if all your resistors were "worst case" edge of their tolerances. Hint: it's inconsequentially small.

Likewise for the DC component: since the sensor's gain is highest at 0.45v output, the actual lambda change from 0.4 to 0.5v output is something like 0.002 lambda.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Mon Mar 28, 2022 10:08 am
The DC component is required. That's how we get feedback for the pump controller. AC measures temperature (ESR), DC provides feedback to the pump cell controller. Review the theory of the sensor here: https://rusefi.com/forum/viewtopic.php?p=38282#p38282
I mean, DC can be used without amplification (just a buffered input). Amplification is needed for AC part only. So we can switch from diff to ac-decoupled.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Mon Mar 28, 2022 10:10 am
By the way, this is very very similar to how the CJ125 works internally. It uses some sample+hold stages (AND ANOTHER DIFFERENTIAL AMPLIFIER) synchronized to the AC injection instead of an ADC, but it works fundamentally the same as this circuit.
Yes, but. ;) It uses external Rical to calibrate this part.
Screenshot from 2022-03-28 14-00-30.png
Screenshot from 2022-03-28 14-00-30.png (427.98 KiB) Viewed 23605 times
In any case, I am not arguing or questioning the current solution. I'm just trying to understand all this as deep as possible.
Last edited by Dron_Gus on Mon Mar 28, 2022 11:07 am, edited 1 time in total.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Mon Mar 28, 2022 10:16 am
And if you don't believe me, solve for how much temperature error you'd get in the worst case if all your resistors were "worst case" edge of their tolerances. Hint: it's inconsequentially small.i
I believe you! Now, with Ri vs T I can do it for all temperatures. But I will not do it. Last time it takes me half of a hour to find final equation to convert Uac to Ri. :)
SHOf429
Posts: 70
Joined: Sun May 24, 2020 11:37 pm

Re: F103 Wideband Controller

Post by SHOf429 »

Maybe a bit premature, but... Does the f103 have enough pins left to do a dual sensor setup? Have we determined if it has the processing power? I can work on the schematic and pcb layout of it's feasible. I would think some consolidation could be done as well.
Josh
94 Ford Taurus SHO
Frankenso in progress
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

Ok. A was able to warm up LSU4.9 with this board and a bit modified FW.
Heater reached closed loop and stay at 0.6 duty @ 12V at open air.
A have added another circuit to measure Ri using AC decoupled opamp with K = 11. Gain is too high and there is still different with Ri measured using diff amp. Will investigate this.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

SHOf429 wrote:
Tue Mar 29, 2022 2:46 pm
Maybe a bit premature, but... Does the f103 have enough pins left to do a dual sensor setup? Have we determined if it has the processing power? I can work on the schematic and pcb layout of it's feasible. I would think some consolidation could be done as well.
Currently each sensor uses 3 ADC channels. Actually 4, but only 3 are used in SW.
One ADC channel for battery measurement.
Two PWM channels per sensor. And one GPIO.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

@mck1117,
Are use sure that R9 make sense when calculating Ri? As it is measured using quite high freq AC and there is C4...
Screenshot from 2022-03-30 00-59-07.png
Screenshot from 2022-03-30 00-59-07.png (8.92 KiB) Viewed 23502 times

Code: Select all

    // There is a resistor between the opamp and Vm sensor pin.  Remove the effect of that
    // resistor so that the remainder is only the ESR of the sensor itself
    return totalEsr - VM_RESISTOR_VALUE;
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

Dron_Gus wrote:
Tue Mar 29, 2022 10:03 pm
Are use sure that R9 make sense when calculating Ri? As it is measured using quite high freq AC and there is C4...
Yes, subtracting that part out is the right thing. Rise time of a 10 ohm / 1uF filter is on the order of 25 microseconds, but the AC is at ~3khz, which is a period if 330 microseconds. Since we do our math (not sampling) just after flipping the pin (waiting for switching noise), we catch very very little of the part where there is current flowing through the cap.

Here's a snip from the SPICE model:
image.png
image.png (70.34 KiB) Viewed 23493 times
Vm is the opamp output, and Vm_ext is on the right side of the 10 ohm resistor. I(C2) is the 1uF capacitor to ground. As you can see, the current flow through it falls off quickly after the switching event, so it's effectively DC by the time we're sampling with the ADC.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

Btw, the SPICE models are checked in to github: https://github.com/mck1117/wideband/tree/master/simulation
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

In the sim we can also play with what it looks like with insane value capacitors too.

Here's 1000uF (practically infinite):
image.png
image.png (83.25 KiB) Viewed 23490 times
And here's 1nF (practically zero):
image.png
image.png (68.81 KiB) Viewed 23490 times
1uF is a happy medium to suppress those spikes (= EMI), but not enough to hurt "DC" accuracy.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Tue Mar 29, 2022 11:10 pm
Yes, subtracting that part out is the right thing. Rise time of a 10 ohm / 1uF filter is on the order of 25 microseconds, but the AC is at ~3khz, which is a period if 330 microseconds. Since we do our math (not sampling) just after flipping the pin (waiting for switching noise), we catch very very little of the part where there is current flowing through the cap.
Thanks! I made a mistake at calculations.
BTW, why R9 is not inside negative feedback loop? Why not to connect it to right side of R9? OpAmp stability due to capacitive load?
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

Dron_Gus wrote:
Wed Mar 30, 2022 10:16 am
OpAmp stability due to capacitive load?
exactly
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

mck1117 wrote:
Wed Mar 30, 2022 5:52 pm
Dron_Gus wrote:
Wed Mar 30, 2022 10:16 am
OpAmp stability due to capacitive load?
exactly
But if feedback is connected to right side of R9, do we still need C4/such a big C4?
I'm thinking about adding protection to all inputs/outputs. Currently Vm output will survive short to ground, but not short to +12V.
Increasing R9 and adding protection diodes/suppressor right to U1D output (14) will help withstand short to +12.
If increasing R9 - better to have it inside feedback loop (of course adding some protection to feedback loop itself).
Something like first picture from this article https://www.edn.com/circuits-protect-outputs-against-overvoltage/ .
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: F103 Wideband Controller

Post by AndreyB »

Dron_Gus wrote:
Tue Mar 29, 2022 9:57 pm
Currently each sensor uses 3 ADC channels. Actually 4, but only 3 are used in SW.
https://github.com/mck1117/wideband/issues/51
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
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: F103 Wideband Controller

Post by AndreyB »

joaodh wrote:
Fri Mar 11, 2022 3:41 pm
compatible with LSU adv
if someone would be so kind to provide me with a part number or URL for any LSU ADV I would purchase one and hand it to @dron0gus this might get us LSU adv firmware.

Open question if we need that level of precision realistically.
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
Abricos
contributor
contributor
Posts: 849
Joined: Mon Aug 18, 2014 12:32 am
Location: Carteret, NJ 07008

Re: F103 Wideband Controller

Post by Abricos »

https://www.bosch-motorsport.com/content/downloads/Raceparts/en-GB/51917195228833675.html#/Tabs=51945995/
ADV_pre_Turbo.pdf
(405.04 KiB) Downloaded 220 times
Ordering Information
Lambda Sensor LSU ADV
Automotive connector, wire length 95 cm

Order number: 0258.027.010

Lambda Sensor LSU ADV
Motorsport connector, wire length customer specific (max. 90 cm)

Order number: F02U.V01.861-01

Lambda Sensor LSU ADV pre Turbo
Automotive connector, wire length 65 cm

Order number: 0258.027.00F

Lambda Sensor LSU ADV pre Turbo
Motorsport connector, wire length 33 cm

Order number: F02U.V02.908-02
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

LSU ADV is not better, other than warm up time. It doesn't require any hardware changes, afaik, just changing the software table to use the different pump current vs. lambda relationship.
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: F103 Wideband Controller

Post by AndreyB »

mck1117 wrote:
Mon Apr 04, 2022 12:37 am
LSU ADV is not better, other than warm up time. It doesn't require any hardware changes, afaik, just changing the software table to use the different pump current vs. lambda relationship.
Something something
32x increase in pump current resolution which translates into a 20x increase in Lambda resolution.
https://www.14point7.com/blogs/news/bosch-lsu-4-9-vs-bosch-lsu-adv

no idea if 20x Lambda resolution would be anything we care about in 2022 or 2023
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
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

I'm not entirely sure what they did, but there's a lot of "marketing speak" there confusing the difference between resolution, precision, and accuracy.
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: F103 Wideband Controller

Post by AndreyB »

Practically speaking right now rusEFI needs 4.2 more than in needs LSU ADV (4.2 is needed to make hellen121vag happier)

looks like "0 258 027" is the prefix for LSU ADV? Looks like VAG uses those from about 2016? I've just ordered a used one from eBay for cheeeeeeap so Dron would have a test unit :)
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
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

AndreyB wrote:
Tue Apr 05, 2022 3:21 am
Practically speaking right now rusEFI needs 4.2 more than in needs LSU ADV (4.2 is needed to make hellen121vag happier)
BTW, I have brand new unused LSU4.2. And mate connector.
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: F103 Wideband Controller

Post by AndreyB »

2016 A6 2.0 oxygen sensor has arrived donor vehicle WAUGFAFC7GN104175

Do we know pinout of this sensor or is it obvious from wire colors?
Attachments
2016-A6-oxygen-sensor-wiring.jpg
2016-A6-oxygen-sensor-wiring.jpg (186.91 KiB) Viewed 22975 times
2016-A6-oxygen-sensor-WAUGFAFC7GN104175.jpg
2016-A6-oxygen-sensor-WAUGFAFC7GN104175.jpg (249.85 KiB) Viewed 22975 times
2016-A6-oxygen-sensor-plug.jpg
2016-A6-oxygen-sensor-plug.jpg (181.15 KiB) Viewed 22975 times
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
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

LSU adv five wire pinout
image.png
image.png (61.18 KiB) Viewed 22973 times
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: F103 Wideband Controller

Post by Dron_Gus »

JRD McLAREN
contributor
contributor
Posts: 434
Joined: Mon Mar 04, 2019 10:19 pm
Location: Slovakia

Re: F103 Wideband Controller

Post by JRD McLAREN »

AndreyB wrote:
Thu Apr 07, 2022 8:17 pm
Do we know pinout of this sensor or is it obvious from wire colors?
Yes, it the same as LSU 4.2 / 4.9 has ...
..
but I have no idea, "how labmda controller" measure sensors parameters without Rcal ..
.. some Proteus and microRusEFI for sale in Europe ..
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: F103 Wideband Controller

Post by mck1117 »

JRD McLAREN wrote:
Thu Apr 07, 2022 8:33 pm
Yes, it the same as LSU 4.2 / 4.9 has ...
..
but I have no idea, "how labmda controller" measure sensors parameters without Rcal ..
Bosch trims the sensor element itself on the LSU ADV. It works the same way, except there's no extra external (in the connector) resistor paralleled with the sense resistor inside the controller.
Post Reply