Main Menu

My life, My coding

Started by Rx7man, May 27, 2015, 09:09:36 AM

Rx7man

Well, I'm getting there... underhood wiring is done and I put a BIG hole in the firewall just under the heater... I'll have to find a good grommet to plug it, but I wanted to be able to pass any size wiring or connector through it.... 2.5" seems to work, it's the only hole saw I had so it had to work.

Meanwhile I pored over the wiring diagrams and writeup in the dodge manual... found out the tach gets a square wave, but they said nothing more about it, so I had to make an oscilloscope to figure it out.. an arduino with a protoboard and a bunch of variable resistors hooked to the analog inputs... that way I could set it so I got about 3.5V when the input was 12V, giving me safety of being able to read up to 16.5V.  Then made a windows program to read the serial data (2 bytes per channel per sample).. it was a bit of a job, but I got it and it can log to a CSV file, I might make it able to log raw data for very slow computers, so you can decode it later.  Anyhow, I got the program working just fine on my desktop, put it on my laptop and no way it would read the serial port in that program.. arduino IDE could open the port just fine and read it.. so I reinstalled drivers until I was blue in the face.. nothing would work.. so I dug out my VERY OLD Toshiba A40 (go look up it's age... ~12+ years old) with WinXP, of course I had to install VB.net, Atmel Studio, Arduino IDE, etc, but finally I got it up and running, and despite being slow, it did what I needed it to do.. I fired the truck up an ran it for a little bit to get the data flowing, and then opened my log file... found out the tach signal is a nice clean 5V square wave, but with a very short pulsewidth (<3ms)

'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

YESSSSSSS!!!!

What I was hoping would work, did!
The RPM and turbine speed sensor work fine the way I wired them and programmed it (even worked the FIRST time!)

Still having laptop troubles... the Old one just won't run Atmel studio at all, and with arduino IDE it doesn't want to program the Mega (haven't tried the others)...can't remember the error.    The new one doesn't program anything with either IDE.. Com port shows up and is correct, just doesn't do it for me... going to try a couple other things yet.. but I've wasted SOOOO much time with this crap.

I think my assumption was correct about the VGT temperature offset.... gauge was just starting to rise when it read 40C (105F), and it was 'very warm' to the touch when it read 57C ~130F.


I think i just got my driver problem figured out in the new laptop so I can program a little more effectively.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

As I was running it last night, I came to a conclusion.. I don't think I'll be able to use boost pressure as much in the calculations, and I will have to switch to turbine speed.. mostly to prevent it from hunting since there's no delay, though I may still be able to use a max boost pressure compensation somewhere in there.

Underhood installation is finished, control box is mounted on the passenger kick panel, fit really nice too... Arduino is mounted in the box, with a relay.   Just have to get the manual controls mounted and the deck cleared off and it's good to go.. I'll be going for a test drive tonight for sure!
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

me78569

#93
I use boost as a way to determine if the turbo is at the top of it's map.

IE:
Overrun stuff

      if (turbo_rpm > 145000 ){  // 145,000 rpms is where I get worried about shaft speed. 
        if (turbo_accel[2] > 0 && BoostPressure > 25) {vane_position = last_vane_position - 2;}         //this will creep the vane position more open each code cycle if turbo rpms are above 150,000 if not in curvea ( perf mode defined by "F_watchpot" tab)
        else if (turbo_accel[2] > 0 && BoostPressure < 25) {vane_position = last_vane_position - 1;}
        else {vane_position = last_vane_position;}


  if (timer % 200) {
     if (ThrottlePosition <= 25) {TPS_low = true;} else {TPS_low = false;}
     if (ThrottlePosition <= 45 && ThrottlePosition > 25) {TPS_midlow = true;} else {TPS_midlow = false;}// watches throttle input to increase or decrease vane position.  Vane position mapping is based on low throttle input.
     if (ThrottlePosition <= 70 && ThrottlePosition > 45) {TPS_mid = true;} else {TPS_mid = false;}
     if (ThrottlePosition > 70)  {TPS_high = true;} else {TPS_high = false;}

     if (TPS_low) {TPS_range = 0;} //supports low throttle cruise. if under %25 don't change vanes
     
     if (TPS_midlow){ //25<tps>45
      if ( BoostPressure < 5) {TPS_range = -40;} //it will try and spool the turbo if tps is 25><45 calc section "-" the tops_range so setting number here to - means housing size shrinks.
      else if ( BoostPressure < 10) {TPS_range = -20;} // 25<tps>45 and boost less than 10 half cm smaller
      else {TPS_range = 0;} //other wise leave vanes
     }
     
     if (TPS_mid){ //45<tps>70
      if (BoostPressure < 10) {TPS_range =  -20;}
      else if (BoostPressure < 20) {TPS_range = 0;}
      else {TPS_range = 20;}
     }
     
     if (TPS_high){ //70<tps>100
      if (BoostPressure < 20) {TPS_range = 0;}
      else if (BoostPressure < 30) {TPS_range = 20;}
      else {TPS_range = 40;}
     }
  }


I have been trying to get it more into the  code, as it is helpful to adjust the end value of the turbo.  IE: the vanes will need to be bigger at 120,000 & 30 psi than 120,000 & 10 psi.

I did find that I needed to limit the turbo movement on each send to + - 5 this really helps the "sling shot" effect I was seeing in the turbo.

        if (vane_position >= last_vane_position + 5) {  //limits turbo movement to 5 increasing or decreasing.
          final_vane_position = last_vane_position + 5;
        } else if (vane_position <= last_vane_position - 5) {
            final_vane_position = last_vane_position - 5;
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

Rx7man

Well, I took it on it's maiden voyage... I'm impressed so far.  EGT's went down 300F at both cruise and WOT.. WOT egt's are now 1000F, so of course that means I just need to feed it more fuel!

Right now I just have a map of TPS position vs RPM, and get the position directly from that, in the future I think I will have a map of TPS vs Boost as well, so I can 'know' where I should be for steady state operation, but if boost isn't at target I can modify the response from that.  Right now I have a boost limit where it opens up the vanes by 30 points (over the 'base position) for every PSI over target it is, which works pretty good, my peak boost is 30psi, but since my EGT's are so low I think I'll drop it down to 20-25PSI until I feed it more fuel.
For a very crude program it works alright.  I'm smilin'
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

me78569

Very cool!

Thing I noticed with the turbo is it is easy to get egts to about 900-1000, but very hard to get egts above 1300*,  I am very impressed with the turbo and what it can do for what it is.
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

Rx7man

You have much bigger injectors than I do.. I'm going to look into bigger ones soon.. I think my buddy has some 65hp sticks that he isn't using.. toss those on and see what happens.. I think I might go to a 0 fuel plate too
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

me78569

I think I have 400-450hp worth of fuel total.  Maybe a touch more, but doubt 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

Rx7man

I figure I'm in the 300's somewhere... I'd love to think it's higher but its unlikely.. I might put the truck on a dyno in a while
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

OK, here's a log file of my drive into town.. I haven't studied it.

I noticed my TPS increments very slowly at low throttle positions.. what is actually about 25% reads as about 10%, so I had to fiddle a little with my maps.. currently they are 4 rows for TPS positions, and 10 columns for RPM.. I can increase it easily if I feel like it.

I'm working on more code now, sitting at the bar having a beer and will be playing some darts in an hour
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

me78569

I am curious how you are calc'ing your map.  Care to share you position calc section?  I am in the middle of redesigning my code for the OBD adapter I am getting and I figure if I am "under the hood" of the code I might as well see how I can make it better haha.
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

Rx7man

Sending PM... I don't think this is pretty enough to make it public.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

OK, installed my line-lock on the front brakes (awesome for some smokeshows, and holding on a hill), as well as installed my brake pressure sensor, and it's all hooked up and reading... I think I'm going to hack my brake controller apart and see if I can bypass the accelerometer and give it a signal from a PWM output.. it would save me the trouble of making a driver circuit...
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

I still have a pesky exhaust leak I just CAN'T find... thanks to the 2 1/2" hole in the firewall I haven't found a grommet for yet, I can hear it pretty good.. it sounds like a squeaky chirp under heavy boost, and a hiss under braking, but other than a TINY bit of blackness on the band clamp between the hot side housing and center section of the turbo I'm not seeing where it could be from...  (and knowing the tight clearances there I really don't think it could bleed that much pressure off)
I retorqued all the bolts and they all seem good.. it's getting to be one of those frustrating, nagging things.

Last night I spent fighting my tires.. trying to break the beads was a MISERY.. I want to install my new studded winter tires here soon.. conditions last trip into town would warrant them
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

I'm pretty sure I found a tps plug in my engine bay.

Black,  black white, and red plug near the front of the injection pump (unplugged).

Never had a cap on it so it's in pretty bad shape but do those colors match up to yours?
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.