Controller Area Network (CAN) is widely used as an automotive communication protocol. It allows electronic control units (ECUs) to communicate with each other and with other devices in the vehicle.
CAN signals can represent a variety of physical phenomena, such as temperature, Vehicle speed, Yaw rate and so on. The underlying CAN protocol deals with raw binary values, but the engineer who is trying to read or write it needs to interpret these raw values in a way that makes sense.
This is where scaling comes in. Scaling is the process of converting a digital signal to a physical quantity. We multiply the digital signal by a scaling factor and add an offset to it. And then we define the scaling factor and offset in the CAN DBC file. And the conversion formula is as below:
PhysicalValue = ( RawValue * factor) + Offset
where,
PhysicalValue is the value of the physical quantity (e.g. speed, rpm, temperature, etc.) that represents the signal.
RawValue is the digital value as it is transmitted in the network.
factor is the scaling factor by which the raw value is multiplied to obtain the physical value.
Offset is the offset to the measured value.
For example, If we have a signal with below properties,
![](https://automotivetomorrow.com/wp-content/uploads/2023/08/SignalScaling.png)
We can derive the following, using the above formula
Physical Value | Decimal Value | Hex Value(Actual value transmitted on CAN Bus) |
-40 | 0 | 0 |
0 | 80 | 50 |
2 | 82 | 52 |
80 | 245 | F5 |
Scaling is an important part of working with CAN signals. It allows engineers to interpret the digital signals in a way that makes sense for the physical quantity they represent.
Advantages of Scaling
Here are some of the benefits of scaling signals in CAN DBC:
- It makes it easier for engineers to understand the meaning of the signal values.
- It allows engineers to compare signal values from different ECUs.
- It can help to improve the accuracy of the signals.
- It can help to reduce the number of errors in the signals.
If you are working with CAN signals, it is important to understand how scaling works. The CAN DBC file for the system will provide the information you need to scale the signals correctly.