Personal tools
User menu

Difference between revisions of "Porsche 928 LH Replacement Prototype"

From Francois Louw

Jump to: navigation, search
Line 1: Line 1:
 +
=Porsche 928 LH Replacement ECU=
 
The discussion forum can be found at [http://forums.rennlist.com/rennforums/928-forum/602152-plug-in-lh-replacement.html Rennlist]
 
The discussion forum can be found at [http://forums.rennlist.com/rennforums/928-forum/602152-plug-in-lh-replacement.html Rennlist]
  
Line 60: Line 61:
  
 
[[File:ECU1-PCB.jpg|500px]]
 
[[File:ECU1-PCB.jpg|500px]]
 +
 +
==PCB Creation and populating==
 +
 +
The PCB that I must make is a two layer pcb with 0.006" gaps between tracks and 0.012" vias. That is small, and I cannot do it at home. So I sent the info to specialists and received my PCB (5 of them).
 +
 +
All the components were ordered from Digi-Key. 34 Different components, 840 components in total for 5 boards)
 +
 +
After I got the PCB and components it was time to play around with solder paste and put all the components on. I baked the PCB, and then soldered on the through hole components.
 +
 +
There was a small delay with getting the processors, thus the last photo here is the PCB complete without processor.
 +
 +
==Integration==
 +
 +
Ok, this step is a really important one. I have to check my design to see if everything works, fits and doesn't blow up.
 +
 +
Powering up the board, checking the power LEDS and verifying voltages was first, afterwards checking the digital inputs, and alalogue voltage levels. Here is a list of mistakes I made.
 +
 +
The LM317 regulator pin outs in the datasheet is numbered 1-3-2 (3 is in the middle) and in my schematics I used 1-2-3. That now means that I need to make a small wire-mod to fix that.
 +
 +
The LH Connector gaps between ping I measured as 5.08mm, but it is in fact 5mm. This means the connector fits a bit tight, but not a problem. (In retrospect I should have realised that it is 5mm and not 5.08, because it is german made and in the 80's the germans were already fully on the metric system.
 +
 +
My comparators that I use to translate from 0-battery voltage to 0-3.3v I powered from 3.3 instead of from the battery voltage. This can be fixed by cutting a track and doing a wire mod.
 +
 +
Those three mistakes are all that I made. After fixing those the unit's hardware works perfectly. I made a small test application that flips my outputs randomly and puts my test LEDs on when inputs are triggered and everything works perfectly.
 +
 +
the next step is to program the unit. The programming will be the remaining steps
 +
 +
==Programming phase 1==
 +
 +
Ok, here is a video clip of the car starting and idling with my ECU (1 Minute).
 +
I switched off the car in the end.
 +
My idling is adjusted to idle higher, will readjust after the units works well.
 +
 +
{{#ev:youtube|-JIH2r-TW0g}}
 +
 +
At the moment I have just done the idling programming. There is no safety shut off of the fuel pump, and the ECU ignores the RPM and MAF. This is just to illustrate that the unit can get inputs and switch the outputs.
 +
 +
The LEDs at the CPU cant be seen in the video but they are flashing in rythm to the EZK inputs and the one far right lights up at WOT.
 +
 +
This weekend I will spend most of my time doing the programming.
 +
 +
The programming phases are listed as follows:
 +
 +
1) Idling
 +
2) Fuel adjustment according to RPM
 +
3) Adding MAF readings and adjusting to fuel map
 +
4) Add support for engine temperature, safety fuel cut off, tank venting, flappy control
 +
5) Add exhaust feedback support and support for 2 fuel maps - normal/WOT
 +
6) Add communication with PC via Serial, followed by USB
 +
7) Make fuel map dynamically changeable and make windows interface software
 +
8) Dyno the car
 +
9) ?
 +
 +
A rough estimate will be 3-4 weeks then all the programming should be done. Hopefully I will be done earlier, so I can enjoy the car more.
 +
 +
I will keep everyone updated with videos and I will definitely let everyone know when I'm done and it works perfectly.
 +
 +
Remember I only have 4 units "in stock" at the moment, It will be a first come first serve when the project is done, afterwards I will order more PCB and components.
 +
 +
Afterwards I will modify the PCB and make units that will be able to work with the 25 pin LH2.2.
 +
 +
==Programming Phase 2: Fuel adjustment according to RPM==
 +
 +
Ok, lets give the youtube link first then I will give my boring explanation.
 +
 +
{{#ev:youtube|_HC11F8Bi80}}
 +
 +
In this video my setup is me sitting with laptop, connected to ICD3 connected to my ECU. The ICD3 in debugging mode allows me to stop and start the CPU when I want (in the bottom of the video on the pc screen you can see me click the run and pause buttons)
 +
 +
I have programmed the first part of my fuel map that looks in a 1 dimensional array for the injector opening time.
 +
 +
To calculate the RPM I use an internal timer on the CPU. The timer runs at half the CPU speed (40 MHz), along with a divider of 256 that I programmed in. This will yield a timer value of 156.35 for every ms. A bit of calculation later gives me a magic number of 11719. When I take the number 11719 and divide the timer value that measures the time between EZK pulsed, I get a nice 100xRPM value. (value of 5 = 500 rpm etc). Using this method I get a 0.002% error. Meaning I read 7000 rpm instead of 7000.149 (Personally I think this is close enough)
 +
 +
I then use that to look up in my table to get the injector opening value.
 +
 +
The next step is to program the unit to take the MAF into account. That will not be done today, If I am lucky (read: will not sleep a lot tonight) tomorrow the MAF will be sorted and I will post a video of me driving around the block.
 +
 +
==Programming Phase 3: Fuel adjustment according to MAF and RPM==
 +
 +
Ok, here is the video...
 +
 +
{{#ev:youtube|kE74lI-tjiE}}
 +
 +
...and here is the explanation.
 +
 +
I finally got the A2D converter going on the CPU, took more effort than I thought it would, but at least it is working. In the video the four LEDs at the CPU indicates the voltage of the MAF.
 +
 +
I have implemented a basic fuel map that uses RPM and MAF to get the fuel. All of the fuel values in the fuel map are guessed, so the AFR is completely wrong.
 +
 +
The software is only set up to work with a maximum MAF input voltage of 6.6V. The next revision I will allow for higher voltages if anyone there wants to use another MAF/MAP that goes higher.
 +
 +
But it is good enough to drive with the car. I do not have a vid of me actually driving with the car because of my tranny messing me about. Tomorrow the tranny will be removed and fixed, so I will not be able to do much more coding during next weekt till I get it back.
 +
 +
While I wait for the tranny I can continue with some of the coding.
 +
 +
==Programming Phase 4: LH Functionality==
 +
 +
Ok, during the time the car was in for repairs I continued working on the coding. The following stuff is implemented and works:
 +
Fuel Pump Safety switchoff - After 10 sec of no engine turning the fuel pump will switch off
 +
Low battery compensation - When the battery voltage drops the injector open time is increased to compensate
 +
Resonance Flap - The resonance flap opens and closes depending on the RPM
 +
Idle speed control - The idle speed control signal is sent out.
 +
Closed Loop - The exhaust sensor is read and depending on the adjustment pot the fuel is enriched or leaned out (Can be enabled/disabled)
 +
Initial engine warm up sequence - Mixture is enriched upon initial engine startup
 +
AC Enrichment - When the AC is switched on the fuel is slightly enriched
 +
Auto Idle Drop - When the box is in neutral the mixture is leaned out a bit
 +
Engine Temperature - Mixture is enriched when engine is cold
 +
WOT Mapping - Uses a different fuel map on WOT
 +
 +
All of the above is working and is customiseable (how much to enrich with what temperatures, the amount to enrich/lean out with the AC, Idle Drop etc)
 +
 +
And to show off a bit I have two videos of me driving around the block today with the new software.
 +
 +
{{#ev:youtube|ROYZuZNc_b8}}
 +
 +
{{#ev:youtube|6Z2-5_UK_Kg}}
 +
 +
The following still needs to be done:
 +
"Accelerator Pump" - When the pedal is pressed the mixture must be enriched to compensate
 +
USB - The coding for the USB port still needs to be done
 +
Windows Tuning - The interface to tune and adjust all the settings must still be written
 +
 +
==Programming Phase 5==
 +
 +
Ok, took me quite a while to get to this point. There was a lot of small bugs that had to be fixed. Unfortunately the only time when the bug popped up was while driving. After about a month of proper ECU testing and driving I am confident that all the bugs have been sorted. The "Accelerator jet" coding is also done, and is working perfectly.
 +
 +
The USB driver side on the ECU was giving me hell and I was stuck for a few weeks till last night late. I was not able to get communication between the PC and the ECU. Turns out that there is a mistake in the datasheet and application notes of the PIC32 processors. I figured out when I saw that the starter kits from Microchip schematics looked "Wrong" compared to the datasheet and app notes. A small wire mod on my board and suddenly my USB code works.

Revision as of 20:09, 29 December 2012