What have I found out:
I had a few questions about the engine I needed answered about injector currents and fuel regulation currents and how the fuel pressure sensor worked. So I went on the hunt for some information....
A gentleman called Barry McCooey from
McCooey Engineering in the U.K. put me in touch with another gentleman called Gavin Merivale who is a Bosch Diesel Master Technician and also Bosch Diesel Systems Regional Trainer. Gavin explained about how the fuel pump works and is regulated and also some information on the fuel pressure sensor, and on the current used to drive the injectors. I will not divulge to much information and I will say that this information can be found in the "Bosch ESItronic database" and a books similar to "Diesel-engine Management" by Robert Bosch GmbH. I have invested in a copy of volume 4 and await delivery (the suspense is killing me). The information also confirmed my progress on home detection. Although one quite obvious thing I had not thought of was that when starting I cant inject fuel until a certain amount of pressure is in the fuel rail.
What does it mean for hardware:
1. I will have to add a more accurate
ADC to the board in order to watch the fuel pressure sensor, which conveniently enough has a linear relationship between fuel pressure and the signal voltage, another reason for the ADC is the fact that the sensor outputs up to 5volts and the on chip ADC's are not capable of converting over 3.3volts reliably. I will also have to make some logic circuitry, AND gates, to combine outputs from the CPU.
2. The route me and John were taking with the power supplies for the injectors will work (although not nearly as efficiently as Bosch, explained a little better
here), my little ECU
just has to make the correct PWM signal to limit the current. The
just part being that each injection has two stages first limiting current to 20amps(openage) and then to 12amps(non-meltage).
3. Fuel pressure regulation also needs to by controlled by PWM, although this is not a new problem, there is a new thing to worry about, and that is that if for some reason the circuitry fails to supply enough/any current to the controlling solenoid the pump will pump maximum pressure, the more current the less pressure. I think AUDI have a pump setup that works the opposite way.
What does it mean for software:
1. The fuel pressure sensor, have to figure out how the SPI bus works... Juice stuff... The software will have to change the duty cycle on the pressure regulator, another PWM output from the board.
2. I have been mulling this over in my mind a lot and I have been changing code forward and back as I have been thinking of the nicest solution. My problem is one of injection, do I tie up the CPU while injecting or how do I not have to tie it up? Its all in the match registers. To begin with I had four match registers, one for each cylinder, I switched the Match pin on to light the LED/injector and the match was set to trip off the LED at a pre calculated time. This worked beautifully. Then I realised that the injector needed to be PWMed, so I was going to tie the processor up in generating the signal in real time (yes how wrong does it sound!), this is not a
cool solution, but it worked for testing my timing and home finding algorithms. FYI at 5000RPM (more then a diesel will ever be required to run) there is 12,048 clock cycles between each injection. So I think the nicest solution is to have 4 GPIO pins for selecting an injector, 2 PWM outputs one for 20A and the other 12A, then the complicated bit. There are 4 match registers on the system timer, I can use two of these to trigger the close of the injector and the toggling between one current and the other. So all of these outputs will have to be brought together with some AND gates to control a big fat MOSFET/TRIAC to switch the injector. For the simulator I will only read the signals form one of the Match registers.
3. The pressure and the injection duration, when you think about it, are very related. Gavin put it a nicer way, saying, "injection which is a function of rail pressure and nozzle flow rate". So I will have to modify duration using a map against pressure, i.e. more pressure less duration, given that we want the same amount of fuel at any one time. This relation will not be linear because of the mechanics of the injector, the more pressure the longer it takes for the needle to open, so the timing will also have to be mapped to the pressure to maintain smooth running (thank you Gavin). All this can get very complicated, also taking load into account (a humans right foot on the throttle or
human PID, after all thats what we do best).