A book-like printer color mark window self-adapting mark searching control system and method

CN122673784APending Publication Date: 2026-09-01JIANGXI LINGDE INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611075503.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

固定窗口无法应对印刷中张力波动或速度变化导致的色标位置偏移,当色标到达时间偏离窗口范围时,信号被屏蔽造成漏检;窗口内若混入相邻色标或噪声,则误识别

Benefits of technology

本发明中,通过传感器接收脉冲并记录相邻色标到达时间,调用滑动平均法生成周期间隔预测值,与理论时刻相减得单次偏差值,该时序预测消弭随机测量误差,使周期特征更稳定。将预测值与理论间隔的周期偏差量乘以比例系数得前移补偿量,与单次偏差值组合构成判别特征集,通过最近邻分类器输出模式标签,区分正常波动、持续偏移或突发扰动。对标签序列采用游程检验,通过后累加单次偏差值得总偏差累积量,基于总偏差累积量计算前移总量,借统计显著性确认趋势真实性,避免噪声引发误调。再对总偏差累积量和前移总量分别比较,进行与运算得严重程度标志,融合多维信息为单一指标,实现色标窗口位置和寻标动作的自适应调整。整体而言,该逻辑在速度波动、间距变化等工况下准确定位色标,提升抗干扰能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122673784A_ABST
    Figure CN122673784A_ABST
Patent Text Reader

Abstract

This invention relates to the field of pattern recognition technology, specifically to an adaptive color mark window tracking control system and method for a book-type printer. The system includes a pulse signal acquisition module, a periodic feature extraction module, a deviation pattern discrimination module, a cumulative trend analysis module, and a pattern recognition output module. In this invention, the arrival time of the color mark is recorded by a sensor. A moving average method is used to generate interval prediction values, which are subtracted from the theoretical time to obtain the single-time deviation to eliminate random errors. The predicted periodic deviation is multiplied by a proportional coefficient to obtain the forward shift compensation. These two values ​​are combined and processed by a nearest neighbor classifier to output pattern labels to distinguish various disturbances. After performing a run test on the label sequence, the total deviation and the total forward shift are accumulated. Statistical significance is used to prevent misadjustment. The two values ​​are compared and ANDed to obtain a severity indicator. By integrating various feature information, the color mark window and tracking action are adaptively adjusted, improving the accuracy of color mark positioning and anti-interference capabilities under varying operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pattern recognition technology, and in particular to an adaptive color mark window tracking control system and method for a book printer. Background Technology

[0002] Pattern recognition technology encompasses the processing and analysis of various forms of information representing things or phenomena to describe, identify, classify, and interpret them. This field is a crucial component of information science and artificial intelligence. Its core lies in using computers to identify and classify a set of events or processes. The identified events or processes can be concrete objects such as text, sound, and images, or abstract objects such as states and degrees. A complete pattern recognition system essentially consists of three parts: data acquisition, data processing, and classification decision-making. Specifically, a typical pattern recognition system includes data acquisition, preprocessing, feature extraction and selection, classifier design, and classification decision-making. Pattern recognition technology has been widely applied in fields such as artificial intelligence, robotics, system control, and remote sensing data analysis. In industrial automation, it is commonly used for scenarios such as parts classification and item classification.

[0003] The adaptive color mark tracking control system for book and magazine printers refers to a system used in book and magazine printers that achieves tracking control by detecting and recognizing printed color mark signals. The system addresses the technical aspects of color mark signal detection and recognition during the printing process, the setting and adaptive adjustment of the color mark window, and tracking control based on color mark identification. Specifically, the system uses photoelectric sensors to detect the contrast difference between the printed color mark and other areas on the substrate, converting the physical quantity into an electrical signal; it defines an interval before and after a reference position as the color mark window, shielding all color mark signals outside the window; within the color mark window, it selects the optimal signal by comparing the deviations of each signal from the reference position; and it outputs control signals based on the color mark detection results to drive the printer to perform positioning actions.

[0004] Existing technology uses a fixed color mark window, shielding all signals outside the window and selecting signals only based on single deviations within the window. This fixed window cannot handle color mark position shifts caused by tension fluctuations or speed changes during printing. When a color mark arrives outside the window range, the shielded signal causes missed detection; if adjacent color marks or noise are mixed in within the window, misidentification occurs. Relying solely on single deviation comparisons cannot distinguish between random noise and systematic shifts. Dust on the sensor surface or uneven material reflectivity can directly output abnormal deviations, leading to a gradual accumulation of positioning errors. The system lacks deviation pattern recognition capabilities, unable to determine whether the deviation is periodic fluctuation or continuous drift. The window position cannot adaptively shift forward or backward, resulting in increased cumulative errors over long-term operation and exceeding registration accuracy limits. For example, during high-speed printing, continuous unidirectional shifts occur. While the fixed window detects signals at the edge, the lack of trend discrimination leads to insufficient compensation, ultimately causing the color mark to exceed the window, triggering a shutdown and reducing efficiency. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose an adaptive color mark window tracking control system and method for a book printer.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: A color mark window adaptive tracking control system for a book printer includes: The pulse signal acquisition module is used to receive pulses and record the time through the sensor, obtain the arrival time of adjacent color mark pulses, and transmit them to the periodic feature extraction module. The periodic feature extraction module is used to obtain the periodic interval prediction value by calling the moving average method on the arrival time of the adjacent color mark pulses, subtract the theoretical time to obtain the single deviation value, combine them into a periodic feature vector and transmit it; The deviation pattern discrimination module is used to obtain the period deviation amount by subtracting the predicted period interval from the theoretical standard interval in the period feature vector, multiplying it by the proportional coefficient to obtain the forward compensation amount, and forming a discrimination feature set with the single deviation value. The module then calls the nearest neighbor classifier to classify the pattern label and passes the pattern label and the single deviation value to the cumulative trend analysis module. The cumulative trend analysis module is used to compare the sequence composed of multiple pattern labels and call the run test method to test it. If it passes, the total cumulative deviation of the single deviation value is accumulated, the total forward shift is calculated based on the total cumulative deviation, and the combination is used to form a trend feature and transmit it. The pattern recognition output module is used to compare the total cumulative deviation and the total forward shift in the trend features respectively, perform AND operation to obtain the severity indicator, and merge them into the final pattern recognition result.

[0007] As a further embodiment of the present invention, the pulse signal acquisition module includes the arrival time of adjacent color mark pulses and time recording; the periodic feature extraction module includes the periodic interval prediction value, single deviation value, and periodic feature vector; the deviation pattern discrimination module includes the periodic deviation amount, forward compensation amount, discrimination feature set, and pattern label; the cumulative trend analysis module includes the total cumulative deviation amount, the total forward shift amount, and trend features; and the pattern recognition output module includes the severity flag and the final pattern recognition result.

[0008] As a further aspect of the present invention, the pulse signal acquisition module includes: The pulse timing submodule acquires the pulse received by the sensor, reads the timer count value register to obtain the original count value when the pulse rises to interrupt the response, calls the reference count value stored at the system startup time and performs subtraction with the original count value to obtain the relative count value, multiplies the relative count value with the timer resolution parameter to generate a microsecond offset, and stores the offset in the sequence according to the pulse arrival order to generate a time offset value sequence; The interval extraction submodule, based on the time offset value sequence, sets the loop variable i to increment from 0 to the sequence length minus 2. Within the loop, it obtains the offset values ​​at index i and index i plus 1 in the sequence, subtracts the offset value at index i from the offset value at index i plus 1 to obtain the interval value, converts the interval value into floating-point data and appends it to the interval list. After the loop ends, the interval list is the pulse interval sequence, generating the arrival time of adjacent color mark pulses.

[0009] As a further aspect of the present invention, the periodic feature extraction module includes: The color mark acquisition submodule acquires the arrival time of the adjacent color mark pulses. The pulse output by the photoelectric sensor is shaped by a Schmitt trigger and then input into a timer to capture the rising edge time. It is recorded as a double-precision floating-point number and continuously acquired until the window length is reached. The sliding window length value is set to obtain the pulse arrival time sequence. The moving average submodule calculates the difference between adjacent time points based on the pulse arrival time series to generate a periodic interval sequence. It takes the five most recent interval values, sums them, divides them by five, and performs a moving average calculation. If the interval sequence length is less than five, it uses all available interval values ​​to calculate the arithmetic mean and generates a periodic interval prediction value. The difference calculation submodule calls the predicted value of the period interval, reads the standard value of the theoretical period interval from the equipment parameters, performs a subtraction operation by subtracting the standard value from the predicted value according to the period sequence number to obtain the signed deviation, and arranges and saves the deviation value according to the period sequence number to obtain the single deviation value. The sequence combination submodule concatenates the single deviation values ​​into a one-dimensional array in a periodic order. After each new deviation value is obtained, the oldest deviation value in the array is removed and a new deviation value is added to the end. The array length remains constant, and the array elements are the deviation values. The combination forms a periodic feature vector.

[0010] As a further aspect of the present invention, the deviation mode discrimination module includes: The deviation calculation submodule is based on the periodic feature vector. It calls the predicted value of the periodic interval and the theoretical standard interval value, performs a numerical subtraction operation on the two, and generates the periodic deviation. The feature combination submodule obtains a proportional coefficient for the periodic deviation amount, performs a multiplication operation on the periodic deviation amount to obtain a forward compensation amount, and combines the single deviation value with the forward compensation amount to form a discriminative feature set. The pattern classification output submodule calls the nearest neighbor classifier to perform distance comparison calculations between the discriminative feature set and the sample library labels, outputs matching category labels, and generates pattern labels.

[0011] As a further aspect of the present invention, the cumulative trend analysis module includes: The sequence comparison test submodule obtains a sequence composed of multiple pattern labels, performs similarity and difference comparisons on adjacent labels in the sequence and records the comparison results for each comparison. It calls the run test method to count the number of runs in the sequence and compares the number of runs with the critical run value calculated based on the total number of labels. If the number of runs is within the critical run value range, the test is deemed to have passed and a pattern difference run test value is generated. The deviation accumulation calculation submodule determines that the sequence passes the test based on the pattern difference run test value, calls the single deviation value at the corresponding position, adds up each single deviation value one by one to calculate the total deviation accumulation; The forward trend combination submodule calls the total cumulative deviation and the number of sequence sample points to perform a division operation to obtain the unit deviation mean. The unit deviation mean is multiplied by the set number of periods to obtain the forward total. The total cumulative deviation and the forward total are combined into a binary data vector to obtain the trend feature.

[0012] As a further aspect of the present invention, the pattern recognition output module includes: The deviation comparison submodule obtains the total cumulative deviation and the total forward shift in the trend feature, compares the total cumulative deviation value with a preset deviation threshold, compares the total forward shift value with a preset displacement threshold, sets the corresponding over-limit flag bit based on the two comparison results, and generates the over-limit flag bit. The severity calculation submodule calls the over-limit flag bit and performs a logical AND operation on the over-limit flag bit corresponding to the total deviation accumulation and the over-limit flag bit corresponding to the total forward shift. When both flag bits are in the over-limit state at the same time, the output state value is true; otherwise, the state value is false, and the severity flag is obtained. The result merging and output submodule calls the severity flag, combines the severity flag with the total cumulative deviation value and the total forward shift value in the trend feature to form a triplet data vector, and generates the final pattern recognition result.

[0013] An adaptive color mark window control method for a book printer includes the following steps: S1: Receive pulse signals through sensors and obtain the arrival time of adjacent color mark pulses based on the arrival time of adjacent pulses; S2: Based on the arrival time of the adjacent color mark pulses, the moving average method is used to calculate the predicted value of the period interval, and the single deviation value is obtained by subtracting it from the theoretical time. The predicted value of the period interval and the single deviation value are combined into a period feature vector. S3: Based on the periodic feature vector, the predicted periodic interval is subtracted from the theoretical standard interval to obtain the periodic deviation, which is multiplied by the proportional coefficient to obtain the forward compensation amount. This, along with the single deviation value, constitutes a discriminative feature set. The discriminative feature set is then input into the nearest neighbor classifier to perform pattern classification and obtain the pattern label. The pattern label and the single deviation value are then called. S4: Perform trend testing based on the sequence composed of multiple pattern labels using the run-length test method. After passing the test, accumulate the total accumulated deviation value of each single deviation value. Calculate the total forward shift based on the total accumulated deviation value. Combine the total accumulated deviation value and the total forward shift value to form a trend feature. S5: Based on the total cumulative deviation and the total forward shift in the trend features, compare them with preset thresholds respectively, obtain the severity flag through AND operation, and output the severity flag as the final pattern recognition result.

[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, a sensor receives pulses and records the arrival times of adjacent color marks. A moving average method is used to generate a predicted periodic interval. This predicted interval is subtracted from the theoretical time to obtain a single-time deviation value. This time-series prediction eliminates random measurement errors, making the periodic characteristics more stable. The periodic deviation between the predicted value and the theoretical interval is multiplied by a proportional coefficient to obtain a forward shift compensation amount. This compensation amount is combined with the single-time deviation value to form a discriminative feature set. A nearest neighbor classifier outputs pattern labels to distinguish between normal fluctuations, continuous shifts, or sudden disturbances. A run-length check is applied to the label sequence. The total accumulated deviation value is calculated by summing the single-time deviation values. The total forward shift is calculated based on the total accumulated deviation, and statistical significance is used to confirm the trend's authenticity, avoiding misadjustment caused by noise. The total accumulated deviation and the total forward shift are then compared separately, and a severity indicator is obtained by AND operation. This integrates multi-dimensional information into a single indicator, enabling adaptive adjustment of the color mark window position and the target-seeking action. Overall, this logic accurately locates color marks under conditions such as speed fluctuations and spacing changes, improving anti-interference capabilities. Attached Figure Description

[0015] Figure 1 This is a system flowchart of the present invention; Figure 2 This is a flowchart of the system sub-modules of the present invention; Figure 3 This is a flowchart of the method steps of the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0017] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0018] Please see Figure 1 An adaptive color mark window tracking control system for a book printer includes: The pulse signal acquisition module is used to receive pulses and record the time through the sensor, obtain the arrival time of adjacent color mark pulses, and transmit them to the periodic feature extraction module. Pulse signal: usually refers to the instantaneous change of electrical signal, which can be accurately detected at high frequencies.

[0019] The periodic feature extraction module is used to obtain the periodic interval prediction value by calling the moving average method on the arrival time of adjacent color mark pulses, subtract the theoretical time to obtain the single deviation value, combine them into a periodic feature vector and transmit it; Predicted period interval: The average time interval is calculated by analyzing the arrival times of multiple consecutive pulses and using the moving average method.

[0020] The deviation pattern discrimination module is used to obtain the periodic deviation by subtracting the predicted periodic interval from the theoretical standard interval in the periodic feature vector, multiplying it by the proportional coefficient to obtain the forward compensation amount, and forming a discrimination feature set with the single deviation value. The module calls the nearest neighbor classifier to classify the pattern label and passes the pattern label and the single deviation value to the cumulative trend analysis module. Proportional coefficient: Generally used to adjust the degree of influence of the deviation so that the dynamic characteristics of the system can be taken into account when calculating the compensation.

[0021] The cumulative trend analysis module is used to compare sequences composed of multiple pattern labels and call the runs test. If the test is successful, the total cumulative deviation of the single deviation value is accumulated. The total forward shift is calculated based on the total cumulative deviation, and the combination is used to form a trend feature and then transmitted. Runs test: A statistical test method that can effectively analyze trend changes in a data sequence.

[0022] The pattern recognition output module is used to compare the total cumulative deviation and the total forward shift in the trend features, perform AND operations to obtain the severity indicator, and merge them into the final pattern recognition result.

[0023] Severity flag: This is usually an identifier used to indicate the severity of the abnormal state in order to facilitate subsequent processing.

[0024] The pulse signal acquisition module includes the arrival time of adjacent color mark pulses and time recording; the periodic feature extraction module includes the predicted value of periodic interval, single deviation value, and periodic feature vector; the deviation pattern discrimination module includes the periodic deviation amount, forward compensation amount, discrimination feature set, and pattern label; the cumulative trend analysis module includes the total cumulative deviation amount, the total forward shift amount, and trend features; and the pattern recognition output module includes the severity flag and the final pattern recognition result.

[0025] Please see Figure 2 The pulse signal acquisition module includes: The pulse timing submodule receives pulses from a color mark sensor installed at the color mark detection station of the printing press. Each time a color mark passes over a printed sheet, it generates an electrical pulse. After system power-on, the microcontroller's timer counts freely at a fixed clock frequency. The count value register is 32 bits. After a short delay at the end of the initialization program, the count value is read as a reference count value and stored in a global variable. When the rising edge of the first color mark pulse arrives, the timer capture interrupt service routine immediately reads the current count value from the capture register, then calls the reference count value to perform a subtraction operation to obtain the relative count value. Next, it calls the timer resolution parameter and performs a multiplication operation with the relative count value to obtain the offset. This offset is appended to the end of the dynamic array. Subsequent pulses... Each time a pulse arrives, the above read, subtraction, multiplication, and append operations are repeated. For example, the original count value of the first pulse is subtracted from the base count value and then multiplied by 1 microsecond resolution to obtain an offset of 1280 microseconds. The second pulse is processed in the same way, and finally a time offset value sequence is generated. This sequence is the output result of this submodule. The multiplication formula involved is that the offset is equal to the relative count value multiplied by the timer resolution. The relative count value is obtained by subtracting the base count value from the original count value. The timer resolution is determined by the timer clock period. The operation logic is to eliminate the difference in system startup time by subtraction and then multiply by the resolution to convert the count value into absolute time. The advantage of this formula is that it can directly obtain the microsecond-level time offset through simple multiplication and the operation speed is extremely fast.

[0026] The interval extraction submodule, based on the aforementioned time offset value sequence, sets the loop variable i to increment from 0 to the sequence length minus 2. Within each loop, it first obtains the offset value at sequence index i, then obtains the offset value at index i plus 1, subtracts the offset value at index i plus 1 from the offset value at index i, and performs a subtraction operation to obtain the difference. This difference is converted into a double-precision floating-point number and appended to the interval list. After the loop ends, a pulse interval sequence is obtained. For example, the first two offset values ​​are subtracted to obtain 1024.0 microseconds as the first interval value, and the same value is obtained in subsequent iterations. Finally, the interval list contains multiple intervals of 1024.0 microseconds. Each value in this sequence represents the time interval between the arrival of adjacent color mark pulses. The subtraction operation formula involved is that the interval is equal to the offset index i plus 1 minus the offset index i. The offset index i and the offset index i plus 1 are taken from the i-th and i+1-th elements in the time offset value sequence, respectively. The operation logic is to eliminate the absolute time base by subtracting adjacent offsets and only retain the time difference. The advantage of this formula is that only one subtraction is needed to obtain the accurate interval without other operations.

[0027] Please see Figure 2 The periodic feature extraction module includes: The color mark acquisition submodule obtains the arrival time of adjacent color mark pulses. In specific implementation, the same microcontroller timer is used to capture the rising edge of the color mark sensor pulses and record it as a double-precision floating-point microsecond value. Acquisition continues until the sliding window length is set to 5 pulses. The rising edge of each pulse is captured sequentially and stored in an array. For example, the first pulse is 1280.0 microseconds, the second is 2304.0 microseconds, the third is 3328.0 microseconds, the fourth is 4352.0 microseconds, and the fifth is 5376.0 microseconds, resulting in a pulse arrival time sequence. This sequence is the output of this submodule. The acquisition process uses the timer capture mode to directly record the count value and convert it to microseconds without any additional formula calculations. This sequence will be used for subsequent period interval calculations.

[0028] The moving average submodule calculates the difference between adjacent time points based on the pulse arrival time series, generating a periodic interval series. If the sequence length is less than the sliding window length, all available interval values ​​are used. For example, when the sequence length is 5, four interval values ​​are generated, all of which are 1024.0 microseconds. All interval values ​​are summed to obtain 4096.0 microseconds, and then divided by the number of intervals (4) to calculate the arithmetic mean, which is 1024.0 microseconds. This arithmetic mean is output as the predicted value of the periodic interval. The arithmetic mean formula involved is that the predicted value is equal to the sum of all interval values ​​divided by the number of intervals. The summation symbol indicates that all elements in the sequence are accumulated. The operation logic is to add all interval values ​​and then divide by the number of intervals. The advantage of this formula is that it stabilizes the periodic estimation through averaging.

[0029] The difference calculation submodule calls the predicted period interval value of 1024.0 microseconds output by the moving average submodule, reads the theoretical period interval standard value of 1000.0 microseconds from the device parameter storage area. This standard value is calculated from the color mark spacing and the belt speed. The predicted value is subtracted from the standard value to obtain the signed deviation of 24.0 microseconds. The deviation is saved to the corresponding position in the array according to the current period number to obtain the single deviation value. The subtraction formula involved is that the deviation equals the predicted value minus the standard value. The operation logic is to calculate the offset between the actual period and the theoretical period. The advantage of this formula is that it directly quantifies the degree of period deviation.

[0030] The sequence combination submodule concatenates the single deviation values ​​into a one-dimensional array in cyclical order. The array length remains constant, for example, 10 elements. After each new deviation value, such as 24.0 microseconds, the oldest element in the array is removed and the new deviation value is added to the end, forming a cyclical feature vector. Each element in this vector represents the single deviation value of the corresponding period. In actual trend analysis, the deviation values ​​of the most recent 5 periods can be extracted from this vector as needed for cumulative calculation (in this example, the most recent 5 values ​​are used).

[0031] Please see Figure 2 The deviation pattern discrimination module includes: The deviation calculation submodule is based on the periodic feature vector and directly uses the current single deviation value of 24.0 microseconds output by the difference calculation submodule as the periodic deviation amount. This periodic deviation amount variable is used for subsequent forward compensation calculation.

[0032] The feature combination submodule retrieves a proportionality coefficient of 0.5 from the storage area for the 24.0 microsecond periodic deviation. This proportionality coefficient was determined through prior debugging: it is calculated by dividing the deviation of the current cycle (the difference between the predicted interval and the theoretical interval) by the actual forward movement in the next cycle (the difference between the actual position of the color mark detected by the external encoder and the theoretical position) over 20 consecutive cycles, and taking the arithmetic mean of these 20 ratios as the proportionality coefficient. If the actual forward movement cannot be directly measured, the coefficient can be tuned by trial and error to minimize the false alarm rate under normal operating conditions. The periodic deviation is multiplied by the proportionality coefficient to obtain a forward movement compensation of 12.0 microseconds. The single deviation value of 24.0 microseconds and the forward movement compensation of 12.0 microseconds are then combined to form a discriminative feature set. The multiplication formula involved is that the forward movement compensation equals the periodic deviation multiplied by the proportionality coefficient. The calculation logic estimates the impact of the deviation on subsequent cycles proportionally. The advantage of this formula is that the forward movement compensation amplitude can be flexibly adjusted through the coefficient.

[0033] The pattern classification output submodule performs nearest neighbor classification on the discriminant feature set [24.0, 12.0]. It reads the feature vectors and labels of each sample from the sample library and calculates the Euclidean distance between the discriminant feature set and each sample feature set. In this embodiment, Euclidean distance is used as the distance metric for the nearest neighbor classifier. Those skilled in the art will understand that Manhattan distance, Chebyshev distance, or Mahalanobis distance can also be used in other embodiments, and an appropriate K value can be selected based on the number of samples. In this embodiment, K=3 is used to reduce the impact of single-point noise on the classification results, while avoiding excessively large K values ​​that could lead to blurred boundaries. Those skilled in the art can adjust the K value according to the sample size and the desired false alarm rate. All adjustments fall within the protection scope of this invention and are within the protection scope of the nearest neighbor classifier disclosed in this invention. For example, the distance to the sample "normal" [20.0, 10.0] is approximately 4.472, and the distance to the sample "deviation" [25.0, 12.0] is 1.0. The sample label "deviation" with the smallest distance is selected as the matching category label, and the pattern label is output. This comparison process involves Euclidean distance calculation and minimum value selection.

[0034] The sample library can be established using conventional methods in the field. Specifically, during the equipment debugging phase, color mark pulse data is collected under different operating conditions (such as normal belt feeding, speed fluctuations, and tension changes), and the actual registration deviation is recorded as a reference benchmark. The corresponding pattern categories (e.g., "normal," "deviation," "disturbance," etc.) are manually labeled according to the deviation amplitude and direction, and the discriminative feature set (single deviation value, forward compensation amount) and labels are stored in the database. The number of samples is generally no less than 50 for each pattern to ensure classifier stability. For different machine models or different paper materials, the sample library can be re-collected and updated. During the system cold start phase, if there are no historical samples, a simple rule based on a fixed threshold can be used as a temporary classifier, automatically switching to the nearest neighbor classifier after sufficient samples have been accumulated.

[0035] Please see Figure 2 The cumulative trend analysis module includes: The sequence comparison test submodule acquires a sequence composed of multiple pattern labels, such as [deviation, deviation, normal, normal, deviation]. It compares adjacent labels starting from the beginning; if they are the same, a value of 1 is assigned; otherwise, a value of 0 is assigned, resulting in the comparison result sequence [1, 0, 1, 0]. The number of runs, i.e., the number of consecutive segments with the same value, is counted as 3. The significance level α for the runs test is typically 0.05 or 0.01, which is a common choice for statistical tests; this embodiment uses α=0.05. The critical run value is obtained from the standard runs test critical value table based on the total number of sample labels n (i.e., the length of the pattern label sequence). For n=5, the critical run interval is [1,5] when α=0.05; for other n values, the standard runs distribution table can be consulted or an approximate formula can be used for calculation. When the sequence length changes dynamically, the system looks up the corresponding critical interval in real time based on the current sequence length to ensure the effectiveness of the test. The critical run number interval is obtained as [1, 5]. The run number 3 is compared with this interval. 3 is not on the boundary 1 or 5, so the test is deemed to pass (that is, when the run number is 1 or 5, it is considered that there is a clear trend and the test is deemed to fail). The pattern difference run test value is generated as a pass state. This process involves comparison, counting and interval judgment.

[0036] The deviation accumulation calculation submodule determines the sequence as passed based on the mode difference run test value, and calls the list of single deviation values ​​at the corresponding position, such as 5 deviation values ​​of 24.0, 20.0, 6.0, 8.0 and 45.0 microseconds. The values ​​are added one by one to obtain the total deviation accumulation of 103.0 microseconds. The addition operation involved is continuous accumulation, and the operation logic is to sum to obtain the total offset.

[0037] The forward trend combination submodule calls the total cumulative deviation of 103.0 microseconds, divided by the number of sample points of 5, to obtain the unit deviation mean of 20.6 microseconds. The unit deviation mean of 20.6 is multiplied by the number of prediction cycles preset according to the mechanical transmission inertia of the equipment, which is 10, to obtain the total forward movement of 206.0 microseconds. The total cumulative deviation of 103.0 and the total forward movement of 206.0 are combined into a binary data vector to obtain the trend characteristics. The division formula involved is that the mean is equal to the sum divided by the number of cycles, and the multiplication formula is that the total forward movement is equal to the mean multiplied by the number of cycles. The operation logic is to predict the future total forward movement through the average deviation.

[0038] Please see Figure 2 The pattern recognition output module includes: The deviation comparison submodule obtains the total cumulative deviation of 103.0 microseconds and the total forward movement of 206.0 microseconds from the trend characteristics. It reads the preset deviation threshold of 150.0 microseconds and the preset displacement threshold of 200.0 microseconds from the parameter storage area. It compares the total cumulative deviation of 103.0 with 150.0. Since 103.0 is less than 150.0, the over-limit flag is set to 0. It compares the total forward movement of 206.0 with 200.0. Since 206.0 is greater than 200.0, the over-limit flag is set to 1. The over-limit flags are generated as 0 and 1 respectively. The comparison process uses the greater than less than judgment.

[0039] The severity calculation submodule calls the first bit of the over-limit flag (0) and the second bit (1) to perform a logical AND operation. 0 and 1 equal 0, resulting in a severity flag of 0. The logical AND operation rule is that the output is true only if both inputs are true.

[0040] The combined output submodule calls the severity flag 0, the total accumulated deviation of 103.0 microseconds, and the total forward shift of 206.0 microseconds, which are combined into a triplet data vector [0, 103.0, 206.0], which is the final pattern recognition result, without any additional calculations.

[0041] In a preferred embodiment of the present invention, the control execution module receives the final pattern recognition result (severity flag, total cumulative deviation, and total forward shift) sent by the pattern recognition output module, and adaptively adjusts the position of the color mark window according to the total forward shift value. Specifically, the offset register of the microcontroller's timer capture window can be modified to advance or delay the window start point by a corresponding number of microseconds. Simultaneously, if the severity flag is true, an additional emergency compensation action (such as temporarily adjusting the printing phase) is triggered, and a log is recorded for maintenance. This control execution module forms a complete closed loop with the core logic of the target-seeking control system, realizing the adaptive forward or backward shift of the color mark window position.

[0042] Please see Figure 3 An adaptive color mark window control method for a book printer includes the following steps: S1: Receive pulse signals through sensors and obtain the arrival time of adjacent color mark pulses based on the arrival time of adjacent pulses; S2: Based on the arrival time of adjacent color mark pulses, the moving average method is used to calculate the predicted value of the period interval. The single deviation value is obtained by subtracting it from the theoretical time. The predicted value of the period interval and the single deviation value are combined into a period feature vector. S3: The periodic deviation is obtained by subtracting the predicted periodic interval from the theoretical standard interval in the periodic feature vector, multiplying it by the proportional coefficient to obtain the forward compensation, and forming a discriminative feature set with the single deviation value. The discriminative feature set is then input into the nearest neighbor classifier to perform pattern classification and obtain the pattern label. The pattern label and the single deviation value are then called. S4: Trend testing is performed based on the run-length test method for sequences composed of multiple pattern labels. The total cumulative deviation is accumulated after each single deviation value is passed. The total forward shift is calculated based on the total cumulative deviation. The total cumulative deviation and the total forward shift are combined to form a trend feature. S5: Based on the trend features, the total cumulative deviation and the total forward shift are compared with preset thresholds, and the severity flag is obtained by AND operation. The severity flag is then output as the final pattern recognition result.

[0043] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. An adaptive color mark window tracking control system for a book printer, characterized in that: The system includes: The pulse signal acquisition module is used to receive pulses and record the time through the sensor, obtain the arrival time of adjacent color mark pulses, and transmit them to the periodic feature extraction module. The periodic feature extraction module is used to obtain the periodic interval prediction value by calling the moving average method on the arrival time of the adjacent color mark pulses, subtract the theoretical time to obtain the single deviation value, combine them into a periodic feature vector and transmit it; The deviation pattern discrimination module is used to obtain the period deviation amount by subtracting the predicted period interval from the theoretical standard interval in the period feature vector, multiplying it by the proportional coefficient to obtain the forward compensation amount, and forming a discrimination feature set with the single deviation value. The module then calls the nearest neighbor classifier to classify the pattern label and passes the pattern label and the single deviation value to the cumulative trend analysis module. The cumulative trend analysis module is used to compare the sequence composed of multiple pattern labels and call the run test method to test it. If it passes, the total cumulative deviation of the single deviation value is accumulated, the total forward shift is calculated based on the total cumulative deviation, and the combination is used to form a trend feature and transmit it. The pattern recognition output module is used to compare the total cumulative deviation and the total forward shift in the trend features respectively, perform AND operation to obtain the severity indicator, and merge them into the final pattern recognition result.

2. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The pulse signal acquisition module includes the arrival time of adjacent color mark pulses and time recording; the periodic feature extraction module includes the periodic interval prediction value, single deviation value, and periodic feature vector; the deviation pattern discrimination module includes the periodic deviation amount, forward compensation amount, discrimination feature set, and pattern label; the cumulative trend analysis module includes the total cumulative deviation amount, the total forward shift amount, and trend features; and the pattern recognition output module includes the severity flag and the final pattern recognition result.

3. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The pulse signal acquisition module includes: The pulse timing submodule acquires the pulse received by the sensor, reads the timer count value register to obtain the original count value when the pulse rises to interrupt the response, calls the reference count value stored at the system startup time and performs subtraction with the original count value to obtain the relative count value, multiplies the relative count value with the timer resolution parameter to generate a microsecond offset, and stores the offset in the sequence according to the pulse arrival order to generate a time offset value sequence; The interval extraction submodule, based on the time offset value sequence, sets the loop variable i to increment from 0 to the sequence length minus 2. Within the loop, it obtains the offset values ​​at index i and index i plus 1 in the sequence, subtracts the offset value at index i from the offset value at index i plus 1 to obtain the interval value, converts the interval value into floating-point data and appends it to the interval list. After the loop ends, the interval list is the pulse interval sequence, generating the arrival time of adjacent color mark pulses.

4. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The periodic feature extraction module includes: The color mark acquisition submodule acquires the arrival time of the adjacent color mark pulses. The pulse output by the photoelectric sensor is shaped by a Schmitt trigger and then input into a timer to capture the rising edge time. It is recorded as a double-precision floating-point number and continuously acquired until the window length is reached. The sliding window length value is set to obtain the pulse arrival time sequence. The moving average submodule calculates the difference between adjacent time points based on the pulse arrival time series to generate a periodic interval sequence. It takes the five most recent interval values, sums them, divides them by five, and performs a moving average calculation. If the interval sequence length is less than five, it uses all available interval values ​​to calculate the arithmetic mean and generates a periodic interval prediction value. The difference calculation submodule calls the predicted value of the period interval, reads the standard value of the theoretical period interval from the equipment parameters, performs a subtraction operation by subtracting the standard value from the predicted value according to the period sequence number to obtain the signed deviation, and arranges and saves the deviation value according to the period sequence number to obtain the single deviation value. The sequence combination submodule concatenates the single deviation values ​​into a one-dimensional array in a periodic order. After each new deviation value is obtained, the oldest deviation value in the array is removed and a new deviation value is added to the end. The array length remains constant, and the array elements are the deviation values. The combination forms a periodic feature vector.

5. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The deviation pattern discrimination module includes: The deviation calculation submodule is based on the periodic feature vector. It calls the predicted value of the periodic interval and the theoretical standard interval value, performs a numerical subtraction operation on the two, and generates the periodic deviation. The feature combination submodule obtains a proportional coefficient for the periodic deviation amount, performs a multiplication operation on the periodic deviation amount to obtain a forward compensation amount, and combines the single deviation value with the forward compensation amount to form a discriminative feature set. The pattern classification output submodule calls the nearest neighbor classifier to perform distance comparison calculations between the discriminative feature set and the sample library labels, outputs matching category labels, and generates pattern labels.

6. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The cumulative trend analysis module includes: The sequence comparison test submodule obtains a sequence composed of multiple pattern labels, performs similarity and difference comparisons on adjacent labels in the sequence and records the comparison results for each comparison. It calls the run test method to count the number of runs in the sequence and compares the number of runs with the critical run value calculated based on the total number of labels. If the number of runs is within the critical run value range, the test is deemed to have passed and a pattern difference run test value is generated. The deviation accumulation calculation submodule determines that the sequence passes the test based on the pattern difference run test value, calls the single deviation value at the corresponding position, adds up each single deviation value one by one to calculate the total deviation accumulation; The forward trend combination submodule calls the total cumulative deviation and the number of sequence sample points to perform a division operation to obtain the unit deviation mean. The unit deviation mean is multiplied by the set number of periods to obtain the forward total. The total cumulative deviation and the forward total are combined into a binary data vector to obtain the trend feature.

7. The adaptive color mark window tracking control system for a book printer according to claim 1, characterized in that: The pattern recognition output module includes: The deviation comparison submodule obtains the total cumulative deviation and the total forward shift in the trend feature, compares the total cumulative deviation value with a preset deviation threshold, compares the total forward shift value with a preset displacement threshold, sets the corresponding over-limit flag bit based on the two comparison results, and generates the over-limit flag bit. The severity calculation submodule calls the over-limit flag bit and performs a logical AND operation on the over-limit flag bit corresponding to the total deviation accumulation and the over-limit flag bit corresponding to the total forward shift. When both flag bits are in the over-limit state at the same time, the output state value is true; otherwise, the state value is false, and the severity flag is obtained. The result merging and output submodule calls the severity flag, combines the severity flag with the total cumulative deviation value and the total forward shift value in the trend feature to form a triplet data vector, and generates the final pattern recognition result.

8. A method for adaptive color mark window control in a book printer, characterized in that, The adaptive color mark window tracking control system for a book printer according to any one of claims 1-7 includes the following steps: S1: Receive pulse signals through sensors and obtain the arrival time of adjacent color mark pulses based on the arrival time of adjacent pulses; S2: Based on the arrival time of the adjacent color mark pulses, the moving average method is used to calculate the predicted value of the period interval, and the single deviation value is obtained by subtracting it from the theoretical time. The predicted value of the period interval and the single deviation value are combined into a period feature vector. S3: Based on the periodic feature vector, the predicted periodic interval is subtracted from the theoretical standard interval to obtain the periodic deviation, which is multiplied by the proportional coefficient to obtain the forward compensation amount. This, along with the single deviation value, constitutes a discriminative feature set. The discriminative feature set is then input into the nearest neighbor classifier to perform pattern classification and obtain the pattern label. The pattern label and the single deviation value are then called. S4: Perform trend testing based on the sequence composed of multiple pattern labels using the run-length test method. After passing the test, accumulate the total accumulated deviation value of each single deviation value. Calculate the total forward shift based on the total accumulated deviation value. Combine the total accumulated deviation value and the total forward shift value to form a trend feature. S5: Based on the total cumulative deviation and the total forward shift in the trend features, compare them with preset thresholds respectively, obtain the severity flag through AND operation, and output the severity flag as the final pattern recognition result.