Reading data from tractor CAN-bus -- Problems when connected to tractor

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear all,

 

I have developed two identical PCB's which need to communicate with each other via CAN-protocol.

I was able to let them communicate with each other on a bitrate of 500kbits/s.

 

After this project I wanted to continue my adventure with CAN. So at home I have a tractor (Fendt 415) which is equipped with  a CAN-bus.

the following picture shows the joystick, which is placed in the cabin, with buttons on it. these buttons are read into a controller and are sended on to the CAN-bus. 

I want to intercept those messages, so I'm able to power other electric things (electric seeder machine) when pushing the buttons onto the joystick.

 

Image result for fendt joystick

 

I didn't only developed a two PCB's with AVR microcontrollers, but also a carrierboard for a AM335x System On Module. 

So first of all I connected my AM335x to the tractor, setted the correct bitrate = 100 kbits/s.

 

commands:

ip link set can0 up type can bitrate 100000
ifconfig can0 up
candump can0

So after searching for a while, I found the CAN ID and data for the buttons.

 

ID= 61F

Data button 1 ==> 15 33 1E  CA 80 00 00 00

Data button 2 ==> 15 34 1E  CA 80 00 00 00

Data button 3 ==> 15 35 1E  CA 80 00 00 00

Data button 4 ==> 15 36 1E  CA 80 00 00 00

 

So this was allready a major step in my project.

Now I don't want to use the AM335x into the tractor, this due to financial reasons.

I would like to use the microcontroller PCB's which I have developed before. 

This board exists out of an ATMega644P, MCP2515 and MCP2561.

 

The following step in my project was to bench test the can-bus. So I connected my two PCB's to each other and setted the bittiming to 100kbits/s (for this I used the following calculator https://www.kvaser.com/support/c...), created one sending node and one receiving node.

CNF1 = 0x03

CNF2 = 0xb6

CNF3 = 0x04

 

When the Sending node sends the following data:

15 33 1E  CA 80 00 00 00

And the receiving node receives it, the receiving node will set output PB1 high.

 

When the sending node sends the following data:

15 34 1E  CA 80 00 00 00

And the receiving node receives it, the receiving node will set output PB1 low.

 

All of this worked, until I connected the receiving node to the tractor. The receiving node doesn't detect any message (debugged it with atmel ice).

Due to this I thought that the problem was the bittiming.  So because of this I tested all the CNF settings which are in the link I posted above.

No setting of the bittiming made me able to read data into the microcontroller.

 

Does anybody know what the problem can be? Is it the bittiming? if so how can I solve this?

(The code is very long, this is why I don't post it. Also I'm sure the code isn't the problem, because it works correctly when bench testing)

 

Kind regards,

Toon Mertens

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So what basic hardware tests have you done to ensure that the signals from the tractor are actually reaching your MCU pins intact?

 

An oscilloscope would be the obvious choice ...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I don't have an oscilloscope any more. I'm asking a friend to use his logic analyzer.
But I think the signals reach my MCU intact, because I can read the signals with my Ti AM335x. (Used the same cable).

Kind regards.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TMJJJ wrote:
But I think the signals reach my MCU intact, because I can read the signals with my Ti AM335x. (Used the same cable).

Think about it: that just shows that the cable is OK - doesn't it?

 

It tells you nothing about what happens between the end of the cable and your MCU pins - does it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes thats wright.
I thought because it worked onto the bench I could say that the connection between the cable and mcu is good. And due to the Ti AM335x I could say the cable is good. But, I will wait for the logic analyzer before I continue. Then I'm 100% sure

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I was finally able to check the signals with an logic analyzer.

 

So first I went into the tractor, connected the system to my PCB and connected the logic analyzer to the canbus on the MCP2551. When I analyse the system, I see a lot of data running on the bus.

I also connected my Atmel ice to the microcontroller, and debugged the system. So that when I get any information into the microcontroller, I can check it. with the atmel ice I see also no information coming in.

 

So Then I know that it can be the MCP2551 or MCP2515 or microcontroller. 

 

The next step was to measure the TXcan and RXcan on the which connects the MCP2551 to the MCP2515. Here I see no data at all. 

With this result I'm almost sure that the MCP2551 is the problem (broken, wrong parameters...)

 

So the next step was to take the PCB inside and connect it again to another PCB which sends the same messages as the tractors canbus sends to the PCB. So like this I could simulate the tractor.

Both work on the bitrate of 100kbits/s.

When I test the system inside there is no problem at all. Everythings functions well.

 

So I think the problem is in the settings of the MCP2551. 

I have no idea what the problem can be... 

Is it a bittiming problem, or something else ....?

 

(I have a TI AM3358 which can communicate to the tractor without any problems.  )

 

I hope somebody can give me good advise.

 

Kind regards TMJJJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You really need to beg, borrow or buy a scope.  That would immediately tell you the differences in signal levels etc between your test board and the tractor, and would tell you where the incoming signal is lost.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you know the tractor's CANbus runs at 100KHz?

 

Jim

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you ask me you probably have your priorities wrong.

Such a tractor is probably an  USD10000 + piece of equipment and you also have the risk of damaging attached equipment or nearby people when you loose control (shorted out CAN bus?)  at the wrong moment.

For about EUR 350 you have a brand new pretty decent Rigol scope.

What is your time worth?

 

 

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com