Implementation of DAQ Mode in Automotive Calibration System Based on CCP Protocol
2026-04-06 08:48:41··#1
Abstract: The CCP protocol is a matching and calibration protocol based on the CAN bus. This protocol features reliable communication, high transmission speed, and good versatility. This paper discusses an automotive ECU calibration system based on the CCP protocol and details its working principle, data acquisition mechanism, and implementation method. Keywords: CCP protocol; CAN bus; calibration system Introduction With the development of automotive electronics technology, the calibration of electronic control units (ECUs) has become a crucial step in the development of automotive electronic control devices. Most ECUs require a matching and calibration process to determine their operating and control parameters. Currently, there is no mature CCP-based ECU calibration system in China. Existing systems mainly use the free CCP driver provided by Vector or related MATLAB toolkits, building upon them to create their own application software, without an independent CCP driver. Foreign products are powerful but expensive. Therefore, researching and mastering the core technology of CCP, and developing ECU calibration software that provides customized functions for different user needs and can adapt to different host interfaces such as PCI and USB, is of great significance. Introduction to the CCP Protocol The CCP protocol's communication method: ECU calibration based on the CCP protocol adopts a master-slave communication method. The master device is connected to multiple slave devices via a CAN bus, as shown in Figure 1. The master device is the Measurement Calibration System (MCS), and the slave devices are the ECUs to be calibrated. According to the CCP protocol, the master device first establishes a logical connection with one of the slave devices. After establishing the logical connection, all data transmission between the master and slave devices is controlled by the master. After executing the master's commands, the slave device returns a message containing command response values or error codes. Any slave device can periodically transmit internal data according to a list set by the master through control commands. Therefore, data transmission is initialized by the master, executed by the slave, and triggered by a fixed cyclic sampling frequency or events. Figure 1: CCP Communication Structure Diagram The CCP protocol defines two operating modes: Polling mode and DAQ (Data Acquisition) mode. In the calibration system designed in this paper, DAQ mode is adopted based on actual requirements. The CCP protocol uses only two CAN message objects, and each object is identified by a unique ID identifier according to its data flow direction: (1) Command receiving object (master-slave): abbreviated as CRO. CRO is used to transmit instruction codes and internal function codes or storage area data exchanged between master and slave. (2) Data transmission object (slave-master): abbreviated as DTO. DTO refers to the message fed back by the slave device. According to the different message PIDs, DTO can be divided into three forms: • Command return message CRM (PID=255): sent by the slave device, a feedback message for CRO. • Event message (PID=254): when the slave device detects an internal error mechanism, it sends the message to the master device to report its current operating status and request the master device to suspend the current working process to handle the error. • DAQ-DTO (0≤PID≤254): used in DAQ mode, organized by the slave device, and sent to the master device periodically. Figure 2. Working Principle Diagram of the Calibration System Implementation of the CCP-Based ECU Calibration System The working principle of the CCP-based ECU calibration system is shown in Figure 2. After adjusting some control parameters, data can be sent to the engine ECU via a USB-to-CAN driver module. Upon receiving the control signal, the ECU processes it internally and the driver module returns important data from within the ECU to the platform for display. The communication between the calibration software and the engine ECU conforms to the CCP calibration protocol. The CCP communication part calls the CCP Driver to enable communication between the calibration software and the ECU, including downloading user-specified calibration parameters to the ECU and receiving measurement data from the ECU for use in the data display sub-window. Figure 3. Data Description Table The data acquisition mechanism of the calibration system. This paper adopts the DAQ mode, which allows the device to upload the data to be monitored according to a specified cycle. The data transmitted by DAQ is organized by a series of tables called ODTs (Object Descriptor Tables). Each ODT table contains 7 elements, which can describe the relative address and data length attributes of 7 internal ECU parameters. These parameters described by the ODT are the monitored data that the slave device needs to send to the master device periodically using DAQ-DTO frames; these attributes are called "parameter descriptions," which help the slave device's DAQ processing code determine the current value of the parameter, as shown in Figure 3. The parameters described in the ODT, and the "parameter descriptions" of each parameter, are written by the master device through the CRO command. When the slave device's DAQ mechanism is activated, the slave device sequentially puts the current value of each ECU parameter described in the ODT table into the corresponding DAQ-DTO frame according to the period required by the master device, and sends it to the master device. Figure 4 shows the operation diagram of the calibration software. The software implementation of the calibration system in DAQ mode is mainly divided into two parts: CAN Driver and CCP Driver. The ECU in this solution uses MC9S12Dg128, so it can directly use the interface provided by the chip's CAN module to send CAN data. The CCP Driver is the core part of the calibration system. It mainly communicates with the host computer calibration software by calling the CAN Driver, thereby performing online calibration of the ECU. The calibration system implementation process is as follows: 1. The upper-layer calibration software defines the number of Lists, the number of ODTs in each List, and the number of elements in each ODT. 2. The ECU determines its own data structure according to the upper-layer definition. That is, both the upper and lower layers define a three-dimensional array (List, ODT, Element) to store the mapping relationship. 3. The upper layer initializes the ODT through protocol commands. First, the upper layer sends the GET_DAQ_SIZE command (parameter is the List number) to obtain the specified List size (number of ODTs in this list) and the first PID number of the DTO in the List. Then, the upper layer sends the SET_DAQ_PTR command (parameters are the List number, ODT number, and element number in the ODT) to specify the parameter unit to be initialized. Finally, according to the specific element set by the SET_DAQ_PTR command, the upper layer sends the WRITE_DAQ command (parameters are the byte size of the DAQ element and the address of the DAQ element). By repeatedly using the SET_PTR and WRITE_DAQ commands, a specific ODT table is initialized, then a specific List table is initialized, and finally all List tables are initialized. At this point, the ODT initialization work is complete. 4. Start and stop DAQ data transmission. The upper layer sends the START_STOP command, and the specified ODT data begins to be uploaded. The ODT copies each element to its corresponding DTO (8 bytes, 1 PID number, 7 data storage bytes), and then returns it to the upper-layer calibration system in the form of a Data Acquisition Message. The DAQ mode ends here. Conclusion The ECU calibration software operation is shown in Figure 4. After multiple debugging sessions, this calibration system is stable and reliable, capable of online calibration of ECUs in automotive systems, and can provide different customized functions for different user needs. This automotive engine calibration system using the CCP protocol has the characteristics of conforming to international standards, good versatility, and strong adaptability to different hardware and different needs, thus having a good development and application prospect. References 1. Tao Hengyan, Tian Jiangxue, Qu Weidong. CCP software program design based on MC68736. Measurement and Control Technology, 2005, 3: 49-52 2. Li Yabo, Zhang Junzhi. Design of ECU Calibration System for HEV Based on CCP Protocol. Automotive Engineering, 2004, 26-4