MEVD17.2 emulation in development

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
Check engine light code and error handling done in DME firmware, but not yet tested.

OBD device PCB layout done, adding a few features for future use before getting prototype boards made.

Working on automated code generation for EEPROM storage of ethanol content and custom CAN frames. No way I can handle a project of this complexity making code for each version by hand, especially given that wider applications of some of this work could cover thousands of software versions of Bosch "17" series ECUs. It is interesting trying to convert how you think to do something manually into Python.
 
  • Like
Reactions: doublespaces

Sbrach

Corporal
Oct 2, 2017
224
175
0
Ride
N55 DCT E82
Awesome progress.

Curious if you have had to rearrange the existing calibration section or if your additional tables and code are all utilizing currently unused space? Basically asking if additional tables/parameters I have defined outside the publicly available xdf are going to change in your release.
 

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
Awesome progress.

Curious if you have had to rearrange the existing calibration section or if your additional tables and code are all utilizing currently unused space? Basically asking if additional tables/parameters I have defined outside the publicly available xdf are going to change in your release.

Existing cal section unchanged.

Additional tables in currently unused space. These are used instead of some of the existing tables when flex fuel is enabled. New tables can be blended by ethanol content by adding their name (from the xdf) to a csv file and then I can make a new bin and xdf.

All the tables you have added will be able to be emulated out the box.

Automation nearly done, adding some safeties then testing.
 

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
Level 10 expert only visibility for power users :) I am about to confuse the crap out of most:

Ethanol content sensor frequency output -> microcontroller -> ethanol content (0.1% scaling so 1000=100% ethanol) -> CAN bus -> gateway > DME -> store result in memory backed up by EEPROM after driving -> this table to convert to ethanol %.

The flexibility here is to change the pointer to something else and scale the "ethanol" input how you like based on any variable you like. Originally this was going to be a voltage input from an ethanol content analyzer, but now it is from a CAN input. It could be a constant value that can be altered by flash or realtime tuning, a value backed up in EEPROM after driving as a map switch/blend value, some status from a water/methanol/port injection system...

Similar concept expandable to other features.

upload_2018-4-25_11-45-29.png
 
Last edited:

Sbrach

Corporal
Oct 2, 2017
224
175
0
Ride
N55 DCT E82
Good news about the existing tables. I’ll send you my xdf so you can see if I’ve added anything useful to you.

So essential you have added an abstract blend factor that can be configured as any input to interpolate infinitely between two tables or if you change the scaling you could basically switch between two or more maps. So for instance a 3 position switch connected to that input could toggle between 3 different load request tables with the middle table being some configurable blend of the other two. Valet mode, daily mode, kill mode. Or blend two fuel scalar tables based on WMI output so if the controller fails you at least aren’t running a lean target anticipating the meth that isn’t there. Or probably a dozen other cool ideas I’m not imaginative enough to come up with. Wow.
 
  • Agree
Reactions: LamboLover

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
Adding a few new safety features. Code to lookup the values and increase counter when they breach these limits is done. Will add tunable counter limit to trigger limp. Load vs RPM, with lookup of fuel pressure in MPa, and lambda in Lambda. Might use 0 to mean no limit. They have their own axes, and are realtime tunable. If they need to be bigger or higher resolution, they can be, but no need to be silly, they are safety tables and of course still interpolate.

Seems the responsible thing to do when people will no doubt be pushing their fuel systems. There seems little need for any other safety features beyond what the OEM already does, but these should allow a bit more control over limp conditions.
upload_2018-4-25_23-9-53.png
 
Last edited:

Sbrach

Corporal
Oct 2, 2017
224
175
0
Ride
N55 DCT E82
That is fantastic. Another safety feature would be a per cylinder output for when the DME cuts fuel. Would alleviate the biggest danger of PI.

I've been working on adding the HPFP VCV duty cycle to my logs but haven't quite got it figured out yet. I have the PID added and the raw value makes sense but I'm not sure how to figure out the conversion factor. My reason for doing this is because I am curious if the HPFP is out of flow at 30% ethanol and 19psi or if there is just a limit on the VCV duty cycle. I find it odd that N54 can run more ethanol/boost without crashing rail pressure using the same fuel pump especially since the piezo injectors flow more. Have you run into any VCV parameters or tables for 98g0b? It's hard going for me because all the info out there is F30 and the pump/valve is different so it doesn't align.
 

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
I have not looked into the VCV duty.

Output for when DME cuts fuel or feed to AIC... may as well just control the PI rather than fix something compromised but am going to get all this done first and think about that another time.
 
  • Like
Reactions: bradsm87

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
All properly scaled now, and changed so that the fuel pressure and lambda safety checks are deviations from target fuel pressure and target lambda. Bit more work involved in latching the result once they are tripped, organising the CEL/MIL, and making it run a lower load target if fuel pressure or lambda safety checks are triggered.
upload_2018-4-26_20-16-32.png
 

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
Limp adjustable for fuel pressure and lambda. Uses worst case of these and the knock value to lookup load ceiling main. I would put a much steeper gradient in load ceiling main contents.
upload_2018-4-27_23-1-49.png
 
  • Like
Reactions: Xer0449

aus335iguy

Colonel
Nov 18, 2017
2,248
803
0
Down under
Ride
335i DCT 2009
I thought I did but clearly Idon’t understand the technical aspects very well lol. Can you explain in layman’s terms what the implications of this are ?
 
  • Like
Reactions: LamboLover

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
I thought I did but clearly Idon’t understand the technical aspects very well lol. Can you explain in layman’s terms what the implications of this are ?
It is new DME program code and a new wireless OBD plug in device to do the following on N55/S55:

Realtime tuning whilst the engine is running. Any table or value, but not all at once, changes lost when DME shuts down after car locked but can be made permanent with a short flash once you are done experimenting/tuning. Could be used for live adjustment as well as tuning. This is done with TunerProRT on a PC using existing xdf. This is a rare feature on OEM ECUs and speeds up dramatically the tuning and development process.

Flex fuel or control of fuel, boost, timing, cold start based on input from ethanol content sensor or other setups like water/meth or port injection system. Could also be a manual map switch/blend and the switch device could be a phone and the setting is remembered when car is locked. New flex fuel tables also can be tuned whilst engine running. Safety features to show MIL/CEL if ethanol content input expected but missing. Safety features to show MIL/CEL if lean or fuel pressure too low.

The flex fuel input is through CAN bus via the wireless OBD device which is being made as small as possible but could be installed somewhere else and coexists with other OBD devices. Flex fuel sensor will be connected to the OBD socket pin 1. There are four other pins in the design available for future use.

Present status:

Realtime tuning works well with J2534 pass thru wired interface (eg Tactrix OpenPort 2.0).

Flex fuel and realtime code works well for months on E92 N55 except physical flex fuel input not yet tested.

Simulated ethanol content sensor (using function generator) working with development hardware on bench through F series gateway to DME.

Wireless CAN transfer from browser on PC to and from bench ECU with development hardware.

Safety and MIL work compiles but testing on bench DME this week.

Hopefully will get prototype OBD boards in June. Finish the OBD device firmware over the summer.

Most of the challenges are solved, it is the crucial part of putting it all together.

Most of the work will be able to be used on many other MED17 vehicles and with the correct integration/partnerships the device is capable of flashing and datalogging at very high speeds - designed to be as fast as the CAN bus is capable of.

There was a pivot for me when the flex fuel input used on N54 does not work on late N55/S55 which has resulted in the new OBD device design - it was then rude not to make it capable of so much more and aim to replace the need for a J2534 device for realtime tuning.
 
Last edited:

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
F series testing on bench. Following pass all tests in production intent DME code:
Realtime tuning
CAN input for ethanol content
Ethanol content being stored and recalled from EEPROM

Testing in progress:
Flex fuel table blending

Testing to do:
Limp/CEL/MIL for low fuel pressure/lean lambda
In car testing

OBD device board layouts complete, prototypes about to be ordered.
 

aus335iguy

Colonel
Nov 18, 2017
2,248
803
0
Down under
Ride
335i DCT 2009
So one of the big issues that has delayed MHD from releasing flex on N54s was the encryption to protect the custom code written. Do you intend on leaving this open source or will you protect it?
 

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
So one of the big issues that has delayed MHD from releasing flex on N54s was the encryption to protect the custom code written. Do you intend on leaving this open source or will you protect it?
I finished the encryption in September apart from a few days work later in the year to enhance it. I think some other issues including integrating things into the app took longer, but I was not involved in that.

I did a huge amount of open source stuff on the Evo from 2006 to 2009. Since then I have been commercial, and the last few years full time.
 
  • Like
Reactions: aus335iguy

LamboLover

Corporal
Apr 6, 2017
238
242
0
Ride
Everything
I don't talk much about the encryption stuff, but it is novel in the automotive aftermarket. It has been running flawlessly since September on my wife's N55 though.

There are other firsts here too: using CAN bus for custom inputs on an OEM ECU, and being able to freely realtime tune any table/value rather than just those the developer has curated/selected is also new to the automotive aftermarket without a physical emulation device in the ECU.

I hope the final quality and usefulness reflect the effort and innovations involved.

It is orders of magnitude more ambitious than the GT-R work I did for Cobb. The market enjoyed that. I know burbles will outsell realtime tuning, but maybe the most popular aspect of it will be realtime burble adjustment. I will try to suppress my feelings on that as long as my cat is fed.
 

aus335iguy

Colonel
Nov 18, 2017
2,248
803
0
Down under
Ride
335i DCT 2009
I did some tuning and even took some MOTEC classes back in the day circa 2004... I know how much easier real-time can make things especially when your chasing issues. That is a real game changer for us on N54 and it may be lost on some people but damn dude that’s impressive !