Author Topic: Reverse Engineering MIU G3 (based on V7 III and V9)  (Read 7487 times)

Offline Zenermaniac

  • Gosling
  • ***
  • Posts: 234
  • Location: Armpit of Ohio, USA
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #30 on: June 29, 2021, 10:06:11 AM »
Hi,

There's a user changeable flag which can dedicate the two main fuel to act as cold/warm main fuel tables. As, however, a multi-cylinder engine always requires different fuel values for each cylinder this arrangement would only make sense on a single cylinder engine. As it turns out the code base used in the MIUG3 is very similar to the MBC1 ECU used in a number of BMWs. Some of which, I believe, are single  cylinder engines.


Cheers
Meinolf

It’s interesting that the MIUG3 can be configured different ways. Can you clarify if, as used on our V7/9’s, the warm and cold tables are in fact configured as left and right? Thanks.

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #31 on: June 29, 2021, 10:42:40 AM »
Hi,

It’s interesting that the MIUG3 can be configured different ways. Can you clarify if, as used on our V7/9’s, the warm and cold tables are in fact configured as left and right? Thanks.

maybe this wasn't so obvious in the screenshots in a previous post. The main fuel tables are used for left and right cylinder, not for cold/warm use.

The first branch is set by Use_left_main_fuel_ flag_C7CD58, which is 1, hence the program flows directly to the MainFuel_LeftCyl_Ta ble_C7CD5A if the left cylinder is the currently active one (from a program point of view, the code supports up to 6 cylinders and a max. rpm of 20.000).

If this flag would be changed to 0, the flow would proceed to the next branch, Engtemp_above_thres hold_flag_8AFD. This would lead to using the MainFuel_RightCyl_T able_C7D25A values for both cylinders as long the engine temperaure is >60°C. Or to using the MainFuel_LeftCyl_Ta ble_C7CD5A values for the left cylinder if engine temperature is <=60°.





HOWEVER..... Changing the flag at C7CD58 from 1 to 0 would necessitate a MAJOR rework of the entire code, as so many flags and scaling operations would be concerned. So, try this only if you lost one of your cylinders.

But, joke aside, I can't imagine any reason why one would use the warm/cold scenario on a multi-cylinder engine. And even a single engine wouldn't require it as all relevant ambient factors like air/engtemperature, baro pressure and the like are taken care of by the numerous scaling and triming ops.

Cheers
Meinolf

PS I guess I fell into the trap of assuming that everybody understands the logic of program flow and the colors used for the connecting lines between the boxes. Three colors are used. Blue if there's no conditional branch involved. Green if a conditional branch is answered positively, for example is 1=1, the program flow then would be using the green line. Or the opposite, then the red line is used.
« Last Edit: June 29, 2021, 10:49:19 AM by Meinolf »

Offline Zenermaniac

  • Gosling
  • ***
  • Posts: 234
  • Location: Armpit of Ohio, USA
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #32 on: June 29, 2021, 10:59:46 AM »
Thanks, Meinolf. It’s becoming clearer.

Back when I was involved in machine level and assembly language code we only had green screens and dot matrix printers. Lol.

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #33 on: June 30, 2021, 04:32:02 AM »
Hi,

I know what you mean. My first and only formal contact with programming, a language called APL, was more than 40 years ago while I was studying mechanical engineering. C64 was the leading edge home computer at that time and I wrote my thesis with Vizawrite on it.

But, you live and learn. Natural curiosity, sufficient time and the generous and patient support of Beard (the Guzzidiag programmer) and John, an EE from the UK, helped in understanding assembler. Well, the understanding is very limited, but being one eyed amongst the blind is ok.

I do wonder where all the computer whizz kids are. Certainly not in the Guzzi or Ducati or Aprilia or Morelli community. Except for Beard and John I have yet to meet anybody having a clue about assembler.

Cheers
Meinolf

Wildguzzi.com

Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #33 on: June 30, 2021, 04:32:02 AM »

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #34 on: June 30, 2021, 11:34:24 AM »
There is one table for Idle at 0x7D77A, how is the right and left distribution adjusted?
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Offline Zenermaniac

  • Gosling
  • ***
  • Posts: 234
  • Location: Armpit of Ohio, USA
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #35 on: June 30, 2021, 01:34:26 PM »


Changing any of the trim and scaling scalars or tables generally not a good idea. In the past I've found that Marelli uses airtemp/pressure correction values in the respective tables of the 15M/RC and 5AM which are wrong. They differ from the values dictated by the general gas equation pV=mRT, I created a spreadsheet several years ago to calculate the correct values and used this in my BINs.

Cheers
Meinolf

You mention that you had found wrong values in the air temp/pressure correction tables. Just for grins I looked at my V9 table and using the 1976 Standard Atmosphere Calculations I came up with slightly different values.  I only checked two axis’, sea level at all temps and the standard reference temp at all altitudes (in millibars). My values are in red.





Is this along the lines of what you found or am I way off base?  Is it significant enough to change?

Thanks.

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #36 on: June 30, 2021, 11:53:51 PM »
Hi Chris,

There is one table for Idle at 0x7D77A, how is the right and left distribution adjusted?

the idle fuel calc uses, same as main fuel,  two tables. The one at 0x7D77A is for the left cylinder, the values for the right cylinder are calculated using a delta table at /D97A and adding/subtracting these values.

mov     r12, r8         ; IdleFuel value left
mov     r13, r4         ; IdleFuel delta value right
calls   0C3h, add_unsigned_R12_R1 3_sub_C30014 ; here the 2 values are added, or subtracted in case the delta value is negative
mov     r8, r4          ; IdleFuel value right





Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #37 on: July 01, 2021, 12:14:10 AM »
Hi,

Is this along the lines of what you found or am I way off base?

yes, this is along the lines of what I found in BINs from Guzzi, Ducati, Aprilia and Mana. Several years ago I built a spreadsheet to calculate the correct trims. The values here are from a Aprilia Mana because that's the file i found first :-)





Is it significant enough to change?

Well, the deviations are not really large enough to justify it. But, why accept wrong trims if a correction is easily done. And if the re-calc is started from the 1.0 value (green colored cells in the screenshot), then the values in the fuel tables can be left as they are.

When first looking into this I wondered if the deviations of the trim table values from the general gas equation were not accidential (I find it hard to believe that the programmers at Marelli don't know the physics) but reflected other influences. The only ones which came to mind were the fuel density, which is also changing corresponding with temperature and the fuel pressure regulator being fed by atmospheric and not by manifold pressure, which in turn influences the total pressure delta and hence the fuel pressure.

However, the trim table deviations are to erratic to achieve this purpose.

Cheers
Meinolf
« Last Edit: July 01, 2021, 02:09:21 AM by Meinolf »

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #38 on: July 01, 2021, 03:12:59 AM »
Hi Chris,
the idle fuel calc uses, same as main fuel,  two tables. The one at 0x7D77A is for the left cylinder, the values for the right cylinder are calculated using a delta table at /D97A and adding/subtracting these values.
mov     r12, r8         ; IdleFuel value left
mov     r13, r4         ; IdleFuel delta value right
calls   0C3h, add_unsigned_R12_R1 3_sub_C30014 ; here the 2 values are added, or subtracted in case the delta value is negative
mov     r8, r4          ; IdleFuel value right



Cheers
Meinolf
Thank you very much  :thumb:

I have add it to my V7 III XDF : https://1drv.ms/u/s!AuqxioVGI9b-iaU27CSFM4KGwAFKsA?e=ZesCF7
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Offline Zenermaniac

  • Gosling
  • ***
  • Posts: 234
  • Location: Armpit of Ohio, USA
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #39 on: July 01, 2021, 06:52:31 AM »
Thank you, Meinolf.  :bow:  :bow:


Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #40 on: July 03, 2021, 01:37:45 AM »
Hi,

... and using the 1976 Standard Atmosphere Calculations I came up with slightly different values.

at 1st glance I wasn't familiar with 1976 Standard Atmosphere Calculations, so I looked it up. This is not the base for the density change calculations, rather it's the shortened general gas equation pV=mRT. Which is being used in the spreadsheet mentioned above.

Here's a link to the spreadsheet, I hope it's self-explanatory. https://drive.google.com/file/d/1DOKKyUSbvLCOmPANT561f0rEtf-UE5HW/view?usp=sharing

Paste the existing values into the upper left cell area, and the corrected values are in the two cell areas below. The bottom one has hex-values for direct C&P into Tunerpro.

Cheers
Meinolf

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #41 on: July 03, 2021, 01:39:23 PM »
Here is what I get with values from my Roamer and adjusting labels for the differences of temperature and pressure points with the MIUG3. It looks like a lot of areas would run richer using those calculations. I'm curious about your using 990mb @ 20C (green) as a base. Is that a Guzzi thing? I would have expected to see 1013mb (sea level) @ 15C which is the standard for calculations I'm familiar with. I'm still learning, though.





Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #42 on: July 04, 2021, 02:15:16 AM »
Hi,

Here is what I get with values from my Roamer and adjusting labels for the differences of temperature and pressure points with the MIUG3. It looks like a lot of areas would run richer using those calculations. I'm curious about your using 990mb @ 20C (green) as a base. Is that a Guzzi thing?

I selected the base point where the trim factor was 1.00, as calculating the corrected trims from this starting point avoided the neccessity to re-calculate (shift) the fuel values. If the spreadsheet is used the factor 1.00 being in a different cell, the cell formulas have to be adapted. Did you do so?

Is that a Guzzi thing? I would have expected to see 1013mb (sea level) @ 15C which is the standard for calculations I'm familiar with.

The standard conditions vary between applications and over time. During my studies the standard condition used was 295,15K and 1013mBar. At the end of the day it doesn't matter which base point is used. The mass change over temperature and pressure is linear.

If the equation is reduced by using an equivalent term without the constants V and R the formula boils down to m⇔p/T - which in laymens terms means m⇔p/1 if the temperature is constant and m⇔1/T is constant.

https://en.wikipedia.org/wiki/Standard_conditions_for_temperature_and_pressure

Cheers
Meinolf
« Last Edit: July 04, 2021, 02:20:55 AM by Meinolf »

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #43 on: July 04, 2021, 03:40:28 AM »
Here is what I get with values from my Roamer and adjusting labels for the differences of temperature and pressure points with the MIUG3. It looks like a lot of areas would run richer using those calculations. I'm curious about your using 990mb @ 20C (green) as a base. Is that a Guzzi thing? I would have expected to see 1013mb (sea level) @ 15C which is the standard for calculations I'm familiar with. I'm still learning, though.




The MIU G3 outdoor temperature sensor, Air Intake Temperature, is on the electronic board and is not ventilated at all.
So for ten minutes, summer and winter, there is a difference of nearly 14 ° C more than the outside temperature ...
« Last Edit: July 04, 2021, 03:41:37 AM by chrisfer »
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Offline Zenermaniac

  • Gosling
  • ***
  • Posts: 234
  • Location: Armpit of Ohio, USA
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #44 on: July 04, 2021, 06:51:58 AM »
Interesting.
« Last Edit: July 04, 2021, 07:24:58 AM by Zenermaniac »

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #45 on: July 04, 2021, 07:31:09 AM »
Thanks, Meinolf. That makes sense. I sort of suspected that might be it but I’ve learned it’s counterproductive to assume something.

Thanks, Chrisfer. I hadn’t considered that engine heat would affect the sensor at the MIUG3. Should have.

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #46 on: July 04, 2021, 09:34:56 PM »
More MIUG3 curiosities for the sake of discussion.  I charted the percentage differences between my V9 right and left fuel maps. I realize that slight differences in manifold length from the "y" as well as small surface differences affecting flow as well as valves and seats, even flow into the cylinder and piston position will affect flow.  I would have expected much less variation than the results show. Like maybe one side is very slightly less efficient or has slightly more impedance to air flow. The chart shows highly chaotic differences and at some points more than 25% differences. How can this be? Is it due to turbulence at different throttle openings and RPMs? What else is a factor here?



 


Online GuzziOrDeath

  • Hatchling
  • **
  • Posts: 118
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #47 on: July 04, 2021, 10:15:06 PM »
What else is a factor here?




The exhaust.





Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #48 on: July 05, 2021, 12:33:35 AM »
Thanks, Chrisfer. I hadn’t considered that engine heat would affect the sensor at the MIUG3. Should have.
Even with the engine off, simply the ignition, the printed circuit heats the probe by ten degrees.
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #49 on: July 05, 2021, 12:37:50 AM »
More MIUG3 curiosities for the sake of discussion.  I charted the percentage differences between my V9 right and left fuel maps. I realize that slight differences in manifold length from the "y" as well as small surface differences affecting flow as well as valves and seats, even flow into the cylinder and piston position will affect flow.  I would have expected much less variation than the results show. Like maybe one side is very slightly less efficient or has slightly more impedance to air flow. The chart shows highly chaotic differences and at some points more than 25% differences. How can this be? Is it due to turbulence at different throttle openings and RPMs? What else is a factor here?




The first column really usable by opening very slowly is the 5th, 6.88 °.
10% less for the right cylinder for small openings, then it becomes very low.
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #50 on: July 05, 2021, 11:33:27 AM »
I zeroed the first two columns above 2250rpm to experiment. It gets rid of deceleration popping but increases engine braking a bit. Interesting effect as you feel the engine come back to life just before you completely stop.

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #51 on: July 06, 2021, 10:56:58 AM »
Hi,

after having some fun with the basic fuelling functions it's time to look at the less trivial stuff. So, let's have a closer look at the ignition.

It all starts off with the trap_50_0 sub and the subprogram group Engine_running_proc esses_sub_C4CAC6.





Which, amongst other interesting stuff, also calls Ignition_calc_sub_C 4CFD8





Nestled in which the first selection about which main/idle fuel tables will be used are taken in yet another subprogram, ignition_lookup_sub _C4D494.

Let's look at the main fuel tables first. Right at the top a branch conditions selects if idle or main fuel tables are required, which is the TPS state. If it's open, the next conditional branch is Engtemp_above_thres hold_flag_8AFD. The flag is determined elsewhere, but basically it's One if the engine temperature exceeds a threshold value and Zero if not. If the threshold (60°C in this BIN) is exceeded, then the Ign_Adv_Main2_Table _C79014 is used as base for the following calcs. If not, then Ign_Adv_Main1_Table _C78B14 is used.
(Btw, the naming is more or less based on other BINs I_ve looked at and doesn't yet reflect the usage).





Now for the idle stuff. TPS state again is the starting point. If it's closed, the state of which is determined elsewhere by start parameters and a self-adaption process, then the idle tables are choosen. IgnIdle_Clt_dis_Tab le_C79A14 is the one used if the drivetrain is engaged and IgnIdle_Clt_en_Tabl e_C79A54 if the drivetrain is disengaged.





So far, so good. A straightforward selection process without any complications.

Cheers
Meinolf



Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #52 on: July 06, 2021, 11:40:21 AM »
Fascinating information! Thanks for sharing.

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #53 on: July 07, 2021, 10:07:18 AM »
Let's look at the main fuel tables first. Right at the top a branch conditions selects if idle or main fuel tables are required, which is the TPS state. If it's open, the next conditional branch is Engtemp_above_thres hold_flag_8AFD. The flag is determined elsewhere, but basically it's One if the engine temperature exceeds a threshold value and Zero if not. If the threshold (60°C in this BIN) is exceeded, then the Ign_Adv_Main2_Table _C79014 is used as base for the following calcs. If not, then Ign_Adv_Main1_Table _C78B14 is used.
What I see while driving is that the table_C78B14 is the one used.

I did not see when the table_C79014 is used.

And what one can notice is that, surprisingly, this table is identical in all respects to the engine of the V7 III (750cc) and to the engine of the V9 (850cc).
« Last Edit: July 07, 2021, 10:13:30 AM by chrisfer »
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #54 on: July 07, 2021, 11:41:26 AM »
Hi Chris,

interesting. This leads to an enhanced understanding of the Engtemp_above_thres hold_flag_8AFD. The actual threshold situtation of the flag, 1 if engine temp > 60°C and 0 if below is certain. However, this is determined at the end of a routine in which the raw values of 2 ADC channels are checked. Not knowing which pins of the ECU connect to which pins of the CPU or ASICs makes it difficult to determine which ADC channel connects to which sensor. Further code analysis may shed some light on this by the process of elimination, but my understanding of assembler and processors is very limited, to put it politely.





Anyway, in light of your observation the conclusion is obvious. The main fuel table at (C)79014 is a limp-home table used if the engine temperature sensor is defective.

Cheers
Meinolf

Offline chrisfer

  • Hatchling
  • **
  • Posts: 115
  • Location: France
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #55 on: July 09, 2021, 12:27:26 AM »
Anyway, in light of your observation the conclusion is obvious. The main fuel table at (C)79014 is a limp-home table used if the engine temperature sensor is defective.
Cheers
Meinolf
indeed, that seems very possible.  :thumb:

Thanks  :bow:
« Last Edit: July 09, 2021, 12:28:28 AM by chrisfer »
2022 V7 850 Stone - 2019 V7 III Carbon - 2004 V11 RossoCorsa - 2002 V11 Le Mans - 1995 750 Nevada

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #56 on: July 09, 2021, 07:58:46 AM »
Hmmm. On my V9 the C78B14 and C79014 tables are identical. So, which ever is chosen - nothing is changed.

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #57 on: July 11, 2021, 12:31:27 PM »
Hi,

one might think that the previously introduced ignition tables for idle and non-idle operation more or less answer which ignition advance is used at a given rpm/TPS breakpoint. Well, not so. Let's take a closer look at the proceedings when delving into the ignition calc sub-program.

Here we see some initial decisions being taken. Is the current rotary process #7, is the engine turning, is the TPS closed, in between or WOT and a first branch into a subroutine if the engine is accelerating.





Then a short break is used to define TPS change speed. The current TPS value minus the TPS value from the previous cycle result in a delta value. This delta value is used to index TPS_deg_speed_Table _C7A270, which houses the TPS speed values. This value is used later to calculate ignition changes when accelerating. The a look at where we are in the warm-up stage. If it'still pre-crank, eg the starter us rotating but the engine is not yet running by itself, the code would lead directly to a calculation of the ignition dwell. But let's assume the engine is running already. A final check of the starter state and off we go to





consider the engine run modes. Modes 10 and 11 use different routines to calc ignition (and fuel as well) values. We skip these for the time being and arrive at the previously discussed ignition_lookup_sub _C4D494.





Now the values for the right cylinder are calculated by adding the value from the IgnAdv_Delta_Table_ C79514 to the main table values. The current ignition value is the massaged in the  IgnTemp_corr_sub_C4 D504.





Values from the air temperature and engine temperature trim tables are added. In case of engine temperature there are 2 tables, one for Idle and one for non-idle.





to be continued...

Cheers
Meinolf

Pdmartin

  • Guest
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #58 on: July 11, 2021, 01:23:50 PM »
There sure is a lot going on in that little TB!  Kudos to Meinolf for all his work delving into this.
I found out the MCU chip in use is an Infineon SAK-XC2060M 16 bit processor and a 95320 eeprom. I contacted Infineon to get data sheets and whitepaper applications. They replied that the chip was obsolete and no longer supported and information wasn’t kept. I wonder if the 2021’s are using a redesigned unit.

Online GuzziOrDeath

  • Hatchling
  • **
  • Posts: 118
Re: Reverse Engineering MIU G3 (based on V7 III and V9)
« Reply #59 on: July 11, 2021, 04:04:51 PM »
I wonder if the 2021’s are using a redesigned unit.


The MIU G4.




 

Quad Lock - The best GPS / phone mount system for your motorcycles, no damage to your cameras!!
Get a Wildguzzi discount of 10% off your order!
http://quadlock.refr.cc/luapmckeever
Advertise Here