Open Source LSU4.9 Wideband Controller

Free Open Source Hardware discussion forum. Post your Free Open Source hardware projects here!
Post Reply
Hell Fire
DIP8 - Involved
Posts: 24
Joined: Wed Jul 31, 2013 11:12 am

Open Source LSU4.9 Wideband Controller

Post by Hell Fire »

Hi all,

I recently did a little project up after a certain WBO2 controller kept hitting some kind of race condition which ended up only running the controller properly about once every 2-3 starts.

The circuit is fairly simple, and actually fairly similar to another open source WBO2 design I later found while trying to debug my circuit. The parts requirements are simple, consisting of:
A NPN darlington BJT or N-channel FET able to carry 2 amps
A quad opamp (rail to rail is better, but not necessary)
Some form of Ardunio capable chip/board (3 ADC, and 3 PWM and 2 on/offs)
A small handful of resistors and capacitors

For my use, I initially did the prototyping with the Teensy++ 2.0, but I have plans to change it around to work with regular AVR C (with Arduino sketch option) on an ATmega167, but for the current setup I'm using, I get a sample rate of about 250Hz with enough accuracy to compare the readings I get out with my previous WBO2 controller (when it worked).

https://github.com/Hell-Fire/WidebandO2

Schematics are in gEDA gschem format, feel free to fork and push requests up for other Arduino family boards and chips :)
Attachments
OpenLogView capture of the data logged to serial
OpenLogView capture of the data logged to serial
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Open Source LSU4.9 Wideband Controller

Post by Fred »

Neat project! Thanks for posting up the thread ;-)

A few questions:

Which one kept screwing up?
Which one is similar?
What is 'ipa'?

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Hell Fire
DIP8 - Involved
Posts: 24
Joined: Wed Jul 31, 2013 11:12 am

Re: Open Source LSU4.9 Wideband Controller

Post by Hell Fire »

I was having issues with the TE 2Y2 DIY kit, which I couldn't get any reply from the people that supplied it. I disliked how much stuff was attached to it that I'd never use, and the firmware just seemed poor quality.

The similar one is http://www.waltech.com/site/index.php/o ... e-projects but it's targeted for the LSU4.2, and an ATmega8 which I didn't have any of.

'ipa' is the measured current from the pump cell, it's directly related to lambda but lambda isn't a linear scale to pump cell current.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Open Source LSU4.9 Wideband Controller

Post by Fred »

OK, thanks!

If ipa is pump current, then what is pumpIn?

Help a n00b out ;-)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Hell Fire
DIP8 - Involved
Posts: 24
Joined: Wed Jul 31, 2013 11:12 am

Re: Open Source LSU4.9 Wideband Controller

Post by Hell Fire »

pumpIn/Out/Target are internals for controlling stoich of the nernst cell of the pump, so pumpIn is actually the nernst cell voltage, which should try to sit at 0.45v, pumpOut is the PWM output trying to control that cell, and ipa is actual measurement of that pump current across the sense resistor (with a calibration resistor that is in the sensor connector that's laser trimmed so that the sense resistors voltage drop is correct.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Open Source LSU4.9 Wideband Controller

Post by Fred »

OK, so your naming could do with some work :-) Thanks for clarifying.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Open Source LSU4.9 Wideband Controller

Post by toalan »

Can you make a pdf of the schematic and make it available, I tried to open the .sch file but I only have eagle and eagle says it is not an eagle file.
Hell Fire
DIP8 - Involved
Posts: 24
Joined: Wed Jul 31, 2013 11:12 am

Re: Open Source LSU4.9 Wideband Controller

Post by Hell Fire »

toalan wrote:Can you make a pdf of the schematic and make it available, I tried to open the .sch file but I only have eagle and eagle says it is not an eagle file.
PNG is easy to export from gschem, so have at it :)

I'm going to do a ATmega168 version for my actual build, but the Teensy is easy to get to at the moment.

Image
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Open Source LSU4.9 Wideband Controller

Post by toalan »

Hi,

In the Virtual ground part you are driving a 100nf load, depending on the opamp part it might be above the max output capacitance it can handle.

In the "Nernest Cell Pulse section", you can drop R4, the 250 uA max pump current is based on a half peak (I am 99% sure), You can also get rid of R5. Between PIN_VS:1 and 5v should be ~100k resistor, the 4.9 has an additional means of replenishing O2 on the reference cell WRT the 4.2; an electrochemical pump which needs 20-40 uA from the Nernest cell. If you do not include the ~100k resistor then the 4.9 will have no advantages over the 4.2, as both will end up using free air diffusion to replenish the reference cell.

I do not see any anti aliasing filters on the ADc inputs, maybe teensy has them built into the board?

I have my own Open sorce wideband for the 4.9, download/file.php?id=1372, Pump and virtual ground is driven by internal DACs, no external anti aliasing filters as I rely on the topology of the ADC to provide anti aliasing, accuracy is based on an internal bandgap reference.
Hell Fire
DIP8 - Involved
Posts: 24
Joined: Wed Jul 31, 2013 11:12 am

Re: Open Source LSU4.9 Wideband Controller

Post by Hell Fire »

I do the filtering in software, gives me control over the response time for very little extra processing cost (and reduces part count).

Nernst Cell Pulse is for measuring the internal resistance of the cell for heater control. The reason for R4 is to form a voltage divider through the cap so the pulse is only a ~2.5v swing instead of 5v, to keep the voltages within range of the ADC. R5 slows down the swing of the cap a little so that by the time the pulse is driven low again, there's not a large negative voltage swing from it. (The code compensates for the delay added by this).

The opamp part I'm using is the LMC6484IN (just one I had laying about), which while does have a 30mA limit on output, can handle shorting of the outputs for short periods of time, so startup capacitance isn't an issue, and once that's charged it's a stable state (doesn't seem to have issues keeping up with pump cell current pulling and pushing on it).

I've never seen a LSU4.2, let alone had one to compare against, and much of this circuit was tweaked by trial and error while looking at how it responded on the scope, then tested in the car comparing what I was reading to what I'd seen my car do with the other controller, I know a terrible way to reference on, but I don't have sample gases to test against :P.
Post Reply