Jump to content
  • Welcome To Mopar1973Man.Com LLC

    We are a privately owned support forum for the Dodge Ram Cummins Diesels. All information is free to read for everyone. To interact or ask questions you must have a subscription plan to enable all other features beyond reading. Please go over to the Subscription Page and pick out a plan that fits you best. At any time you wish to cancel the subscription please go back over to the Subscription Page and hit the Cancel button and your subscription will be stopped. All subscriptions are auto-renewing. 

replacement homemade VP44 & ECU project update.


Recommended Posts

I finally had some time and good weather to work on my project. The goal is to replace the black boxes that may be unobtainable in the  future.

 

The speed/ position sensor circuit was reworked again  it is an advanced and adaptive design now part hardware and some digital signal processing.

This is the 4th gen now. It syncs up fast and has good noise filtering. It also does not rely on hard coded zero crossing thresholds. It learns and saves

the last known good values in non volatile memory for fast start ups.

 

The cold weather revealed some problems which are fixed now. The injection drive has to be hammered harder and for longer time than I anticipated

because the battery voltage is so low.  The thresholds and sync were also improved, faster acting because the cold engine has extreme rotational speed changes.

Think of rope starting a chainsaw or kick starting a motorcycle. these affects are still present to a much less extent when running, but can't be ignored or else the engine will run rough and if it starts surging it's all over. The angular velocity and acceleration must be tracked and the injection event timing (SOI) has to be predicted before it happens because the solenoid has a dead time from being energized till the time it closes and injection starts, it's not instant like a spark engine. It also needs all the current it can get when cold and cranking with a weak battery.

 

I had to make a fast coarse current adjustment that works off battery voltage because the grid heater cycling was causing missing.

 

I finally have a very stable governor and fuel algorithm it works great.  No surging or hunting and won't die no matter how fast i let off

or abuse it. The idle is  smooth even with my completely worn out original injectors. It took a lot of trial and error to get it right.

The throttle response is very close to stock also.

 

Here is the governor code it explains a lot of it. If anyone is interrested.

 

[code]

void governor(void)
{
    /****** Cummins 24V VP44 PID based governor.*******
     *  notice no dt or time interval. this is called on every injection cycle so dt is speed dependant.
     *  RPM is measured and calculated on each injection cycle, so there is no sense trying to adjust
     *  fuel until the RPM change is observed from the last fuel change.
     *  TPS is 0 - 5 volt sensor with idle saftey switch built in
     *  It is about .45 v resting and just less then 4 volts WOT.
     *  TPS output is halfed with 10 Kohm resistors so it wont exceed 3.3 volts limits of STM32F303 chip
    */
    
    static int fuelGov, lastFuelGov, lastFuelp, fuelp, fueli, fueld;
    const int SetPoint = 800;   //desired idle speed
    const int FuelBias = 1500;  //typical fuel level to cause idle speed at 800 RPM
    const int RestingPos = 300; //TPS raw A/D sensor value plus a little extra while pedal not pressed
    const int MaxFuel = 3600;   //4095 is the max allowable fueling level. 3600 is stock-ish
    const int SoftRev = 2800, HardRev = 3100;  //Rev limiter
    //fuelGov2, RPM, TPS, Load, and crank are global var's.

    fuelp = SetPoint + ((TPS - 275) / 3) - RPM; //difference of 800 RPM setpoint and actual RPM. TPS also affects setpoint -   
    fuelp = constrain(fuelp, -400, 400);        //so there is a smooth transistion off the governor. 
    fueli = fueli + fuelp;                      //intergrate any residule porportional error on each iteration of this function
    fueli = constrain(fueli, -300, 800);        //limit integral term allow some droop (20-30rpm) and help prevent hunting
   if (RPM < 400) {                             //prevent integral wind up while starting
    fueli = 0;
    }
    fueld = fuelp - lastFuelp;                  //derivative term. limit large step change if abrubt speed change.
    lastFuelp = fuelp;

    fuelGov = FuelBias + (fuelp * 2) + (fueli / 5) - (fueld / 16);  //this is an out = ʃƩ PID, Kp=2, Ki=0.2, Kd=0.063

   if (TPS > RestingPos) {                              //Throttle pressed. moving off constant speed
    fuelGov = fuelGov + ((TPS - RestingPos - 25) * 2);  //TPS is doubled so it can reach 4095 and added to fuel
    }                                                   //the TPS - 25 mimics stock feel. without it feels lazy in 800 - 1100 range
      //eg: pressed TPS =1000 - (300-25), 1000 - 275 = 725, times 2 = 1450 fuel units added. 
  //*******idle validation switch check********
   if (RPM > 1300 && idle_valid)           //idle valid switch is 5V at idle. 0V when pedal pushed
    {
    fuelGov = fuelGov - (RPM - 1300) * 3;   //limit RPM  to about 1300
    fuelGov = constrain(fuelGov, 0, 2000);  //hard fuel limit of 2000
    }

  //********** Anti stall ****** mostly un-tested need a manual transmission.
   if (RPM < 740) {                       
    fuelGov = fuelGov + 50; //quick response
    fuelGov = fuelGov + constrain(((740 - RPM) * 3), 0, 300); //porpotional response
    }
  //**********starting***********
   if (RPM < 600) {    //retard timing 3 deg and increase fuel
    crank = 1;        //SOI on B tooth edge 20
    fuelGov = fuelGov + 50;
    }
   if (RPM < 400) {    //retard timing 6 deg and even more fuel
    crank = 2;        //SOI on B tooth edge 21
    fuelGov = fuelGov + 150;
    }
   else {
    crank = 0;        //SOI on B tooth edge 19. Normal running
    }
  //*********** Rev limit ******
   if (RPM > SoftRev) {
    fuelGov = fuelGov - (RPM - SoftRev) * 3;  //eg 2950 - 2800 = 150 times 3 = 450 fuel units removed
    }
   if (RPM > HardRev) {
    fuelGov -= 2000;
    }

    fuelGov = (fuelGov + lastFuelGov) / 2;  //rolling average fuelGov output for smoother response
    lastFuelGov = fuelGov;
    fuelGov2 = constrain(fuelGov, 0, MaxFuel);  //fuelGov2 (output) is copied from fuelGov so it won't change during interrupt handlers

    Load = mapf(fuelGov2, FuelBias, MaxFuel, 0.0, 100.0);  //use fuelGov2 to scale load between no 0% load and 100% full load.
   if (fuelGov2 < FuelBias) {
    Load = 0;
    }
    Load = constrain(Load, 0.0, 100.0); //used for MAP fueling table and Timing advance table later

} //governor done
 

[/code]

 

Cheers.

 

 

  

 

 

 

 

Link to comment
Share on other sites

Man, this is such amazing work! With a little bit of hardware hardening I think you might be on to something here! Maybe cool the electronics with coolant? Something that doesn't rely on fuel to cool and is more dependable and bam, amazingness :)

Link to comment
Share on other sites

@Linux I have a couple of liquid cooled heat sinks. Thinking of plumbing one into the fuel line. They are 7mm 5/16 ish lines but there is minimal restriction. Should be ok too use. I can't drill holes in them to mount components or they will leak so I'm going to have to try some clamping options.

https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjfmu28q4H9AhXW5uMHHQWkBnsYABAYGgJ5bQ&ohost=www.google.com&cid=CAASJORoxb-o-5SN4ba2tWFJoodHprhInFmL0Ai0_HuVmtyyuLZs7g&sig=AOD64_106fhikSDX7Ff1vTQrahIkx9PJWA&ctype=5&q=&ved=2ahUKEwiWjuS8q4H9AhUFjYkEHTthAvMQwg8oAHoECAUQKw&adurl=

Edited by Great work!
Correction
Link to comment
Share on other sites

Those should do the trick! If it were me I'd make them parallel to the heater core coolant hoses, but fuel should work too so long as you have a hard kill on lack of fuel pressure etc. Really I think the stock one would be fine if they had better error handling around that. Food for thought!

Link to comment
Share on other sites

  • Owner
13 hours ago, Linux said:

Man, this is such amazing work! With a little bit of hardware hardening I think you might be on to something here! Maybe cool the electronics with coolant? Something that doesn't rely on fuel to cool and is more dependable and bam, amazingness :)

A heads up if you draw your fuel from the tank and not out off the sender basket fuel temps are much much lower. Mine follow the IAT temp and typically match. Most of the winter I see +20°F to +60°F then summer 80°F to 130°F no issues with fuel temp.

Link to comment
Share on other sites

  • Owner

Nothing wrong with the PSG circuits. The biggest problem is stock pulls from the hot fuel in the sender basket then a lot of people went back to draw straw in the basket which is a very poor idea. Mine is drawing forward of the sender basket which is typically cooler fuel. I've never had a PSG failure yet. (P1688 and P1689)

Link to comment
Share on other sites

×
×
  • Create New...