Design of CAN Bus Communication Interfaces for Forestry Machines
"> Figure 1
<p>Harvester machine in operation equipped with a processor head.</p> "> Figure 2
<p>CAN bus modules implementation overview.</p> "> Figure 3
<p>CAN bus network architecture.</p> "> Figure 4
<p>Standard CAN.</p> "> Figure 5
<p>Extended CAN.</p> "> Figure 6
<p>CAN node established for the study.</p> "> Figure 7
<p>ECU CAN bus “IPCB SMARTCUT V00.2021”.</p> "> Figure 8
<p>Reverse polarity protection circuit.</p> "> Figure 9
<p>Short-circuit protection implemented.</p> "> Figure 10
<p>ECU CAN bus “IPCB SMARTCUT V02.2021”.</p> "> Figure 11
<p>Illustration of the experimental setup.</p> "> Figure 12
<p>Experimental setup.</p> "> Figure 13
<p>(<b>a</b>) Programming CAN transmission flowchart. (<b>b</b>) Programming CAN reception flowchart.</p> "> Figure 14
<p>Received data from inductive proximity sensor 1 CAN Analyzer.</p> "> Figure 15
<p>Received data from potentiometer CAN Analyzer.</p> "> Figure 16
<p>Received data from inductive proximity sensor 2 CAN Analyzer.</p> ">
Abstract
:1. Introduction
2. Related Works
3. Materials and Methods
3.1. CAN Bus Concepts
- Baud rate and cable length: The CAN bus handles up to 1 Mbit/s in bit rates (classical CAN) or 5 Mbit/s (CAN FD [18]). The baud rate is inversely proportional to the length of the CAN bus. The maximum cable length allowed when running a baud rate of 1 Mbit/s is 40 m. For 125 kbit/s it is 500 m;
- Termination: Two 120 Ohm resistors must be placed at each extremity of the CAN bus to properly terminate it. The resistors guarantee the perfect propagation of electrical signals through the bus cables. Each resistor allows the reflection of signals which is mandatory for the proper functioning of the CAN bus network.
- Data frame: most commonly used, contains data sent from the transmitter to the receiver;
- Remote frame: used to request a message from a node with a designated ID;
- Error frame: is transmitted by any node that detects an error on the bus;
- Overload frame: generates an extra delay to finish the processing of data frames or remote frames.
- Start-of-frame (SOF): Defined by only one dominant bit ‘0′, this field marks the beginning of the message or frame;
- Identifier: The 11-bit identifier establishes the priority of the message in the CAN network. The lower its binary value, the higher its priority;
- Remote transmission request (RTR): The Remote Transmission Request bit indicates if the frame is a data frame (‘0′) or a remote frame (‘1′);
- Identifier extension bit (IDE): The identifier extension bit determines the size of the identifier. A dominant bit corresponds to an 11-bit identifier;
- Reserved bit (r0): Bit reserved by the standard. Has a default value of ‘0′ but the CAN controllers accept it independently of its logical value;
- Data length code (DLC): Indicates the number of bytes of data (0–8);
- Data: Contains the data bits. Up to 64 bits (8 bytes) can be sent through a data frame;
- Cyclic redundancy check (CRC): Contains the checksum (number of bits transmitted) of the preceding application data for error correction;
- Acknowledgement (ACK): Has two bits (ACK slot and ACK delimiter). The transmitter sends two recessive bits, while the receiver overwrites the recessive bit (ACK slot) if it acknowledges and receives the data correctly;
- End-of-frame (EOF): Delimits each data frame and remote frame by a sequence of flags consisting of seven bits;
- Interframe space (IFS): Moves a correctly received message to a proper buffer by indicating the time requirement;
- Substitute remote request (SRR): In extended format it replaces the RTR bit as a placeholder;
- Identifier extension: A recessive bit that, when sending an extended CAN message, indicates that more identifier bits follow (18-bit extension follows IDE);
- r1: Another bit for possible use in future amendments [19].
3.1.1. CAN Bus Arbitration
3.1.2. Advantages and Disadvantages of CAN Bus
- Reduction of wires, errors, weight and cost, since there is only one CAN system needed for ECUs to communicate;
- Provides a fully centralized network for ECUs, with master-slave and multicast features;
- It is a robust system once it is not subject to electrical disturbance and electromagnetic disturbance;
- It allows nodes that have lost arbitration to send a message when the bus is free without losing any data and with no interruptions, since CAN has carrier sense multiple access with collision detection (CSMA/CD) and arbitration on message priority (AMP) protocols.
- Limits the number of nodes connected to the CAN bus (maximum 64 nodes);
- Possibility of integrity issues;
- Undesirable interaction between the nodes;
- Limited length and amount of data per message;
- High cost for software development and maintenance.
3.2. CAN Bus Module Implementation
4. Results
4.1. First ECU CAN 2.0 B Prototype
- Programmer-PICkit 4 (MCLR; +5 V; GND; ICSPDAT; ICSPCLK);
- Power supply (+5 V; GND);
- CAN bus (CAN high; CAN low).
- Clock-out and clock-in to connect to an external oscillator (RA6 and RA7 respectively);
- CAN_Rx and CAN_Tx (RB3 and RB4 respectively);
- ICSPCLK an ICSPDAT (RB6 and RB7 respectively);TXPIC and RXPIC (RC6 and RC7 respectively) to be connected to the MAX232CPE+.
4.2. Second ECU CAN 2.0 B Prototype
4.3. CAN Bus Test Communications Case Study
Experimental Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Singh, R.; Gehlot, A.; Akram, S.V.; Thakur, A.K.; Buddhi, D.; Das, P.K. Forest 4.0: Digitalization of forest using the Internet of Things (IoT). J. King Saud Univ.-Comput. Inf. Sci. 2021. Available online: https://www.sciencedirect.com/science/article/pii/S1319157821000483?via%3Dihub (accessed on 3 November 2021).
- Kizito, R.; Scruggs, P.; Li, X.; Kress, R.; Devinney, M.; Berg, T. The Application of Random Forest to Predictive Maintenance. In Proceedings of the 2018 IISE Annual Conference, Orlando, FL, USA, 19–22 May 2018. [Google Scholar]
- Ahmad, B.; Mishra, B.K.; Ghufran, M.; Pervez, Z.; Ramzan, N. Intelligent Predictive Maintenance Model for Rolling Components of a Machine based on Speed and Vibration. In Proceedings of the 2021 International Conference on Artificial Intelligence in Information and Communication (ICAIIC), Jeju Island, Korea, 13–16 April 2021; pp. 459–464. [Google Scholar] [CrossRef]
- Stojmenovic, I. Machine-to-Machine Communications with In-Network Data Aggregation, Processing, and Actuation for Large-Scale Cyber-Physical Systems. IEEE Internet Things J. 2014, 1, 122–128. [Google Scholar] [CrossRef]
- Fleck, P.; Reyes-Aviles, F.; Pirchheim, C.; Arth, C.; Schmalstieg, D. MAUI: Tele-assistance for Maintenance of Cyber-physical Systems. In Proceedings of the 15th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications 2020, Valetta, Malta, 27–29 February 2020; pp. 800–812. [Google Scholar] [CrossRef]
- Alfergani, A.; Khalil, A.; Rajab, Z.; Zuheir, M.; Asheibi, A.; Khan, S.; Aboadla, E.H.E.; Bin Azna, K.A.; Tohtayong, M. Control of master-slave microgrid based on CAN bus. In Proceedings of the 2017 IEEE Jordan Conference on Applied Electrical Engineering and Computing Technologies (AEECT), Aqaba, Jordan, 11–13 October 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Peng, Y.; Shujuan, Z.; Xin, G. Design of motor drive module on CAN bus. In Proceedings of the Second International Conference on Intelligent NEtworks and Intelligent Systems, Tianjin, China, 1–3 November 2009. [Google Scholar]
- Yue, X.; Zhu, A.; Song, J.; Cao, G.; An, D.; Guo, Z. The Design and Implementation of Human Motion Capture System Based on CAN Bus. In Proceedings of the 2020 17th International Conference on Ubiquitous Robots (UR), Kyoto, Japan, 22–26 June 2020; pp. 415–420. [Google Scholar] [CrossRef]
- Shi, J. The Implementation of CAN Bus Network of PLC Based on ARM. In Proceedings of the 2012 4th International Conference on Intelligent Human-Machine Systems and Cybernetics, Nanchang, China, 26–27 August 2012; pp. 268–270. [Google Scholar] [CrossRef]
- Zhijian, L.; Tiehua, M. Design of CAN-Bus universal interface module based on USB. In Proceedings of the 2011 International Conference on Consumer Electronics, Communications and Networks (CECNet); Institute of Electrical and Electronics Engineers (IEEE), Xianning, Chian, 16–18 April 2011; pp. 4020–4023. [Google Scholar] [CrossRef]
- Yang, S.W.; Yang, L.; Zhuo, B. Developing a Multi-node Calibration System for CAN Bus Based Vehicle. In Proceedings of the 2006 IEEE International Conference on Vehicular Electronics and Safety, Shanghai, China, 13–15 December 2006; pp. 199–203. [Google Scholar] [CrossRef]
- Elshaer, A.M.; Elrakaiby, M.M.; Harb, M.E. Autonomous Car Implementation Based on CAN Bus Protocol for IoT Applications. In Proceedings of the 2018 13th International Conference on Computer Engineering and Systems (ICCES), Cairo, Egypt, 18–19 December 2018; pp. 275–278. [Google Scholar] [CrossRef]
- Tao, R.W.; Lin, Y. Design of Electrical Control System Based on CAN Field Bus. In Proceedings of the 2017 International Conference on Smart Grid and Electrical Automation (ICSGEA), Changsha, China, 27–28 May 2017; pp. 1–4. [Google Scholar] [CrossRef]
- Xu, Y.; Wei-Bo, C. Design and implementation of gateway for vehicular networks. In Proceedings of the 2013 25th Chinese Control and Decision Conference (CCDC), Guiyang, China, 25–27 May 2013; pp. 4486–4489. [Google Scholar] [CrossRef]
- Kimm, H.; Jarrell, M. Controller Area Network for fault tolerant small satellite system design. In Proceedings of the 2014 IEEE 23rd International Symposium on Industrial Electronics (ISIE), Istanbul, Turkey, 1–4 June 2014; pp. 81–86. [Google Scholar] [CrossRef]
- CSS Eletronics. CAN Bus Explained—A Simple Intro (2021). 2021. Available online: https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial (accessed on 29 September 2021).
- Broyles, S. A System Evaluation of CAN Transceivers. Tex. Instrum. 2002. Available online: https://www.ti.com/lit/an/slla109a/slla109a.pdf (accessed on 3 November 2021).
- Wang, Z.; Geng, S.; Peng, X.; Zhang, Y.; Yan, S.; Tang, H. The Driven Design of CAN-FD Bus Controller Based on Cortex-M0. In Proceedings of the 2020 IEEE 5th International Conference on Integrated Circuits and Microsystems (ICICM), Nanjing, China, 23–25 October 2020; pp. 209–212. [Google Scholar] [CrossRef]
- Corrigan, S. Introduction to the Controller Area Network (CAN). Tex. Instrum. 2002. Available online: https://www.rpi.edu/dept/ecse/mps/sloa101.pdf (accessed on 3 November 2021).
- Microchip. 2021. Available online: https://www.microchip.com/en-us/product/PIC18F26K83 (accessed on 29 September 2021).
Start Bit | ID Bits | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
Node 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
Node 2 | 0 | 0 | 0 | 0 | 0 | 1 | Transmission Interrupted | |||||
Node 3 | 0 | 0 | 0 | 0 | 1 | Transmission Interrupted | ||||||
CAN Data | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
Sensors | ID (Hexadecimal) | Data Length Code (DLC) | Data (0–7 Bytes) |
---|---|---|---|
PIHER 200 Ω potentiometer | 0x120 | 0x2 | ADRESL |
ADRESH | |||
Inductive proximity sensor (CHE12-10N11-H710)-1 | 0x01 | 0x10 | |
Inductive proximity sensor (CHE12-10N11-H710)-2 | 0x01 | 0x01 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Spencer, G.; Mateus, F.; Torres, P.; Dionísio, R.; Martins, R. Design of CAN Bus Communication Interfaces for Forestry Machines. Computers 2021, 10, 144. https://doi.org/10.3390/computers10110144
Spencer G, Mateus F, Torres P, Dionísio R, Martins R. Design of CAN Bus Communication Interfaces for Forestry Machines. Computers. 2021; 10(11):144. https://doi.org/10.3390/computers10110144
Chicago/Turabian StyleSpencer, Geoffrey, Frutuoso Mateus, Pedro Torres, Rogério Dionísio, and Ricardo Martins. 2021. "Design of CAN Bus Communication Interfaces for Forestry Machines" Computers 10, no. 11: 144. https://doi.org/10.3390/computers10110144
APA StyleSpencer, G., Mateus, F., Torres, P., Dionísio, R., & Martins, R. (2021). Design of CAN Bus Communication Interfaces for Forestry Machines. Computers, 10(11), 144. https://doi.org/10.3390/computers10110144