A control method based on CAN transmission frame self-checking self-adaption
Patent Information
- Application Number
- CN202611128063.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-09-11
AI Technical Summary
但由于不同收发器、不同波特率对应的相位延迟存在差异,需要人工针对性配置参数,CAN接收节点仅发送应答信号,不存在该自比对检测需求
Smart Images

Figure CN122741406A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of CAN transmission frame self-test, and specifically to a control method based on CAN transmission frame self-test adaptive control. Background Technology
[0002] When the CAN controller sends a signal and loops back to the receiving port via the bus, a phase deviation will occur. Low-speed CAN speeds do not exceed 1 Mbps, and the standard limits the maximum phase delay to 255 ns. Accurate detection can be achieved using only conventional sampling points (SPs) configured with parameters such as SEG1 and SEG2. Figure 1 As shown, the red area indicates that the sampling point (SP) is configured in the phase shift region (Transmit error), resulting in an incorrect detection result; the black area indicates that the sampling point (SP) is configured in the Transmit no error region, resulting in a normal detection result, requiring no compensation. However, in the high-speed segment of CANFD (Variable Rate CAN) with speeds below 10Mbps, the bit clock duration is shortened, and equal phase shifts easily cause sampling and comparison distortion. Existing technologies use a compensated sampling point (SSP) scheme, manually setting the compensation sampling time (SSPOFF) offset value of the compensation sampling point to offset the phase difference. However, since the phase delay varies for different transceivers and baud rates, manual configuration of parameters is required. CAN receiving nodes only send response signals and do not require this self-comparison detection.
[0003] However, the existing technology of manually configuring SSPOFF cannot adapt to the speed of different hardware, and the parameter design needs to take into account the detection effect, which has a high debugging threshold and poor flexibility. Summary of the Invention
[0004] The purpose of this application is to overcome the shortcomings and deficiencies in the prior art and provide a control method based on CAN transmission frame self-test and adaptive control, which can improve the self-test flexibility and accuracy of the CAN controller.
[0005] The first aspect of this application provides a control method based on CAN transmission frame self-test and adaptive control, including:
[0006] When the CAN controller is detected to be in frame transmission state, the delay signal and the backtest signal are obtained according to the data output signal of the CAN controller and the preset phase shift time.
[0007] Based on the data reception signal of the CAN controller, the delay signal, and the backtest signal, the phase shift value is obtained according to the number of bits transmitted in the frame;
[0008] Based on the phase buffer parameters of the CAN controller and the phase shift value, the default sampling time and the compensated sampling time of the CAN controller are obtained;
[0009] Based on the default sampling time and the compensated sampling time, the data output signal, the data received signal and the backtest signal are sampled and compared to obtain the target self-test result.
[0010] As one implementation method, the step of sampling and comparing the data output signal, the data received signal, and the backtest signal based on the default sampling time and the compensated sampling time to obtain the target self-test result includes:
[0011] Based on the default sampling time, the data output signal and the data received signal are sampled to obtain a first sampled signal and a second sampled signal;
[0012] Compare the first sampled signal and the second sampled signal to obtain the initial self-test result;
[0013] If the initial self-test result is incorrect, the data received signal and the backtest signal are sampled and compared according to the compensation sampling time to obtain the target self-test result.
[0014] As one implementation, the step of comparing the first sampled signal and the second sampled signal to obtain the initial self-test result includes:
[0015] If the first sampling signal is different from the second sampling signal, the initial self-test result is determined to be an error result;
[0016] If the first sampling signal is the same as the second sampling signal, the initial self-test result is determined to be normal, and the target self-test result is determined to be normal.
[0017] As one implementation method, if the initial self-test result is an error, the step of sampling and comparing the data received signal and the backtest signal according to the compensation sampling time to obtain the target self-test result includes:
[0018] If the initial self-test result is an error, the data receiving signal and the backtest signal are sampled according to the compensation sampling time to obtain the third sampling signal and the fourth sampling signal;
[0019] The target self-test result is obtained by comparing the third sampling signal and the fourth sampling signal.
[0020] As one implementation, the step of comparing the third sampling signal and the fourth sampling signal to obtain the target self-test result includes:
[0021] If the third sampling signal is different from the fourth sampling signal, the target self-test result is determined to be an erroneous result.
[0022] If the third sampling signal is the same as the fourth sampling signal, the target self-test result is determined to be a normal result.
[0023] In one implementation, the phase buffer parameters include a first buffer parameter and a second buffer parameter;
[0024] The steps for obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters and the phase shift value include:
[0025] The default sampling time can be obtained using the following formula:
[0026] ;
[0027] Where SP is the default sampling time. This is the first buffer parameter. This is the second buffer parameter.
[0028] As one implementation, the step of obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters of the CAN controller and the phase shift value includes:
[0029] Based on the phase buffer parameters, the first phase threshold and the second phase threshold are obtained;
[0030] If the phase shift value is less than or equal to the first phase threshold, the compensation sampling time is obtained using the following formula:
[0031] ;
[0032] If the phase shift value is greater than the first phase threshold but less than or equal to the second phase threshold, the compensation sampling time is obtained using the following formula:
[0033] ;
[0034] in, For the compensation sampling time, This is the first buffer parameter. This is the second buffer parameter.
[0035] As one implementation, the step of obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters of the CAN controller and the phase shift value further includes:
[0036] If the phase shift value is greater than the second phase threshold, the compensation sampling time is determined to be 0, and the target self-test result is an error result.
[0037] As one implementation, the step of obtaining the first phase threshold and the second phase threshold based on the phase buffer parameters includes:
[0038] The first phase threshold is obtained using the following formula:
[0039] ;
[0040] in, The first phase threshold;
[0041] The second phase threshold is obtained using the following formula;
[0042] ;
[0043] in, This is the second phase threshold.
[0044] As one implementation, the step of obtaining the phase shift value based on the data received signal of the CAN controller, the delay signal, and the test signal, according to the number of bits transmitted in the frame, includes:
[0045] When the delayed signal is the same as the received data signal and the backtest signal is different from the received data signal, or when the delayed signal is different from the received data signal and the backtest signal is the same as the received data signal, the phase shift value is obtained using the following formula:
[0046] ;
[0047] in, The phase shift value, The next flip time point corresponding to the delayed signal. The txd bit clock point;
[0048] ;
[0049] in, The number of bits transmitted in a frame, starting from the start bit of the frame transmission. This is the first buffer parameter. This is the second buffer parameter. It is a unit clock.
[0050] Compared to related technologies, the self-test adaptive control method based on CAN transmission frames in this application, when detecting that the CAN controller is in frame transmission state, obtains a delay signal and a backtest signal based on the data output signal of the CAN controller and a preset phase shift time; then, based on the data received signal of the CAN controller, the delay signal, and the backtest signal, obtains a phase shift value according to the number of bits transmitted in the frame; then, based on the phase buffer parameters of the CAN controller and the phase shift value, obtains the default sampling time and the compensated sampling time of the CAN controller; then, based on the default sampling time and the compensated sampling time, samples and compares the data output signal, the data received signal, and the backtest signal to obtain the target self-test result. By automatically performing a secondary self-test through the generated delay signal and backtest signal, it can avoid the situation where CAN FD frames are misjudged as transmission errors in the high-speed segment due to phase deviation and sampling point settings, thus improving the self-test flexibility and accuracy of the CAN controller.
[0051] To provide a clearer understanding of this application, the specific embodiments of this application will be described below in conjunction with the accompanying drawings. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of SP sampling detection for a CAN controller.
[0053] Figure 2 This is a flowchart of a control method based on CAN transmission frame self-test and adaptive control according to an embodiment of this application.
[0054] Figure 3 This is a first schematic diagram of SSP compensation sampling points according to an embodiment of this application.
[0055] Figure 4 This is a second schematic diagram of SSP compensation sampling points according to an embodiment of this application.
[0056] Figure 5 This is a schematic diagram of the signal of a CAN controller according to an embodiment of this application.
[0057] Figure 6 This application provides an embodiment of a control method based on CAN transmission frame self-test and adaptive control. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0059] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0060] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances. The singular forms "a," "the," and "the" used in this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. The word "if" as used herein can be interpreted as "when," "when," or "in response to determination."
[0061] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0062] Please see Figure 2 This application discloses a control method based on CAN transmission frame self-test and adaptive control, the method comprising:
[0063] S1: When the CAN controller is detected to be in frame transmission state, the delay signal and the backtest signal are obtained according to the data output signal of the CAN controller and the preset phase shift time.
[0064] Specifically, when the CAN controller is detected to be in frame transmission state (transmit_s=1), the TXD automatic compensation mechanism (automatic frame adaptive detection) is activated. Then, after each toggle of the data output signal TXD, the TXD is updated. (Delayed signal) and Signal (backtest signal).
[0065] Specifically, at the start position of SOF in the frame ,every time (Data output signal) is updated after each flip. The toggle time of the (delayed signal), specifically, each time After each flip, The toggle time of the (delayed signal) will increment by one unit clock cycle TQ. When When the real-time time corresponding to the (delay signal) reaches the updated flip-over duration value, The (delayed signal) flips.
[0066] (Backtest signal) is (Delayed signal) Phase shifted by 1 unit clock cycle TQ, that is Lag A phase shift occurs only after one unit clock cycle (TQ). The preset phase shift time is the unit clock cycle (TQ), which refers to the smallest basic time unit of CAN timing. The total time required to transmit one bit (BT) is composed of several TQ cycles concatenated together.
[0067] S2: Based on the data reception signal of the CAN controller, the delay signal, and the backtest signal, obtain the phase shift value according to the number of bits transmitted in the frame;
[0068] Step S2 includes the following steps:
[0069] When the delayed signal is the same as the received data signal and the backtest signal is different from the received data signal, or when the delayed signal is different from the received data signal and the backtest signal is the same as the received data signal, the phase shift value is obtained using the following formula:
[0070] ;
[0071] in, The phase shift value, For the The flip-off time point corresponding to the (delayed signal) The txd bit clock point;
[0072] ;
[0073] in, The number of bits transmitted in a frame, starting from the start bit of the frame transmission. This is the first buffer parameter. This is the second buffer parameter. It is a unit clock.
[0074] It should be noted that the delay signal being the same as the data received signal and the backtesting signal being different from the data received signal refer to... , The situation.
[0075] The delay signal being different from the received data signal and the backtesting signal being the same as the received data signal means that... , The situation.
[0076] S3: Based on the phase buffer parameters of the CAN controller and the phase shift value, obtain the default sampling time and the compensation sampling time of the CAN controller.
[0077] Specifically, the phase buffer parameters include a first buffer parameter and a second buffer parameter, and step S3 includes:
[0078] S31: Obtain the default sampling time using the following formula:
[0079] ;
[0080] Where SP is the default sampling time. This is the first buffer parameter. This is the second buffer parameter.
[0081] S32: Obtain the first phase threshold and the second phase threshold according to the phase buffer parameters, including:
[0082] S3201: Obtain the first phase threshold using the following formula:
[0083] ;
[0084] in, The first phase threshold;
[0085] S3202: Obtain the second phase threshold using the following formula;
[0086] ;
[0087] in, This is the second phase threshold.
[0088] S33: Obtain the compensation sampling time based on the first phase threshold, the second phase threshold, and the phase shift value.
[0089] It should be noted that the compensation sampling time Including cases with 0 and non-zero values:
[0090] If compensation sampling time If the manual configuration is set to 0, the TXD automatic compensation mechanism is disabled. If the TXD automatic compensation mechanism is enabled, the compensation sampling time will be adjusted. If the value is automatically set to 0, then txd does not pay attention to the backtesting results of the entire SSP, and in the high-speed segment, it does not pay attention to the sampling results of SP (sample point, specifically, signal sampling based on the default sampling time).
[0091] If the TXD automatic compensation mechanism is activated, the compensation sampling time is adjusted accordingly. For non-zero values, the sampling time is compensated through the following process. Adaptive value assignment:
[0092] S331: If the phase shift value is less than or equal to the first phase threshold (i.e.) The compensation sampling time can be obtained using the following formula:
[0093] ;
[0094] S332: If the phase shift value is greater than the first phase threshold, but less than or equal to the second phase threshold (i.e. The compensation sampling time can be obtained using the following formula:
[0095] ;
[0096] in, For the compensation sampling time, This is the first buffer parameter. This is the second buffer parameter.
[0097] S333: If the phase shift value is greater than the second phase threshold (i.e. The compensation sampling time is determined to be 0, and the target self-test result is an error result.
[0098] Among them, steps S331 to S333 are all steps to obtain the compensation sampling time based on the first phase threshold and the second phase threshold. Therefore, S331 to S333 can be steps implemented in parallel, or steps whose execution order can be freely set by the user.
[0099] S4: Based on the default sampling time and the compensated sampling time, the data output signal, the data received signal and the backtest signal are sampled and compared to obtain the target self-test result.
[0100] Step S4 includes:
[0101] S41: Based on the default sampling time, sample the data output signal and the data received signal to obtain a first sampled signal and a second sampled signal;
[0102] S42: Compare the first sampled signal and the second sampled signal to obtain the initial self-test result;
[0103] S43: If the initial self-test result is an error, the data received signal and the backtest signal are sampled and compared according to the compensation sampling time to obtain the target self-test result.
[0104] In a feasible embodiment, S42: the step of comparing the first sampled signal and the second sampled signal to obtain the initial self-test result includes:
[0105] S421: If the first sampling signal is different from the second sampling signal, the initial self-test result is determined to be an error result (i.e., the initial self-test result sp_error=1).
[0106] S422: If the first sampling signal is the same as the second sampling signal, determine that the initial self-test result is a normal result (i.e., the initial self-test result sp_error=0) and the target self-test result is a normal result.
[0107] In a feasible embodiment, S43: If the initial self-test result is an erroneous result, the step of sampling and comparing the data received signal and the backtest signal according to the compensation sampling time to obtain the target self-test result includes:
[0108] S431: If the initial self-test result is an error (i.e., the initial self-test result sp_error=1), the data receiving signal and the backtest signal are sampled according to the compensation sampling time to obtain the third sampling signal and the fourth sampling signal;
[0109] S432: Compare the third sampling signal and the fourth sampling signal to obtain the target self-test result.
[0110] Step S432 includes:
[0111] S4321: If the third sampling signal is different from the fourth sampling signal, the target self-test result is determined to be an error result (i.e., the target self-test result tx_error=1).
[0112] S4322: If the third sampling signal is the same as the fourth sampling signal, determine that the target self-test result is a normal result (i.e., the target self-test result tx_error=0).
[0113] The comparison result of the third and fourth sampled signals can be represented by the signal from the secondary comparison. For example, ssp_error=0 indicates that the third and fourth sampled signals are different, and ssp_error=1 indicates that the third and fourth sampled signals are the same. In this case, if the initial self-test result sp_error=1 and ssp_error=1, then the target self-test result tx_error=1, indicating an error in frame transmission. If the initial self-test result sp_error=1 but ssp_error=0, then the target self-test result tx_error=0, indicating a normal result in frame transmission.
[0114] In summary, such as Figure 3 and Figure 4 As shown, when the CAN controller is detected to be in frame transmission state (transmit_s=1), the TXD automatic compensation mechanism is activated. Then, after each toggle of the data output signal TXD, the TXD is updated. (Delayed signal) and The toggle time of the signal (test signal). However, when the data output signal txd does not toggle, such as... Figure 5 As shown, no updates. (Delayed signal) and The toggle time of the signal (retest signal). Among them, Figure 3 , Figure 4 and Figure 5 In the diagram, the red area indicates that txd≠rxd, meaning the initial detection result is incorrect; the black area indicates that txd=rxd, meaning the initial detection result is correct.
[0115] Compared to related technologies, the self-test adaptive control method based on CAN transmission frames in this application, when detecting that the CAN controller is in frame transmission state, obtains a delay signal and a backtest signal based on the data output signal of the CAN controller and a preset phase shift time; then, based on the data received signal of the CAN controller, the delay signal, and the backtest signal, obtains a phase shift value according to the number of bits transmitted in the frame; then, based on the phase buffer parameters of the CAN controller and the phase shift value, obtains the default sampling time and the compensated sampling time of the CAN controller; then, based on the default sampling time and the compensated sampling time, samples and compares the data output signal, the data received signal, and the backtest signal to obtain the target self-test result. By automatically performing a secondary self-test through the generated delay signal and backtest signal, it can avoid the situation where CAN FD frames are misjudged as transmission errors in the high-speed segment due to phase deviation and sampling point settings, thus improving the self-test flexibility and accuracy of the CAN controller.
[0116] Please see Figure 6 The method of this application can be implemented by connecting devices or modules. When implemented by connecting devices or modules, the connection relationship is as follows: Figure 6 As shown, the device or module is equipped with an automatic TXD compensation mechanism and a backtesting comparison mechanism to implement the self-testing and adaptive control method based on CAN transmission frames as described above.
[0117] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function selected in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function selected in one or more boxes.
[0120] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0121] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0122] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0123] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0124] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A control method based on CAN transmission frame self-test and adaptive control, characterized in that, include: When the CAN controller is detected to be in frame transmission state, the delay signal and the backtest signal are obtained according to the data output signal of the CAN controller and the preset phase shift time. Based on the data reception signal of the CAN controller, the delay signal, and the backtest signal, the phase shift value is obtained according to the number of bits transmitted in the frame; Based on the phase buffer parameters of the CAN controller and the phase shift value, the default sampling time and the compensated sampling time of the CAN controller are obtained; Based on the default sampling time and the compensated sampling time, the data output signal, the data received signal and the backtest signal are sampled and compared to obtain the target self-test result.
2. The control method based on CAN transmission frame self-test and adaptive control according to claim 1, characterized in that, The step of sampling and comparing the data output signal, the data received signal, and the backtest signal based on the default sampling time and the compensated sampling time to obtain the target self-test result includes: Based on the default sampling time, the data output signal and the data received signal are sampled to obtain a first sampled signal and a second sampled signal; Compare the first sampled signal and the second sampled signal to obtain the initial self-test result; If the initial self-test result is incorrect, the data received signal and the backtest signal are sampled and compared according to the compensation sampling time to obtain the target self-test result.
3. The control method based on CAN transmission frame self-test and adaptive control according to claim 2, characterized in that, The step of comparing the first sampled signal and the second sampled signal to obtain the initial self-test result includes: If the first sampling signal is different from the second sampling signal, the initial self-test result is determined to be an error result; If the first sampling signal is the same as the second sampling signal, the initial self-test result is determined to be normal, and the target self-test result is determined to be normal.
4. The control method based on CAN transmission frame self-test and adaptive control according to claim 2, characterized in that, If the initial self-test result is incorrect, the step of sampling and comparing the received data signal and the backtest signal according to the compensation sampling time to obtain the target self-test result includes: If the initial self-test result is an error, the data receiving signal and the backtest signal are sampled according to the compensation sampling time to obtain the third sampling signal and the fourth sampling signal; The target self-test result is obtained by comparing the third sampling signal and the fourth sampling signal.
5. The control method based on CAN transmission frame self-test and adaptive control according to claim 4, characterized in that, The step of comparing the third sampling signal and the fourth sampling signal to obtain the target self-test result includes: If the third sampling signal is different from the fourth sampling signal, the target self-test result is determined to be an erroneous result. If the third sampling signal is the same as the fourth sampling signal, the target self-test result is determined to be a normal result.
6. The control method based on CAN transmission frame self-test and adaptive control according to claim 1, characterized in that, The phase buffer parameters include a first buffer parameter and a second buffer parameter; The steps for obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters and the phase shift value include: The default sampling time can be obtained using the following formula: ; Where SP is the default sampling time. This is the first buffer parameter. This is the second buffer parameter.
7. The control method based on CAN transmission frame self-test and adaptive control according to claim 1, characterized in that, The steps for obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters and the phase shift value include: Based on the phase buffer parameters, the first phase threshold and the second phase threshold are obtained; If the phase shift value is less than or equal to the first phase threshold, the compensation sampling time is obtained using the following formula: ; If the phase shift value is greater than the first phase threshold but less than or equal to the second phase threshold, the compensation sampling time is obtained using the following formula: ; in, For the compensation sampling time, This is the first buffer parameter. This is the second buffer parameter.
8. The control method based on CAN transmission frame self-test and adaptive control according to claim 7, characterized in that, The step of obtaining the default sampling time and compensated sampling time of the CAN controller based on the phase buffer parameters of the CAN controller and the phase shift value further includes: If the phase shift value is greater than the second phase threshold, the compensation sampling time is determined to be 0, and the target self-test result is an error result.
9. The control method based on CAN transmission frame self-test and adaptive control according to claim 7, characterized in that, The steps of obtaining the first phase threshold and the second phase threshold based on the phase buffer parameters include: The first phase threshold is obtained using the following formula: ; in, The first phase threshold; The second phase threshold is obtained using the following formula; ; in, This is the second phase threshold.
10. The control method based on CAN transmission frame self-test and adaptive control according to claim 1, characterized in that, The step of obtaining the phase shift value based on the data received signal of the CAN controller, the delay signal, and the backtest signal, according to the number of bits transmitted in the frame, includes: When the delayed signal is the same as the received data signal and the backtest signal is different from the received data signal, or when the delayed signal is different from the received data signal and the backtest signal is the same as the received data signal, the phase shift value is obtained using the following formula: ; in, The phase shift value, The next flip time point corresponding to the delayed signal. The txd bit clock point; ; in, The number of bits transmitted in a frame, starting from the start bit of the frame transmission. This is the first buffer parameter. This is the second buffer parameter. It is a unit clock.