Instable connection when moving from PCI Express to PCI Express FD

CAN FD Interface for PCI Express
felixwidmaier
Posts: 13
Joined: Tue 11. May 2021, 11:25

Re: Instable connection when moving from PCI Express to PCI Express FD

Post by felixwidmaier » Thu 14. Oct 2021, 12:19

I think I do have exact information about the motor boards bit rate, as I have to configure it myself in the firmware. The settings I am currently using on the motor board are

Code: Select all

    clock = 45 MHz  (this I cannot change)
    BRP = 3
    Prop Seg + Phase Seg1 = 12
    Phase Seg 2 = 2
    SJW = 2
If my understanding is correct, this results in a bit rate of 1 Mbit/s and sampling point 86.7%.

There is no change between the tests that I am aware of. As far as I know, no one touched the hardware in the meantime. I'll ask my colleague if he can double-check the cable.

Here is a diagram of my setup:

Image

Cable length between PC and motor board is around 3m.

The configuration:

- The PC is configured to 1 Mbit/s, sample point 0.667 or 0.867.
- The motor board is configured to 1 Mbit/s, sample point 0.867 (see above).
- The laptop is running pcanview and is configured to listen-only, 1 Mbit/s, sample point 0.875 (0.867 was not possible).

With setting the sample point to 0.667 on the PC it was mostly working yesterday. Interestingly when I set it to 0.867 (so it matches the motor board), it was consistently failing.

I repeated the test today (without the laptop connected to the bus) and now 0.867 was working sometimes, 0.667 was still more reliable, though.
Failures are most likely to occur on the first run after initialising the CAN interface on the PC (i.e. on follow-up runs it is more likely to succeed until the interface is re-initialised).


I saw that when only specifying bitrate/sampling point on the PC, the parameter SJW is set to 1. As I read somewhere that SJW should be the same on all devices in the network, I also tried the following configurations (based on the values that were automatically set when specifying bitrate/sampling point, just increasing SJW):

1) For sampling point 0.667

Code: Select all

    ip link set canX type can \
        tq 12 prop-seg 26 phase-seg1 26 phase-seg2 27 sjw 2 \
        fd off fd-non-iso off
   
2) For sampling point 0.867

Code: Select all

    ip link set canX type can \
        tq 12 prop-seg 34 phase-seg1 34 phase-seg2 11 sjw 2 \
        fd off fd-non-iso off
   
On the first tests, this indeed seems to make it slightly more reliable in both cases, while still sampling point 0.667 is working better.

Since there is some non-determinism in the results I'll repeat the tests a few times in the next days.

In case I still get errors, would it make sense to increase SJW further (both on PC and motor board)?

M.Maidhof
Support
Support
Posts: 1433
Joined: Wed 22. Sep 2010, 14:00

Re: Instable connection when moving from PCI Express to PCI Express FD

Post by M.Maidhof » Thu 14. Oct 2021, 13:24

Hi,

are there termination resistors on both ends of your CAN bus cables? How long is the T connection to the PCAN-USB?

regards

Michael

felixwidmaier
Posts: 13
Joined: Tue 11. May 2021, 11:25

Re: Instable connection when moving from PCI Express to PCI Express FD

Post by felixwidmaier » Thu 14. Oct 2021, 13:42

Yes, there are termination resistors on the PC and motor board ends, not at the PCAN-USB.
The T connection is around 80 cm.

M.Maidhof
Support
Support
Posts: 1433
Joined: Wed 22. Sep 2010, 14:00

Re: Instable connection when moving from PCI Express to PCI Express FD

Post by M.Maidhof » Thu 14. Oct 2021, 15:24

Please try to prevent T-connections, this could cause problems on higher baudrates.

regards

Michael

felixwidmaier
Posts: 13
Joined: Tue 11. May 2021, 11:25

Re: Instable connection when moving from PCI Express to PCI Express FD

Post by felixwidmaier » Thu 28. Oct 2021, 13:35

I now repeated the test with a new test setup, i.e. different motor board, different cable (without the T-connection) and got similar results, i.e. the settings with sampling point around 0.667 work well (at least in the tests I am doing) while the ones with 0.867 are failing.
It was also confirmed by someone in a different lab who has the same setup (with the same issues).

I'll do some more tests but assuming it keeps working, I guess I can just use these settings, even if they don't make sense in theory.

Thanks a lot for your help and your patience!

Post Reply