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

Give this a go

 

this should do the typical startup loop ( message) then it will loop adding 10 to the position. It should also print the turbo position in CM.

#include <SPI.h>
#include <can.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Defines for setting up the CAN Bus
#define mode NORMAL // define CAN mode
#define bitrate 250 // define CAN speed (bitrate)
MCP CAN1 (10);       //Create CAN Channel
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

unsigned int last_vane_position = 0;
unsigned int final_vane_position;
unsigned int vane_position = 0;
int VanePos = 0;

void setup() {
  // Initialize Serial communications with computer to use serial monitor
  Serial.begin(115200);
  lcd.begin(20, 4);        // initialize the lcd for 20 chars 4 lines and turn on backlight
  // Set CAN mode and speed
  CAN1.begin(NORMAL, bitrate);
 


  //-------- Write characters on the display ----------------
  // NOTE: Cursor Position: CHAR, LINE) start at 0
  lcd.setCursor(2, 0);
  lcd.print("Starting HE351VE");
  lcd.setCursor(5, 1);
  lcd.print("Controller");
  lcd.setCursor(4, 2);
  lcd.print("Will Display ");
  lcd.setCursor(0, 3);
  lcd.print("Boost,Drive,Position");
  delay(2000);
  lcd.clear();
  lcd.setCursor(4, 0); //Start at character 4 on line 0
  lcd.print("Cycling Vein");
  lcd.setCursor(6, 1);
  lcd.print("Position");
  lcd.setCursor(3, 3);
  lcd.print("Wait To Start!");
  delay(250);
  lcd.clear();
  vane_position = 960;
  SendTurboPos();
  lcd.clear();
  lcd.setCursor(4, 0); //Start at character 4 on line 0
  lcd.print("Cycling Vein");
  lcd.setCursor(6, 1);
  lcd.print("Position");
  lcd.setCursor(3, 3);
  lcd.print("Wait To Start!");
  delay(250);
  vane_position = 960;
  SendTurboPos();
  lcd.clear();
  lcd.setCursor(4, 0); //Start at character 4 on line 0
  lcd.print("Cycling Vein");
  lcd.setCursor(6, 1);
  lcd.print("Position");
  lcd.setCursor(3, 3);
  lcd.print("Wait To Start!");
  delay(250);
  vane_position = 960;
  SendTurboPos();
  lcd.clear();
  lcd.setCursor(4, 0); //Start at character 4 on line 0
  lcd.print("Cycling Vein");
  lcd.setCursor(6, 1);
  lcd.print("Position");
  lcd.setCursor(3, 3);
  lcd.print("Wait To Start!");
  delay(250);
  lcd.clear();
  lcd.setCursor(8, 2);
  lcd.print("Done!");
  delay(500);
  lcd.clear();
  vane_position = 500;
  SendTurboPos();
lcd.setCursor(0, 0);
lcd.print("CM^2 = ");
}

void loop(){
  vane_position = last_vane_position + 10;
  if (vane_position > 960);{
    vane_position = 100;
  }  
  SendTurboPos();
}


void SendTurboPos(){
  vane_position = final_vane_position; 
  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);
 
  VanePos = constrain(map(final_vane_position,960,40,3,25), 3, 25);
  String TurboPos = String(String(VanePos, DEC) + " ");
  lcd.setCursor(0, 6);
  lcd.print(TurboPos);
 }

He351ve_Test.zip

Link to comment
Share on other sites

Here is the update. I uploaded the program it runs through the start up screen and displays cm^2 = 25 but stays at that screen, characters never change and turbo never moves. It does this if I have power to the turbo or not. I ohmed out the actuator and have 120 ohms, I am starting to think the board is not communicating but am going to check the controller tonight at work. Not sure if this helps or not but i have 49k ohms between can high and can low on the board. and about 74 milivolts when back probing the can h and l wires. 

Link to comment
Share on other sites

Alright,

 

I think I got it working for you.  

 

Go ahead and load this up

#include <SPI.h>
#include <can.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Defines for setting up the CAN Bus
#define mode NORMAL // define CAN mode
#define bitrate 250 // define CAN speed (bitrate)
MCP CAN1 (10);       //Create CAN Channel
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

unsigned int last_vane_position = 40;
unsigned int DesiredPosition;
unsigned int vane_position;
int VanePos = 0;

void setup() {
  // Initialize Serial communications with computer to use serial monitor
  Serial.begin(115200);
  lcd.begin(20, 4);        // initialize the lcd for 20 chars 4 lines and turn on backlight
  // Set CAN mode and speed
  CAN1.begin(NORMAL, bitrate);
 
lcd.setCursor(0, 0);
lcd.print("CM^2 = ");
}

void loop(){
 
  if(DesiredPosition > 800){
    DesiredPosition = 100;
  }
  else{ DesiredPosition += 1;}
    // Set the Turbo Position
    SendTurboPosition( DesiredPosition );
    
    // Delay for Processor
    delay(5);

 
  VanePos = constrain(map(DesiredPosition,40,960,3,25), 3, 25);
  String TurboPos = String(String(VanePos, DEC) + " ");
  lcd.setCursor(6, 0);
  lcd.print(TurboPos);
  }    
void SendTurboPosition( int TurboPosition )
{
  last_vane_position = DesiredPosition;
  int FinalPosition = map( TurboPosition, 0, 1023, 960, 40 );
  byte lobyte = lowByte(FinalPosition);
  byte hibyte = highByte(FinalPosition);
  unsigned long ID = 0x0CFFC600; // Random Extended Message ID
  byte length = 8; // Data length
  byte data[] = { lobyte, hibyte, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; // data message with an added counter

  CAN1.send ( ID, extID, length, data ); // Load message and send

}

I Think it will walk the turbo out and then reset, butI can only hear the turbo resetting ( so I am assuming it is moving) the screen should also show you the cm position.

 

Here is the board layout post from lilbb.com

http://community.lilbb.com/hardware/through-hole-fun/msg104/#msg104

 

You will need a 10k on the shaft speed wires, then also a cap or something connecting them.  My thread on his site goes into that detail, or you can compare is build list vs the layout.  Feel free to ask quesitons when you get to that point.

 

Pretty much pin out the 9924 like so

pin 1. turbo speed wire in 10+k resistor

pin 2.turbo speed wire in 10+k resistor

pin 3. NC

pin 4. NC

pin 5. ground

pin 6. 5v

pin 7. output to pin 8 on arduino 10k resitor

pin 8. nc

pin 9. 5v

pin 10. 5v

You can find the datasheet info for the 9924 in the article for the code.  It has the modes vs which pins are connected.  You want mode A1 I think.  

Link to comment
Share on other sites

Well here is the update. I set the actuator up and had it hooked to a Cummins motor in an 07 f650. turbo and actuator work properly. I could fool the boost sensor and the turbo would move as comanded so i know the turbo is working. Am using a new steeed can bus shield still can not get the turbo to work with the controller. The gnd light is lit up, RX light is lit up INT light intermittently flickers but the TX light never comes on. Is there a setting one needs to set up in the code? Do I have to jumper the ICSP pins? Trying to figure out whatIi missed. 

Link to comment
Share on other sites

Did you try switching your + and - canbus wires just to make sure? 

 

Take a picture of your shield and the wires.  Verify the continuity of the can wires from the turbo plug to the board.

 

 

 

 

 

I am VERY surprised the turbo moves with boost on the f-650.  I was curious how they did it.

Link to comment
Share on other sites

  • 2 weeks later...

Big thanks to Nick for all his help. The issue was c9 was defaulted instead of c10 on the can board. Hopefully this helps some on in the future. I am running the seeed bus v1.2 can bus if you are having communications mainly not sending check the back of the board. I will post up pictures and a video of the 2nd vane test. 

20151027_125807.mp4

Link to comment
Share on other sites

 

I am VERY surprised the turbo moves with boost on the f-650.  I was curious how they did it.

Just noticed you asked this. From what I under stand talking with cummins is that the ecm monitors drive pressure, boost pressure and turbo speed and along with a host  of  other engine information. With the engine anything off idle to meet egr flow the turbo stays small to create back pressure, but to keep the gases moving and the dpf and doc happy the engine needs the boost to keep the gasses warm so the turbo will stay small until it hits it's eficency point at what point it will try and maintain the efficiency point for that driving condition. When drive pressure gets to high the egr can open to drop it back down. If egr does not work it will open up the housing just as your coding does. Driving them down the road most of the time under light driving the turbo is 80% closed. When viewed with in site. 

Link to comment
Share on other sites

×
×
  • Create New...