Individual control units are networked with each other and can exchange data.
The bus is bidirectional, i.e. any device connected to it can receive and transmit messages.
Sensor signal (sensor) enters the nearest control unit, which processes it and transfers it to the CAN data bus.
Any control unit connected to the CAN data bus can read this signal, calculate the value of the control action based on it, and control the servo actuator.
CAN communication
- B - Sensor 1
- CAN - Data bus
- M - Executive elements I-III (servo mechanisms)
- N - Control units (controllers) I-V
Advantages
With the usual cable connection of electrical and electronic devices, each control unit is directly connected to all sensors and actuators from which it receives measurements or which it controls.
The complication of the control system leads to excessive length or multiple cable lines.
Compared to standard cabling, the data bus provides:
- Reducing the number of cables. The wires from the sensors are pulled only to the nearest control unit, which converts the measured values into a data packet and transfers it to the CAN bus.
- Any control unit can control the actuator, which receives the corresponding data packet via the CAN bus, and on its basis calculates the value of the control action on the servomechanism.
- Improved electromagnetic compatibility.
- Reducing the number of plug connections and reducing the number of contact outputs on control units.
- Weight loss.
- Reducing the number of sensors, because single sensor signals (e.g. from the coolant temperature sensor) can be used by different systems.
- Improving diagnostic capabilities. Because single sensor signals (e.g. speed signal) are used by different systems, then if a fault message is issued by all systems using this signal, the sensor or control unit that processes its signals is usually faulty. If the error message comes from only one system, although this signal is also used by other systems, then the cause of the malfunction is most often in the processing control unit or servomechanism.
- High data rate - up to 1 Mbps possible with a maximum line length of 40 m. Currently, data rates on vehicles range from 83 Kbps to 500 Kbps.
- Several messages can be transmitted in turn on the same line.
The CAN data bus consists of a two-wire wire made in the form of a twisted pair. All devices connected to this line (device control units).
Data transfer is carried out with duplication on both wires, and the logical levels of the data bus are mirrored (that is, if a logic zero level is transmitted on one wire, then a logic one level is transmitted on the other wire, and vice versa).
The two-wire transmission scheme is used for two reasons: to detect errors and as a basis for reliability.
If the voltage peak occurs on only one wire (e.g. due to EMC problems (electromagnetic compatibility)), the receiver units can identify this as an error and ignore this voltage peak.
If there is a short circuit or a break in one of the two wires of the CAN data bus, then thanks to the integrated hardware and software system of reliability, there will be a switch to the single-wire operation mode. A damaged transmission line will not be used.
Order and format transmitted and received by users (subscribers) messages is defined in the communication protocol.
A significant distinguishing feature of the CAN data bus compared to other bus systems based on the principle of subscriber addressing is message-related addressing.
This means that each message on the CAN data bus is assigned its permanent address (identifier), marking the content of this message (e.g.: coolant temperature). The CAN data bus protocol allows the transmission of up to 2048 different messages, with addresses from 3 to 2048 being permanently fixed.
The amount of data in one message on the CAN data bus is 8 bytes.
The receiver block processes only those messages (data packets), which are stored in its list of CAN·messages received on the data bus (acceptance control).
Data packets can only be transmitted if the CAN data bus is free (i.e. if after the last data packet an interval of 3 bits followed and no control unit starts to send a message).
In this case, the logical level of the data bus must be recessive (logical «1»).
If several control units start transmitting messages at the same time, then the priority principle takes effect, according to which the message on the CAN data bus with the highest priority will be transmitted first without losing time or bits (arbitration of access requests to the common data bus).
Each control unit that loses the right to arbitrate will automatically switch to receive and retry to send its message as soon as the CAN data bus is free again.
In addition to data packets, there is also a request packet for a specific message on the CAN data bus.
In this case, the control unit, which can provide the requested data packet, responds to this request.
Data Packet Format
In normal transmission mode, data packets have the following block configurations (frames):
- Data Frame (message frame) for transmitting messages on the CAN data bus (e.g.: coolant temperature).
- Remote Frame (request frame) to request messages on the CAN data bus from another control unit.
- Error Frame (error frame) all connected control units are notified that an error has occurred and the last message on the CAN data bus is invalid.
The CAN data bus protocol supports two different CAN data bus message frame formats that differ only in the length of the identifier:
- standard format;
- extended format.
The standard format is currently used.
The data packet for transmitting messages on the CAN data bus consists of seven consecutive fields:
- Start of Frame (start bit): Marks the beginning of the message and synchronizes all modules.
- Arbitration Field (id and request): This field consists of an identifier (addresses) 11 bits and 1 check bit (Remote Transmission Request-Bit). This control bit marks the packet as a Data Frame (message frame) or as Remote Frame (request frame) no data bytes.
- Control Field (control bits): Control field (6 bit) contains IDE bit (Identifier Extension Bit) to recognize the standard and extended format, a spare bit for subsequent extensions and - in the last 4 bits - the number of data bytes embedded in the Data Field (data field).
- Data Field (data): Data field can contain 0 to 8 bytes of data. A message on the CAN data bus with a length of 0 bytes is used to synchronize distributed processes.
- CRC Field (control field): CRC field (Cyclic-Redundancy-Check Field) contains 16 bits and serves for control recognition of errors during transmission.
- ACK Field (acceptance confirmation): ACK field (Acknowledgement Field) contains an acknowledgment signal for all receiver units that received a message via the CAN bus without errors.
- End of Frame (end of frame): Marks the end of the data packet.
- Intermission (interval): Interval between two data packets. The interval must be at least 3 bits. After that, any control unit can transmit the next data packet.
- IDLE (rest mode): If no control unit sends messages, then the CAN bus remains in idle mode until the next data packet is transmitted.
Priorities
In order to process data in real time, it must be possible to transfer them quickly.
This not only requires a link with a high physical data rate, but also requires that a common CAN bus be quickly provided if several control units need to send messages at the same time.
In order to distinguish between the messages transmitted on the CAN data bus according to the degree of urgency, different priorities are provided for individual messages.
Ignition timing, for example, has the highest priority, slip values have medium, and the outside temperature has the lowest priority.
The priority with which a message is transmitted on the CAN bus is determined by the identifier (address) the corresponding message.
An identifier corresponding to a smaller binary number has a higher priority, and vice versa.
The CAN data bus protocol is based on two logical states: The bits are either «recessive» (logical «1»), or «dominant» (logical «0»). If a dominant bit is transmitted by at least one module, then recessive bits transmitted by other modules are overwritten.
Example
If several control units start data transfer at the same time, then the conflict of access to the common data bus is resolved by «bitwise arbitration of shared resource requests» with the appropriate identifiers.
When transmitting the identifier field, the transmitter checks after each bit whether it still has the right to transmit, or whether another control unit is already transmitting a message with a higher priority on the CAN data bus.
If the recessive bit transmitted by the first transmitter unit is overwritten by the dominant bit of another transmitter unit, then the first transmitter unit loses its right to transmit (arbitration) and becomes a receiver block.
First control unit (N I) loses arbitration from the 3rd bit.
Third control unit (N III) loses arbitration from the 7th bit.
Second control unit (N II) retains the right to access the CAN data bus and can transmit its message.
Other control units will only attempt to transmit their messages on the CAN data bus when it is free again. In this case, the right to transmit will again be granted in accordance with the priority of the message on the CAN data bus.
Error recognition
Interference can lead to errors in data transmission. Such transmission errors should be recognized and corrected. The CAN data bus protocol distinguishes between two levels of error recognition:
- mechanisms at the Data Frame level (message frame);
- bit-level mechanisms.
Mechanisms at the Data Frame level
Cyclic-Redundancy-Check:
Based on the message transmitted via the CAN data bus, the transmitter calculates the control bits that are transmitted together with the data packet in the field «CRC Field» (checksums). The receiver unit recalculates these control bits on the basis of the message received via the CAN data bus and compares them with the control bits received with this message.
Frame Check:
This mechanism checks the structure of the transmitted block (frame), that is, bit fields with a given fixed format and the frame length are rechecked.
Errors detected by Frame Check are marked as format errors.
Bit level mechanisms
Monitoring:
Each module, when transmitting a message, monitors the logical level of the CAN data bus and determines the differences between the transmitted and received bits. This ensures reliable recognition of global and local bit errors that occur in the transmitter unit.
Bit Stuffing:
In each data packet between the field «Start of Frame» and the end of the field «CRC Field» there should be no more than 5 consecutive bits with the same polarity.
After each sequence of 5 identical bits, the block transmitter adds one bit with opposite polarity to the bit stream.
Receiver units clear these bits after receiving a message on the CAN data bus.
Troubleshooting
If any CAN data bus module detects an error, it will abort the current data transfer process by sending an error message. The error message consists of 6 dominant bits.
Thanks to the error message, all control units connected to the CAN data bus are notified of a local error that has occurred and accordingly ignore the previously transmitted message.
After a short pause, all control units will again be able to send messages on the CAN data bus, with the message with the highest priority being sent first again.
The control unit whose message on the CAN data bus caused the error also starts retransmitting its message (automatic repeat request function).
CAN bus types
Different CAN buses are used for different control areas. They differ from each other in data transfer speed.
CAN baud rate area «engine and running gear» (CAN-C) is 125 Kbps, and the CAN data bus «Salon» (CAN-B) due to the smaller number of especially urgent messages, it is designed for a data transfer rate of only 83 Kbps.
The exchange of data between the two bus systems takes place via so-called «gateways», i.e. control units connected to both data buses.
Fiber optic D2B (Digital Daten-Bus) data applied to area «Audio/Communication/Navigation». An optical fiber cable can transmit a significantly larger amount of information than a bus with a copper cable.
Visitor comments