A method and device for monitoring the state of an electric vehicle charging gun

By continuously sampling and calibrating the microcontroller and energy metering chip in the electric vehicle charging gun status monitoring device, and combining them with an adaptive filtering algorithm, the problems of signal acquisition complexity and metering accuracy in the existing technology are solved. This achieves reliable signal recognition and accurate energy metering, and improves the accuracy and response speed of charging status determination.

CN123176368APending Publication Date: 2026-11-27CHONGQING QIANJIANG DISTRICT ETHNIC VOCATIONAL EDUCATION CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611254082.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In the existing technology, the control guidance signal acquisition circuit during electric vehicle charging is complex and has low recognition reliability; the software calibration of the power metering chip increases the computational load of the microcontroller and has physical drift error in the early stage of power-on; and a single filtering algorithm is difficult to balance data smoothness and response speed to sudden state changes.

Method used

The microcontroller continuously samples the control guidance signal in batches, extracts the peak-to-peak value to determine the signal type, and calculates the voltage amplitude by combining the maximum voltage sampling value; the gain calibration value is written into the energy metering chip for hardware calibration, and data filtering is performed by combining a multi-level amplitude limiting filter mechanism to realize the integration of signal type identification and parameter measurement, reduce hardware complexity and improve metering accuracy; the output data is discarded in the early stage of data acquisition to eliminate drift error, and an adaptive filtering algorithm is used to follow the data change without delay when the state changes abruptly.

Benefits of technology

It achieves reliable identification and accurate measurement of control guidance signals, reduces the complexity of hardware circuit design, lightens the load on the microcontroller, improves the accuracy of power metering data and the accuracy of charging status determination, and ensures the stability and response speed of data display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123176368A_ABST
    Figure CN123176368A_ABST
Patent Text Reader

Abstract

The present application relates to electric vehicle charging technical field, disclose a kind of electric vehicle charging gun state monitoring method and monitoring device, method includes: microcontroller is continuously batch sampling to control guide signal, according to the peak-peak value of sampling sequence determines signal type and calculates voltage amplitude;The gain calibration value read is written in electric energy metering chip gain calibration register, and the valid value data of initial power-on is discarded;According to the relative deviation between current valid value reading and last output result in different threshold interval, adaptive limiting filter operation is carried out to obtain filtered power value;Signal type, voltage amplitude, resistance value of ground resistance and filtered power value are generated new working state, and output after preset de-bouncing time.This application solves the problems of complex signal acquisition circuit, low recognition reliability, initial physical drift error of electric energy metering chip and single filter difficult to consider smooth and sudden response.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electric vehicle charging technology, specifically to a method and device for monitoring the status of an electric vehicle charging gun. Background Technology

[0002] With the development of the new energy vehicle industry, status monitoring during the charging process of electric vehicles is crucial for charging safety. During the AC charging process of electric vehicles, the charging gun and the vehicle mainly communicate status through control guidance signals and connection confirmation signals. Accurately collecting and identifying these signals is the foundation for realizing status monitoring.

[0003] In existing control guidance signal detection schemes, optocoupler comparators or microcontroller timer input capture modules are typically used to measure pulse width modulation signals. Using optocoupler comparators requires multiple circuits to correspond to different voltage windows, resulting in a large number of components and complex hardware circuit design. When using timer input capture, after the control guidance signal is stepped down by a voltage divider circuit, the high level of the low voltage signal can easily approach the judgment threshold boundary of the microcontroller input pin, causing false triggering or missed capture of input capture, resulting in unstable measurement results. Some schemes use single analog-to-digital conversion sampling to judge the voltage threshold. However, since instantaneous sampling is easily affected by electromagnetic noise and cannot accurately distinguish between the instantaneous state of constant DC signals and pulse width modulation square wave signals when they are at a low level, the reliability of signal type identification is poor.

[0004] In terms of electricity metering and processing, most existing electricity metering chip data calibrations rely on software calibration performed by the microcontroller. The microcontroller needs to perform floating-point multiplication operations using internal software programs after each reading of the original data to obtain the actual value. This method increases the computational load on the microprocessor. At the same time, electricity metering chips generally have an internal output drift process after each power-on reset. Existing software calibration schemes read data and perform calculations immediately after power-on, resulting in a large deviation in the output value at the initial power-on stage of the system, which affects the accuracy of the initial electricity metering data.

[0005] During the switching of charging gun working status and data communication, the collected raw readings are accompanied by transient voltage fluctuations and occasional noise spikes. Existing single filtering algorithms are difficult to balance data smoothness and state response speed. They cannot effectively filter out occasional communication noise spikes while ensuring that the system can follow the data changes without delay when real state changes occur. This leads to unstable display of the underlying data and increases the risk of false alarms in state determination. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method and device for monitoring the status of electric vehicle charging guns. It solves the problems of complex control and guidance signal acquisition circuits with low recognition reliability, increased computational load on microcontrollers due to power metering chip software calibration and physical drift errors in the initial power-on stage, and the difficulty of a single filtering algorithm in balancing data smoothness and response speed to sudden state changes.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] The first aspect of this invention provides a method for monitoring the status of an electric vehicle charging gun, applied to an electric vehicle charging gun status monitoring device. The electric vehicle charging gun status monitoring device includes a microcontroller, an energy metering chip, a non-volatile memory, and a signal conditioning circuit connected to the electric vehicle charging gun. The method includes: The microcontroller continuously samples the control guidance signal in batches through a signal conditioning circuit, extracting the maximum and minimum voltage sampling values ​​of the sampling sequence. The peak-to-peak value is obtained by calculating the absolute value of the difference between these two values. Based on the comparison between the peak-to-peak value and a preset noise threshold, the microcontroller determines whether the control guidance signal is a constant DC signal or a pulse-width modulated square wave signal. Then, based on the determined signal type and the maximum voltage sampling value, the microcontroller calculates the voltage amplitude of the control guidance signal.

[0009] The microcontroller reads the RMS output register of the energy metering chip. When the relative deviation between two consecutive readings is less than a preset stability threshold, it acquires the reading to calculate the average RMS value. The microcontroller uses the quotient of the target physical quantity value and a preset proportionality coefficient as the expected RMS value. Based on the ratio of the expected RMS value to the average RMS value, it calculates the gain calibration value and writes it into the gain calibration register inside the energy metering chip. At the initial stage of the data acquisition thread, the microcontroller discards the RMS data output by the energy metering chip for a preset number of periods.

[0010] The microcontroller acquires the current effective value reading from the power metering chip and calculates the relative deviation between the current effective value reading and the previous effective value output. Depending on the threshold range of the relative deviation, the microcontroller performs either exponential moving average smoothing, immediate follow-up on sudden changes in value, or trend direction confirmation and follow-up to obtain the filtered power value.

[0011] The microcontroller obtains the ground resistance value corresponding to the connection confirmation signal through the signal conditioning circuit, and generates a new operating state by comprehensively controlling the signal type, voltage amplitude, ground resistance value, and filtered power value of the pilot signal. A timer is started when the new operating state differs from the old one, and the final operating state is output after a preset debouncing time in the new operating state.

[0012] A second aspect of the present invention provides an electric vehicle charging gun status monitoring device, comprising: a non-volatile memory, a microcontroller, an energy metering chip, and a signal conditioning circuit.

[0013] The microcontroller is electrically connected to a non-volatile memory, an energy metering chip, and a signal conditioning circuit. The signal conditioning circuit is connected to the control guide terminal and the connection confirmation terminal of the electric vehicle charging gun. The non-volatile memory is used to store computer-executable instructions. When the computer-executable instructions are executed by the microcontroller, the microcontroller enables the microcontroller to implement the electric vehicle charging gun status monitoring method provided in the first aspect of the present invention.

[0014] This invention provides a method and device for monitoring the status of an electric vehicle charging gun. It has the following beneficial effects: 1. This invention continuously samples and extracts peak-to-peak values ​​of control guidance signals through a single analog-to-digital converter channel. It determines constant DC signals and pulse-width modulated square wave signals based on the comparison between peak-to-peak values ​​and preset noise thresholds. The batch sampling peak-to-peak value identification method does not rely on a timer input capture module and is not limited by input threshold boundaries. While realizing the integration of signal type identification and parameter measurement, it reduces the complexity of hardware circuit design and improves the reliability of control guidance signal acquisition.

[0015] 2. This invention writes the calculated gain calibration value into the gain calibration register inside the power metering chip, and the chip hardware automatically corrects the effective value output. At the beginning of data acquisition, the output data of a preset number of cycles is discarded. The mechanism of combining hardware-level calibration and reading discard avoids the microcontroller from performing software floating-point operations every time it reads data, reducing the processor load. At the same time, it eliminates the physical drift error at the beginning of chip power-on and improves the output accuracy of power metering data.

[0016] 3. Based on the different threshold ranges of the relative deviation between the current effective value reading and the historical output results, this invention performs exponential moving average smoothing, immediate follow-up of sudden value, or trend direction confirmation and follow-up operation respectively. The multi-level amplitude limiting filtering mechanism can smooth normal low-level sampling fluctuations to maintain the stability of data display, achieve data follow-up without delay when a state change occurs, and effectively filter occasional communication noise spikes, thereby improving the accuracy of charging status determination. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1 This invention provides a method and device for monitoring the status of an electric vehicle charging gun. The electric vehicle charging gun status monitoring device mainly includes a microcontroller, an energy metering chip, a signal conditioning circuit, and a non-volatile memory. The microcontroller is electrically connected to the energy metering chip, the signal conditioning circuit, and the non-volatile memory.

[0020] The microcontroller is used to perform data acquisition, logic operations, and state control. Specifically, the microcontroller is a microprocessor with an internal analog-to-digital converter that supports high-frequency continuous sampling and a high-precision period counter that supports edge timestamp capture. As a specific implementation of the lower-level concept, the microcontroller is a single-chip microcomputer or digital signal processor based on an ARM core. The signal conditioning circuit is connected to the control guidance terminal and the connection confirmation terminal of the electric vehicle charging gun. It is used to convert external electrical signals into analog signals that the microcontroller can process. For the control guidance signal, the signal conditioning circuit includes a resistor voltage divider network. For the connection confirmation signal, the signal conditioning circuit includes a ground resistance measurement loop. For the specific circuit topology of the resistor voltage divider network and the ground resistance measurement loop, those skilled in the art can build it according to conventional circuit design specifications. The hardware selection and connection method of the signal conditioning circuit are well known in the art and will not be described in detail here.

[0021] The power metering chip is used to measure AC voltage, AC current and power during the charging process. Specifically, the power metering chip has an internal gain calibration register and an RMS output register. The microcontroller interacts with the power metering chip through a standard communication bus. The standard communication bus can be any one of a serial peripheral interface bus, an integrated circuit built-in bus or a universal asynchronous transceiver bus. Non-volatile memory is used to persistently store the device's operating parameters and calibration data. As a specific implementation of the lower-level concept, the non-volatile memory adopts flash memory or electrically erasable programmable read-only memory.

[0022] Based on the above-mentioned electric vehicle charging gun status monitoring device, this invention proposes an electric vehicle charging gun status monitoring method. The electric vehicle charging gun status monitoring method is implemented by loading and executing a computer program stored in the internal storage medium of the microcontroller. The electric vehicle charging gun status monitoring method includes the following steps.

[0023] Step S100: Identify the type and parameters of the control guidance signal. The microcontroller uses a single internal analog-to-digital converter channel to perform high-frequency continuous sampling of the control guidance signal after it has been stepped down by the signal conditioning circuit within a total sampling duration covering at least one complete pulse width modulation cycle. The peak-to-peak value is calculated based on the maximum and minimum values ​​in the sampling sequence. By comparing the peak-to-peak value with a preset noise threshold, it is determined whether the current control guidance signal is a constant DC signal or a pulse width modulation square wave signal. The voltage amplitude, frequency and duty cycle of the control guidance signal are measured simultaneously.

[0024] In step S200, the power metering chip is calibrated and drift readings are eliminated. The microcontroller reads the pre-stored gain calibration value from the non-volatile memory and writes the gain calibration value directly into the gain calibration register inside the power metering chip. The power metering chip performs hardware-level calibration based on the gain calibration register configuration to correct the value in the effective value output register of the power metering chip. At the same time, the microcontroller actively discards the output data of a preset number of cycles at the beginning of the acquisition thread to eliminate the physical drift error of the power metering chip at the beginning of power-on.

[0025] In step S300, adaptive amplitude limiting filtering is performed on the effective value reading. The microcontroller calculates the relative deviation between the current effective value reading and the historical output value in real time. Depending on the different threshold ranges in which the relative deviation falls, the microcontroller adaptively switches between performing exponential moving average smoothing, immediate following of sudden value changes, or trend direction confirmation and following operations, and outputs smooth and delay-free effective values ​​of power, voltage, and current.

[0026] Step S400: Perform multi-dimensional state determination and debouncing. The microcontroller comprehensively evaluates the extracted control guidance signal type and voltage range, the ground resistance range corresponding to the connection confirmation signal, and the current filtered power value to determine the specific working state of the electric vehicle charging gun: standby, inserted, vehicle ready, charging, resistance abnormal, or voltage abnormal. When the calculated new working state is different from the currently maintained working state, the debouncing timing logic of the preset duration is triggered. Under the condition that the new working state remains unchanged within the debouncing cycle, the microcontroller outputs the final working state switching command.

[0027] The step S100 of identifying the type and parameters of the control guidance signal specifically includes the following sub-steps.

[0028] Step S110: Perform continuous batch sampling. The microcontroller starts the internal analog-to-digital converter to perform continuous batch sampling on the stepped-down control guidance signal. The total number of samplings is set to variable N, which is greater than or equal to 128. In a preferred embodiment, variable N is set to 256. The microcontroller sets the time interval between two adjacent samples so that the total duration of continuous batch sampling covers at least one complete pulse width modulation signal cycle. For a pulse width modulation signal with a frequency of 1 kHz, the total duration of continuous batch sampling is not less than 1 millisecond. In a specific application scenario, the single sampling time interval is set to 5 microseconds, and the total duration of continuous batch sampling is 1.3 milliseconds.

[0029] Step S120: Calculate the peak-to-peak value. During continuous batch sampling, the microcontroller records the maximum and minimum voltage sampling values ​​in the sampling sequence in real time. The microcontroller calculates the difference between the maximum and minimum voltage sampling values ​​to obtain the peak-to-peak value. The formula for calculating the peak-to-peak value is: ; In the formula, Vpp represents the peak-to-peak value calculated from the sequence acquired by the analog-to-digital converter, vmax represents the maximum voltage sample value during the continuous batch sampling process, and vmin represents the minimum voltage sample value during the continuous batch sampling process.

[0030] Step S130: Adaptively determine the signal type. The microcontroller compares the calculated peak-to-peak value Vpp with a preset noise threshold. The preset noise threshold is set based on the statistical law of sampling noise of the analog-to-digital converter under constant DC signal conditions. The specific value of the preset noise threshold is between 2 and 5 times the maximum statistical value to retain the electromagnetic noise margin of the hardware circuit.

[0031] Step S131: When the peak-to-peak value Vpp is less than the preset noise threshold, the microcontroller determines that the current control guidance signal is a constant DC signal, that is, the control guidance signal does not have pulse width modulation logic.

[0032] Step S132: When the peak-to-peak value Vpp is greater than or equal to the preset noise threshold, the microcontroller determines that the current control guidance signal is a pulse width modulation square wave signal.

[0033] Step S140: Classify and calculate the electrical parameters of the signals. Based on the determination result of the control guide signal type, the microcontroller calculates the amplitude, frequency and duty cycle of the control guide signal respectively.

[0034] Step S141: When the control guidance signal is determined to be a constant DC signal, the microcontroller uses the physical voltage value mapped by the maximum voltage sampling value vmax as the voltage amplitude of the constant DC signal, sets the frequency parameter of the constant DC signal to zero, and sets the duty cycle parameter of the constant DC signal to zero.

[0035] In step S142, when the control guidance signal is determined to be a pulse width modulation square wave signal, the microcontroller uses the physical voltage value mapped by the maximum voltage sampling value vmax as the voltage amplitude when the pulse width modulation square wave signal is in a high-level state. The microcontroller uses an internal high-precision period counter to capture the timestamp of the pulse width modulation square wave signal level transition during the batch sampling process as a specific implementation of the lower-level concept. The high-precision period counter adopts a data observation point and tracking period counter based on the ARM architecture. For the mathematical operation process of calculating the frequency and duty cycle of the square wave signal based on the timestamp, those skilled in the art can program it according to conventional digital signal processing theory. Calculating the frequency and duty cycle based on the timestamp is a well-known technology in this field and will not be described in detail here.

[0036] Step S200, which involves calibrating the power metering chip and eliminating drift readings, specifically includes the following sub-steps.

[0037] Step S210: Trigger calibration and wait for stabilization. The microcontroller triggers the calibration process via an external command and receives the input target physical quantity value, which includes the target voltage or target current. The microcontroller continuously reads the effective value output register of the power metering chip. When the relative deviation between two consecutive readings in M ​​consecutive readings is less than the preset stabilization threshold, the microcontroller determines that the output of the power metering chip has reached a stable state. In a preferred embodiment, variable M is set to 5, the preset stabilization threshold is set to 2%, and the microcontroller simultaneously sets the maximum waiting time T. max As a preferred embodiment, the maximum waiting time T max Set to 30 seconds; when the waiting time exceeds the maximum waiting time T... max At that time, the microcontroller directly uses the current effective value reading as the stable reading.

[0038] Step S220: Acquiring readings and calculating calibration values. After the power metering chip output stabilizes, the microcontroller continuously acquires K effective value readings and calculates the average of the K consecutive effective value readings to obtain the average effective value rawavg. In a preferred embodiment, the variable K is set to 10. The microcontroller calculates the expected effective value targetraw based on the target physical quantity value target and the preset proportional coefficient SCALE. The value of the expected effective value targetraw is equal to the target physical quantity value target divided by the preset proportional coefficient SCALE. The microcontroller calculates the gain calibration value GAIN based on the expected effective value targetraw and the average effective value rawavg. The formula for calculating the gain calibration value GAIN is: ; In the formula, GAIN represents the gain calibration value written to the power metering chip, targetraw represents the expected effective value converted from the target physical quantity value target, rawavg represents the average effective value obtained from K consecutive acquisitions, variable B represents the resolution bits of the gain calibration register of the power metering chip, and the microcontroller performs amplitude limiting processing on the calculated gain calibration value GAIN to limit the gain calibration value GAIN to the signed representation range of the gain calibration register of the power metering chip.

[0039] In step S230, the microcontroller writes to the register and persists the data. It enables the write protection mechanism of the energy metering chip, writes the gain calibration value GAIN to the gain calibration register of the energy metering chip, and then disables the write protection mechanism. The microcontroller stores the gain calibration value GAIN in the non-volatile memory. The microcontroller uses a key-value pair containing a version identifier and a checksum to persistently store the data. The underlying read / write control and data verification logic of the non-volatile memory can be implemented by those skilled in the art according to conventional memory programming specifications. The read / write and verification of non-volatile memory are well-known technologies in the field and will not be described in detail here.

[0040] Step S240, Power-on recovery and drift elimination: Each time the electric vehicle charging gun status monitoring device is powered on, the microcontroller reads the historically stored gain calibration value GAIN from the non-volatile memory. After the energy metering chip completes hardware reset and default parameter configuration, the microcontroller writes the gain calibration value GAIN into the gain calibration register of the energy metering chip. The microcontroller reads back the data in the gain calibration register of the energy metering chip to verify the accuracy of the write operation. In the first P sampling cycles after the data acquisition thread of the electric vehicle charging gun status monitoring device is started, the microcontroller discards the valid value data output by the energy metering chip. By shielding the unstable output at the beginning of power-on, physical drift error is eliminated. In a preferred embodiment, the variable P is set to 10.

[0041] The step S300 of adaptive amplitude limiting filtering of the effective value reading specifically includes the following sub-steps.

[0042] Step S310: Determine the fluctuation range. The microcontroller obtains the current effective value reading of the current output of the power metering chip. The microcontroller retrieves the previously stored effective value output result. The microcontroller calculates the absolute value of the difference between the current effective value reading and the previous effective value output result. The microcontroller divides the absolute value of the difference by the previous effective value output result to obtain the relative deviation value. The microcontroller compares the relative deviation value with the preset first threshold and the preset second threshold to determine the fluctuation range of the current effective value reading. As a preferred embodiment, the preset first threshold is set to 8%, and the preset second threshold is set to 50%.

[0043] Step S320: Perform normal fluctuation smoothing. When the relative deviation value is less than or equal to a preset first threshold, the microcontroller determines that the current effective value reading belongs to the normal fluctuation range. The microcontroller uses an exponential moving average smoothing algorithm to calculate the current filtered output value. The calculation formula for the exponential moving average smoothing algorithm is as follows: ; In the formula, output represents the current filtered output value obtained by the microcontroller after filtering calculation, α represents the preset smoothing coefficient, raw represents the current effective value reading of the current output of the power metering chip, and lastoutput represents the previous effective value output result stored in the history of the microcontroller. As a preferred embodiment, the preset smoothing coefficient α is set to 0.5. The microcontroller outputs the current filtered output value as the final effective value data to ensure the stability of the numerical display.

[0044] Step S330: Perform mutation following. When the relative deviation value is greater than the preset second threshold, the microcontroller determines that a real charging state change has occurred. The microcontroller directly uses the current effective value reading as the current filtered output value. The microcontroller does not perform exponential moving average smoothing calculation on the current effective value reading. The microcontroller synchronously resets the internal trend counter value to zero. The microcontroller outputs the current filtered output value as the final effective value data to ensure the response speed of state switching.

[0045] Step S340: Perform trend confirmation. When the relative deviation value is greater than a preset first threshold and less than or equal to a preset second threshold, the microcontroller determines the direction of change of the current effective value reading compared to the previous effective value output result. The direction of change includes the direction of numerical increase and the direction of numerical decrease. The microcontroller records the current direction of change and determines whether the current direction of change is consistent with the previously recorded direction of change. If they are consistent, the microcontroller increments the internal trend counter. When the internal trend counter reaches the preset number of consecutive confirmations variable C, the microcontroller determines that the current effective value reading belongs to a real numerical change. The microcontroller uses the current effective value reading as the current filtered output value. If they are consistent but the internal trend counter has not reached the preset number of consecutive confirmations variable C, the microcontroller continues to call the calculation formula of the exponential moving average smoothing algorithm to calculate the current filtered output value. If they are inconsistent, the microcontroller determines that the current effective value reading belongs to an occasional noise spike. The microcontroller resets the internal trend counter to zero and continues to call the calculation formula of the exponential moving average smoothing algorithm to calculate the current filtered output value. As a preferred specific embodiment, the number of consecutive confirmations variable C is set to 8 times.

[0046] The steps S400 for multi-dimensional state determination and debouncing specifically include the following sub-steps.

[0047] Step S410: Obtain multi-dimensional state parameters. The microcontroller obtains the control guidance signal type and voltage amplitude of the control guidance signal extracted in the previous steps. The microcontroller obtains the filtered power value output by the power metering chip. The microcontroller obtains the ground resistance value corresponding to the connection confirmation signal through the ground resistance measurement circuit. The microcontroller uses the control guidance signal type, voltage amplitude of the control guidance signal, filtered power value, and ground resistance value as multi-dimensional input parameters of the state machine.

[0048] Step S420: Determine the resistance to ground state. The microcontroller determines whether the resistance value to ground is within a preset first resistance range or a preset second resistance range. In a preferred embodiment, the preset first resistance range is set to fluctuate within 10% of 1.5 kΩ, and the preset second resistance range is set to fluctuate within 10% of 3.3 kΩ. When the resistance value to ground is neither within the preset first resistance range nor within the preset second resistance range, the microcontroller determines and generates a candidate state for resistance abnormality. When the resistance value to ground is within the preset first resistance range or the preset second resistance range, the microcontroller performs subsequent state subdivision based on the control guidance signal type and the voltage amplitude of the control guidance signal.

[0049] Step S430: Determine the basic working state. When the microcontroller determines that the control guide signal type is a constant DC signal and the voltage amplitude of the control guide signal is within the preset first voltage range, the microcontroller determines to generate a standby candidate state. The preset first voltage range is set to fluctuate within 10% of 12 volts. When the microcontroller determines that the control guide signal type is a pulse width modulation square wave signal and the voltage amplitude of the control guide signal is within the preset second voltage range, the microcontroller determines to generate an inserted candidate state. The preset second voltage range is set to fluctuate within 10% of 9 volts. When the voltage amplitude of the control guide signal does not belong to any of the preset first voltage range, the preset second voltage range, and the preset third voltage range, the microcontroller determines to generate a voltage abnormality candidate state. The preset third voltage range is set to fluctuate within 10% of 6 volts.

[0050] Step S440: Determine the charging-related state. When the microcontroller determines that the control guidance signal type is a pulse width modulation square wave signal and the voltage amplitude of the control guidance signal is within the preset third voltage range, the microcontroller compares the filtered power value with the preset power threshold. In a preferred embodiment, the preset power threshold is set to 1 watt. When the filtered power value is greater than the preset power threshold, the microcontroller determines to generate a candidate state for charging. When the filtered power value is less than or equal to the preset power threshold, the microcontroller determines to generate a candidate state for vehicle readiness.

[0051] Step S450: Perform state debouncing and output. The microcontroller marks the currently calculated candidate states as the new working state. The microcontroller compares the new working state with the old working state currently maintained by the electric vehicle charging gun state monitoring device. When the new working state is different from the old working state, the microcontroller starts the internal debouncing timer and begins timing. The microcontroller determines whether the cumulative timing duration of the debouncing timer during the duration of the new working state reaches the preset debouncing time. As a preferred embodiment, the preset debouncing time is set to 500 milliseconds. When the cumulative timing duration reaches the preset debouncing time and the new working state remains unchanged within the preset debouncing time, the microcontroller performs a state switching action and outputs the new working state as the final working state. The microcontroller synchronously triggers the voice broadcast action corresponding to the final working state. During the process where the cumulative timing duration of the debouncing timer has not reached the preset debouncing time, the microcontroller maintains the old working state unchanged to filter transient voltage fluctuations at the moment of state switching.

[0052] To further illustrate the technical solution of the present invention, the following provides a specific application embodiment of the electric vehicle charging gun status monitoring device during a complete charging cycle.

[0053] During the power-on standby phase, the microcontroller continuously collects control guidance signals after the electric vehicle charging gun status monitoring device is powered on. When the microcontroller calculates that the peak-to-peak value of the control guidance signal is less than the preset noise threshold and the voltage amplitude of the control guidance signal is within the preset first voltage range, the microcontroller determines that the current working state is standby. In the standby state, the microcontroller does not trigger the voice broadcast action.

[0054] During the plug-in response phase, the user plugs the electric vehicle charging gun into the electric vehicle's charging port. The microcontroller detects that the control guidance signal has changed into a pulse width modulation square wave signal in the preset second voltage range. The microcontroller starts the internal debounce timer. When the pulse width modulation square wave signal in the preset second voltage range continues for the preset debounce time without changing, the microcontroller switches its working state from standby to plugged-in state. The microcontroller also triggers a voice broadcast to indicate that the plugged-in state has been activated.

[0055] During the vehicle readiness response phase, the electric vehicle's internal circuitry completes a self-test and changes the control guidance signal state. The microcontroller detects that the control guidance signal has changed to a pulse width modulation square wave signal in the preset third voltage range. The microcontroller simultaneously acquires the filtered power value. When the filtered power value is less than or equal to a preset power threshold, the microcontroller starts its internal debounce timer. When the control guidance signal changes to a pulse width modulation square wave signal in the preset third voltage range and the filtered power value is less than or equal to the preset power threshold for a preset debounce time without changing, the microcontroller switches its operating state from the inserted state to the vehicle ready state. The microcontroller simultaneously triggers a voice announcement to indicate the vehicle ready state.

[0056] During the charging status response phase, the electric vehicle closes the charging circuit and begins to draw current. The microcontroller detects that the filtered power value is greater than the preset power threshold. The microcontroller switches its operating state from the vehicle ready state to the charging state. The microcontroller triggers a voice broadcast to indicate the charging status. The microcontroller drives the display peripheral to display the voltage data, current data, and filtered power value output by the power metering chip in real time. For the display panel selection and drive control logic programming of the display peripheral, those skilled in the art can build and burn the code according to the conventional peripheral development manual. The driver development of the display peripheral is a well-known technology in this field and will not be described in detail here.

[0057] During the unplug response phase, when the user unplugs the electric vehicle charging gun after charging is complete, the microcontroller detects that the control guidance signal has returned to a constant DC signal within the preset first voltage range. The microcontroller then starts the debounce timer inside the microcontroller. When the constant DC signal within the preset first voltage range continues for the preset debounce time without changing, the microcontroller switches its operating state from the charging state to the standby state.

[0058] During the resistance anomaly response phase, at any point in the complete charging process, when the microcontroller detects through the ground resistance measurement loop that the ground resistance value corresponding to the connection confirmation signal is not within the preset first resistance range and not within the preset second resistance range, the microcontroller will forcibly switch its working state to the resistance anomaly state, and the microcontroller will simultaneously trigger a voice broadcast action to prompt the resistance anomaly state.

[0059] During the voltage anomaly response phase, at any point in the complete charging process, when the microcontroller detects that the voltage amplitude of the control guidance signal does not belong to any of the preset first voltage range, the preset second voltage range, or the preset third voltage range, the microcontroller will forcibly switch its operating state to the voltage anomaly state, and the microcontroller will simultaneously trigger a voice broadcast action to indicate the voltage anomaly state.

[0060] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for monitoring the status of an electric vehicle charging gun, applied to an electric vehicle charging gun status monitoring device, the electric vehicle charging gun status monitoring device comprising a microcontroller, an energy metering chip, a non-volatile memory, and a signal conditioning circuit connected to the electric vehicle charging gun; characterized in that, The method includes: The microcontroller continuously samples the control guidance signal in batches through the signal conditioning circuit, determines the signal type of the control guidance signal based on the peak-to-peak value of the sampling sequence, and calculates the voltage amplitude of the control guidance signal. The microcontroller will write the gain calibration value read from the non-volatile memory into the gain calibration register of the power metering chip, and discard the effective value data of the power metering chip at the initial power-on stage for a preset number of cycles. The microcontroller acquires the current effective value reading of the power metering chip, and performs an adaptive amplitude limiting filter operation to obtain the filtered power value based on the threshold range of the relative deviation between the current effective value reading and the previous effective value output result. The microcontroller obtains the ground resistance value corresponding to the connection confirmation signal through the signal conditioning circuit, generates a new working state by combining the signal type, the voltage amplitude, the ground resistance value, and the filtered power value, and outputs the final working state after continuously debouncing for a preset time in the new working state.

2. The method for monitoring the status of an electric vehicle charging gun according to claim 1, characterized in that, The step of determining the signal type of the control guidance signal based on the peak-to-peak value of the sampling sequence includes: When the peak-to-peak value is less than a preset noise threshold, the microcontroller determines that the signal type is a constant DC signal; When the peak-to-peak value is greater than or equal to the preset noise threshold, the microcontroller determines that the signal type is a pulse width modulation square wave signal.

3. The method for monitoring the status of an electric vehicle charging gun according to claim 2, characterized in that, The calculation of the voltage amplitude of the control guidance signal includes: When the signal type is a constant DC signal, the microcontroller uses the physical voltage value mapped to the maximum voltage sample value in the sampling sequence as the voltage amplitude; When the signal type is a pulse width modulation square wave signal, the microcontroller uses the physical voltage value mapped by the maximum voltage sampling value as the voltage amplitude when the control guidance signal is in a high-level state, and uses an internal period counter to capture the level transition timestamp of the pulse width modulation square wave signal during the continuous batch sampling process, and calculates the frequency parameters and duty cycle parameters based on the level transition timestamp.

4. The method for monitoring the status of an electric vehicle charging gun according to claim 1, characterized in that, The gain calibration value read by the microcontroller from the non-volatile memory is pre-generated through the following steps: The microcontroller continuously reads the effective value output register of the power metering chip; When the relative deviation between two consecutive readings is less than a preset stability threshold, the microcontroller collects readings for a preset number of times and calculates the average effective value. The microcontroller divides the input target physical quantity value by a preset scaling factor to obtain the desired effective value. The microcontroller calculates the quotient of the expected effective value divided by the average effective value, subtracts one from the quotient to obtain the difference, multiplies the difference by two raised to the power of the resolution bits of the power metering chip gain calibration register, obtains the gain calibration value, and stores it in the non-volatile memory.

5. The method for monitoring the status of an electric vehicle charging gun according to claim 1, characterized in that, The process of performing adaptive amplitude limiting filtering to obtain the filtered power value includes: The microcontroller calculates the absolute value of the difference between the current effective value reading and the previous effective value output result, and divides the absolute value of the difference by the previous effective value output result to obtain the relative deviation; When the relative deviation is less than or equal to a preset first threshold, the microcontroller performs an exponential moving average smoothing operation to obtain the filtered power value. When the relative deviation is greater than the preset second threshold, the microcontroller directly uses the current effective value reading as the filtered power value and resets the internal trend counter to zero.

6. The method for monitoring the status of an electric vehicle charging gun according to claim 5, characterized in that, The step of performing adaptive amplitude limiting filtering to obtain the filtered power value also includes: When the relative deviation is greater than the preset first threshold and less than or equal to the preset second threshold, the microcontroller determines the current direction of change of the current effective value reading compared to the previous effective value output result, and determines whether the current direction of change is consistent with the historical direction of change. When the current change direction is consistent with the historical change direction, the microcontroller increments the trend counter, and when the trend counter reaches a preset number of consecutive confirmations, the current effective value reading is used as the filtered power value. When the current direction of change is inconsistent with the historical direction of change, the microcontroller resets the trend counter to zero and performs an exponential moving average smoothing operation to obtain the filtered power value.

7. The method for monitoring the status of an electric vehicle charging gun according to claim 1, characterized in that, The process of generating a new operating state by combining the signal type, voltage amplitude, ground resistance value, and filtered power value includes: When the resistance to ground is not within the preset first resistance range and not within the preset second resistance range, the microcontroller generates a new operating state representing an abnormal resistance. When the resistance to ground is within the preset first resistance range or the preset second resistance range, and the signal type is a constant DC signal and the voltage amplitude is within the preset first voltage range, the microcontroller generates a new working state representing standby. When the resistance to ground is within the preset first resistance range or the preset second resistance range, and the signal type is a pulse width modulation square wave signal and the voltage amplitude is within the preset second voltage range, the microcontroller generates a new working state representing the insertion. When the voltage amplitude does not belong to any of the preset first voltage range, the preset second voltage range, and the preset third voltage range, the microcontroller generates a new operating state representing a voltage anomaly.

8. The method for monitoring the status of an electric vehicle charging gun according to claim 7, characterized in that, The process of generating a new operating state by combining the signal type, voltage amplitude, ground resistance value, and filtered power value also includes: When the resistance to ground is within the preset first resistance range or the preset second resistance range, and the signal type is a pulse width modulation square wave signal and the voltage amplitude is within the preset third voltage range, the microcontroller compares the filtered power value with a preset power threshold. When the filtered power value is greater than the preset power threshold, the microcontroller generates a new working state representing charging. When the filtered power value is less than or equal to the preset power threshold, the microcontroller generates a new working state representing that the vehicle is ready.

9. The method for monitoring the status of an electric vehicle charging gun according to claim 1, characterized in that, The step of outputting the final working state after a preset debouncing time in the new working state includes: The microcontroller compares the new operating state with the currently maintained old operating state; When the new operating state differs from the old operating state, the microcontroller starts its internal debounce timer; When the cumulative duration of the debouncing timer reaches the preset debouncing time and the new working state remains unchanged within the preset debouncing time, the microcontroller outputs the new working state as the final working state. During the period when the cumulative duration of the debounce timer has not reached the preset debounce time, the microcontroller maintains the old working state as the final working state and outputs it.

10. A device for monitoring the status of an electric vehicle charging gun, characterized in that, include: Non-volatile memory, microcontrollers, power metering chips, and signal conditioning circuits; The microcontroller is electrically connected to the non-volatile memory, the power metering chip, and the signal conditioning circuit, respectively. The signal conditioning circuit is connected to the control guide terminal and the connection confirmation terminal of the electric vehicle charging gun. The non-volatile memory is used to store computer-executable instructions, which, when executed by the microcontroller, cause the microcontroller to implement the electric vehicle charging gun status monitoring method as described in any one of claims 1 to 9.