Method for sampling falling edge signal of EPS sensor based on rising edge

By using the rising edge sampling EPS sensor falling edge signal on the MCU chip, the interrupt acquisition and analysis of signals is realized, solving the problem that domestic MCUs cannot acquire falling edge signals, and improving the accuracy of signal acquisition and the portability of software.

CN119511826APending Publication Date: 2025-02-25NANJING DONGHUA AUTOMOTIVE STEERING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411526869.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the prior art, domestic MCUs are unable to acquire falling edge signals, resulting in inaccurate signal acquisition and inability to ensure accuracy.

Method used

The method of sampling the falling edge signal of the EPS sensor based on the rising edge of the MCU chip is adopted to realize the interrupt acquisition and analysis of the signal through the system to ensure the integrity and accuracy of the signal.

Benefits of technology

It solves the problem of inaccurate signal acquisition in falling edges, improves the accuracy of signal acquisition and software portability, and is suitable for all MCU solutions and has high versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119511826A_ABST
    Figure CN119511826A_ABST
Patent Text Reader

Abstract

The invention discloses a method for sampling an EPS sensor falling edge signal based on a rising edge, and the method comprises the steps: connecting a sensor with a controller through a wire harness, electrifying a system, and guaranteeing the normal power supply of the sensor; the MCU is provided with a corresponding register, an IO port is initialized, and then a PWM measurement mode is started; and interrupt acquisition is carried out on signals of the sensor, and signal analysis is carried out. According to the invention, the problem of abnormal acquisition period of effective signals of a falling edge, especially sensor P signals in an EPS product, can be solved. According to the sampling method disclosed by the invention, the energy consumed by software is less, the portability is high, the sampling method can be suitable for all MCU schemes, other products on the market can also refer to the protocol, and the universality is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for sampling a falling edge signal of an EPS sensor based on a rising edge of an MCU chip, and belongs to the technical field of automotive electronic systems. Background Art

[0003] In the prior art, most measurement methods use the falling edge acquisition function of the MCU to directly collect signals, but domestic MCUs are unable to do this. Generally, valid data is discarded during software processing. This method cannot guarantee accuracy and error detection, nor can it guarantee precision. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method for sampling the falling edge signal of the EPS sensor based on the rising edge of the MCU chip.

[0005] The present invention adopts the following technical solution to solve the above technical problems: a method based on rising edge sampling of the falling edge signal of the EPS sensor, which implements the following specific steps through the system:

[0006] Step 1: Connect the sensor to the controller through the wiring harness, power on the system, and ensure that the sensor is powered normally;

[0007] Step 2: MCU configures the corresponding registers, initializes the IO port first, and then turns on the PWM measurement mode;

[0008] Step 3: collect the sensor signal and analyze the signal.

[0009] Furthermore, the system includes at least a sensor, an MCU and an EPS controller, which are connected and communicated via a wiring harness, and the MCU includes at least an IO module, a PWM module and an interrupt module.

[0010] Furthermore, in step 2, the specific steps of MCU initializing the IO port are: the sensor is connected to the controller connector through the wiring harness, and then connected to the port of the MCU again, and the MCU initializes the IO port corresponding to the data to be collected, ensuring that the IO port is configured as a multiplexing function for measuring the PWM module function;

[0011] The specific content of MCU initializing the PWM module is: the MCU is powered on, and the PWM module is initialized, and configured to the PWM measurement mode to collect the PWM signal.

[0012] Furthermore, in step 3, the sensor signal acquisition: interrupt the acquisition of the sensor signal, splice the previous and next cycles of the two signals, splice the negative pulse width of the previous cycle and the positive pulse width of the current cycle together; then divide the negative pulse width of the current cycle by the cycle to convert it into a duty cycle;

[0013] Sensor signal analysis: The spliced ​​period obtained in the MCU interrupt is checked to determine whether the period exceeds the limit. If the period does not exceed the limit, the period is converted into the duty cycle signal and converted into an angle signal.

[0014] Furthermore, whether the period exceeds the limit depends on the algorithm judgment of the application layer, and the conversion angle of the duty cycle signal also depends on the processing of the application layer. This solves the problem of MCU using the rising edge to collect the valid signal of the falling edge for periodic splicing processing.

[0015] Furthermore, in step 2, the MCU register is configured to implement the register readback function, thereby ensuring that the MCU initialization completes IO normally.

[0016] Furthermore, signal integrity can be handled when periodic signals change suddenly.

[0017] Furthermore, in step 3, ensure that the MCU initializes the PWM module to complete the PWM measurement mode.

[0018] Compared with the prior art, the present invention adopts the above technical solution and has the following advantages:

[0019] 1. Solve the problem of effective falling edge signals, especially the abnormal acquisition cycle of sensor P signal in EPS products.

[0020] 2. The sampling method of the present invention consumes less effort in software and has high portability.

[0021] 3. The sampling method of the present invention is applicable to all MCU solutions. Other products on the market can also refer to this protocol, which has high versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the architecture of the present invention.

[0023] Figure 2 The figure is a flow chart of an embodiment of the present invention.

[0024] Figure 3 This is a schematic diagram of the sensor signal acquisition principle in the present invention.

[0025] Figure 4 This is a schematic diagram of the splicing principle of sensor signals in the present invention. DETAILED DESCRIPTION

[0026] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:

[0027] This embodiment proposes a method for sampling the falling edge signal of the EPS sensor based on the rising edge of the MCU chip, which is mainly convenient for adapting to all MCU development and acquisition on the market. It can be collected on any physical medium and is used to measure all sensor signals of the entire ECU, mainly including entering system initialization, measuring data, etc.

[0028] The main steps include:

[0029] Step 1: Connect the sensor, power on the system, and ensure that the sensor is powered normally. Connect the sensor to the ECU controller and power on to ensure the normal operation of the system; initialize each module at the same time, including at least the IO module, PWM module and interrupt module.

[0030] Step 2: MCU configures the corresponding registers, initializes the IO port first, and then turns on the PWM measurement mode.

[0031] First, the MCU initializes the IO port: the sensor is connected to the EPS controller connector through the wiring harness, and then connected to the port of the MCU through the wiring harness. The MCU initializes the IO port corresponding to the data to be collected, ensuring that the IO port is configured as a multiplexing function to specifically measure the PWM module function.

[0032] MCU initializes PWM module: When the MCU initializes the PWM module, it is configured to PWM measurement mode to collect PWM signals, and can collect negative pulse width and period.

[0033] Step 3: collect the sensor signal and analyze the signal.

[0034] Among them, sensor signal acquisition: interrupt the acquisition of sensor signals, splice the cycles before and after the two signals, splice the negative pulse width of the previous cycle and the positive pulse width of the current cycle together; then divide the negative pulse width of the current cycle by the cycle to convert it into a duty cycle. Two falling edges are one cycle. If the rising edge is used for acquisition, a sudden change will occur in the middle. To avoid this situation, interrupts can be used to perform two consecutive samplings for splicing.

[0035] Sensor signal analysis: Get the spliced ​​period in the MCU interrupt for verification and determine whether the period exceeds the limit. Then get the duty cycle signal to convert it into an angle signal. For example, the sampling frequency of PWM capture is 2MHz, and the frequency of the sensor is 200Hz, so the sampled signal value should be 10000. If the sampling value is outside the range of 10000±10, it is determined that the period exceeds the limit. Then get the duty cycle signal to convert it into an angle signal. The angle signal is converted according to the sensor manual.

[0036] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above specific embodiments. The above specific embodiments and the description in the specification are only for further illustrating the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of the present invention to be protected is defined by the claims and their equivalents.

Claims

1. A method for sampling the falling edge signal of an EPS sensor based on the rising edge, characterized in that: The following specific steps are implemented through the system: Step 1: Connect the sensor to the controller through the wiring harness, power on the system, and ensure that the sensor is powered normally; Step 2: MCU configures the corresponding registers, initializes the IO port first, and then turns on the PWM measurement mode; Step 3: collect the sensor signal and analyze the signal.

2. The method for sampling the falling edge signal of the EPS sensor based on the rising edge according to claim 1 is characterized in that: The system at least includes a sensor, an MCU and an EPS controller, which are connected and communicated via a wiring harness. The MCU at least includes an IO module, a PWM module and an interrupt module.

3. The method for sampling the falling edge signal of the EPS sensor based on the rising edge according to claim 1 is characterized in that: In step 2, the specific steps of MCU initializing the IO port are: the sensor is connected to the controller connector through the wiring harness, and then connected to the port of the MCU again, and the MCU initializes the IO port corresponding to the acquisition to ensure that the IO port is configured as a multiplexing function for measuring the PWM module function; The specific content of MCU initializing the PWM module is: the MCU is powered on, and the PWM module is initialized, and configured to the PWM measurement mode to collect the PWM signal.

4. The method for sampling the falling edge signal of the EPS sensor based on the rising edge according to claim 1 is characterized in that: In step 3, sensor signal acquisition: interrupt the acquisition of the sensor signal, splice the previous and next cycles of the two signals, splice the negative pulse width of the previous cycle and the positive pulse width of the current cycle together; then divide the negative pulse width of the current cycle by the cycle to convert it into a duty cycle; Sensor signal analysis: The spliced ​​period obtained in the MCU interrupt is checked to determine whether the period exceeds the limit. If the period does not exceed the limit, the period is converted into the duty cycle signal and converted into an angle signal.

5. The method for sampling the falling edge signal of the EPS sensor based on the rising edge according to claim 4 is characterized in that: Whether the period exceeds the limit depends on the algorithm judgment of the application layer. The conversion angle of the duty cycle signal also depends on the processing of the application layer. This solves the problem of MCU using the rising edge to collect the valid signal of the falling edge for periodic splicing processing.

6. The method for collecting falling edge signals of EPS sensors based on rising edge sampling according to claim 1 is characterized in that: In step 2, the MCU register is configured to implement the register readback function, thereby ensuring that the MCU initialization is completed and the IO is normal.

7. The method for collecting falling edge signals of EPS sensors based on rising edge sampling according to claim 4 is characterized in that: It can handle signal integrity when periodic signals change suddenly.

8. The method for collecting falling edge signals of EPS sensors based on rising edge sampling according to claim 1 is characterized in that: In step 3, ensure that the MCU initializes the PWM module to complete the PWM measurement mode.