Main Menu

Almost there

Started by ford69557ci, February 01, 2016, 10:24:49 AM

ford69557ci

Ok.... I have the code loaded and all the wiring hooked up. I changed the baud rate on the serial monitor so it would spit out words instead of giberish. On the monitor I am getting turbo rpm reading, I am getting changes on the serial monitor when I switch from performance cruise and brake, but I am not getting any response from the turbo. the actuator is a brand new one from cummins. I changed the line to 0x02 to calibrate the actuator and it did calibrate. That is the only response I have got though. Any thoughts?

me78569

#1
Reverse the Can + and - from the unit to the turbo.  suppose is 0x02 did something though, the can is right.


How are you powering the turbo?  It will need a relay powered off the battery directly.

I have this code to just walk out the turbo slowly. to test the vane sending functions.
#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(0x27, 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

}
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'm not sure if you'll see a difference in position when you switch between modes, or if it's large enough to notice..
I should write a mini sketch just to test that..
Curtis knows his code better and should be able to say
'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

The code I posted walks the vanes out slowly then jumps back to 0 position and back out.  You should be able to hear the turbo pretty easily and verify if it is walking out. 
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 somehow missed that,.. it's exactly what I'd have done
'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

ford69557ci

#5
I didnt figure it would change between the modes but the exhaust brake should have a major difference. Driving it the turbo is wide open. I have tried 3 different actuators. They all will calibrate and thats all they will do.

ford69557ci

I ran that code. Had to remove the lcd part to make it compile since im not running a screen. No response at all.

hakcenter

did you zero the vanes before you put the controller on ?
after calibrating did you power cycle the turbo ?
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.

ford69557ci

Yes and yes. I have done it with 3 different actuators now

Rx7man

#9
Try adding this code



void ReadCanMessage() {
if (CAN1.msgAvailable() == true) {                      // Check to see if a valid message has been received.

//This is from the MCP examples, modified to work for what I need

unsigned long ID;                                       // assign a variable for Message ID
byte length;                                               //assign a variable for length
byte data[8];                                             //assign an array for data
CAN1.read(&ID, &length, data);           // read Message and assign data through reference operator &
PrintCANmessage(ID, length, data);
}
}

void PrintCANmessage(unsigned long ID, byte length, byte* data){
Serial.print("ID");
Serial.print(" | 0x");
Serial.print(ID,HEX);                                 // Displays received ID
Serial.print(" | ");
Serial.print("Data Length DEC");
Serial.print(" | ");
Serial.print( length);                            // Displays message length
Serial.print(" | ");
Serial.print("Data");
for (byte i=0;i<length;i++) {
Serial.print(" | ");
if(data[i] <0x10)                                   // If the data is less than 10 hex it will assign a zero to the front as leading zeros are ignored...
{
Serial.print("0");
}
Serial.print(data[i],HEX);                          // Displays message data
}
Serial.println();

}


And add this in the "void loop()"..

ReadCanMessage();



Send it to your unit, and watch the serial monitor, it should give you lines of messages with the ID and each byte of data... if it doesn't I'd have to say it's a communication problem, try reversing CanH and CanL. (Edit: maybe you already tried that, I missed it above in reply #1) and make sure you're initializing the CAN on the right Arduino pin (I think it's 10?)

I wish I had 3 actuators to test with!
'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

 
Here are the message ID's I've found through trial and error


Since it calibrates, you probably have the address already set right... The VGT listens for messages sent to this address
0x0CFFC600UL     

Here is what I call the Status message ID, it gives feedback on what's happening with the controller
StatusMessageID  0x18FFC502UL //this is the message id of the messages we're concerned with

Here's the Break Message ID, I think it's sent once every 5th message, perhaps for timing reasons?  it can be ignored
BreakMessageID  0x18FF0A02UL

Here's what I call the Error message ID.. When I deliberately reduced the voltage, I'd start to get this message.. Haven't figured out the details of it yet.
ErrorMessageID  0x18EEFF02UL  //Seems to be an error message ID when low voltage is triggered?


And here's a breakdown of each byte (or two) of the Status Message ID

These two bytes together tell you what position the VGT is *actually* at
VgtRealPosition = ((data[2] * 256) + data[1]); 

This byte tells you the temperature, though I haven't figured out the scaling yet
VgtRawTemp = data[3];

These two bytes tell you what position you're commanding it to be at
VgtCommandPosition = ((data[6] * 256) + data[5]);
         
This byte tells you the relative motor command speed..
VgtMotorCommandSpeed = data[7] - 127;



'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 remoted in today, and was all over the controller.

From my extensive testing, the LBB is 100% functional. He has 3 controllers for the turbo, 2 appeared to not even send/respond to can messages. The 3rd brand new in box from Cummins, broadcasted messages, accepted calibrate. But refused to respond to anything else.

With an error of 0x11 up front, after calibrate / power cycle on 0x08 error (calibrate and reset).

The unit also did not apply torque to the motor when just powered on, freely spun by hand, so I can only assume that either this unit needs programming or is non-functional.
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.

Rx7man

Wow.. that's really weird

Is there any chance they're programmed to respond to a different address?
'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

Don't know, I can't necessarily scan for it... you know ?
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.

Rx7man

Have you tried just dumping the CAN messages to serial, kinda like what I showed above?  you should be able to see if some other address is broadcasting.. I figure you've tried it though.
'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