CAN Bus Questions

information about how to make an ECU (MoTeC or non MoTeC) work with a MoTeC dash or data logger

CAN Bus Questions

Postby Slagathor on Tue Nov 20, 2018 12:29 pm

I have some questions that I am hoping some of the experts here can answer.

#1. Is there a Webinar/Tutorial that explains the details of custom CAN message byte handing in a logger (C Series, etc)? I am referring to the actual mapping of byte data to channels using the following:
*Base Resolution
*Default Value
*Offset
*Length
*Bitmask
*Signing
*Multiplier
*Divisor
*Adder
*Chosen Channel

I thought I watched a video in the past that delved into these details, but I can not seem to find it now.

Here is an image of the settings I am referring to. See lower right for message/byte level settings:

CAN Message Details.JPG
CAN Message Details.JPG (98.04 KiB) Viewed 12269 times


#2. If a Dash / Logger is receiving and logging data from a 3rd party device via CAN, and mapping it to a logger channel, does it consider the time at which THE LOGGER receives the data to be the "real time"? In looking at the every CAN template so far, there is no time data buried in the data bytes.

Because of the arbitration of messages, couldn't this cause a significant error in the data profile vs time at the logger? For example, lets assume I am measuring some suspension data at a high sampling rate, and during the time period in question, the displacement is falling linearly. Then during this decrease, there is BUNCH of higher priority traffic, and the suspension data messages queue up on the CAN transceiver that is sending them. Then...after the traffic clears all the messages are sent and logged. The times associated with those messages when the logger stores them will be wrong.

This is the idea....

IMG_0060 Small.JPG
IMG_0060 Small.JPG (28.92 KiB) Viewed 12269 times


Is the CAN Bus so fast that this literally can not happen, and the error is insignificant? How do the Motec external modules that log at very high speeds (VIM, etc) handle this. They must have a local timestamp that is transmitted, and the logger matches re-syncs on its own end...right?

#3 Does the CAN Bus have to be physically linear?..... like long length of twisted pair with 120 Ohm resistors at each end... What if it has a bunch of "branches"? Imagine an octopus with 8 legs. Each leg is a twisted pair, with terminating 120 Ohm resister at the tip of each leg? Will this work? I have a new application where it would be helpful to have this "branched" configuration.

Thanks in advance Motec Gurus!
Slagathor
 
Posts: 9
Joined: Tue Nov 20, 2018 9:24 am

Re: CAN Bus Questions

Postby adrian on Tue Nov 20, 2018 3:29 pm

1. The value of the channel is calculated as follows:

Channel Value = (Raw CAN Value x Multiplier / Divisor + Adder) x Base Resolution

The offset is the byte position of the channel in the message (from 0 to 7) and the length is the length of the channel in bytes.

The mask is used as you can only select the length of a channel in bytes. If a channel is less than 8, 16 or 32 bits you need to use a mask. The mask is a bitwise 'and' with the channel.

There is more information on setting up CAN here

2. That is essentially correct, a CAN message will be delayed if a higher priority message is sent at the same time. You would have to be sending the messages extremely quickly to notice.
Some (very) rough calculations:
Assuming a 1Mbit bus and 11bit ID's, a message including the worst case for stuff bits is about 130us long, so unless your high priority messages are being sent at 4-5kHz then it is unlikely your suspension message will be delayed by more than 130us.

Our SVIM modules have some smarts built in that allow us to properly time sync the messages and avoid any possible delays.

3. Yes it must be linear, do not build a CAN bus like an octopus. There should only ever be 2 CAN resistors, one at each end. Have a look at any of our User Manuals for CAN wiring, it shows you how it should be wired up.
adrian
MoTeC
 
Posts: 718
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Bus Questions

Postby Slagathor on Tue Nov 20, 2018 4:47 pm

Adrian, thanks for the clear and concise responses....
Slagathor
 
Posts: 9
Joined: Tue Nov 20, 2018 9:24 am


Return to ECU to Dash Comms

Who is online

Users browsing this forum: No registered users and 1 guest