Import external DBC Multiplier – Divisor – Adder – Resolutio

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

Import external DBC Multiplier – Divisor – Adder – Resolutio

Postby FrankL on Tue Feb 01, 2022 11:59 am

Import external DBC Multiplier – Divisor – Adder – Resolution

Hi I am trying to understand how an imported DBC is interpreted in the dash.

As an example I am using a CAN IMU unit from Bosch. All signals are 4 Bytes long.
Accel add giros offset (Adder): 32768 (x8000).
Accel scale: 0.0001274 g/digit
Giro scale: 0.005 °/s/digit
See first image for manufacturer data
First image.jpg
IMU data sheet
First image.jpg (13.21 KiB) Viewed 8187 times

-------------------------------

Using BusMaster I created a DBC file with all the data exchange on the vehicle CAN.
To get the right value in BusMaster I used:
Accel scale: 0.000127
Accel Offset: -4.17 -> (32768 * 0.0001274)
Giro scale: 0.005
Giro Offset: -163.84 -> (32768 * 0.005)
See image at the end for the BusMaster channel setup
--------------------------------

Exporting the setup to a DBC file I get the following.

BO_ 376 x178_IMU_AY_RY: 8 Vector__XXX
SG_ IMU_AY : 32|16@1+ (0.000127,-4.17) [-4.17|4.15295] "g" Vector__XXX
SG_ IMU_RY : 0|16@1+ (0.005,-163.84) [-163.84|163.835] "deg/s" Vector__XXX
-------------------------------

Importing the DBC file to the Dash, I get the following:

IMU AY
Base resolution: 0.0001 G
Offset: 4 -> (Byte index 4) -> ok
Length: 2 -> (2 Byte) -> ok
Output Length: 4 ( ?? 4 hex characters’ ??) ->??
Bit Mask (HEX): FFFF -> (All bits) -> ok
Multiplier: 14, Divisor: 11 -> (14/11 = 1.2727) -> ok close enough to 0.000127 (1.2727*0.0001 resolution)
Adder: 23836 -> ?? Can’t figure it out ??
See image at the end

IMU RY
Base resolution: 0.1 Hz -> Is 1 Hz equal to 1 rotation/s (360°/s) ???
Offset: 0 -> (Byte index 0) -> ok
Length: 2 -> (2 Byte) -> ok
Output Length: 4 ( ?? 4 hex characters’ ??) ->??
Bit Mask (HEX): FFFF -> (All bits) -> ok
Multiplier: 1, Divisor: 2700 -> (1/2700 = 0.003703) -> ?? Can’t figure it out ??
Adder: -5 -> ?? Can’t figure it out ??
See image at the end
-------------------------------------

Following a topic about dbc file on the forum the equation should be
“ (Raw CAN Value x Multiplier / Divisor + Adder) x Base Resolution ”

IMU AY issues
At a Raw CAN value of 32768 I should have 0.0000 G Force
(Raw CAN Value x Multiplier / Divisor + Adder) x Base Resolution
(32768 x 14 / 11 – 41705) x 0.0001 = 0.0000 G Force

The issue is that I cannot use an “Adder” value larger/smaller than -32768 / +32767
See the sixth image
Sixth image.jpg
Motec error
Sixth image.jpg (33.53 KiB) Viewed 8187 times

IMU RY confusion

Should I divide the “Multiplier”, “Divisor” and “Adder” by 360 to end up with Hz?
------------------------------------

Can anyone help me on that?
Sure I could do try and error until I figure this out, but I it much better to have right the first time.

Thanks, Frank
Attachments
Picture1.jpg
BusMaster & Motec 2,3,4,5 image
Picture1.jpg (90.75 KiB) Viewed 8187 times
FrankL
 
Posts: 23
Joined: Sat Jan 16, 2016 5:39 am
Location: Québec, Canada

Re: Import external DBC Multiplier – Divisor – Adder – Resol

Postby adrian on Fri Feb 04, 2022 9:47 am

It looks like there is an error with the dbc import and it isn't calculating the values correctly (it actually warns you that it isn't correct and tells you to edit it manually). One of the biggest limitations is that the multiplier/divisor/adder are all only 16bit signed numbers. This means that with channels that have very small resolutions and large offsets it is impossible to get a combination of mult/div/add that works without losing precision.

Below are CAN templates that work, just with slightly less resolution.

Regarding the angular speed channels you need to convert from °/s to Hz.
So work out the factor first. 0.005°/s /360 = 0.000013888Hz. One combination of mult/div/base res to match this is
mult 1736, div 12500 base res 0.0001Hz
Now calculate the adder. 0x8000 x 0.005°/s = 163.84 = 0.4551Hz. You then have to take into account the adder is applied before the base resolution so in this case you need to multiply it by 1000 to give 4551 and it needs to be negative.
Attachments
Bosch MM5.10 0x174.CC8
(8.34 KiB) Downloaded 432 times
Bosch MM5.10 0x17C.CC8
(8.34 KiB) Downloaded 457 times
Bosch MM5.10 0x178.CC8
(8.34 KiB) Downloaded 463 times
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: Import external DBC Multiplier – Divisor – Adder – Resol

Postby FrankL on Fri Feb 04, 2022 11:28 am

Thanks Adrian,

I ended up with a pretty similar solution, but I was wondering if I missed something in the dbc import.
Thanks for sending me the CAN config for the IMU.

1. When importing dbc we can add rules to recognize units. So would that change any thing for the deg/s or would the channel still be treated as if it is send in Hz?

2. I have been struggling with some unit conversion in imported dbc for a while. I am trying to understand what is going on behind the scene in the conversion process. When importing a dbc will the software try to modify the "Mult, Div, & Adder" to the base unit of the channel?

3. Also, what is the use of the drop down menu "Output Length" field " 2, 4, Auto"?

Thanks, Frank
FrankL
 
Posts: 23
Joined: Sat Jan 16, 2016 5:39 am
Location: Québec, Canada

Re: Import external DBC Multiplier – Divisor – Adder – Resol

Postby adrian on Fri Feb 04, 2022 11:48 am

1. The rules are there to tell the manager what the units actually are. With a dbc file there is no restriction on how you write the units, so for example for temperature you can have °C, degC, degrees Celsius....and so on. There is no way for us to allow for every possible combination so you can map it to something the Dash recognises. The base resolution of a channel can't be changed, so for angular speed it will always be Hz. However, there are Displayed Units which the Dash will automatically convert the channel so that it is logged or displayed in your selected 'display unit'.

2. If the CAN channel has units that are recognised by Dash Manager (or mapped) and they are different to the base resolution it will do the conversion during the import.

3. The Dash has 16bit and 32bit channels, they are both signed. If your CAN channel is 16 bit unsigned then a 16bit signed channel in the Dash can't display the full range of the channel. The "output length" allows you to set this to a 32bit signed channel which has enough positive range to cover a 16bit unsigned channel. Auto determines whether you need a 16 or 32 bit channel based on the length and sign parameters in the template.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm


Return to ECU to Dash Comms

Who is online

Users browsing this forum: No registered users and 2 guests