Design of a CAN bus-based intelligent sensor system for vehicles
2026-04-06 07:40:00··#1
Introduction With the advancement of science and technology, the demands for vehicle driving performance and safety comfort have greatly increased, leading to a gradual increase in the number of electronic control units (ECUs) in vehicles. However, the connections of these ECUs (such as various switches, actuators, and sensors) are still achieved using traditional wiring harnesses, resulting in excessive and complex wiring within the vehicle, causing severe electromagnetic interference and reducing system reliability. In high-end cars, electronic components and their systems account for more than 20% of the total vehicle price, and this trend is increasing. In this context, the in-vehicle electronic control circuitry becomes even more complex. How to network in-vehicle devices and reduce the number of wiring harnesses has become a key research direction for improving in-vehicle systems. In vehicle networking and communication systems, local area network (LAN) methods are becoming increasingly diverse. Among them, CAN, Profibus, LON, ASI, EIB, and eBus network technologies have matured considerably, and standardization of various network technologies has been successively introduced. Furthermore, these mature network technologies have completed integration. The CAN bus demonstrates strong advantages in automotive applications in terms of stability, real-time performance, and cost-effectiveness, making it a highly competitive LAN technology in distributed control. Currently, many automobiles use CAN bus to connect and manage the entire vehicle control system, enabling data sharing and collaborative operation. This makes in-vehicle wiring harnesses convenient and reliable, improves overall vehicle safety and cost-effectiveness, and enhances competitiveness. The prerequisite for networked control of vehicle systems is the intelligent design of network nodes, including intelligent sensors, controllers, and actuators. This paper takes the drive-by-wire electronic throttle as the research object, designing intelligent CAN bus nodes for the pedal position sensor, throttle position sensor, and throttle position control actuator. Based on this, a CAN bus control network is formed to achieve precise control of the throttle position. 1. Vehicle CAN Bus and Distributed Control System Structure Controller Area Network (CAN) is an industrial fieldbus, a communication protocol developed by Bosch in the early 1980s to solve the data exchange between numerous control and testing instruments in modern automobiles. In November 1993, ISO officially issued the international standard for high-speed communication CAN (ISO 11898). In the CAN bus system, field data acquisition is completed by sensors. Currently, there are not many types of sensors with CAN bus interfaces, and they are relatively expensive. Vehicle control systems contain numerous sensors, electronic control units, and actuators. Typically, multiple controllers share the same sensor information, and high real-time and speed requirements are present. Connecting these components to form a distributed control network system is a crucial development direction for modern control systems. Field bus control systems (FCS) are a typical example of such control network structures. CAN, belonging to the field bus category, is a multi-master serial bus that effectively supports distributed or real-time control. Its short message frames and excellent CSMA/BA bit-by-bit arbitration protocol have made it popular for interconnecting field devices. Figure 1 shows a CAN bus-based vehicle distributed control network system, employing a field bus distributed control system (FDCS) structure. It consists of sensors, actuators, controller intelligent nodes, and a CAN field control network. Multiple intelligent nodes independently complete data acquisition, system settings, and operational control. Through the CAN field bus, these intelligent nodes exchange various data and management control information. 2. Principle and Structure of Drive-by-Wire Electronic Throttle System Electronic throttle control technology first appeared in the early 1980s, initially only applied to high-end cars. With the rapid development of electronic technology, the increasing prominence of energy and environmental issues, and the rising demands on automotive performance, the electronic throttle has become the most important control device in a fully electronically controlled engine and is now widely used in various vehicles. Its advantages lie in its ability to quickly and accurately control the throttle opening to the optimal degree based on driver preferences, emissions, fuel consumption, and safety requirements. It also allows for the setting of various control functions to improve driving safety and comfort. Currently, companies such as BMW, Bosch, and Toyota are researching this technology, and manufacturers like BMW, GM, Toyota, and Audi have successfully applied it to some of their models. As shown in Figure 2, the system consists of an accelerator pedal position sensor and an electronic throttle body. The throttle body comprises three parts: an actuator, a throttle valve, and a throttle position sensor, all encapsulated as a single unit. The actuator consists of a DC motor and related transmission components. The accelerator pedal is a high-precision linear potentiometer, serving as a sensor for the driver's desired throttle opening. Its output is an analog voltage signal proportional to the pedal travel. The throttle body uses two position sensors (forward and reverse) as feedback signals for the throttle opening during control. These sensors obtain the corresponding voltage feedback value for the current opening through a pair of high-precision potentiometers inside the throttle body. This feedback value changes linearly with the throttle opening angle. 3. Intelligent Sensor CAN Bus Interface Design The intelligent sensor contact design is based on Microchip's PIC16F877A microcontroller, independent CAN bus controller MCP2510, and CAN transceiver PCA82C250. The PIC16F877A is a high-performance 8-bit microprocessor with a RISC instruction set, Harvard bus architecture, low power consumption, and high speed. It integrates an ADC, serial peripheral interface (SPI), and Flash program memory, and has multiple functions such as PWM output. The PIC16F877A can achieve seamless connection with the CAN controller MCP2510 through the SPI interface. Figure 3 shows the hardware schematic of the CAN smart sensor node based on the PIC16F877A. The communication module of the smart sensor CAN node consists of an independent CAN controller MCP2510 and a CAN transceiver PCA82C250. The MCP2510 can perform all functions of the physical layer and data link layer of the CAN bus, supports a high-speed SPI interface (maximum data transfer rate up to 5MB/s), and supports CAN2.0A/CAN2.0B protocols. The CAN transceiver PCA82C250 is the interface between the CAN controller and the physical bus, providing differential transmission capability to the physical bus and differential reception capability to the CAN controller. Simultaneously, it can increase the communication distance and improve the anti-interference capability of the embedded CAN smart node. The PIC16F877A connects to the CAN controller MCP2510 via SPI. Its Serial Data Input (SDI) pin is connected to the MCP2510's SO pin, its Serial Data Output (SDO) pin is connected to the MCP2510's SI pin, and its Serial Clock (SCK) pin is connected to the MCP2510's SCK pin. The MCP2510's reset and chip select signals are provided by the microcontroller. The SPI interface is set to active mode by configuring the PIC16F877A's SPI interface status register and control register. The timing of communication between the PIC16F877A and MCP2510 is crucial. When sending data, the write command is sent first, followed by the register address, and finally the data. When the MCP2510 receives data from the bus, it generates an interrupt. The microcontroller responds to the interrupt; when reading data, it first sends a read command, followed by the register address, and the data is automatically written to the microcontroller's SPI interface buffer. Since the microcontroller itself has a built-in 10-bit A/D converter, the analog signals output from the pedal position sensor and throttle position sensor are directly input to the microcontroller for digital-to-analog conversion, eliminating the need for a new A/D converter. In Figure 3, the sensors are input via RA0/AN0. To filter out high-frequency noise, an RC filter circuit is connected to the analog-to-digital input port. Simultaneously, in the control of the DC motor of the electronic throttle actuator, the PIC16F877A has a PWM port, which can drive the DC motor by connecting to the drive circuit. The driver used in this device is the L298. The entire CAN bus control network consists of a pedal intelligent position sensor node, a throttle body position sensor and actuator node, and a controller node. The pedal intelligent position sensor node, throttle body position sensor and actuator node are implemented by the microcontroller's CAN bus mechanism. Their main function is to transmit the pedal position and feedback throttle position signal to the controller, and simultaneously receive drive command signals from the controller to the actuator. The controller uses a microcomputer to achieve CAN bus communication and corresponding control algorithms via an Advantech PCL-841 card to control the drive-by-wire electronic throttle. 4. System Control Principle and Experimental Results The system control flow is shown in Figure 4. The control system is a closed-loop control process. The pedal position sensor serves as the system input, and after A/D conversion, it is sent to the controller via the CAN bus. Similarly, the throttle position sensor serves as the feedback signal, and after A/D conversion, it is sent to the controller via the CAN bus. The two signals are compared in the controller, which then uses an appropriate control algorithm (such as PID) to make a decision. The decision result is sent to the throttle body position sensor and actuator node via the CAN bus. The microprocessor at this node generates a corresponding PWM signal, which drives the actuator to operate via the drive unit. To verify the performance of the control system, an adaptive PID control algorithm was used for experimental platform and real vehicle experiments. The experimental results are shown in Figure 5. Here, PPS represents the pedal position, TPS1 represents the throttle position experimental result under experimental platform conditions, and TPS2 represents the throttle position experimental result under real vehicle conditions. From the control results, the system meets the real-time and accuracy requirements of electronic throttle control. Furthermore, testing in a real-vehicle environment demonstrates a certain level of noise immunity. 5. Conclusion: The CAN bus, as a reliable automotive computer network bus, has been applied in many advanced vehicles. Applying the CAN bus to intelligent sensors enables the real-time, reliable, high-speed, and accurate transmission of signals obtained by the sensors. This allows various automotive computer control units to share all information and resources via the CAN bus, achieving the goals of simplified wiring, reduced sensor count, avoidance of redundant control functions, improved system reliability, reduced costs, and better matching and coordination of various control systems. Simultaneously, because the entire intelligent sensor network uses fully digital communication, the bus also possesses excellent anti-interference capabilities, representing the future development trend of intelligent sensors and intelligent control networks.