Main Menu

HE351 code for me78569

Started by me78569, June 11, 2015, 09:38:57 AM

hakcenter

right.

its terrible for the street, just fyi, unless you always WOT and never let off lol

more proof of concept, especially in my early testing. To show how to do it, and how well it works.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

Haha don't think I have a need for it.

2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

me78569

Another question about what you are doing. 

The while(1) {   in the main loop?  Why are you doing a while(1) there?  doesn't that effectively just always do the code within {}?
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

Yes, but I like being in control of the actual loop. Also you can see there is variables for just the loop, that I didn't want to put into the main setup tab.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

Alright 9924 is in resistors and cap installed.  I'M now seeing turbo rpm.

I haven't road tested yet but so far so good.


New dfi injectors are in seem better, but haven't had it on the street yet.

I am gonna run Around with your code tomorrow , but I also have a hybrid my code your code I am gonna try.  Uses your vane position call and my eb brake and pot control and lcd screen.

2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

Drove into work today 1/2 with you 1.1 code and half with my bastard code child ( haha)  both run the same, as expected, when using the vane calc, everything else is good on my side.  your code I don't have the wiring to do the position selection etc. 

Thoughts on how I am selecting the turbo curve based on the inactive pot reading? watchpot ()

Smoke cleanup is better it seems and the turbo control is better than with the boost maps.  No more barking so that is nice. 

I have attached my bastard code if you care to look.  I need to clean it up some.


Question I have for you is in the licenses for the code.  do I need to enter your header into each tab or at the beginning.  Also I need to indicate my changes from yours?  or does the header explain the changes well enough?

thanks again for your work man.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

#97
Creative Commons - Attribution-NonCommercial-ShareAlike 4.0 International - CC BY-NC-SA 4.0

Is the license its carried under, very simple, just cover my ass kind of stuff.

but for instance,


/////////////////////////////POS Manage////////////////////////////////////////
//Manages Boost map position in an effort to prevent Barking when letting off the throttle.
void PosManage() {
[...]

Everything in there is basically a copy of the lbb common code, what I would do in each tab where any of the common code was used, or you made a derivative work of.. just attribute.


/////////////////////////////POS Manage////////////////////////////////////////
/*
*  This work is licensed under the
*  Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
*  To view a copy of this license,
*  visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
*   
*  Sections of this code are based off of the LBB Common Code and may be derivative works or copy's of
*  Curtis R Hacker at www.lilbb.com and his RPM based HE351vgt Arduino shield.
*
*  POS Manage
*  Manages Boost map position in an effort to prevent Barking when letting off the throttle.
*/


It is really simple no problems, just cover your ass is the only reason I tossed a license in there.[/code]
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

I am sure you have noticed this, but I have been watching what the turbo is doing from idle leaving a stop light.

Typically when driving you let of throttle and come to a stop, this would engage idle, which will bring the turbo veins to about 14 cm^2 ( or like 500 something) which is nice.  No reason to work the turbo hard at idle. 

Now the issue I see has to do from this point forward. When you start to leave a stoplight your program will decrease the vein position down to 5 or 6 cm^2, to help get the turbo shaft speed up.  Dodge/Cummins does this also.  They have an idle position then they jump down to the same 5 or 6 cm^2 and go from there. 

Issue is since there is code in place to keep the turbo from "jumping" ( which works really well) to a position it takes a good couple seconds for the turbo to go from the 14cm^2 down to the 5 or 6 cm^2 requested and get the shaft speed up. 

I feel like the turbo would feel much more perky and have a flatter torque curve is the jump to 5 or 6 cm^2 from idle was instant. 


Thoughts on this?  have you seen the same thing? 

I am thinking since I watch throttle position I could go around the "dejump" code if I see throttle input of 1-%10 ?  however I am sure you might have a better way to accomplish this.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

If rpm < first rpm stage jump out of smoothing
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

duh,

haha good idea.  I never would have thought of that. 

thanks...again
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

me78569

#101
So I have done a bit of testing and changing of the code.  Since I know when I am at idle, watching throttle position, I don't have to qualify turbo rpms as = idle.  Rather than watching rpms to qualify idle by rpms I am doing this.

/////////////////////////////POS Manage////////////////////////////////////////
void PosManage() {

    if (turbo_rpm > minimum_turbo_rpm) {
      if (turbo_rpm <= curve_rpm[4]) {
        if (ThrottlePosition < 2){  // Idle Section
            Offidle = true;
            if(turbo_rpm <= idle_rpm) {
             vane_position = idle_position;
             idle_mode = true;
             idle_walkdown_mode = false;
        } else {
            if (turbo_rpm <= idle_walkdown_rpm) { idle_walkdown_mode = true; } else { idle_walkdown_mode = false; }
            if (idle_walkdown_mode) { vane_position = constrain((final_vane_position - 10),800, idle_position); }
            idle_mode = false;
          }
        }else {
          // -----
          // Curve section
               if (turbo_rpm <= curve_rpm[0]) { vane_position = map(turbo_rpm, idle_rpm, curve_rpm[0],(turbo_curve[0] + one_cm),turbo_curve[0]); } //(idle_position - one_cm), (turbo_curve[0] - two_cm)
          else if (turbo_rpm <= curve_rpm[1]) { vane_position = map(turbo_rpm, curve_rpm[0], curve_rpm[1], turbo_curve[0], turbo_curve[1]); Offidle = false; }
          else if (turbo_rpm <= curve_rpm[2]) { vane_position = turbo_curve[1]; }
          else if (turbo_rpm <= curve_rpm[3]) { vane_position = map(turbo_rpm, curve_rpm[2], curve_rpm[3], turbo_curve[1], turbo_curve[2]); }
          else { vane_position = map(turbo_rpm, curve_rpm[3], curve_rpm[4], turbo_curve[2], turbo_curve[3]); }
        }
      } else if (turbo_rpm < top_end_rpm) {
        vane_position = map(turbo_rpm, curve_rpm[4], top_end_rpm, turbo_curve[3], turbo_curve[4]);
      } else {
       
            if (turbo_rpm <= 126000) { vane_position = map(turbo_rpm, top_end_rpm, 126000, turbo_curve[4], 580); }
          else if (turbo_rpm <= 130000) { vane_position = map(turbo_rpm, 126000, 130000, 580, 400); }
          else { vane_position = map(turbo_rpm, 130000, 132000, 400, min_position); }
        }
        // Overrun protection
       if (turbo_rpm > 132000) { vane_position = 0; };   
      // Default Full Open Position if no RPM signal
  } else { vane_position = min_position; }
}


Now to keep the smoothing from running when going from idle state to accelerating ( from a stop light for example) I created the variable "Offidle", which I set to true when idle state is sensed ( less than 2% throttle).  then I set "Offidle" to false once turbo curve 2 is reached  I also took the idle_walkdown_rpm down to below curve_rpm[1] so if you come off the throttle for a second it won't jump right into walkdown mode.

void set_turbo_position() {
  // Keep vane position within constraints
  final_vane_position = vane_position;

    if(!startcycle) {      //disregards the smoothing function below when setup is running to allow for a full sweep of the vanes for cleaning.
     if(!eb_mode && !pot_mode) {  //disregards the smoothing if in EB mode or Pot mode.
      if(!Offidle);{
      constrain(vane_position, min_position, max_position);
      final_vane_position = vane_position;
      // Vane smoothing between large values
      if (turbo_rpm < top_end_rpm) {
        if (vane_position >= last_vane_position + 20 && last_vane_position < max_position - 10) {
          final_vane_position = last_vane_position + 10;
        } else if (vane_position <= last_vane_position - 20 && last_vane_position > min_position + 10) {
          final_vane_position = last_vane_position - 10;
        } else if (vane_position - 10 >= last_vane_position || vane_position + 10 <= last_vane_position) {
          if (vane_position > last_vane_position + 2 && last_vane_position < max_position - 2) {
            final_vane_position = last_vane_position + 2;
          } else if (vane_position < last_vane_position - 2 && last_vane_position > min_position + 2) {
            final_vane_position = last_vane_position - 2;
          }
        }
       }
      }
     }
    }
   
// Function to Send the Calculated Position to the Turbo
  last_vane_position = final_vane_position;
  byte lo_byte = lowByte(final_vane_position);
  byte hi_byte = highByte(final_vane_position);
  byte data[] = { lo_byte, hi_byte, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // data message with an added counter
  // data[2] = 0x02 for recalibrating gearbox
  // Load message and send
  CAN1.send(0x0CFFC600, extID, 8, data);

}



I am hoping that now rather than having start position be map(turbo_rpm, idle_rpm, curve_rpm[0], (idle_position - one_cm), (turbo_curve[0] - two_cm)); }
          }

It will jump from idle position to the start position when coming onto the throttle.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

#102
Having a tps is great isn't it lol

Just make sure you don't run into a condition where you let off the throttle and the turbo is / was rolling hard or else you may bark it
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

me78569

TPS is wonderful to have.  I gotta admit your rpm set idle worked really well though. 

I am somewhat worried about barking, but it shouldn't be bad as the smoothing is in effect at higher rpm ranges.  I do intend to work on that more though. 
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

hakcenter

#104
Ya I spent an hour dialing that idle setup, pretty ingenious way to do it. Having a TPS input is the way to go thou.

You could trigger so much with just that.

RPM > 25k, TPS > 80% = perf.. etc


How's rpm control over boost / bp ? Pretty substantial difference in how smooth the power curve is ?
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.