Author Topic: ECU Simulator next gen - 5AM  (Read 29892 times)

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
ECU Simulator next gen - 5AM
« on: December 14, 2017, 10:54:29 AM »
Hi,

some might remember that I built a test board to create an virtual engine with a 15M and 15RC ECU http://wildguzzi.com/forum/index.php?topic=67653.0;nowap. Some months ago a Aprilia Mana came into my possession, which uses the 5AM ECU. And shortly afterwards a Guzzi Norge, also using the 5AM. So I decided to built a 2nd ECU simulator for the 5AM and make it versatile enough to run both Aprilia and Mana BINs plus the assorted accessories like dashboard and TCU.

The first step was to arrange the wire loom incl. handle bar switches and ignition switch from a Mana and the 5AM ECU on a board.




An operator panel was manufactured, containing potis to simulate TPS, engine and intake air temperature, ambient air temperature, air pressure and fuel level. Switches for neutral, side stand, brake, fall sensor, clutch and oil pressure as well as assorted LEDs were added.




A 1200 Sport dashboard, supposedly defect, came my way and found its place.




Then a Stelvio display plus paired key found its way into the laboratory. After some trials a signal generator connected to the wiring loom provided the speed signal. As the pin out of the Aprilia loom to the dashboard and the ECU are different, even the different Guzzi models have slightly other pin outs, a bread board and 40 cables are used to patch as needed.




The first attempt to simulate the narrow band probe signal worked, but not reliabely. The ECU expects a signal between 0.3-1.1V at a frequency of 1-3Hz. A steady signal provokes an error.




So the signal generator was used to provide the required signal. Eventually a Arduino will be used to provide a PWM signal.




The operator panel was redesigned and 2 staggered potis each for engine and intake air temperature now provide sufficiently high enough resolution to adjust the temperatures.




More or less finished, but it's certainly work in progress. In addition to the software suite (GuzziDiag, BinWriter/Reader, EEPROMWriter/Reader) from Beard a 4ch DSO will help to track signals.




The virtual engines now runs with all Guzzi BINs, first findings as to the EEPROM content are already being processed. Operation of the dashboard via the handle bar switches from the Aprilia also work.

Unfortunately the Aprilia BIN doesn't yet allow running the virtual engine. This might be due to the TCU (Transmission control unit) not being present, the missing Aprilia dashboard plus paired key or other cut outs (the Mana is an automatic, no gears or clutch) which I haven't found yet.

While already merrily measuring away some further steps are planned.
The barometric sensor is inside the dashboard and the data is send to the ECU on the CAN bus. So, three pins of the sensor will be de-soldered and the points on the PCB will be connected with cables to the poti.
The dashboard also contains a (smaller) ECU and 24C16 EEPROM. While I have no idea how to connect to the dashboard ECU (there never were any updates published by Guzzi AFAIK), the EEPROM is more accessible. Cables will be soldered to the 24C16 and reading and writing is planned to be done using the Arduiono as well. Contents of the 24C16 include mileage, ID of the paired keys and other interesting stuff.

Beard and PaulDaytona are very supportive, Beard and I had a pyjama party in front of the testboard some weeks ago during a rainy weekend.

If any of you should know of a used (only electric needs to work, the mechanical condition doesn't matter) TCU and a dashboard (condition same as TCU) plus paired key from a Mana, preferably in Europe and at a cost suited to the hobby budget available, please contact me.

Cheers
Meinolf
« Last Edit: December 14, 2017, 10:58:02 AM by Meinolf »

oldbike54

  • Guest
Re: ECU Simulator next gen - 5AM
« Reply #1 on: December 14, 2017, 11:06:27 AM »
 Very impressive  :bow:

 Now can you dumb it down a bit for us regular folks  :laugh:

 Dusty

Offline lucian

  • Gaggle Hero
  • *****
  • *
  • *
  • *
  • *
  • Posts: 3316
  • Location: Maine, Ayuh
Re: ECU Simulator next gen - 5AM
« Reply #2 on: December 14, 2017, 11:10:13 AM »
Awesome work !  I know next to  nothing about electronics but find this fascinating.  What is your original intent behind developing such a devise? Thanks for sharing your creation. :thumb:
« Last Edit: December 14, 2017, 12:14:07 PM by lucian »

Offline Chuck in Indiana

  • Gaggle Hero
  • *****
  • *
  • *
  • *
  • Posts: 29445
Re: ECU Simulator next gen - 5AM
« Reply #3 on: December 14, 2017, 11:13:02 AM »
Very impressive  :bow:

 Now can you dumb it down a bit for us regular folks  :laugh:

 Dusty

Uhh, Dusty.. I think he already has..  :grin: :boozing:
Chuck in (Elwood) Indiana/sometimes SoCal
 
87 AeroLario
95 Skorpion tour
22 Royal Enfield Classic 3 fiddy
 "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."
Albert Einstein

Wildguzzi.com

Re: ECU Simulator next gen - 5AM
« Reply #3 on: December 14, 2017, 11:13:02 AM »

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #4 on: December 14, 2017, 11:39:05 AM »
Hi,

indeed, this was supposed to be the executive summary of the project. So dumbing it down might be difficult.

The basic idea, same as previously with the 15M/RC project,



is to reverse engineer the program code in the ECU, find the relevant maps and scalars and then use it to optimize the BIN. More or less a blue-printing approach.

Alas, my skills and knowledge in regards to electronics or software are at -10.000 feet, my education is civil engineering and work as marketeer/sales/mgt. in the IT biz. So this was and is a dumb persons approach, relying mostly on tenaciousness and the liberal support from Beard, Paul and others.

The testbed approach worked quite well, at least initially, with the 15M/RC. However, due to the large number of unknowns I eventually had to dive into the dissassembled code of the ECU program and use both the testbed and the code explorations. The 15M/RC use a 68HC11 CPU, the assembly language is well documented and I could understand some of it. Like, 0.1% or so.

The 5AM uses a different CPU (and interfaces with the 2nd ECU in the dashboard), and more important, the code was written in a high-level programming language and compiled with highly optimizing compilers. Which, in laymens terms, means that the challenge to reverse engineer the code get much more difficult. I do have the dissassembled code of the Mana and Guzzi BINs, but it's not the same assembly language used in the 15M/RC. So, a new language and unknown grammar. Difficult - for me. If there are skilled programmers around willing to invest some time in this project, stand up and be counted.

The eventual result of the work with the 15M/RC was that I could correct some bugs in the code and create BINs, having maps and scalars suited to my V11 and Jackal, which provide more power/torque, run more smoothly and consume less fuel. I distributed these BINs liberally, some are being used in the US as well. My V11 and Jackal are permanently equipped with data loggers from Innovate and Zeitronix. AFR for both cylinders, TPS, rpm, engine temp/air temp, voltage and MAP are logged during each drive, the resulting data is analyzed and used in further optimization of the BINs.

Cheers
Meinolf



Online lazlokovacs

  • Gaggle Hero
  • *****
  • *
  • Posts: 1079
Re: ECU Simulator next gen - 5AM
« Reply #5 on: December 14, 2017, 03:18:41 PM »
this looks like great stuff, keep on keepin on!

 :thumb: :thumb:

Meinholf's BIN's ran great in my Calvin and his generous help gratefully appreciated.

That said, I've since de-up-graded to carbs, but those virtual operating panels are truly amazing endeavours.

 






 

pete roper

  • Guest
Re: ECU Simulator next gen - 5AM
« Reply #6 on: December 15, 2017, 03:56:25 PM »
I've been keeping my eyes open for a wrecked Mana to get a TCU from but so far no joy. One of the problems is they are pretty rare.

Offline normzone

  • Gaggle Hero
  • *****
  • Posts: 3076
  • '72 Eldo - 1980 to 1990 - '99 Bassa 2014 - 2023
  • Location: San Diego CA
Re: ECU Simulator next gen - 5AM
« Reply #7 on: December 15, 2017, 04:14:09 PM »
Will you requires a simulated rider for a simulated ride?

QUOTE: " My V11 and Jackal are permanently equipped with data loggers "

Very, very cool.
That's the combustion chamber of the turbo shaft. It is supposed to be on fire. You just don't usually see it but the case and fairing fell off.

Offline Bluerobotz

  • New Egg
  • *
  • Posts: 67
Re: ECU Simulator next gen - 5AM
« Reply #8 on: December 15, 2017, 11:23:51 PM »
Have you tried de-compiling with Avast RetDec? Platform independent an de-compiles to C or Python source. It has just been made into an open source project. I'm not sure of what type of processor you are using, so I can't be sure of whether it is supported.

https://retdec.com/decompilation/

I wish I could help you out, but I'm no expert in this. I can certain write C code though so give me a shout if you need help. The last time I needed to de-compile was about 15 years ago, and that was sucked out as assembly code which I was fairly good at back then. Keep us informed and I'll chip in where  I can.

Dave
2003 B750, 1984 GPz900R A1, 1985 GPz900R A2, 1981 V50 Monza, 1973 Eldorado Civilian

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #9 on: December 18, 2017, 02:48:05 AM »
Hi Dave,

thanks for the link and the offer to help with the Firmware. The 15M/RC uses 68HC11 and the 5AM a ST10F269. Neither are supported by Avast.

Anyway, the dissassembled code is available. The task is to understand the assembly code, as it does not contain any comments as one would find in the original source code.

If you are willing to take a look, I'll be happy to send you the code.

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #10 on: December 18, 2017, 03:03:35 AM »
Hi,

in the meantime an Arduino board was added to the setup. It's currently used for two purposes. The first is to provide an adjustable speed signal to the ECU and thereby the dashboard, as well as providing 2 signals simulating the input from the Lambda probes. Beard invested plenty of time and brain smarts in writing and debugging the Arduino sketch. That guy really is a genius, it's unbelievable how freely he supports. Support him!




The second is to access the EEPROM on the dashboard. Cables were soldered to the SDA/SCA pins of the EEPROM, the RST pins from the ECU and the Vout of the barometric pressure sensors, so that the barometric pressure can also be changed via a poti on the operator panel.







Cheers
Meinolf

Offline tris

  • Gaggle Hero
  • *****
  • *
  • *
  • *
  • Posts: 2794
  • Location: United Kingdom
Re: ECU Simulator next gen - 5AM
« Reply #11 on: December 18, 2017, 05:10:21 AM »
Top Work Meinolf  :bow: :bow:

Can you explain why you decided on this route rather than going via a Microsquirt (or similar) after market ECU?

2017 V9 Roamer
2005 Breva 1100 (non ABS) "Bruno" - now sold
1995 Cali 1100 - carby   "Dino" -now sold
1993 TW125 "POS" - Resting

Offline yogidozer

  • Gaggle Hero
  • *****
  • Posts: 2920
Re: ECU Simulator next gen - 5AM
« Reply #12 on: December 18, 2017, 05:20:21 AM »
Remember back when...feeler gauge, timing lights, maybe a dwell meter if ya had one?

Back When.......Thanks Tim




https://www.youtube.com/watch?v=9PgfQpJFYp8
« Last Edit: December 18, 2017, 05:22:23 AM by yogidozer »

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #13 on: December 18, 2017, 05:35:18 AM »
Hi,

Can you explain why you decided on this route rather than going via a Microsquirt (or similar) after market ECU?

because almost everybody is using the OEM ECUs and the knowledge gained can be shared and used. I did look into MyECU, but the 15M was already there.

Cheers
Meinolf

Offline tris

  • Gaggle Hero
  • *****
  • *
  • *
  • *
  • Posts: 2794
  • Location: United Kingdom
Re: ECU Simulator next gen - 5AM
« Reply #14 on: December 18, 2017, 06:54:27 AM »
Hi,

because almost everybody is using the OEM ECUs and the knowledge gained can be shared and used. I did look into MyECU, but the 15M was already there.

Cheers
Meinolf

Aha - that makes sense!

I've been thinking about the Microsquirt as my B11 suffers from the "poorly dash syndrome" and given that the immobiliser is in the dash it seemed like a way to escape the problem should the dash die completely

Still, maybe your Herculean efforts will find where the immobiliser code hides in the ECU and give us the means to duck around it rather than go the aftermarket ECU route

Keep up the good work

Tris
2017 V9 Roamer
2005 Breva 1100 (non ABS) "Bruno" - now sold
1995 Cali 1100 - carby   "Dino" -now sold
1993 TW125 "POS" - Resting

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #15 on: December 19, 2017, 01:23:00 AM »
Hi,

the dash EEPROM is accessible. Reading and writing works, now beginning to decipher the content.

User code change works, but plenty of Bytes left.









Cheers
Meinolf
« Last Edit: December 19, 2017, 10:30:28 AM by Meinolf »

Offline Sheepdog

  • Gaggle Hero
  • *****
  • Posts: 5575
  • 2007 Moto Guzzi California Vintage
  • Location: Waldheim, Louisiana. USA
Re: ECU Simulator next gen - 5AM
« Reply #16 on: December 19, 2017, 06:43:28 AM »
A worthy endeavor, Meinholf. As a 15M user, I appreciate your efforts...
"Change is inevitable. Growth is optional." John C. Maxwell

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #17 on: December 19, 2017, 10:13:06 AM »
Hi,

A worthy endeavor, Meinholf. As a 15M user, I appreciate your efforts...

worthy or not, thanks for the kind words. Actually, I am already planning to apply the learnings gained during the construction of the 5AM ECU simulator and upgrade the 15M/15RC simulator.

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #18 on: December 19, 2017, 10:19:32 AM »
Hi,

after getting acquainted with the dashboard and the operation Beard and I pooled our insights. So here's the current status. The green'ed cells are the ones where I believe that they are completely known. Beard is already preparing a XDF.





The 1200 dashboard is currently being operated as stand-alone unit, e.g. not connected to the wire loom and ECU. Once connected to the ECU I need a paired key, which I don't have, to start and run the virtual engine.

So, I either need a dashboard (in a state where soldering cables to the EEPROM doesn't matter) with a paired key or insights in how to extract the transponder value from a key. Once this is available I can apply a speed signal and identify total mileage, trip mileages, lap times, maybe speedo correction factor, etc.

Anybody here with a workable approach on how to extract the key transponder value?

Cheers
Meinolf
« Last Edit: December 19, 2017, 10:24:02 AM by Meinolf »

pete roper

  • Guest
Re: ECU Simulator next gen - 5AM
« Reply #19 on: December 19, 2017, 10:47:45 PM »
I may be able to help with a dashboard with key. Does it matter what model?

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #20 on: December 20, 2017, 12:50:46 AM »
Hi Pete,

thanks for the offer. No, I guess any dashboard (Stelvio, Norge, Griso, Breva, 1200 Sport) will serve the purpose.

You do understand that, if it's not already taken apart, I would have do so and to solder cables to the PCB?

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #21 on: December 20, 2017, 01:00:28 AM »
Hi,

more entries identified.





Those identified cover most of the settings selectable via the dashboard. But plenty of Bytes are written in the higher address range and not reflected in any dashboard setting. So, the quest continues.

Time, time format (12/24) and Display brightness are not written to the EEPROM. The assumption is that the respective values are kept by the RTC (inside CPU?) and LCD controller.

Cheers
Meinolf

pete roper

  • Guest
Re: ECU Simulator next gen - 5AM
« Reply #22 on: December 20, 2017, 01:07:57 AM »
Yup, but sometimes learning stuff costs.

All the electronics, even mapping with known ECU's is NOT my area of expertise so I have to rely on the help with this from the likes of Bernt, yourself, Paul and Mark. I'm more than happy to contribute in any way I can. If it requires the sacrificing of a dashboard? Meh? That's what it costs!

Tomorrow I'll see what we have hanging about. I know I have a complete lock set and dash with two keys of a Griso but I'm also pretty sure I have a Stelvio dash with a single matching key. I'll have to have a dig through the mountain of munt but over the Christmas period Michael and I will be re-locating a lot of our 'Stock' to locations away from the workshop in a pathetic attempt on my part to get more organised! :D

Pete

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #23 on: December 20, 2017, 01:15:56 AM »
Hi Pete,

that's a splendid attitude :thumb: :bow:

A dashboard with a single key will be enough to connect it to the loom and ECU and start the virtual engine.

I'll at least cover the shipping costs. Which, btw, are very reasonable. One of my daughters currently is is Australia and needed a new digicam. DHL cost was 3,90€.

Cheers
Meinolf

Offline Bluerobotz

  • New Egg
  • *
  • Posts: 67
Re: ECU Simulator next gen - 5AM
« Reply #24 on: December 20, 2017, 02:03:58 AM »
Hi Dave,

thanks for the link and the offer to help with the Firmware. The 15M/RC uses 68HC11 and the 5AM a ST10F269. Neither are supported by Avast.

Anyway, the dissassembled code is available. The task is to understand the assembly code, as it does not contain any comments as one would find in the original source code.

If you are willing to take a look, I'll be happy to send you the code.

Cheers
Meinolf

Hi Meinolf,

no worries, send it to me and I'll have a look. I can't promise much though, life is pretty busy at the moment, and its been a long time since I did this so I'm pretty rusty. Have you done any work on it already? If so, send that too, the more info the better. Thinking about it, we do have a steady stream of undergraduate/newly graduated engineers going though our place all the time. Maybe I could get one or two of those on the case.

Thanks

Dave
2003 B750, 1984 GPz900R A1, 1985 GPz900R A2, 1981 V50 Monza, 1973 Eldorado Civilian

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #25 on: December 20, 2017, 07:01:39 AM »
Hi Pete,

STOP - don't send anything yet. Beard came up with a nice approach, which might work with what I already have at my disposal.

Delete the transponder keys in the EEPROM and the pair 2 keys. I have one working key paired with the Stelvio display and the keys from my Norge. I'll connect the dash to the loom/ECU and try this first.

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #26 on: December 20, 2017, 07:03:12 AM »
Hi Dave,

no worries, send it to me and I'll have a look

great, together we are strong :-)

I got your PM, files will be send later today.

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #27 on: December 21, 2017, 03:14:16 AM »
Hi Pete,

after more tests yesterday evening with the dashboard connected to the loom and ECU it finally died (I received it as defective in the first place). I could confirm the addresses for the mileage, 4 identical words beginning at $10 and $20 and the first run indicates that no checksum is written to $05/$25. So here's the current view:





It also seems that the spurious data appearing in the higher address space only appears when the dashboard is not communicating with the ECU. Once connected it was FF everywhere, the only exception being a single word.

Pete, your offer to sponsor a dashboard is relevant again. As written above no key is needed.

Cheers
Meinolf
« Last Edit: December 27, 2017, 11:57:02 AM by Meinolf »

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #28 on: December 27, 2017, 12:01:04 PM »
Hi,

Will you requires a simulated rider for a simulated ride?




so sorry, after reviewing the applications I selected a suitable driver, suggested and sponsored by one of my daughters.

Cheers
Meinolf

Offline Meinolf

  • Gosling
  • ***
  • Posts: 243
  • Location: Germany
Re: ECU Simulator next gen - 5AM
« Reply #29 on: December 27, 2017, 12:36:42 PM »
Hi,

the EEPROM is now mostly understood and documented. We could also determine the checksum calculation algorithm, it covers the contents of the block from $10-$18.





The operator panel was upgraded again to cope with the changed requirements. The Lambda signal amplitude, a 5V PWM signal generated by the Arduino, can now be adjusted with a poti to influence the Lambda 1/2 voltage and Lambda 1/2 integrator values. The cables connecting the EEPROM programmer to the Dashboard EEPROM can now be quickly disconnected to avoid signal interference in the communication stream between CPU and EEPROM. And Up/Down/Set buttons were added as well for more convenient usage.





Some research was done about the pinouts of the dashboards. All service manuals and wiring diagrams were reviewed and a table was created listing each pinout by model and dashboard. That simplifies connecting the dashboard(s) to the Aprilia cable loom and helps avoiding misconnections potentially endangering the electronics.

An attempt was made to collect the different dashboard firmware versions. The current status is:

Small dashboards (Griso/Stelvio/..)
MGST0003 und
MGST0004

APMG 0022 (Griso12008V)

Big dashboards (Norge/1200Sport/...)
APSN0002 (Norge 2V, Breva1100)

APSB0010 (Breva1100)
APSB0014 (Breva1100)
APSB0015 (Breva1100)
APSB00016 (1200Sport/Breva1200)

If you can add more here, it'd be appreciated. Bellagio, Norge1200GT and Griso1100 are still missing.

Cheers
Meinolf


 

***Wildguzzi Official Logo High Quality 5 Color Window Decals Back In Stock***
Shipping in USA Only. Awesome quality. Back by popular demand. All proceeds go back into the forum.
http://www.wildguzzi.com/Products/products.htm
Advertise Here