A peak-holding vehicle speed smoothing filtering method and system for tunnel lighting radar speed measurement
By adopting a peak-holding vehicle speed smoothing filter method in the tunnel lighting system, the safety and stability issues of tunnel radar speed measurement filtering technology have been solved, thus achieving the safety and stability of tunnel lighting, reducing hardware modification costs, and improving the real-time response capability of the system.
Patent Information
- Application Number
- CN202611225488.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-17
AI Technical Summary
Existing tunnel radar speed measurement and filtering technology cannot simultaneously address driving safety, lighting stability, hardware compatibility, and scene adaptability, resulting in lighting safety hazards, light flickering, and wasted hardware resources.
A peak hold type vehicle speed smoothing filter method is adopted, which distinguishes between real vehicle speed changes and noise by error threshold, locks the highest vehicle speed as the lighting control benchmark, and combines lightweight algorithm and closed-loop control logic to adapt to low-cost microcontroller hardware.
It has achieved safety and stability in tunnel lighting, eliminated the problem of dim lighting when fast and slow vehicles are mixed, reduced light flicker, lowered hardware modification costs, and improved the system's operational stability and real-time response capabilities.
Smart Images

Figure CN123124183A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tunnel intelligent lighting and millimeter-wave radar speed measurement data embedded preprocessing technology. Specifically, it relates to a peak-holding vehicle speed smoothing filtering method and system for tunnel lighting radar speed measurement, which is suitable for speed measurement preprocessing systems configured with 8-bit and 16-bit low-resource microcontrollers in highways, urban expressways, and mountain tunnels. Background Technology
[0002] Highway and urban expressway tunnels commonly employ vehicle-following energy-saving control schemes. These schemes utilize segmented millimeter-wave radars to collect vehicle speed data in real time. The lighting controller dynamically adjusts the brightness and coverage distance of lighting sections based on the real-time vehicle speed, reducing long-term energy consumption of tunnel lighting while ensuring driving safety. Existing preprocessing schemes for radar vehicle speed mainly fall into four categories: direct input of raw vehicle speed, moving average filtering, Kalman filtering, and radar bottom-level echo optimization. Each scheme suffers from drawbacks in simultaneously achieving safety, stability, and low-cost hardware compatibility. These are explained below, based on comparative patent documents obtained from the search.
[0003] Chinese patents CN110933824A and CN120659204A state that millimeter-wave radar directly transmits raw speed measurement data to the lighting controller without any noise reduction preprocessing logic. Multipath reflections from tunnel walls, airflow disturbances, and radar hardware errors can cause random fluctuations of ±5~10 km / h in the raw speed measurement data. In tunnels with mixed traffic of fast and slow vehicles, the speed data from low-speed vehicles directly lowers the baseline brightness of the lighting, posing a safety hazard of insufficient illumination when high-speed vehicles enter darkened sections. Small speed fluctuations continuously trigger the lamps' dimming action, and frequent flashing of the lights can easily cause driver fatigue and shorten the lamps' lifespan.
[0004] Existing moving average filtering schemes use a fixed-length sampling window to take the arithmetic mean of vehicle speed samples from multiple consecutive frames to achieve noise reduction. This scheme has inherent drawbacks: a fixed filtering delay exists, resulting in a lag in lighting brightness response during rapid vehicle acceleration; the peak vehicle speed at high speeds is attenuated by the average of lower-speed samples within the window, failing to retain the highest safe speed benchmark. This does not comply with the safety management principle of "better bright than dim" for tunnel lighting and is unsuitable for tunnel scenarios with mixed traffic of fast and slow vehicles.
[0005] Chinese patent CN117676951A achieves optimal vehicle speed estimation through state matrix iteration and extensive floating-point operations, theoretically resulting in high noise reduction accuracy. However, its drawbacks include high demands on embedded hardware computing power and memory resources for matrix operations and floating-point iteration, making it unsuitable for real-time operation on existing 8-bit and 16-bit low-cost lighting microcontrollers in tunnels; the algorithm logic follows instantaneous vehicle speed increases and decreases synchronously with speed decreases, lacking a peak lock-and-hold mechanism and failing to mitigate the risk of insufficient lighting for fast vehicles; and it does not set an error threshold to distinguish between radar noise and actual vehicle speed changes.
[0006] Chinese patents CN120491038A and 202510065872.X eliminate acquisition interference from the radar hardware echo and point cloud matching levels, respectively. They only optimize the accuracy of the original radio frequency signal and do not perform peak smoothing processing for time-series vehicle speeds. The solutions rely on high-end parallel hardware such as FPGA, resulting in high equipment modification costs. They do not incorporate filtering rules designed with specific safety constraints for tunnel lighting, and therefore cannot solve the problem of dimming lights when fast and slow vehicles are mixed.
[0007] In summary, the existing technology has the following main drawbacks: There are inherent safety hazards in driving: Traditional filtering logic adjusts synchronously with instantaneous vehicle speed. Low-speed data from slow vehicles directly reduces the lighting benchmark, which can easily lead to insufficient lighting brightness on high-speed vehicle sections, violating tunnel lighting safety regulations. Poor lighting stability: The lack of a threshold-based noise reduction mechanism means that small fluctuations in radar speed measurement continuously trigger dimming, and the problem of light flickering cannot be eliminated. Poor hardware compatibility: High-precision filtering algorithms have high computational load and high resource consumption, while lightweight filtering has defects such as peak attenuation and response delay. Neither of them can be adapted to existing low-cost lighting controllers. The system lacks a closed-loop logic for the scenario: no automatic reset process is designed for intermittent traffic conditions in tunnels, which may lead to problems such as state confusion, ineffective dimming, and energy waste during long-term operation. Summary of the Invention
[0008] To address the four major industry pain points of existing tunnel radar speed measurement filtering solutions—namely, lighting safety defects, light flicker, insufficient hardware computing power, and poor scene adaptability—this invention provides a peak-holding type vehicle speed smoothing filtering method and system for tunnel lighting radar speed measurement, thereby solving the following core technical challenges: 1. To address the issue of premature dimming of headlights when fast and slow vehicles are mixed, a peak speed locking mechanism is used to permanently retain the highest vehicle speed as the lighting control benchmark, thus implementing the "better bright than dim" safety standard for tunnel lighting; 2. To resolve the issue of frequent headlight flickering caused by radar random speed measurement noise, the system distinguishes between actual acceleration conditions and minor speed fluctuations by using an error threshold, and blocks invalid dimming commands. 3. To solve the problem that traditional complex filtering algorithms cannot be adapted to low-end MCUs, a lightweight architecture with pure numerical comparison logic is adopted, which can be deployed and run on existing lighting equipment without hardware upgrades; 4. To resolve the lag in response to dynamic changes in vehicle speed, the peak vehicle speed is updated instantaneously for situations of significant vehicle acceleration, ensuring the real-time dimming of lights that follow vehicle movement. 5. To resolve the issue of logical errors in the intermittent traffic and vehicle-free state in tunnels, a closed-loop process of automatic zeroing when no vehicle is present and automatic initialization when a vehicle arrives has been added, ensuring long-term stable operation of the system without accumulated errors.
[0009] The technical solution to achieve the objective of this invention is: A peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement includes the following steps: S1. System Initialization: After the device powers on and completes its self-test or resets after a timeout in the vehicle-free state, it clears all algorithm variables and sets the vehicle-free state flag s=0. It continuously monitors radar sampling data. When it detects the first raw vehicle speed vraw(k) that is greater than the effective vehicle speed lower limit vmin, it assigns the vehicle speed peak value vpeak=vraw(k), sets the state flag s=1, and enters the cyclic filtering process. S2, Periodic Sampling and Vehicle-Free Detection The filtering execution cycle synchronizes the sampling frequency of the millimeter-wave radar. In each cycle, the original vehicle speed vraw(k) output by the radar is read. If vraw(k)=0, it is determined that there are no vehicles passing through the tunnel, and the no-vehicle reset process is executed. If vraw(k)>vmin, it is determined that the driving speed measurement data is valid, and the vehicle speed threshold discrimination logic is entered. S3, Threshold judgment of vehicle speed change: Calculate the difference in speed between the current sampled vehicle speed and the peak value locked in the previous cycle, Δv(k) = vraw(k) − vpeak(k−1); configure a customizable error threshold err, with the following three-layer discrimination rules: Δv(k)≥err: This indicates that the vehicle has significantly accelerated and the peak vehicle speed needs to be updated. -err<Δv (k)<err: This is determined to be small-amplitude random speed measurement noise from the radar, and the original peak value remains unchanged. Δv (k)≤−err: This indicates that the vehicle has decelerated significantly. The low-speed value is not updated, and the historical high-speed peak value is locked. S4, Peak Update and Vehicle Speed Output: The peak vehicle speed vpeak(k) = vraw(k) is refreshed only when the vehicle is accelerating significantly; the peak value vpeak(k) = vpeak(k−1) of the previous cycle is inherited in scenarios such as vehicle deceleration and small radar noise fluctuations; the currently locked peak value is directly used as the filtered output vehicle speed vout(k) and sent to the lighting controller to complete the brightness adjustment of the corresponding section. S5, Automatic Reset When No Vehicle is Found: If vraw(k) = 0 for multiple consecutive filtering cycles and the cumulative duration reaches the preset vehicle-free determination threshold, it is determined that there are no vehicles in the tunnel; the flag s = 0 is set and the vpeak peak value variable is cleared; the system returns to the initialization waiting state, and when an effective vehicle speed is detected again, the peak value reference is automatically reconstructed to form a complete closed-loop control logic.
[0010] The algorithm of this invention adopts a lightweight embedded architecture: it sets only 4 sets of global variables to store the running state, and there are no multiplication, division, floating-point operations, or matrix iteration operations throughout the process. It only performs numerical comparison logic. The algorithm occupies less than 10 bytes of RAM and has a single-cycle CPU utilization rate of less than 1%. It is compatible with various 8-bit low-cost lighting microcontrollers such as 8051, AVR, and STM8S.
[0011] The core configurable parameters of the algorithm have the following ranges: error threshold err = 5~15km / h; effective vehicle speed lower limit vmin defaults to 4km / h; algorithm execution frequency 10~50Hz; vehicle-free determination time defaults to 100ms.
[0012] The core iterative logic formula of the algorithm is as follows: Initialization: vpeak = the first initial vehicle speed that satisfies vraw(k) > vmin, s = 1; Periodic iteration: if vraw(k) == 0: Reset s=0, vpeak is empty. elif Δv(k) ≥ err:vpeak(k) = vraw(k) else:vpeak(k) = vpeak(k−1) Output: vout(k) = vpeak(k) This invention discloses a peak-hold filtering control system for tunnel lighting radar speed measurement, comprising a millimeter-wave radar detector, an embedded lighting controller, and tunnel lighting fixtures. The embedded lighting controller incorporates the aforementioned peak-hold vehicle speed smoothing filtering method. The millimeter-wave radar is deployed in segments above the tunnel driving lanes to collect vehicle speed data in real time and upload it serially to the embedded controller. After performing filtering preprocessing on the raw speed measurement data, the controller outputs a stable and safe vehicle speed signal and dynamically adjusts the lighting range and output brightness of the lighting fixtures, achieving vehicle-following light control that balances safety and energy saving.
[0013] The beneficial effects of this invention are: 1. Eliminate safety hazards caused by mixed traffic of fast and slow vehicles and improve tunnel driving safety: This invention locks in the peak speed of vehicles, and the lighting maintains a high brightness standard during the slow vehicle traffic period. It will not dim the road lights in advance, fully meeting the mandatory safety requirement of "better bright than dim" for tunnel lighting, and avoiding traffic accidents caused by high-speed vehicles entering low-brightness areas.
[0014] 2. Completely suppress light flicker and extend lamp life: By filtering out the inherent speed measurement noise of radar at ±5~10km / h through the error threshold, invalid dimming actions are reduced by more than 80%, eliminating frequent switching between light and dark, alleviating driver visual fatigue, and reducing the wear and tear of lamp electronic components.
[0015] 3. Ultra-low hardware resource consumption and zero equipment modification cost: The algorithm relies only on simple numerical comparison logic, without the need for floating-point or matrix operations, and has a very small memory footprint. Existing 8 / 16-bit lighting controllers do not need to be replaced or upgraded. They can be deployed by directly burning the program. Large-scale tunnel renovation can save a lot of hardware procurement costs.
[0016] 4. Instantaneous response under acceleration conditions and excellent real-time dimming performance: Unlike the inherent delay of moving average filtering, the algorithm immediately refreshes the peak value when the vehicle accelerates significantly, and the lighting brightness increases synchronously and quickly. The changes in vehicle speed are followed without lag, and the control of the lights following the vehicle's movement is more precise.
[0017] 5. Parameters are adaptive and adjustable to adapt to all types of tunnel scenarios: Error threshold, sampling frequency, and vehicle-free determination time can all be flexibly configured according to radar model, tunnel road grade, and traffic flow characteristics, adapting to all application scenarios such as long highway tunnels, short urban tunnels, and mountain fog tunnels.
[0018] 6. Closed-loop vehicle-free reset logic ensures stable and reliable long-term operation: Peak states are automatically cleared during vehicle-free periods to avoid unnecessary energy consumption caused by retaining outdated high-speed peak values in empty tunnels for extended periods; the base speed is automatically initialized when a vehicle re-enters the tunnel, with no state confusion or error accumulation. Attached Figure Description
[0019] Figure 1 is a flowchart of the overall algorithm of the peak-preserving vehicle speed smoothing filtering method for tunnel lighting radar speed measurement of the present invention. Figure 2 This is a detailed flowchart of the branch logic of the present invention; Figure 3 This is a simplified summary diagram of the algorithm logic of this invention. Detailed Implementation
[0020] Example 1: Mixed traffic of fast and slow vehicles in a long highway tunnel Implementation scenario: A 2km long highway tunnel, segmented millimeter-wave radar sampling frequency of 20Hz, single filter period of 50ms; the lighting controller adopts STM8S003 8-bit low-power microcontroller; algorithm configuration parameters: err=10km / h, vmin=4km / h, vehicle-free determination time of 100ms.
[0021] Operation process: t=0s: The radar acquires the first frame of effective vehicle speed of 120km / h, the system initializes vpeak=120km / h, outputs vehicle speed of 120km / h, and the lights in the corresponding section of the tunnel are turned on at full power; t=1s: The vehicle enters the radar detection area at a slow speed. The original speed is 60km / h. Δv=60−120=−60km / h<−10km / h, which is judged as a significant deceleration. vpeak remains unchanged at 120km / h, and the lighting brightness does not decrease. t=2s: The high-speed vehicle passes the radar again. The original speed is 122km / h, Δv=2km / h, which is between -10 and 10km / h. It is judged as noise fluctuation. The peak speed remains at 120km / h, and the lights are stable without change.
[0022] Actual test results: There was no dimming of lights throughout the entire process, the lighting was safe and sufficient for fast traffic, and there was no frequent dimming or flickering.
[0023] Example 2: Radar speed measurement noise suppression operation Radar continuously sampled the original vehicle speed sequence: 108, 112, 105, 115, 110, 113, 109, 111 km / h, with noise fluctuations of ±7 km / h, less than err=10 km / h.
[0024] Algorithm operation logic: The first frame is assigned an initial peak value of 108km / h. All subsequent fluctuations in the sampled values are judged as radar noise. The output is consistently and stably 108km / h without any slight dimming action, and the brightness of the light remains constant.
[0025] Example 3: Automatic Reset of Closed-Loop Operating Condition Without Vehicle During the gaps in the tunnel traffic flow, if the radar sampling vraw(k) = 0 for 3 consecutive frames and the cumulative duration is 150ms, exceeding the 100ms judgment threshold, the system sets s = 0, clears the vpeak variable, and the lighting system switches to the basic low brightness energy-saving mode. 5 seconds later, a vehicle enters, the radar outputs an effective vehicle speed of 85km / h, the system automatically initializes vpeak = 85km / h, and the lighting brightness is increased synchronously. The logic switching is done without manual intervention and without state confusion.
Claims
1. A peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement, characterized in that, Includes the following steps: S1. System initialization: After the device is powered on or reset when there is no vehicle, clear all variables and set the no-vehicle status flag s=0; when the first raw vehicle speed vraw(k) greater than the effective vehicle speed lower limit vmin is detected, assign the vehicle speed peak vpeak to the first effective raw vehicle speed and set the status flag s=1. S2. Periodic sampling and vehicle-free determination: The current raw vehicle speed vraw(k) collected by the millimeter-wave radar is read in each filtering cycle; if vraw(k)=0, it is determined to be a vehicle-free condition, and the vehicle-free reset process is executed. If vraw(k) > vmin, it is determined to be a valid vehicle speed, and the vehicle speed threshold discrimination step is entered. S3. Vehicle speed change threshold judgment: Calculate the change in current vehicle speed relative to the peak value of the previous cycle Δv(k) = vraw(k) − vpeak(k−1); preset error judgment threshold err, judgment rules are as follows: When Δv(k)≥err, it is determined to be a real and significant increase in vehicle speed; When −err<Δv (k)<err, it is determined to be a small random noise fluctuation of the radar; When Δv(k)≤−err, it is determined that the vehicle speed has dropped significantly; S4, Peak Update and Vehicle Speed Output: If the increase in vehicle speed is determined to be real and significant, then update the current period's peak vehicle speed vpeak(k) = vraw(k); If the radar noise fluctuation is determined to be small or the vehicle speed drops significantly, then the current cycle vehicle speed peak value vpeak(k) = vpeak(k−1) is maintained. The filtered output vehicle speed vout(k) is assigned the current peak vehicle speed vpeak(k) and output to the tunnel lighting controller for brightness adjustment; S5. Automatic Reset When No Vehicle Detection: If vraw(k)=0 is detected for multiple consecutive cycles and the preset no vehicle detection time is reached, the status flag s=0 is set, the vehicle speed peak vpeak is cleared, the system returns to the initialization state, and waits for the next valid vehicle speed input.
2. The peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement according to claim 1, characterized in that, The method uses only 4 global variables to complete all calculations, performs only numerical comparison logic, and has no floating-point operations or matrix iteration operations. The algorithm occupies less than 10 bytes of RAM and can run directly on 8-bit and 16-bit embedded MCUs.
3. The peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement according to claim 1, characterized in that, The error discrimination threshold err ranges from 5 to 15 km / h, the effective vehicle speed lower limit vmin defaults to 4 km / h, and the filtering algorithm execution frequency is adapted to the radar sampling rate, ranging from 10 to 50 Hz.
4. The peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement according to claim 1, characterized in that, The peak vehicle speed is only updated when the vehicle accelerates significantly or the speed increase exceeds err; the highest historical peak vehicle speed is locked for scenarios such as vehicle speed decrease or small fluctuations in speed measurement noise.
5. The peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement according to claim 1, characterized in that, The default time for determining the absence of vehicles is set to 100ms. In the absence of vehicles, the peak value variable is cleared to eliminate the false dimming behavior during the absence of vehicles. When a valid vehicle speed is detected again, the peak value is automatically initialized to form a closed-loop filter control process.
6. The peak-holding vehicle speed smoothing filtering method for tunnel lighting radar speed measurement according to claim 1, characterized in that, The core logic formula for the complete algorithm iteration is: Initialization: vpeak = the first initial vehicle speed that satisfies vraw(k) > vmin, s = 1; Periodic iteration: if vraw(k) == 0: Reset s=0, vpeak is empty. elif Δv(k) ≥ err:vpeak(k) = vraw(k) else:vpeak(k) = vpeak(k−1) Output: vout(k) = vpeak(k).
7. A peak value hold filter control system for tunnel lighting radar speed measurement, characterized in that, The system includes a millimeter-wave radar detector, an embedded lighting controller, and tunnel lighting fixtures; the embedded lighting controller incorporates the peak-holding vehicle speed smoothing filtering method described in any one of claims 1 to 6; the millimeter-wave radar collects vehicle speed data in real time and uploads it to the embedded lighting controller, which outputs a stable vehicle speed signal after filtering and preprocessing, and dynamically adjusts the brightness and lighting range of the tunnel lighting fixtures.
Citation Information
Patent Citations
Tunnel intelligent lighting energy-saving control system and method based on traffic situation awareness
CN110933824A
Tunnel intelligent dimming method and system based on Kalman filtering algorithm
CN117676951A
Vehicle-mounted connector copper alloy strip and preparation method thereof
CN119464827A
Intelligent traffic-oriented in-tunnel high-precision radar speed measurement method
CN120491038A
Accompanying type tunnel lighting control method considering human, vehicle and road environment
CN120659204A
