Welcome To Mopar1973Man.Com LLC
We are privately owned, with access to a professional Diesel Mechanic, who can provide additional support for Dodge Ram Cummins Diesel vehicles. Many detailed information is FREE and available to read. However, in order to interact directly with our Diesel Mechanic, Michael, by phone, via zoom, or as the web-based option, Subscription Plans are offered that will enable these and other features. Go to the Subscription Page and Select a desired plan. At any time you wish to cancel the Subscription, click Subscription Page, select the 'Cancel' button, and it will be canceled. For your convenience, all subscriptions are on auto-renewal.
- Replies 6
- Views 1.6k
- Created
- Last Reply
Featured Replies
Archived
This topic is now archived and is closed to further replies.
Did This Forum Post Help You?
Show the author some love by liking their post!
Welcome To Mopar1973Man.Com LLC
We are privately owned, with access to a professional Diesel Mechanic, who can provide additional support for Dodge Ram Cummins Diesel vehicles. Many detailed information is FREE and available to read. However, in order to interact directly with our Diesel Mechanic, Michael, by phone, via zoom, or as the web-based option, Subscription Plans are offered that will enable these and other features. Go to the Subscription Page and Select a desired plan. At any time you wish to cancel the Subscription, click Subscription Page, select the 'Cancel' button, and it will be canceled. For your convenience, all subscriptions are on auto-renewal.
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.