Bosch LSU 4.x controller from Arduino / Maple or similar

Free and Open Source Engine Management discussions excluding more specific things on this board.
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by toalan »

I was the first one to do a wideband controller using PSOC1 and still only one to use PSOC. PSOC3/5 is a fantastically speced chip, it was only natural for me to use PSOC3/5 for my next lambda controllers, I did do a preliminary layout and a little code just to see if all the digital, analog, routing resources would accommodate what I had in mind and everything did fit. There is enough analog/digital/routing resources on a medium end $8 PSOC3 chip to control 8 lambda sensors.

I decided against PSOC3/5 because it was too easy, it would just be my PSOC1 design but better, no new novelty would be involved. I had a new novel design in mind that did not require the analog performance of PSOC and decided to use plain vanilla ARM Cortex M0 uCs instead, that new novel design is what my Spartan Lambda Sensor is.

1. Find the peak to peak in software.

2. If you just do a comparator on the Vs line, your response time will be garbage. The delta on the Vs should be used to Drive a PID controller which drives the DAC which drives pump current in/out of the pump cell so to balance Vs very quickly.

3. No comment.

4. 250ua is the half peak value (I am pretty sure about this)

5. If you made a perfect controller using PSOC5 you will not get better than 100ms response time, it would likely be in the 200ms range. This is a limit of the response time of the sensor (50-75ms) and a limit of PID control algorithms (that is if you are using PID control, if you are using a Comparator on the Vs then I am guessing the response time will be in the 500ms range). To get into the sub 100ms range you need a novel solution in the form of new control techniques, innovate has one and I have one with spartan.

The primary merit of PSOC3/5 is that it has the resources to control many sensors at the same time and also because it's analog system is 0.1% accurate over temperature. A PSOC3/5 lambda controller if done right would be easily the most accurate lambda controller on the market, even those 5k lambda professional grade controllers would not be as accurate as a solid PSOC3/5 designed one. However the Bosch lambda sensors are only 0.01 lambda accurate, for my PSOC1 design the sensor inaccuracy is the primary source of error, unless you use high end lambda probes with much better than 0.01 accuracy PSOC3/5's 0.1% analog accuracy is wasted.

There one huge flaw of the PSOC3/5 chips that was a big showstopper for me, the built in op amps can only sink or source very small amounts of current before the voltages start to change. So for the virtual ground you will need to use external op amps, and you might need to use external op amps to buffer the DAC output as well. That was another big reason why I decided not to use PSOC3/5, I am happy to pay $8-$20 for a PSOC chip if it is indeed a "System on Chip".
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by toalan »

blownhemi wrote:
Fred wrote: If you were to use a multiplexer on your ADC, say the 20bit one, wouldn't you lose some (a lot of?) accuracy in that process?
Fred.
Actually, I don't know, but it's definitely a good point. The PSoC does not have dedicated ADC pins, but relies on an internal bus/switch-matrix to route almost any pin to any internal module, so any signal would have to go through this multpilexing network that to get to an ADC. My guess would be, that this was considered in the design of the PSoC, and accuracy should not suffer. Well, at least not from having to go through the internal multiplexing. Making changes to the routing on the fly could be an entirely different matter, though. I'll dig into the datasheet to find out.

If it does influence accuracy, I guess I could still use an internal R2R opamp to scale it up some, before routing it to the ADC. If that doesn't open up a new can of worms.
I would not worry about the internal mux causing accuracy problems due to path resistance, it may cause accuracy problems if you are sampling at very high speeds and you do not wait until the SC blocks have settled after a switch before you do the ADC sample. This was a problem for me with PSOC1, and I had to put in a small delay after the switch and then do the ADC sampling.
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by toalan »

jtw11 wrote:
Fred wrote:Thanks! I read your sign up details, and removed you from n00b group. Go nuts! :-)
Ah, I wondered why my other posts didn't need approving - cheers Fred! I'm using the CJ125 IC in the project I mentioned in sign up details, it's absolutely brilliant as one of my biggest specification constraints in PCB size, so having everything in one tiny SMD package is a god send. One problem, I ordered 3 and by the time I'd paid postage from the states (seems Future Electronics is the only place to get them) it cost me £30!
Does the Cj125 require an external FET for the heater power? Does it still require an external uC to control the heater FET?

Regards,

Alan To
blownhemi
TO220 - Visibile
Posts: 4
Joined: Tue Feb 05, 2013 7:21 pm
Location: Hungary, Eu.

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by blownhemi »

First of all, thanks for all the valuable insight!
toalan wrote:There is enough analog/digital/routing resources on a medium end $8 PSOC3 chip to control 8 lambda sensors.
That's good news! I was under the impression, that Vs and Ip measurements need dedicated full-time ADCs to reach an adequate response time, and that I would need an additional chip if I wanted to do a dual lambda controller (like, for V-s, or dual downpipe inlines, which I'm planning to get in the near future). Then I can make it all work with just one.
toalan wrote: 5. If you made a perfect controller using PSOC5 you will not get better than 100ms response time, it would likely be in the 200ms range. This is a limit of the response time of the sensor (50-75ms) and a limit of PID control algorithms.
Oh, OK. With that kind of sensor response, it's pointless to think about ICAFRM.
toalan wrote:The primary merit of PSOC3/5 is that it has the resources to control many sensors at the same time and also because it's analog system is 0.1% accurate over temperature. A PSOC3/5 lambda controller if done right would be easily the most accurate lambda controller on the market, even those 5k lambda professional grade controllers would not be as accurate as a solid PSOC3/5 designed one. However the Bosch lambda sensors are only 0.01 lambda accurate, for my PSOC1 design the sensor inaccuracy is the primary source of error, unless you use high end lambda probes with much better than 0.01 accuracy PSOC3/5's 0.1% analog accuracy is wasted.
I'm not looking to break new ground, or even compete, I just want to monitor O2/EGT on my present and future cars, without having to buy several LC-1s, and at the same time integrate some functions, which cost way too much for what they actually do, IMO (boost controller, MAP/IAT translator, electronic distributor).
toalan wrote: There one huge flaw of the PSOC3/5 chips that was a big showstopper for me, the built in op amps can only sink or source very small amounts of current before the voltages start to change. So for the virtual ground you will need to use external op amps, and you might need to use external op amps to buffer the DAC output as well. That was another big reason why I decided not to use PSOC3/5, I am happy to pay $8-$20 for a PSOC chip if it is indeed a "System on Chip".
Thanks for drawing my attention to this! After reading the PSoC1's output current in the datasheet, I didn't even occur to me, that the bigger brother's specs could be worse. Together with the DAC's max voltage output of 4V (what where they thinking here?), pretty much defeats the raison-d-etre of the DAC as well, when you need external components for it anyway. That's a pity, it started to look like this one IC would cover everything. Well, that's plus 1-2 rail-to-rail opamp ICs to the BOM.
All in all, still not a bad chip, though. I especially like the on-chip programmable logic, I was always curious about CPLD design, it's a good starting point.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by Fred »

blownhemi wrote:I'm not looking to break new ground, or even compete, I just want to monitor O2/EGT on my present and future cars, without having to buy several LC-1s
Why buy an LC-1 for that when you can get one of Alan's Spartan units for 105usd + shipping? Too cheap to ignore. DeuceEFI has one on one of his FreeEMS cars, ask him what he thinks. I've certainly heard no complaints ;-) http://14point7.com
and at the same time integrate some functions, which cost way too much for what they actually do, IMO (boost controller, MAP/IAT translator, electronic distributor).
I'm unsure what you mean with this stuff. Wouldn't this be the domain of the EMS? Or are you stuck in the dark ages with carbs/dizzy? :-p
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!
blownhemi
TO220 - Visibile
Posts: 4
Joined: Tue Feb 05, 2013 7:21 pm
Location: Hungary, Eu.

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by blownhemi »

Fred wrote:
blownhemi wrote:and at the same time integrate some functions, which cost way too much for what they actually do, IMO (boost controller, MAP/IAT translator, electronic distributor).
I'm unsure what you mean with this stuff. Wouldn't this be the domain of the EMS? Or are you stuck in the dark ages with carbs/dizzy? :-p
Oops, forgot that the name might be a bit misleading... ;). It's just that I use this name almost everywhere else. But, no, I'm not a carb guy, I'm mostly into EFI Nissans.
And, you're right, a good standalone ECU would take care of all the above, but - although I may be crucified for this :) - I'm running a stock "chipped" ECU, and plan to stay that way. I like, that it handles all the stock little tidbits, like idle air, stock gauge cluster, uses the harnesses I already have in the car, etc. But it's missing above said features, so I'm "enhancing" it. I think adding a small PCB with a few components will be both simpler, and cheaper, than going standalone, and this way I also get to "make" something.
Fred wrote:
blownhemi wrote:I'm not looking to break new ground, or even compete, I just want to monitor O2/EGT on my present and future cars, without having to buy several LC-1s
Why buy an LC-1 for that when you can get one of Alan's Spartan units for 105usd + shipping? Too cheap to ignore. DeuceEFI has one on one of his FreeEMS cars, ask him what he thinks. I've certainly heard no complaints ;-) http://14point7.com
I have no doubt at all about Alan's unit being top notch. I was actually looking into buying one or two SLC OEMs. There are some catches, though, which pull me towards making one of my own, at the moment.
1. One of my cars is a IDI diesel, which I'd like to tune not only for all out power on boost, but off-boost economy as well, so I need to be able to measure AFRs way above 20. (I know, I could do it via I2C, but then I would have to do I2C, and I reeeeaaaaally wouldn't like to do I2C.)
2. I'd like the unit to be capable of handling two probes at once, should the need arise. For this, I would have to buy another controller.
3. The idea of mounting one or two separate SLC OEM boards onto a third board with my own stuff doesn't appeal to me, mounting them separately and wiring them in does it even less.

It's not like the cons outweigh the pros going either way, it's just what my plan is at the moment. I may still give it up, and buy some SLC OEMs. :)
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by Fred »

No crucification for using chipped OEM stuff. You're likely right about ease of supplementing, in your case.

Fair enough re the gotchas.

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!
toalan
Wideband Wizard
Posts: 241
Joined: Tue Jun 10, 2008 2:53 am
Location: Toronto Canada
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by toalan »

Well I can put in a custom linear output curve for you so you do not have to touch I2C. I2C is a good protocol for the lambda modules as there is built in addressing so you can run multiple SLC OEMs on the same 2 lines, alternatives are UART and SPI both of which require more lines for more devices.

If you want confidence in your design that it is accurate and will not cause you engine to blow up then you will need lab test gases to bench and debug your design, I pay 4k-5k for a tank of lab gas.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by Fred »

Alan, if you can do that to order, advertise it on your page "Available with output range suitable for diesel use on request" or similar. You lost another sale to that recently for the same reason.
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: Bosch LSU 4.x controller from Arduino / Maple or similar

Post by toalan »

I do modifications to the code only for special circumstances, even a small change in the code requires testing and I need to keep a copy of the modified source files as a record of what I did if the customer runs into problems.

Blown seems to know his stuff, I am willing to give him a discount on the modules, I would like it if he put my modules to the test and asks me technical questions on how I do things on this forum to which I will happily answer.
Post Reply