Pedal displacement signal analysis method and system and vehicle

By collecting and calculating the timestamp and edge state information of the PWM square wave signal, the problem that the ICU in the MCU cannot analyze the frequency and duty cycle is solved, and the brake pedal opening is accurately determined, which improves the braking effect of the vehicle and 安全性,减少了MCU型号选择的限制,并降低了系统负载。

CN119283884APending Publication Date: 2025-01-10SHANGHAI NASN AUTOMOTIVE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411386293.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, ICUs in certain models of MCUs cannot directly analyze the frequency and duty cycle of the PWM square wave signal, resulting in difficulty in determining the brake pedal opening, affecting the braking effect and safety of the vehicle.

Method used

By obtaining the PWM square wave signal generated by the pedal displacement sensor, collecting timestamp information and edge state information, calculating duty cycle and frequency, determining the brake pedal opening and sensor working status, and using the DMA channel for data transmission to avoid interruption of use , reduce the load rate.

Benefits of technology

It achieves greater flexibility and accuracy in the selection of MCU models, ensures the correct calculation of brake pedal opening, improves the braking effect and safety of the vehicle, and has the advantages of low load rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119283884A_ABST
    Figure CN119283884A_ABST
Patent Text Reader

Abstract

The invention discloses a pedal displacement signal analysis method. The method comprises the steps that a PWM square wave signal generated by a pedal displacement sensor of a vehicle based on brake pedal travel information is obtained; collecting timestamp information and edge state information of the PWM square wave signal; calculating the duty ratio and the frequency of the PWM square wave signal based on the timestamp information and the edge state information; and the pedal opening degree is determined based on the duty ratio, and whether the pedal displacement sensor is in a normal working state or not is determined based on the frequency. The invention further discloses a system and a vehicle applying the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile technology, and in particular to a pedal displacement signal analysis method, system and vehicle. Background Art

[0002] The brake pedal opening refers to the vertical distance the brake pedal travels from a stationary state to being fully depressed. It can also be understood as the extent to which the brake pedal sinks during this process. This parameter is crucial in the automotive braking system because it directly affects the transmission of braking force and the braking effect. When the driver steps on the brake pedal, the size of the pedal opening determines the change in brake fluid pressure, which in turn controls the clamping force of the brake pads to achieve vehicle deceleration or stopping. Therefore, the reasonable setting of the brake pedal opening is of great significance to ensuring driving safety.

[0003] The pedal displacement sensor is a signal device used in automobiles to detect the position and movement distance of the vehicle pedal. Its working principle is based on the effect of resistance change. During the movement of the pedal, the resistance value inside the pedal displacement sensor will continue to change, thereby generating an output signal. The pedal displacement sensor converts the displacement of the pedal into an electrical signal and transmits it to the vehicle's electronic control unit (ECU), thereby ensuring that the ECU can sense and control the pedal status.

[0004] The pedal displacement signal is a signal sent by the pedal displacement sensor in the automobile braking system after detecting the brake pedal travel information. The pedal displacement signal usually has different external output modes such as PWM square wave and single edge half word transmission protocol (SENT) square wave. For PWM square wave, the brake pedal opening can be determined by analyzing the duty cycle of the PWM square wave, and whether the pedal displacement sensor is in normal working state can be determined by analyzing the frequency of the PWM square wave.

[0005] In the prior art, the more common methods for collecting the frequency and duty cycle of the PWM square wave rely on direct analysis by the input capture unit (ICU) in the car's MCU. When the ICU in some models of MCU cannot directly parse the frequency and duty cycle of the PWM square wave, it is necessary to parse the frequency and duty cycle of the PWM square wave signal in a way that focuses more on software design. Summary of the invention

[0006] In order to solve the above technical problems, the present invention specifically provides the following technical solutions.

[0007] The present invention provides a pedal displacement signal analysis method, comprising the following steps:

[0008] S1, obtaining a PWM square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information;

[0009] S2, collecting timestamp information and edge status information of the PWM square wave signal;

[0010] S3, calculating the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information;

[0011] S4, determining a brake pedal opening based on the duty cycle.

[0012] Optionally, the method further comprises the following steps:

[0013] S5, calculating the frequency of the PWM square wave signal based on the timestamp information and the edge state information;

[0014] S6, determining whether the pedal displacement sensor is in a normal working state based on the frequency.

[0015] Optionally, the step S1 includes: obtaining, through the vehicle's MCU, a PWM square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information.

[0016] Optionally, step S2 includes the following sub-steps:

[0017] S21, receiving the timestamp information and edge status information of the PWM square wave signal through the register of the MCU;

[0018] S22, transmitting the timestamp information and the edge status information to the cache of the MCU through the DMA channel of the MCU.

[0019] Optionally, the sub-step S21 includes:

[0020] Receiving the timestamp information of each edge of the PWM square wave signal through the first register of the MCU;

[0021] The edge status information of each edge of the PWM square wave signal is received through the second register of the MCU.

[0022] Optionally, the sub-step S22 includes:

[0023] According to a preset task cycle, the timestamp information is transmitted to a first cache of the MCU through a first DMA channel of the MCU;

[0024] The edge status information is transmitted to a second cache of the MCU through a second DMA channel of the MCU.

[0025] Optionally, step S3 includes the following sub-steps:

[0026] S31, numbering the timestamp information in the first cache in order of receiving time, and calculating the cycle time according to the following formula:

[0027] Cycle time = timestamp information y -Timestamp information (y-2) ;

[0028] Wherein, y is the maximum number in the timestamp information in the first cache, and the timestamp information y It is the timestamp information numbered y. (y-2) It is the timestamp information of the difference numbered y minus 2;

[0029] S32, determining whether the latest received edge status information in the second cache is a rising edge or a falling edge; if the latest received edge status information is a rising edge, calculating the high level time according to the following formula:

[0030] High level time = timestamp information (y-1) – Timestamp information (y-2) ;

[0031] Among them, the timestamp information (y-1) It is the timestamp information of the difference numbered y minus 1;

[0032] If the latest received edge status information is a falling edge, the high level time is calculated according to the following formula:

[0033] High level time = timestamp information y -Timestamp information (y-1) ;

[0034] S33, dividing the high level time by the cycle time to determine the duty cycle of the PWM square wave signal of this task cycle.

[0035] Optionally, the step S4 includes: determining the inverse of the cycle time as the frequency of the PWM square wave signal of this task cycle.

[0036] In addition, the present invention also provides a pedal displacement signal analysis system, comprising:

[0037] A square wave acquisition module, used to acquire a PWM square wave signal generated by a pedal displacement sensor of a vehicle based on brake pedal travel information;

[0038] An edge information acquisition module, used for acquiring timestamp information and edge status information of the PWM square wave signal;

[0039] A duty cycle calculation module, used for calculating the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information;

[0040] The pedal opening determination module is configured to determine a brake pedal opening based on the duty cycle.

[0041] In addition, the present invention also provides a vehicle, comprising the pedal displacement signal analysis system as described above.

[0042] Through the above technical solution, when the ICU in some MCU models cannot directly parse the frequency and duty cycle of the PWM square wave, the function of calculating the duty cycle and frequency of the PWM square wave signal based on the timestamp information and edge state information of the PWM square wave signal can be realized, thereby reducing the restrictions on the selection of MCU models. The present invention transmits data through the DMA channel without using interrupts, so it also has the advantage of low load rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a flow chart of a pedal displacement signal analysis method provided by an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of data interaction of a pedal displacement signal analysis method provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of the modules of the pedal displacement signal analysis system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0047] The specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] Although the various steps in the flowchart in the embodiment of the present invention are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0049] Although the terms first and second may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination". Furthermore, as used in this article, the singular form "one" is intended to also include the plural form, unless there is an opposite indication in the context.

[0050] See also Figure 1 and Figure 2 According to one aspect of the present application, there is provided a pedal displacement signal analysis method, comprising the following steps:

[0051] S1, obtaining a PWM square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information.

[0052] S2, collecting timestamp information and edge status information of the PWM square wave signal.

[0053] S3, calculating the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information.

[0054] S4, determining a brake pedal opening based on the duty cycle.

[0055] The principle of this operation is that the minimum opening and maximum opening of the brake pedal correspond to duty ratios of 0% and 100% respectively. After the duty ratio is calculated, the brake pedal opening can be determined based on the duty ratio.

[0056] The method may further comprise the following steps:

[0057] S5, calculating the frequency of the PWM square wave signal based on the timestamp information and the edge status information.

[0058] S6, determining whether the pedal displacement sensor is in a normal working state based on the frequency.

[0059] The principle of this operation is that when the pedal displacement sensor works normally, the frequency of the transmitted PWM square wave signal is fixed at 2 kHz; when the frequency of the calculated PWM square wave signal is not 2 kHz, it can be determined that the pedal displacement sensor is not in a normal working state.

[0060] The step S1 may include: obtaining, through the vehicle's MCU, a PWM square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information.

[0061] The MCU is programmable and consists of a CPU, memory, peripherals, etc., to realize the function of controlling the entire automobile system.

[0062] The step S2 may include the following sub-steps:

[0063] S21, receiving the timestamp information and edge status information of the PWM square wave signal through the register of the MCU.

[0064] The register may be a register in the ICU of the MCU, and the function of the ICU is to help the MCU implement an input capture function.

[0065] Each edge of the PWM square wave signal includes a timestamp information and an edge status information. A counter is provided inside the ICU. In this embodiment, the counter is preferably a 16-bit counter, which counts cyclically from 0 to 65535. When each edge of the PWM square wave signal enters the ICU, the counter counts once, and each edge records the count value of the counter as the timestamp information of the edge.

[0066] The edge status information of each edge records whether the edge is a high level or a low level. According to the edge status information, it can be determined whether the edge is a rising edge or a falling edge: when the edge status information of the edge is a high level, the edge is a rising edge; when the edge status information of the edge is a low level, the edge is a falling edge.

[0067] S22, transmitting the timestamp information and the edge status information to the cache of the MCU through the DMA channel of the MCU.

[0068] The sub-step S21 may include:

[0069] The timestamp information of each edge of the PWM square wave signal is received through the first register of the MCU. In this embodiment, the first register can only receive one timestamp information at a time, and the timestamp information received last is overwritten by the latest timestamp information received.

[0070] The edge status information of each edge of the PWM square wave signal is received through the second register of the MCU. In this embodiment, the second register can only receive one edge status information at a time, and the edge status information received last is overwritten by the latest received edge status information.

[0071] The sub-step S22 may include:

[0072] According to the preset task cycle, the timestamp information of each edge is transmitted to the first cache of the MCU through the first DMA channel of the MCU. When the first DMA channel transmission is completed, the second DMA channel of the MCU will be immediately triggered to transmit the edge status information of the edge to the second cache of the MCU.

[0073] The DMA channel is a peripheral module inside the MCU that directly accesses the memory. The DMA channel can quickly move data from the original address to the destination address without CPU intervention. In this embodiment, the original address is the first register and the second register of the MCU, and the destination address is the first cache and the second cache of the MCU.

[0074] In this embodiment, the first cache and the second cache may be included in a random access memory (RAM) of the MCU.

[0075] The first cache may include a timestamp cache A and a timestamp cache B, and the timestamp cache A and the timestamp cache B are used alternately.

[0076] The second cache may include an edge status cache A and an edge status cache B, and the edge status cache A and the edge status cache B are used alternately.

[0077] At the beginning of each task cycle, the first DMA channel and the second DMA channel are suspended first, because the cache will be switched next, so the target addresses of the first DMA channel and the second DMA channel need to be reset, so DMA is temporarily suspended.

[0078] Then switch the cache, that is, if the last task cycle used timestamp cache A to receive timestamp information, then this task cycle uses timestamp cache B to receive timestamp information, and sets the target address of the first DMA channel to timestamp cache B; if the last task cycle used edge status cache A to receive edge status information, then this task cycle uses edge status cache B to receive edge status information, and sets the target address of the second DMA channel to edge status cache B.

[0079] Clear the data in the timestamp cache B and the edge status cache B, and restore the first DMA channel and the second DMA channel from the suspended state to the transport state. The time required to restore from the suspended state to the transport state is extremely short. When performing the recovery operation, no timestamp information and edge status information will be transmitted to the first DMA channel and the second DMA channel, so no data loss will be caused.

[0080] The timestamp information of each edge is transmitted to the timestamp buffer B through the first DMA channel. When the first DMA channel transmission is completed, the second DMA channel is immediately triggered to transmit the edge status information of the edge to the edge status buffer B.

[0081] While the above operations are being performed in each task cycle, the duty cycle and frequency of the PWM square wave signal of this task cycle are calculated based on the timestamp information in the timestamp buffer A and the edge state information in the edge state buffer A.

[0082] In this embodiment, the task cycle is preferably 1 millisecond. When the pedal displacement sensor works normally, the frequency of the sent PWM square wave signal is fixed at 2 kHz, and a frequency of 2 kHz means a period of 500 microseconds. Therefore, in theory, the MCU cache will receive the timestamp information and edge status information of 4 edges for each 1 millisecond task cycle. However, when the software load rate of the MCU increases, the task cycle will exceed 1 millisecond, so that the MCU cache receives more than 4 edges of timestamp information and edge status information during the task cycle. Therefore, the timestamp cache A and the timestamp cache B are preferably capable of storing up to 8 edges of timestamp information, and the storage space of each timestamp information is preferably 4 bytes; the edge status cache A and the edge status cache B are preferably capable of storing up to 8 edges of edge status information, and the storage space of each edge status information is preferably 4 bytes.

[0083] The step S3 may include the following sub-steps:

[0084] S31, numbering the timestamp information in the first cache in order of receiving time, and calculating the cycle time according to the following formula:

[0085] Cycle time = timestamp information y -Timestamp information (y-2) ;

[0086] Wherein, y is the maximum number in the timestamp information in the first cache, and the timestamp information y It is the timestamp information numbered y. (y-2) It is the timestamp information of the difference numbered y minus 2.

[0087] S32, determining whether the latest received edge status information in the second cache is a rising edge or a falling edge; if the latest received edge status information is a rising edge, calculating the high level time according to the following formula:

[0088] High level time = timestamp information (y-1) – Timestamp information (y-2) ;

[0089] Among them, the timestamp information (y-1) It is the timestamp information of the difference numbered y minus 1.

[0090] If the latest received edge status information is a falling edge, the high level time is calculated according to the following formula:

[0091] High level time = timestamp information y -Timestamp information (y-1) .

[0092] S33, dividing the high level time by the cycle time to determine the duty cycle of the PWM square wave signal of this task cycle.

[0093] The step S4 may include: determining the inverse of the cycle time as the frequency of the PWM square wave signal of this task cycle.

[0094] Through the above technical solution, when the ICU in some MCU models cannot directly parse the frequency and duty cycle of the PWM square wave, the function of calculating the duty cycle and frequency of the PWM square wave signal based on the timestamp information and edge state information of the PWM square wave signal can be realized, thereby reducing the restrictions on the selection of MCU models. The present invention transmits data through the DMA channel without using interrupts, so it also has the advantage of low load rate.

[0095] See also Figure 3 Another aspect of the present application provides a pedal displacement signal analysis system, comprising:

[0096] The square wave acquisition module is used to acquire the PWM square wave signal generated by the vehicle's pedal displacement sensor based on the brake pedal travel information.

[0097] The edge information acquisition module is used to acquire the timestamp information and edge status information of the PWM square wave signal.

[0098] A duty cycle calculation module is used to calculate the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information.

[0099] The pedal opening determination module is configured to determine a brake pedal opening based on the duty cycle.

[0100] The system further comprises:

[0101] A frequency calculation module is used to calculate the frequency of the PWM square wave signal based on the timestamp information and the edge state information.

[0102] The sensor state judgment module is used to determine whether the pedal displacement sensor is in a normal working state based on the frequency.

[0103] Another aspect of the present application provides a vehicle, comprising the pedal displacement signal analysis system as described above.

[0104] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0105] In this document, the terms "comprises," "comprising" or any other variations thereof are intended to cover a non-exclusive inclusion of elements other than those listed and may also include other elements not expressly listed.

[0106] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A pedal displacement signal analysis method, characterized in that: The following steps are involved: S1, obtaining a pulse width modulation (PWM) square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information; S2, collecting timestamp information and edge status information of the PWM square wave signal; S3, calculating the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information; S4, determining a brake pedal opening based on the duty cycle.

2. The pedal displacement signal analysis method according to claim 1, characterized in that: The following steps are also included: S5, calculating the frequency of the PWM square wave signal based on the timestamp information and the edge state information; S6, determining whether the pedal displacement sensor is in a normal working state based on the frequency.

3. The pedal displacement signal analysis method according to claim 1 or 2, characterized in that: The step S1 includes: obtaining, through a microcontroller unit (MCU) of the vehicle, a PWM square wave signal generated by a pedal displacement sensor of the vehicle based on brake pedal travel information.

4. The pedal displacement signal analysis method according to claim 3, characterized in that: The step S2 comprises the following sub-steps: S21, receiving the timestamp information and edge status information of the PWM square wave signal through the register of the MCU; S22, transmitting the timestamp information and the edge status information to a cache of the MCU through a direct memory access (DMA) channel of the MCU.

5. The pedal displacement signal analysis method according to claim 4, characterized in that: The sub-step S21 includes: Receiving the timestamp information of each edge of the PWM square wave signal through the first register of the MCU; The edge status information of each edge of the PWM square wave signal is received through the second register of the MCU.

6. The pedal displacement signal analysis method according to claim 5, characterized in that: The sub-step S22 comprises: According to a preset task cycle, the timestamp information is transmitted to a first cache of the MCU through a first DMA channel of the MCU; The edge status information is transmitted to a second cache of the MCU through a second DMA channel of the MCU.

7. The pedal displacement signal analysis method according to claim 6, characterized in that: The step S3 comprises the following sub-steps: S31, numbering the timestamp information in the first cache in order of receiving time, and calculating the cycle time according to the following formula: Cycle time = timestamp information y -Timestamp information (y-2) ; Wherein, y is the maximum number in the timestamp information in the first cache, and the timestamp information y It is the timestamp information numbered y. (y-2) It is the timestamp information of the difference numbered y minus 2; S32, determining whether the latest received edge status information in the second cache is a rising edge or a falling edge; if the latest received edge status information is a rising edge, calculating the high level time according to the following formula: High level time = timestamp information (y-1) – Timestamp information (y-2) ; Among them, the timestamp information (y-1) It is the timestamp information of the difference numbered y minus 1; If the latest received edge status information is a falling edge, the high level time is calculated according to the following formula: High level time = timestamp information y -Timestamp information (y-1) ; S33, dividing the high level time by the cycle time to determine the duty cycle of the PWM square wave signal of this task cycle.

8. The pedal displacement signal analysis method according to claim 7, characterized in that: The step S4 includes: determining the inverse of the cycle time as the frequency of the PWM square wave signal of this task cycle.

9. A pedal displacement signal analysis system, characterized in that: include: A square wave acquisition module, used to acquire a PWM square wave signal generated by a pedal displacement sensor of a vehicle based on brake pedal travel information; An edge information acquisition module, used for acquiring timestamp information and edge status information of the PWM square wave signal; A duty cycle calculation module, used for calculating the duty cycle of the PWM square wave signal based on the timestamp information and the edge state information; The pedal opening determination module is configured to determine a brake pedal opening based on the duty cycle.

10. A vehicle, characterized in that: It comprises the pedal displacement signal analysis system as claimed in claim 9.