Author Topic: Almost there  (Read 1327 times)

Offline ford69557ci

  • Member
  • **
  • Posts: 23
    • 01 dodge
on: February 01, 2016, 10:24:49 AM
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?



Offline me78569

  • Sr. Member
  • ****
  • Posts: 274
Reply #1 on: February 01, 2016, 12:58:31 PM
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.
Code: [Select]
#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


Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #2 on: February 02, 2016, 09:06:10 AM
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM


Offline me78569

  • Sr. Member
  • ****
  • Posts: 274
Reply #3 on: February 02, 2016, 09:47:57 AM
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


Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #4 on: February 02, 2016, 09:51:22 AM
I somehow missed that,.. it's exactly what I'd have done

'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM


Offline ford69557ci

  • Member
  • **
  • Posts: 23
    • 01 dodge
Reply #5 on: February 02, 2016, 11:15:32 AM
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.



Offline ford69557ci

  • Member
  • **
  • Posts: 23
    • 01 dodge
Reply #6 on: February 02, 2016, 11:48:15 AM
I ran that code. Had to remove the lcd part to make it compile since im not running a screen. No response at all.



Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 723
    • 1998 12v Ram
Reply #7 on: February 02, 2016, 12:21:53 PM
did you zero the vanes before you put the controller on ?
after calibrating did you power cycle the turbo ?

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline ford69557ci

  • Member
  • **
  • Posts: 23
    • 01 dodge
Reply #8 on: February 02, 2016, 02:00:53 PM
Yes and yes. I have done it with 3 different actuators now



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #9 on: February 02, 2016, 07:08:26 PM
Try adding this code

Code: [Select]

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()"..
Code: [Select]
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM


Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #10 on: February 02, 2016, 07:27:48 PM
 
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 723
    • 1998 12v Ram
Reply #11 on: February 03, 2016, 03:03:53 PM
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.

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #12 on: February 03, 2016, 03:24:37 PM
Wow.. that's really weird

Is there any chance they're programmed to respond to a different address?

'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 723
    • 1998 12v Ram
Reply #13 on: February 03, 2016, 04:52:41 PM
Don't know, I can't necessarily scan for it... you know ?

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1014
  • Jack of all trades
    • '94 Dodge dually
Reply #14 on: February 03, 2016, 05:27:41 PM
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM