Design of CAN Intelligent Sensor Based on PIC16F877A

Publisher:Yuexin888Latest update time:2011-05-19 Keywords:PIC16F877A Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the progress and development of science and technology, the requirements for vehicle driving performance, safety and comfort have been greatly improved, which has led to a gradual increase in the number of electronic control units on vehicles. However, the connection of electronic control units on vehicles (such as various switches, actuators, sensors, etc.) is still achieved with traditional wiring harnesses, which makes the wiring harnesses in the car too many and complicated, thus causing serious electromagnetic interference and reducing the reliability of the system. In high-end cars, electronic components and their systems account for more than 20% of the price of the whole vehicle, and there is a trend of increasing day by day. In this case, the electronic control circuits in the car will become more complicated. How to network the devices in the car and reduce the number of wiring harnesses has become a key research direction for improving the in-car system.

With the progress and development of science and technology, the requirements for vehicle driving performance and safety and comfort have been greatly improved, which has led to a gradual increase in the number of electronic control units on vehicles. However, the connection of electronic control units on vehicles (such as various switches, actuators, sensors, etc.) is still realized by traditional wiring harnesses, which makes the wiring harnesses in the car too much and the wiring is complicated, thus causing serious electromagnetic interference and reducing the reliability of the system. In high-end cars, electronic components and their systems account for more than 20% of the price of the whole vehicle, and there is a trend of increasing day by day. In this case, the electronic control circuits in the car will be more complicated. How to network the devices in the car and reduce the number of wiring harnesses has become a key research direction for improving the in-car system.

In the networking and communication system of vehicles, local network methods are becoming more and more abundant. Among them, network technologies such as CAN, Profibus, LON, ASI, EIB and eBus have developed quite maturely, and the standardization of various network technologies has also been introduced one after another. Moreover, these mature network technologies have completed the integration work. The CAN bus has shown strong advantages in stability, immediacy and cost-effectiveness in automotive applications. As a local area network technology in distributed control, it has strong competitiveness. At present, many cars use CAN bus to connect the entire car control system for unified management, realize data sharing and mutual cooperation, make the wiring harness wiring in the car convenient and reliable, improve the overall safety and cost-effectiveness of the car, and enhance its own competitiveness.
The premise of realizing network control of vehicle systems is the intelligent design of network nodes, including the intelligence of sensors, controllers and actuators. This paper takes the wire-controlled electronic throttle as the research object, designs the CAN bus intelligent nodes of the pedal position sensor, throttle position sensor and throttle position control actuator, and forms a CAN bus control network based on this to complete the precise control of the throttle position.


1 Vehicle CAN bus and distributed control system structure

Controller area network (CAN) belongs to industrial field bus. It is a communication protocol developed by Bosch in Germany in the early 1980s to solve the data exchange between numerous control and test instruments in modern automobiles. In November 1993, ISO officially promulgated the international standard (ISO 11898) for high-speed communication CAN. The field data collection in the CAN bus system is completed by sensors. At present, there are not many types of sensors with CAN bus interfaces, and the price is also relatively expensive.


There are a large number of sensors, electronic control units, actuators, etc. in the vehicle control system. Usually, multiple controllers share the same sensor information, and the real-time and rapid requirements are high. How to connect them to form a distributed control network system is an important development direction of modern control systems. Fieldbus control system (FCS) is a typical implementation of the control network structure. CAN belongs to the category of fieldbus. It is a multi-master serial bus that effectively supports distributed control or real-time control. It is favored by field equipment interconnection for its short message frame and excellent CSMA/BA bit-by-bit arbitration protocol.


The vehicle distributed control network system based on CAN bus is shown in Figure 1. It adopts the field distributed control system (FDCS) structure and consists of sensors, actuators, controller intelligent nodes and CAN field control network. Multiple intelligent nodes independently complete data acquisition, system settings, operation control, etc. Through the CAN field bus, various data and management control information are exchanged between intelligent nodes.

2 Principle and structure of the electronic throttle valve control system

Electronic throttle control technology first appeared in the early 1980s and was initially only used in high-end cars. With the increasing development of electronic technology, the increasingly prominent energy and environmental issues, and the increasing requirements for automobile performance, the electronic throttle has become the most important control device on the fully electronically controlled engine and has begun to be widely used in various vehicles. Its advantages are that the throttle can be quickly and accurately controlled at the optimal opening according to the driver's wishes, emissions, fuel consumption and safety requirements, and a variety of control functions can be set to improve driving safety and comfort. At present, companies such as BMW, BOSCH, and Toyota are conducting research on this technology, and manufacturers such as BMW, GM, Toyota, and AUDI have successfully applied it on 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 includes three parts: an actuator, a throttle valve, and a throttle position sensor, which are packaged as one. The actuator consists of a DC motor and related transmission components. The accelerator pedal is a high-precision linear potentiometer, which serves as a sensor device for the driver's desired throttle opening. Its output is an analog voltage signal proportional to the pedal stroke; the throttle body consists of two forward and reverse position sensors as the throttle opening feedback signal in the control. It obtains the corresponding voltage feedback value at the current opening through a pair of high-precision potentiometers inside the throttle body. The feedback value changes linearly with the throttle opening angle.

3 Intelligent sensor CAN bus interface design

The design of the intelligent sensor contact is based on Microchip's PIC16F877A microcontroller, independent CAN bus controller MCP2510 and CAN transceiver PCA82C250.

PIC16F877A is a high-performance 8-bit microprocessor with RISC instruction system, Harvard bus structure, low power consumption and high speed. It integrates ADC, serial peripheral interface (SPI) and Flash program memory, and has multiple functions such as PWM output. PIC16F877A can achieve seamless connection with CAN controller MCP2510 through SPI interface.

The hardware schematic diagram of the CAN intelligent sensor node based on PIC16F877A is shown in Figure 3.

The communication module of the intelligent sensor CAN node consists of an independent CAN controller MCP2510 and a CAN transceiver PCA82C250. MCP2510 can complete all the functions of the physical layer and data link layer of the CAN bus, support high-speed SPI interface (the maximum data transmission rate can reach 5MB/s), and support CAN2.0A/CAN2.0B protocol. The CAN transceiver PCA82C250 is the interface between the CAN controller and the physical bus, providing differential transmission capability for the physical bus and differential reception capability for the CAN controller. At the same time, it can increase the communication distance and improve the anti-interference ability of the embedded CAN intelligent node.

PIC16F877A is connected to CAN controller MCP2510 via SPI, with its serial data input (SDI) pin connected to SO pin of MCP2510, its serial data output (SDO) pin connected to SI pin of MCP2510, and its serial clock (SCK) pin connected to SCK pin of MCP2510. The reset signal and chip select signal of MCP2510 are provided by the microcontroller.

By setting the SPI interface status register and control register of PIC16F877A, the SPI interface works in active mode. The timing of the communication between PIC16F877A and MCP2510 is very important. When sending data, send the write instruction first, then send the register address, and finally send the data. When MCP2510 receives data from the bus, an interrupt will be generated, and the microcontroller responds to the interrupt. When reading data, send the read instruction first, then send the register address, and the data will be automatically written into the buffer of the microcontroller SPI interface.

Since the microcontroller itself has a 10-bit A/D converter, the analog signals output by the pedal position sensor and the throttle position sensor are directly connected to the microcontroller for digital-to-analog conversion, without the need to add a new A/D conversion device. In Figure 3, the sensor is input via RA0/AN0. In order to filter out high-frequency noise, an RC filter circuit is connected to the analog-to-digital input port. At the same time, in the control of the DC motor of the electronic throttle device actuator, the PIC16F877A has a PWM port, which can drive the DC motor by connecting the drive circuit. The driver of this device uses L298.

The whole CAN bus control network consists of pedal intelligent position sensor nodes, throttle position sensor and actuator nodes and controller nodes. Among them, the pedal intelligent position sensor nodes, throttle position sensor and actuator nodes are completed by the single-chip CAN bus mechanism. Its main function is to transmit the pedal position and feedback signal throttle position signal to the controller, and at the same time, receive the drive command signal sent by the controller to the actuator. The controller uses a microcomputer to realize CAN bus communication and corresponding control algorithms through Advantech PCL-841 card to complete the control of the wire-controlled 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 is used as the input of the system and is sent to the controller through the CAN bus after A/D conversion. Similarly, the throttle position sensor is used as the feedback signal and is sent to the controller through the CAN bus after A/D conversion. The two signals are compared in the controller, and the controller uses the corresponding control algorithm (such as PID, etc.) to make a decision. The decision result is sent to the throttle body position sensor and the actuator node through the CAN bus. The microprocessor of the node generates a corresponding PWM signal to drive the operation of the actuator through the drive device.

In order to verify the performance of the control system, the adaptive PID control algorithm was used to conduct experimental platform and real vehicle experiments. The experimental results are shown in Figure 5. Among them, PPS represents the pedal position, TPS1 represents the throttle position experimental result under the experimental platform, and TPS2 represents the throttle position experimental result under the real vehicle. From the control results, it can meet the real-time and accuracy requirements of electronic throttle control. At the same time, after testing in the real vehicle environment, the system has a certain anti-noise ability.

5 Conclusion
CAN bus, as a reliable automotive computer network bus, has been applied in many advanced cars. Applying CAN bus to intelligent sensors enables the signals obtained by sensors to be transmitted through the bus in real time, reliably, at high speed and accurately, so that each automotive computer control unit can share all information and resources through CAN bus, thus simplifying wiring, reducing the number of sensors, avoiding duplication of control functions, improving system reliability, reducing costs, and better matching and coordinating various control systems. At the same time, since the entire intelligent sensor network adopts fully digital communication, the bus also has good anti-interference ability, which is the development trend of intelligent sensors and intelligent control networks in the future.

Keywords:PIC16F877A Reference address:Design of CAN Intelligent Sensor Based on PIC16F877A

Previous article:Design of automotive lighting system based on PIC16F873A and LT3476
Next article:Application of PIC microcontroller in remote control

Recommended ReadingLatest update time:2024-11-16 19:49

Application of PIC16F877A in CAN communication
Application of P IC 16F877A in CAN communication // ========CAN communication program =======   #include pic.h   #include pic16f87x.h   #include mcp2510.h // MCP2510 register definition  // =========Constants and variable definitions========    #define READ 0x03 // Read MCP2510 instruction code   #define WRITE 0x02 /
[Microcontroller]
PIC16F877A+18B10 temperature measurement+LCD1602 temperature display
;18B10 temperature measurement + LCD 1602 temperature display ;Practical purpose ;1. Learn how to use the 18B20 single bus temperature sensor . ;2. Learn how to use LCD. ;3. Learn how to convert decimal to decimal. ;All resources: ;1. TMRO timer. Generates the delay time required for temperature conversion. ;2. PORTA
[Microcontroller]
Design of solar energy and mains complementary lighting system controller based on PIC16F877A
Solar led lighting is one of the main uses of solar energy for human development and utilization. However, due to the discontinuity and intermittency of solar radiation, the high investment and cost of the current pure solar led lighting system, and the immaturity of some technologies, the solar ligh
[Analog Electronics]
pic16f877a.h Chinese comments
Storage path: In the PICC software hi-tech installation directory, ?:\Microchip\cc8.05\include, find pic1687xa.h, which contains the following header file content and detailed comments: /*  * Header file for the Microchip   * PIC 16F873A chip  * PIC 16F874A chip  * PIC 16F876A chip  * PIC 16F877A chip  * Midrange Micr
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号