Termination Resistor and source address for multi-node CAN network

  • 4 Replies
  • 49 Views
*

Offline anothernord

  • Member
  • **
  • 12
    • 01 Tacoma 3.4
I'm working on integrating the LBB into a system that uses this very cool standalone ECU for the Mercedes OM606 engine https://controls.is/shop/dsl1.

I'd like to remove the terminating resistor on the LBB, but I can't find it.  I'm still learning here so maybe I'm missing something obvious

Also, is there a way to change the  source address of the LBB?  Or is that hard-coded into the Arduino CAN library or something?

Thanks in advance. 

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 684
    • 1998 12v Ram
Re: Termination Resistor and source address for multi-node CAN network
« Reply #1 on: June 25, 2018, 05:30:01 PM »
Termination resistor for what?
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 anothernord

  • Member
  • **
  • 12
    • 01 Tacoma 3.4
Re: Termination Resistor and source address for multi-node CAN network
« Reply #2 on: June 26, 2018, 07:53:59 AM »
Termination resistor for what?

The 120 ohm CAN bus termination resistor.  Does the LBB have one?  I'm assuming it would need one, correct? 

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 684
    • 1998 12v Ram
Re: Termination Resistor and source address for multi-node CAN network
« Reply #3 on: June 26, 2018, 09:00:39 AM »
Shield or the Standalone.

They both have a 1watt 60ohm resistor across the High and Low. But that's it.

The standalone, it's R14, the SMD component bridging the 2 traces connected to 1 / 9 on the pinout.
The shield, it's R6, the gigantic resistor next to the pinouts.

I found it necessary to make canbus communication work.

If you're looking to setup some canbus communication, you need to brush up on the can library.

Code: [Select]
void read_can_data(unsigned long id, byte length) {
  if (CAN1.msgAvailable() == true) {
    CAN1.read(&id, &length, can_data);
    // 419,415,298 = 0x18FFC502 is turbo output
    // 419,367,426 = 0x18FF0A02 is no idea
    can_id = id;
    if (can_id == 419415298) {
      can_timeout = 0;
      memcpy(turbo_flags, can_data, 8);
      turbo_position = (turbo_flags[2] << 8) + turbo_flags[1];
      turbo_temp = turbo_flags[3];
      turbo_cmd_position = (turbo_flags[6] << 8) + turbo_flags[5];
      turbo_feedback = (turbo_flags[7] / 127.0) * 100;
    } else {
      timeout_can();
    }
  } else {
    timeout_can();
  }
}

It listens to the entire canbus network it is connected to. Technically you could connect it to your vehicles bus and spy on stuff.
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 anothernord

  • Member
  • **
  • 12
    • 01 Tacoma 3.4
Re: Termination Resistor and source address for multi-node CAN network
« Reply #4 on: July 11, 2018, 08:18:38 AM »
Shield or the Standalone.

They both have a 1watt 60ohm resistor across the High and Low. But that's it.

The standalone, it's R14, the SMD component bridging the 2 traces connected to 1 / 9 on the pinout.
The shield, it's R6, the gigantic resistor next to the pinouts.

I found it necessary to make canbus communication work.

If you're looking to setup some canbus communication, you need to brush up on the can library.

Code: [Select]
void read_can_data(unsigned long id, byte length) {
  if (CAN1.msgAvailable() == true) {
    CAN1.read(&id, &length, can_data);
    // 419,415,298 = 0x18FFC502 is turbo output
    // 419,367,426 = 0x18FF0A02 is no idea
    can_id = id;
    if (can_id == 419415298) {
      can_timeout = 0;
      memcpy(turbo_flags, can_data, 8);
      turbo_position = (turbo_flags[2] << 8) + turbo_flags[1];
      turbo_temp = turbo_flags[3];
      turbo_cmd_position = (turbo_flags[6] << 8) + turbo_flags[5];
      turbo_feedback = (turbo_flags[7] / 127.0) * 100;
    } else {
      timeout_can();
    }
  } else {
    timeout_can();
  }
}

It listens to the entire canbus network it is connected to. Technically you could connect it to your vehicles bus and spy on stuff.

I'm using the shield, and I see the big 60 ohm guy on there.  Thanks for that, and for the code.  I think it makes sense so I'll play with it.

The DSL1 controller that I linked has a PID boost control system that can use a PWM output for a solenoid or whatever, but I might just have the LBB read that signal and set the vane position proportionally.  It's kinda hokey but if the command frequency on the LBB is set much higher than the boost control loop, I think it'll work fine.