Jump to content
Mopar1973Man.Com LLC
  • 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. 

He351ve stand alone Arduino controller code for 2nd Gen Cummins


Recommended Posts

I'm surprised me78569 hasn't mentioned but there is an entire Arduino shield I've setup for this turbo. Runs on shaft speed, which is cheap cause you don't need to buy $100 pressure sensors for boost / back pressure. Thou there is room in the header, to add additional sensors to do lots of stuff.

 

SMD

v1.1:smd:layout.png

Through Hole

v1.1:th:layout.png

 

Self powering, CANBus integrated, 3 ADCs, 1 spare digital I/O on a 16pin header. Unfortunately for me I can't afford the assembly fee to get 10 SMD's made, but I've already got an order in for 25 through hole boards, BOM's are relatively the same price but with through-hole someone has to put them together :D

Edited by hakcenter
Link to comment
Share on other sites

My plan was to build the thread as I go then pretty it up and make an article out of it.  If you want you can post up your own thread, explain how it works and I will merge that into the article in regards to do a homebrew controller for an he351ve.   Multiple methods etc.

 

I like your board a lot I just really wish it had the ability to tie more sensors into it.   Seems to me if you are going to go through the work you might as well use it for gauges too ya know.   

 

Nick

Link to comment
Share on other sites

I designed my shield specifically for controlling the turbo.

 

Putting the canbus on the arduino literally ties up 4 digital i/o's from the get go. Then most people are going to want to at least braking or cruise, etc. So instead of putting all my nuts in a basket I made it what it is, just to control the turbo. If people want more you can put this right on a mega, design another shield (anyone could) and have another side of a whole lot of other stuff. But be forewarned multiplexing is okay, but isn't as great as having dedicated ADCs.

 

I figure if people want gauges, they would install them or already have them, especially as this is pretty much a standalone controller for the turbo. So anyone that doesn't want to code their own stuff, can literally take my shield, move a couple jumpers and voila, tune the turbo to their vehicle pretty simply.

Link to comment
Share on other sites

  • Owner

What Nick attempting to do is allow it to branch naturally and see where it goes more or less. Then there could be a stand alone and maybe something a bit more. It working more or less like open source coding for Linux. Every is welcome to take the design and modify it how they see fit and see where it goes.

Link to comment
Share on other sites

That's cool, pretty much what I've already done. Code for my shield is already available here

 

Nick is a member, and I spent some time revamping his code :)

 

 

Anyways I can feel a bit of hostility for whatever reason so I'll just graciously bow out m'kay.

Edited by hakcenter
Link to comment
Share on other sites

No Hostility, internet is a dangerous place to guess emotions.  

 

I will like your site in my write-up ( whenever I actually get around to doing it)

 

All we are saying is the more info/ways to do something we can put out there the better.  I will likely end up buying one of your shields at some point here and getting a mega like you said to do what I want out of my setup.  

Link to comment
Share on other sites

When I designed the PCB for my project, I screwed up in a couple ways.  One of the larger ones was lack of flexibility.  The beauty/curse of building something yourself is it's never finished, there are always things that could be added.  I don't know how many extra pins there are left after controlling the turbo.  However I would break all of them out onto your board so you can hook random things to it (control for water/meth, etc).

Link to comment
Share on other sites

The turbo is on the truck and the code is working pretty well.  I need to address an issue though.

 

 

It is so stupid easy to bark this turbo because the controller will close the vein VERY quickly if you let off the throttle.  I need to figure out a way to dampen the closing of the turbo.  

 

 

Thoughts on this are to create a manage routine that will slow the veins movement if boost falls more than x psi.

 

Got any thoughts on this cowboy?

/////////////////////////////POS Manage////////////////////////////////////////
//Manages Boost map position in an effort to prevent Barking when letting off the throttle.
void POSManage() {
  if ( ((Thrreadings[2] + Thrreadings[3]) >>1) < (5+(Thrreadings[0] + Thrreadings[1]) >>1)) //Detect if throttle is lifted more than %5
    { DesiredPosition = BoostVeinPosCalc(Bstreadings[0]);}        // use the first boost reading in the array and keep the veins at that position
  else { DesiredPosition = BoostVeinPosCalc(BoostPressure);}
}
Link to comment
Share on other sites

My two cents would be to create a delay instead. If not is there a way for it to sense the brake being applied. Just thinking how it could interfere with your exhaust brake function. This is a 10 page conversation, so forgive me if I missed something, lol.

Link to comment
Share on other sites

I thought about the delay but I really would like to avoid doing a delay as it puts the rest of the program on hold.  

 

 

Hakcenter ,guy with the rpm based controller, uses a smoothing function that I am going to try and use.

Link to comment
Share on other sites

My head is kinda "Out of the game" so to speak, so I'm not likely to be of much help on this one.  From just a little thought, I think I would find the function that tells it to close and change how fast it closes, or add a delay to keep it from closing till either a certain amount of time, or till boost is below a certain amount.

 

When I say add a delay, I don't mean a delay(), I mean a "smart delay", it's more complicated to use 'if' statements and count the millis, but it lets the rest of the code function properly.

 

Also, I'm all for trying to make the code work as fast a possible, but if it were me, I would stay away from bit shifting, and just use division.  Then once you have a working code, and you're happy with it, then optimise it for speed.  This is just my opinion,so don't feel obligated to do it, it's just a lot more complicated for me to troubleshoot, or understand code when it's got all that bit shifting in it, however, maybe my head is just slow.

 

In that thread on CF, I posted where I tested the speed of division vs multiplication vs addition vs subtraction, and according to my results, there really wasn't that much difference.

Link to comment
Share on other sites

Understand that bud.  

 

 

 

 

So after the first longish trip ( 100 miles) I am pretty happy with the turbo and very mad at myself.......I forgot to tighten the compressor housing all the day tight.  THANKFULLY no damage, but it was causing my high egt and slow spool issues.  

 

I can say however, I can do 65 mph with the veins %100 open with 0 boost and 0 drive.  

Link to comment
Share on other sites

I have made come coding changes on the boost map. I found that a starting position of 235 is too small. It just smokes and smokes. I am testing a few different maps, but this seems to work well.
 

#define NumEntriesDD 14 // boost map for high performance
int BoostMapDD[NumEntriesDD][2] = {{10,300},{11.5,310},{13,320},{14.5,330},
{16,340},{17.5,350},{19,360},{20.5,370},{22,380},{23.5,390},{25,400},{26.5,410},
{28,420},{29.5,430}};

Looking at the 6.7 logs that the guy on CF recorded it "LOOKS" like they snap the turbo closed for a split second to 3 or 4cm then pop it back open to about the 300-400 range if you step on the go pedal.

Link to comment
Share on other sites

  • 3 weeks later...

First post is updated with new code that is RPM based.  I have left in place my final boost map code for use if you want to control the holset he351ve using boost / drive.

 

I would suggest you visit lilbb.com and learn how to setup your controller to work with shaft rpms.  

 

some notes on the change to rpm code.

-Turbo position has been un-inverted compared to the boost code. 25cm now = 40,  3cm = 960 This is to match what cummins did

-This means that the pot control section needs to map the pot to match 

constrain(map(PotentiometerValue,0,1000,970,05), 20, 970);
Link to comment
Share on other sites

  • 2 weeks later...

Well most of the tuning is done.  some refinement needs to happen to the top end still, but overall I am pretty pleased.    

 

I gotta say the mid range power of the truck is unreal.  

 

Anyways I am now going to run some testing for MPG's.  I am gonna run a week or two with the vanes set to open and see what kind of mpg's I can get.  

Link to comment
Share on other sites

×
×
  • Create New...