Overload detection methods, devices, computer equipment, and storage media for safety switches

CN122410291BActive Publication Date: 2026-08-14SHENZHEN BAYTEST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-15
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0007]基于此,有必要针对上述技术问题,提供一种安全开关的过载检测方法、装置、计算机设备及存储介质,具有在不显著增加硬件成本和运算负担的情况下,提高安全输出端模拟输出参数的检测准确性,并进一步提高安全开关的过载检测结果的可靠性的优点

Benefits of technology

[0018]上述安全开关的过载检测方法、装置、计算机设备及存储介质,获取目标安全输出端的输出检测值、目标输出状态以及预设的校准特征点集,所述输出检测值为对所述目标安全输出端的模拟输出参数进行采样得到的数值,所述校准特征点集包括多个校准特征点,每个所述校准特征点包括检测特征值以及与所述检测特征值对应的标定参数值;根据所述输出检测值与所述多个校准特征点中的检测特征值之间的区间关系,确定所述输出检测值所在的目标校准区间,所述目标校准区间由相邻两个校准特征点确定;基于所述目标校准区间两端的检测特征值以及对应的标定参数值,对所述输出检测值进行分段线性校准,得到校准输出参数值;根据所述目标输出状态确定对应的基准输出参数值,基于所述校准输出参数值与所述基准输出参数值之间的偏差确定输出偏差值,并根据所述输出偏差值确定所述目标安全输出端是否处于过载状态。通过预设校准特征点集,将目标安全输出端的输出检测值与标定参数值之间的非理想对应关系划分为多个校准区间,并根据输出检测值所在的目标校准区间进行分段线性校准,得到更接近实际模拟输出参数的校准输出参数值;同时,结合目标安全输出端的目标输出状态确定对应的基准输出参数值,并基于校准输出参数值与基准输出参数值之间的输出偏差值进行过载判断。由此,能够降低采样链路中器件非线性、器件误差等因素对安全开关的过载检测结果的影响,在不显著增加硬件成本和运算负担的情况下,提高安全输出端安全开关的过载检测的准确性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122410291B_ABST
    Figure CN122410291B_ABST
Patent Text Reader

Abstract

This invention discloses an overload detection method, apparatus, computer device, and storage medium for a safety switch. The method includes: acquiring the output detection value of the target safety output terminal, the target output state, and a preset calibration feature point set; determining the target calibration interval where the output detection value lies based on the interval relationship between the output detection value and the detection feature values ​​in the multiple calibration feature points; performing piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values ​​to obtain a calibration output parameter value; determining the corresponding reference output parameter value according to the target output state; determining the output deviation value based on the deviation between the calibration output parameter value and the reference output parameter value; and determining whether the target safety output terminal is in an overload state based on the output deviation value. This method can improve the accuracy and reliability of overload detection of the safety switch at the safety output terminal without significantly increasing hardware costs and computational burden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial safety, and in particular to an overload detection method, device, computer equipment, and storage medium for a safety switch. Background Technology

[0002] Safety switches typically need to output a safety status signal to an external control system via a safety output terminal. This signal enables the external control system to perform safety actions such as shutdown, preventing startup, alarm activation, or interlocking. For safety switch products such as safety light curtains, safety door locks, and safety sensors, the safety output terminal may be in a high-level or low-level output state during actual operation. Whether its output parameters meet the expected range for the corresponding output state directly affects whether the safety switch can accurately identify output anomalies, load anomalies, or overload anomalies. Therefore, during the operation of a safety switch, it is usually necessary to sample and detect the analog output parameters of the safety output terminal, and determine whether the safety output terminal is in an overload state based on the detection results.

[0003] In existing technologies, analog output parameters such as output voltage and current at the safety output terminal are typically sampled using a sampling circuit to obtain output detection values. These values ​​are then converted into corresponding output parameter values ​​based on a preset conversion relationship. These output parameter values ​​are then compared with reference parameters in either a high-level or low-level state to determine if an overload abnormality exists at the safety output terminal. This method is relatively simple to implement and can meet the status detection requirements of the safety output terminal to a certain extent.

[0004] However, in actual products, the sampling link of the safety output terminal is usually affected by factors such as voltage divider resistors, voltage regulators, protection devices, clamping devices, and errors in the sampling circuit components. This means that the output detection value and the actual output parameter value do not always maintain an ideal linear relationship. If a single linear conversion method is still used for detection, there may be cases where the detection error is large in certain output ranges, leading to misjudgments or missed judgments when subsequent overload judgments are made based on the deviation between the output parameter value and the reference parameter value. For example, the safety output terminal may not actually reach the overload condition in a certain output range, but it may be misjudged as overloaded due to a large detection conversion error; or there may be an abnormal voltage drop or residual voltage at the safety output terminal, but the protection may not be triggered in time because the detection result deviates from the true value.

[0005] Furthermore, improving detection accuracy by replacing high-precision components, upgrading sampling link hardware specifications, or introducing complex nonlinear fitting algorithms would increase hardware costs or consume more controller computing resources, which is not conducive to application in cost-sensitive safety switch products with high real-time requirements.

[0006] Therefore, how to improve the detection accuracy of the analog output parameters of the safety output terminal and further improve the reliability of the overload detection results of the safety switch without significantly increasing hardware costs and computational burden has become a problem that needs to be solved in this field. Summary of the Invention

[0007] Therefore, it is necessary to provide an overload detection method, device, computer equipment, and storage medium for a safety switch to address the aforementioned technical problems. This method has the advantages of improving the detection accuracy of the analog output parameters of the safety output terminal and further improving the reliability of the overload detection results of the safety switch without significantly increasing hardware costs and computational burden.

[0008] An overload detection method for a safety switch, the method comprising: The system acquires the output detection value of the target safety output terminal, the target output status, and a preset calibration feature point set. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, and each calibration feature point includes a detection feature value and a calibration parameter value corresponding to the detection feature value. Based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points, the target calibration interval in which the output detection value is located is determined, and the target calibration interval is determined by two adjacent calibration feature points; Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is subjected to piecewise linear calibration to obtain the calibration output parameter value; The corresponding reference output parameter value is determined based on the target output state, the output deviation value is determined based on the deviation between the calibration output parameter value and the reference output parameter value, and the target safety output terminal is determined to be in an overload state based on the output deviation value.

[0009] Optionally, before obtaining the preset calibration feature point set, the method further includes: Under multiple calibration conditions, the detection feature values ​​and calibration parameter values ​​corresponding to the target safety output terminal are obtained respectively; The calibration feature point set is generated based on the detection feature values ​​and calibration parameter values ​​corresponding to multiple calibration conditions; Among them, multiple calibration conditions cover the detection range of the simulated output parameters of the target safety output terminal.

[0010] Optionally, determining the target calibration interval where the output detection value lies based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points includes: The plurality of calibration feature points are arranged in order of magnitude of the detected feature values; The target calibration interval where the output detection value is located is determined from multiple calibration intervals formed by two adjacent calibration feature points; Wherein, the lower limit detection feature value of the target calibration interval is less than or equal to the output detection value, and the upper limit detection feature value of the target calibration interval is greater than or equal to the output detection value.

[0011] Optionally, the detection feature values ​​at both ends of the target calibration interval include a lower limit detection feature value and an upper limit detection feature value, and the calibration parameter values ​​corresponding to both ends of the target calibration interval include a lower limit calibration parameter value and an upper limit calibration parameter value. The step of performing piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values ​​to obtain calibration output parameter values ​​includes: Based on the output detection value, the lower limit detection feature value, and the upper limit detection feature value, determine the interval position ratio of the output detection value in the target calibration interval; The calibration output parameter value is determined based on the interval position ratio, the lower limit calibration parameter value, and the upper limit calibration parameter value.

[0012] Optionally, determining the corresponding baseline output parameter value based on the target output state includes: When the target output state is a low-level output state, the low-level reference parameter value is used as the reference output parameter value; When the target output state is a high-level output state, the high-level reference parameter value is used as the reference output parameter value.

[0013] Optionally, determining whether the target safety output terminal is in an overload state based on the output deviation value includes: The output deviation value is compared with a preset offset threshold to obtain the comparison result; Based on the comparison results, it is determined whether the target safety output terminal is in an overload state.

[0014] Optionally, determining whether the target safety output terminal is in an overload state based on the comparison result includes: If the comparison result is that the output deviation value is greater than or equal to the offset threshold, then it is determined that the target safety output terminal is in an overload state, and the target safety output terminal is controlled to enter the protection state. If the comparison result shows that the output deviation value is less than the offset threshold, then it is determined that the target safety output terminal is not in an overload state.

[0015] An overload detection device for a safety switch, the device comprising: The acquisition module is used to acquire the output detection value of the target safety output terminal, the target output status, and a preset calibration feature point set. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, and each calibration feature point includes a detection feature value and a calibration parameter value corresponding to the detection feature value. The determination module is used to determine the target calibration interval where the output detection value is located based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points, wherein the target calibration interval is determined by two adjacent calibration feature points; The calibration module is used to perform piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, so as to obtain the calibration output parameter value; The detection module is used to determine the corresponding reference output parameter value according to the target output state, determine the output deviation value based on the deviation between the calibration output parameter value and the reference output parameter value, and determine whether the target safety output terminal is in an overload state based on the output deviation value.

[0016] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the overload detection method of the aforementioned safety switch.

[0017] A readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the overload detection method of the aforementioned safety switch.

[0018] The overload detection method, apparatus, computer equipment, and storage medium for the aforementioned safety switch acquire the output detection value, target output state, and preset calibration feature point set of the target safety output terminal. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, each of which includes a detection feature value and a calibration parameter value corresponding to the detection feature value. Based on the interval relationship between the output detection value and the detection feature values ​​among the multiple calibration feature points, a target calibration interval in which the output detection value is located is determined. The target calibration interval is determined by two adjacent calibration feature points. Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is subjected to piecewise linear calibration to obtain a calibration output parameter value. A corresponding reference output parameter value is determined according to the target output state. An output deviation value is determined based on the deviation between the calibration output parameter value and the reference output parameter value. Finally, the target safety output terminal is determined to be in an overload state based on the output deviation value. By pre-setting a set of calibration feature points, the non-ideal correspondence between the output detection value and the calibration parameter value of the target safety output terminal is divided into multiple calibration intervals. Piecewise linear calibration is then performed based on the target calibration interval where the output detection value falls, resulting in calibrated output parameter values ​​that more closely approximate the actual simulated output parameters. Simultaneously, a corresponding reference output parameter value is determined by combining the target output state of the target safety output terminal, and overload judgment is made based on the output deviation between the calibrated output parameter value and the reference output parameter value. This reduces the impact of factors such as device nonlinearity and device errors in the sampling link on the overload detection results of the safety switch, improving the accuracy and reliability of overload detection of the safety output terminal safety switch without significantly increasing hardware costs and computational burden. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an overload detection method for a safety switch according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the overload detection device for a safety switch in one embodiment of the present invention; Figure 3 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of 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, not all, of the embodiments of the present invention. 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.

[0022] In one embodiment, such as Figure 1 As shown, an overload detection method for a safety switch is provided, comprising the following steps: 101. Obtain the output detection value of the target's safety output terminal, the target's output status, and the preset calibration feature point set.

[0023] In this embodiment of the invention, the target safety output terminal can be understood as a port in a safety switch used to output safety control signals, such as the OSSD output terminal in a safety light curtain, safety door lock, or safety sensor. The target safety output terminal can output a high-level signal or a low-level signal according to the current safety state, and reflect the current output status through analog output parameters such as output voltage and output current. The target output state can be understood as the output state currently controlled by the target safety output terminal, such as a high-level output state or a low-level output state, used to subsequently determine the corresponding reference output parameter values.

[0024] The output detection value can be a value obtained by sampling the analog output parameters of the target safety output terminal. For example, if the output voltage of the target safety output terminal needs to be detected, the output voltage can first be converted to the allowable sampling range through a sampling link such as voltage divider, filter, and protection, and then the controller can collect the corresponding detection value. This output detection value can be a sample count value after analog-to-digital conversion, or a detection quantization value after preliminary conversion, as long as it can characterize the current analog output parameters of the target safety output terminal.

[0025] A calibration feature point set can include multiple calibration feature points. Each calibration feature point includes a detection feature value and a corresponding calibration parameter value. The detection feature value can be understood as the detection-side value acquired by the sampling link under calibration conditions, used to characterize the detection result of the sampling link under a certain actual output condition. The calibration parameter value can be understood as the actual parameter value or reference parameter value corresponding to the detection feature value, which can be obtained through a standard voltage source, standard current source, high-precision measuring instrument, or factory calibration equipment. For example, during the OSSD output voltage calibration process, if the actual output voltage is 3.4V and the sampling link obtains a detection feature value of 526, then the detection feature value 526 and the calibration parameter value 3.4V can be saved as a calibration feature point.

[0026] In one possible embodiment, the calibration feature point set can be pre-stored in the controller's non-volatile storage area and read when the device is powered on, self-tested, or enters the overload detection process of the safety switch; alternatively, it can be generated during the production calibration stage and written into the safety switch, so that safety switches of the same batch or the same hardware version can complete the output parameter calibration based on the corresponding calibration feature point set.

[0027] 102. Determine the target calibration interval where the output detection value is located based on the interval relationship between the output detection value and the detection feature values ​​in multiple calibration feature points.

[0028] In this embodiment of the invention, multiple calibration feature points in the calibration feature point set can be arranged in ascending order of detection feature values, forming a calibration interval between two adjacent calibration feature points. After obtaining the output detection value of the target safety output terminal, the output detection value can be compared sequentially with the detection feature values ​​in each calibration feature point to determine which two adjacent detection feature values ​​the output detection value falls between, and the interval formed by these two adjacent calibration feature points is determined as the target calibration interval.

[0029] The target calibration interval is determined by two adjacent calibration feature points, one of which serves as the lower limit of the interval, and the other as the upper limit. The lower limit corresponds to the lower limit detection feature value and the lower limit calibration parameter value, while the upper limit corresponds to the upper limit detection feature value and the upper limit calibration parameter value. By determining the target calibration interval, it is clear which segment of the interval's detection feature value and calibration parameter value will be used during subsequent piecewise linear calibration, thus avoiding detection deviations caused by using a single linear relationship across the entire measurement range.

[0030] For example, the calibration feature point set includes detection feature values ​​0, 526, 2445, 3043, and 3459, each corresponding to a different calibration voltage value. When the current output detection value is 1200, since 1200 is greater than 526 and less than 2445, it can be determined that the output detection value lies within the calibration interval formed by the detection feature values ​​526 and 2445, which is the target calibration interval. Subsequently, based on the detection feature values ​​526 and 2445 and their corresponding calibration parameter values, piecewise linear calibration can be performed on the output detection value of 1200.

[0031] 103. Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is linearly calibrated piecewise to obtain the calibration output parameter value.

[0032] In this embodiment of the invention, after determining the target calibration interval where the output detection value lies, the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values ​​can be read. Based on the relative position of the output detection value within the target calibration interval, linear interpolation is performed on the calibration parameter values ​​at both ends to obtain the calibration output parameter value. In other words, the closer the output detection value is to the lower limit detection feature value, the closer the calibration output parameter value is to the lower limit calibration parameter value; the closer the output detection value is to the upper limit detection feature value, the closer the calibration output parameter value is to the upper limit calibration parameter value.

[0033] For example, the lower limit detection feature value of the target calibration interval is 526, corresponding to a lower limit calibration parameter value of 3.40V; the upper limit detection feature value is 2445, corresponding to an upper limit calibration parameter value of 18.44V. When the current output detection value is 1200, we can first determine the positional proportion of 1200 between 526 and 2445, and then convert it according to this positional proportion between 3.40V and 18.44V to obtain the corresponding calibration output parameter value. In this way, the calibration output parameter value no longer relies on a single linear relationship across the entire range, but is calculated based on a local linear relationship within the interval where the current output detection value lies, thereby reducing the detection error caused by the nonlinearity of the hardware sampling link.

[0034] In one possible embodiment, to accommodate resource-constrained controllers, calibration parameter values ​​can be stored in integer form, for example, using 0.01V as the quantization unit, such that 3.40V is stored as 340 and 18.44V as 1844. During piecewise linear calibration, integer multiplication and division operations can be used to perform calculations, avoiding the increased resource consumption and execution time associated with floating-point operations.

[0035] 104. Determine the corresponding reference output parameter value based on the target output state, determine the output deviation value based on the deviation between the calibration output parameter value and the reference output parameter value, and determine whether the target safety output terminal is in an overload state based on the output deviation value.

[0036] In this embodiment of the invention, the target output state can be used to characterize the current output level state that the target safety output terminal should output, such as a low-level output state or a high-level output state. Since the normal output range varies depending on the output state, the corresponding reference output parameter value can be determined based on the target output state before overload judgment. When the target output state is a low-level output state, the reference output parameter value can be a low-level reference parameter value, such as a voltage value close to 0V; when the target output state is a high-level output state, the reference output parameter value can be a high-level reference parameter value, such as the voltage value corresponding to the supply voltage.

[0037] After determining the reference output parameter value, the deviation between the calibrated output parameter value and the reference output parameter value can be calculated, and this deviation can be used as the output deviation value. The output deviation value reflects the degree of deviation between the actual output of the target safety output terminal and the normal output under the current target output state. If the target safety output terminal is in a low-level output state, but the calibrated output parameter value is significantly higher than the low-level reference parameter value, it indicates that there may be an abnormal residual voltage at the safety output terminal; if the target safety output terminal is in a high-level output state, but the calibrated output parameter value is significantly lower than the high-level reference parameter value, it indicates that there may be an abnormal voltage drop at the safety output terminal. Both the aforementioned abnormal residual voltage and abnormal voltage drop can serve as important criteria for judging overload conditions.

[0038] For example, if the target safety output is an OSSD output, the target output state is high, the high-level reference parameter is 24V, and the calibrated output parameter obtained after piecewise linear calibration is 22.8V, then the output deviation value can be 1.2V. If the preset offset threshold is 0.6V, then the output deviation value is greater than the preset offset threshold, indicating that the OSSD output is in an overload state, and further control of the OSSD output to enter the protection state. As another example, if the target output state is low, the low-level reference parameter is 0V, the calibrated output parameter is 0.2V, and the output deviation value is less than the preset offset threshold, then it can be determined that the target safety output is not in an overload state.

[0039] In one possible embodiment, the low-level reference parameter value and the high-level reference parameter value can be pre-stored in the controller, or they can be dynamically determined based on the power supply voltage, output type, or product configuration parameters. For example, the high-level reference parameter value can be the currently acquired power supply voltage value, and the low-level reference parameter value can be the ground reference voltage value, thereby enabling the overload detection process of the safety switch to adapt to different power supply specifications or different safety output types.

[0040] In this embodiment of the invention, the output detection value of the target safety output terminal, the target output state, and a preset calibration feature point set are obtained. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, each of which includes a detection feature value and a calibration parameter value corresponding to the detection feature value. Based on the interval relationship between the output detection value and the detection feature values ​​among the multiple calibration feature points, a target calibration interval in which the output detection value is located is determined. The target calibration interval is determined by two adjacent calibration feature points. Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is subjected to piecewise linear calibration to obtain a calibration output parameter value. Based on the target output state, a corresponding reference output parameter value is determined. Based on the deviation between the calibration output parameter value and the reference output parameter value, an output deviation value is determined. Based on the output deviation value, it is determined whether the target safety output terminal is in an overload state. By pre-setting a set of calibration feature points, the non-ideal correspondence between the output detection value and the calibration parameter value of the target safety output terminal is divided into multiple calibration intervals. Piecewise linear calibration is then performed based on the target calibration interval where the output detection value falls, resulting in calibrated output parameter values ​​that more closely approximate the actual simulated output parameters. Simultaneously, a corresponding reference output parameter value is determined by combining the target output state of the target safety output terminal, and overload judgment is made based on the output deviation between the calibrated output parameter value and the reference output parameter value. This reduces the impact of factors such as device nonlinearity and device errors in the sampling link on the overload detection results of the safety switch, improving the accuracy and reliability of overload detection of the safety output terminal safety switch without significantly increasing hardware costs and computational burden.

[0041] Optionally, before obtaining the preset calibration feature point set, the detection feature value and calibration parameter value corresponding to the target safety output terminal can be obtained under multiple calibration conditions respectively; a calibration feature point set is generated based on the detection feature value and calibration parameter value corresponding to the multiple calibration conditions; wherein, the multiple calibration conditions cover the detection range of the simulated output parameters of the target safety output terminal.

[0042] In this embodiment of the invention, the calibration feature point set can be pre-generated during the product factory calibration stage, production testing stage, or maintenance calibration stage. Specifically, under multiple calibration conditions, the target safety output terminal can output analog output parameters of different magnitudes, and the corresponding actual physical values ​​can be obtained through standard measuring equipment. Simultaneously, the corresponding detection feature values ​​can be obtained through the internal sampling link of the safety switch. The detection feature values ​​can be ADC sampled values ​​output by the sampling link, or quantized values ​​after preliminary processing; the calibration parameter values ​​can be quantized values ​​corresponding to actual voltage, actual current, or other analog output parameters. By storing the corresponding detection feature values ​​and calibration parameter values ​​obtained under the same calibration condition, a calibration feature point can be formed.

[0043] When constructing the calibration feature point set, multiple calibration conditions need to cover the detection range of the simulated output parameters of the target safety output terminal, and calibration feature points can be arranged in the interval with more obvious nonlinear error in order to improve the accuracy of subsequent piecewise linear calibration.

[0044] For example, the above calibration feature point set can be further illustrated by the following example in Table 1:

[0045] Table 1 As shown in Table 1 above, the calibration feature point set is not simply generated according to an ideal linear ratio, but is calibrated based on the detection results of the target safety output terminal under different actual voltages. For example, when the actual voltage is 3.4V, the corresponding ADC sampling value is 526; when the actual voltage is 18.44V, the corresponding ADC sampling value is 2445; and when the actual voltage is 23.41V, the corresponding ADC sampling value is 3043. Since the ratio of change between the ADC sampling value and the actual voltage quantization value is not completely consistent in different voltage ranges, directly using a unified conversion relationship across the entire range can easily lead to large detection errors in some ranges. By using adjacent calibration feature points in Table 1 as interval boundaries, multiple calibration intervals can be formed. For example, ADC sampling values ​​from 0 to 526 form the first calibration interval, 526 to 2445 form the second calibration interval, 2445 to 3043 form the third calibration interval, and 3043 to 3459 form the fourth calibration interval. After obtaining the output detection value, we can first determine which calibration interval the output detection value falls into, and then use the ADC sampling value and the actual voltage quantization value at both ends of the calibration interval to perform piecewise linear calibration, so that the calibration output parameter value is closer to the real output voltage of the target safe output terminal.

[0046] The actual voltage quantization value can be stored using a fixed unit. For example, with 0.01V as the quantization unit, 340 represents 3.40V, 1844 represents 18.44V, 2341 represents 23.41V, and 2735 represents 27.35V. Using quantized value storage reduces the need for floating-point operations, allowing the controller to perform calibration calculations through integer operations. This is suitable for applications where internal resources of the safety switch are limited and the overload detection response speed of the safety switch is critical.

[0047] In one possible embodiment, the number and distribution of calibration feature points can be adjusted based on the linearity of the sampling link at the target safety output terminal. When the nonlinear error introduced by the voltage regulator, protection device, or voltage divider network is significant within a certain voltage range, calibration feature points can be added in that voltage range; when the detection relationship is close to linear within a certain voltage range, the number of calibration feature points can be reduced to balance calibration accuracy, storage space, and computational efficiency.

[0048] In another possible embodiment, the calibration feature point set can be generated based on the overload judgment sensitive area of ​​the target safe output terminal. The overload judgment sensitive area can be understood as the parameter range in which a small deviation in the calibration output parameter value may affect the overload judgment result. For example, when the target output state is a low-level output state, the parameter range from the low-level reference parameter value to near the offset threshold can be used as the low-level overload judgment sensitive area; when the target output state is a high-level output state, the parameter range from the high-level reference parameter value minus near the offset threshold can be used as the high-level overload judgment sensitive area.

[0049] When constructing the calibration feature point set, the simulated output parameters of the target safety output terminal can cover the detection range under multiple calibration conditions. More dense calibration conditions can be set within the parameter range closer to the overload judgment sensitive area, while relatively sparse calibration conditions can be set within the parameter range farther from the overload judgment sensitive area. In this way, the calibration feature point set can both cover the detection range of the simulated output parameters and form a higher density of calibration feature points in the critical intervals affecting the accuracy of overload judgment.

[0050] Under each calibration condition, multiple detection values ​​output from the target safety output terminal via the sampling link can be collected. These values ​​can then be averaged, medianized, or have extreme value removed to obtain the corresponding detection feature values. Simultaneously, the actual simulated output parameters under this calibration condition can be obtained using standard measuring or calibration equipment and used as calibration parameter values. After storing the corresponding detection feature values ​​and calibration parameter values ​​under the same calibration condition, calibration feature points can be formed. Arranging multiple calibration feature points in order of the magnitude of the detection feature values ​​generates a calibration feature point set.

[0051] In this way, calibration feature points are not simply evenly distributed according to the detection range, but rather, in conjunction with the overload judgment rules of the target's safe output, the calibration density is increased in parameter ranges that are prone to affecting the overload judgment results. This improves calibration accuracy near the overload critical region during subsequent piecewise linear calibration, reduces the risk of misjudgment or missed judgment due to nonlinear errors in the sampling link, and avoids setting too many calibration feature points in parameter ranges that have little impact on overload judgment, thus balancing calibration accuracy, storage space, and computational efficiency.

[0052] Optionally, in the step of determining the target calibration interval where the output detection value is located based on the interval relationship between the output detection value and the detection feature values ​​among multiple calibration feature points, multiple calibration feature points can be arranged in order of magnitude of the detection feature values; the target calibration interval where the output detection value is located can be determined from multiple calibration intervals formed by two adjacent calibration feature points; wherein the lower limit detection feature value of the target calibration interval is less than or equal to the output detection value, and the upper limit detection feature value of the target calibration interval is greater than or equal to the output detection value.

[0053] In this embodiment of the invention, multiple calibration feature points can be arranged in ascending order of detection feature values, forming a calibration interval between adjacent calibration feature points. After obtaining the output detection value, the output detection value can be compared with each detection feature value to determine which two adjacent detection feature values ​​the output detection value lies between, and the interval formed by these two adjacent calibration feature points is taken as the target calibration interval. This method allows subsequent piecewise linear calibration to be performed only within the local interval corresponding to the current output detection value, without needing to use a unified conversion relationship across the entire range, thereby reducing the impact of nonlinear differences between different intervals on the calibration results.

[0054] For example, in an OSSD output voltage calibration scenario, the detection feature values ​​in the calibration feature point set can include 0, 526, 2445, 3043, and 3459, corresponding to feature points 0 to 4, respectively. When the ADC sample value to be calibrated is less than or equal to 526, it can be determined that the ADC sample value is located in the first linear interval formed by feature point 0 and feature point 1; when the ADC sample value is greater than 526 and less than or equal to 2445, it can be determined that the ADC sample value is located in the second linear interval formed by feature point 1 and feature point 2; when the ADC sample value is greater than 2445 and less than or equal to 3043, it can be determined that the ADC sample value is located in the third linear interval formed by feature point 2 and feature point 3; when the ADC sample value is greater than 3043, it can be determined that the ADC sample value is located in the fourth linear interval formed by feature point 3 and feature point 4. Therefore, based on the interval corresponding to the current ADC sample value, the detection feature values ​​and calibration parameter values ​​at both ends of the corresponding interval can be selected to participate in the subsequent piecewise linear calibration calculation.

[0055] In one possible embodiment, when the output detection value is lower than the lowest detection feature value or higher than the highest detection feature value, calibration can be performed using a boundary calibration range. Alternatively, the calibration output parameter value can be limited to the corresponding boundary calibration parameter value to avoid abnormal calibration results due to extrapolation calculations after exceeding the calibration range. For the example above, when the ADC sample value is higher than 3459, the highest calibration range formed by feature point 3 and feature point 4 can be used for further calculation. Alternatively, the calibration output parameter value can be limited to the calibration parameter value corresponding to feature point 4. The specific configuration can be based on the detection accuracy requirements and protection strategy of the safety switch.

[0056] In another possible embodiment, after arranging multiple calibration feature points in order of magnitude of the detected feature values, an effective span verification can be performed on the candidate calibration interval formed by two adjacent calibration feature points. Specifically, the detection span value can be determined based on the detected feature values ​​at both ends of the candidate calibration interval, and the calibration span value can be determined based on the calibration parameter values ​​at both ends of the candidate calibration interval. The detection span value can be the difference between the upper limit detection feature value and the lower limit detection feature value, and the calibration span value can be the difference between the upper limit calibration parameter value and the lower limit calibration parameter value.

[0057] In practical applications, if the detection span value of a candidate calibration interval is too small, while the calibration span value has changed significantly, it indicates that the interval may be affected by local saturation of the sampling link, clamping of protection devices, or hardware nonlinearity. If piecewise linear calibration is performed directly based on this candidate calibration interval, the small detection span value will amplify sampling jitter or quantization error, causing abnormal fluctuations in the calibration output parameter value, which in turn affects the overload state judgment.

[0058] Based on this, effective span thresholds and calibration change thresholds can be preset. When the detection span value of a candidate calibration interval is less than the effective span threshold and the calibration span value is greater than the calibration change threshold, intermediate calibration feature points in the candidate calibration interval can be merged or removed to obtain an updated calibration feature point set. Subsequently, multiple calibration intervals can be re-formed based on the updated calibration feature point set, and the target calibration interval containing the output detection value can be determined from these multiple calibration intervals.

[0059] In this way, the target calibration interval is still determined by two adjacent calibration feature points in the updated calibration feature point set. At the same time, it avoids abnormally narrow intervals with excessively small detection spans from participating in piecewise linear calibration alone. This maintains the logical consistency of "determining the target calibration interval by two adjacent calibration feature points," reduces the amplification effect of sampling noise and quantization error in piecewise linear calibration, improves the stability of calibration output parameter values, and reduces the risk of misjudgment or missed judgment under overload critical conditions.

[0060] Optionally, the detection feature values ​​at both ends of the target calibration interval include a lower limit detection feature value and an upper limit detection feature value, and the corresponding calibration parameter values ​​at both ends of the target calibration interval include a lower limit calibration parameter value and an upper limit calibration parameter value. In the step of performing piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values ​​to obtain the calibration output parameter value, the interval position ratio of the output detection value in the target calibration interval can also be determined based on the output detection value, the lower limit detection feature value, and the upper limit detection feature value; and the calibration output parameter value can be determined based on the interval position ratio, the lower limit calibration parameter value, and the upper limit calibration parameter value.

[0061] In this embodiment of the invention, after determining the target calibration interval, a linear transformation relationship within the corresponding interval can be established based on the calibration feature points at both ends of the target calibration interval. Specifically, the calibration output parameter values ​​can be calculated according to the following formula:

[0062] Where retVal represents the quantized value of the actual physical value of the calibrated analog quantity, adc represents the current output detection value, which can be the current ADC sampling value in the OSSD output voltage calibration scenario; low represents the lower limit of the detection feature value of the current target calibration interval, scope represents the upper limit of the detection feature value of the current target calibration interval; min represents the lower limit of the calibration parameter value of the current target calibration interval, and max represents the upper limit of the calibration parameter value of the current target calibration interval.

[0063] This formula allows us to first determine the proportion of the current output detection value within the target calibration interval based on `adc`, `low`, and `scope`. Then, based on this proportion, we interpolate between `min` and `max` to obtain `retVal`. In other words, the closer the current output detection value is to `low`, the closer the calibration output parameter value is to `min`; the closer the current output detection value is to `scope`, the closer the calibration output parameter value is to `max`. Therefore, calibration can be performed using corresponding local linear relationships for different calibration intervals, avoiding significant conversion errors caused by sampling link nonlinearity when using the same linear relationship across the entire range.

[0064] For example, if the current ADC sample value is 1200, after interval matching, it falls within the target calibration interval formed by the detection feature values ​​526 to 2445. The corresponding calibration parameter values ​​for this interval are 340 and 1844, respectively. In this case, low is 526, scope is 2445, min is 340, max is 1844, and adc is 1200. Substituting these values ​​into the formula, the calibration output parameter value corresponding to the current ADC sample value can be obtained. If the calibration parameter value is stored in units of 0.01V, the calculated retVal can be directly converted into the corresponding calibration output voltage.

[0065] In one possible embodiment, the calibration output parameter value can be used as the calibrated output parameter in the overload detection logic of a subsequent safety switch. For example, in an OSSD output voltage detection scenario, the calibration output parameter value can be used as the calibrated OSSD output voltage `out`. When the OSSD is in a low-level output state, the residual voltage deviation can be determined based on `diff = out`; when the OSSD is in a high-level output state, the high-level voltage drop deviation can be determined based on `diff = vcc - out`, where `vcc` is the supply voltage. When `diff` is greater than or equal to a preset offset threshold, it can be determined that the OSSD output is in an overload state.

[0066] In another possible embodiment, after determining the target calibration interval, a piecewise linear calibration of the output detection value can be performed using a fixed-point proportional calculation method. Specifically, the detection offset can be determined based on the difference between the output detection value and the lower limit detection feature value, and the detection span value can be determined based on the difference between the upper limit detection feature value and the lower limit detection feature value. The detection offset is used to characterize the degree of deviation of the output detection value relative to the lower limit position of the target calibration interval, and the detection span value is used to characterize the interval width of the target calibration interval in the direction of the detection feature value.

[0067] To accommodate controllers lacking floating-point units or with limited floating-point resources, the detection offset can be amplified by a preset number of bits before being divided by the detection span value to obtain the interval position ratio in fixed-point form. The preset number of bits can be determined based on calibration accuracy requirements and controller word length. This method allows integer arithmetic to represent the position ratio of the output detection value within the target calibration interval, reducing the resource consumption and execution time associated with floating-point operations.

[0068] After obtaining the interval position ratio in fixed-point form, the calibration span value can be determined based on the difference between the upper and lower limit calibration parameter values. The calibration offset is then determined based on the interval position ratio and the calibration span value. Finally, the lower limit calibration parameter value and the calibration offset are added together to obtain the calibration output parameter value. Therefore, the calibration output parameter value is still obtained by interpolating the calibration parameter values ​​at both ends of the target calibration interval, but the calculation process can be implemented using fixed-point integer arithmetic.

[0069] In one possible embodiment, to avoid intermediate calculation results overflow due to processor word length limitations, a higher bit width intermediate variable can be used when calculating the calibration offset, or the intermediate calculation results can be limited. When the intermediate calculation result exceeds a preset upper limit, the intermediate calculation result can be limited to the preset upper limit; when the intermediate calculation result is lower than a preset lower limit, the intermediate calculation result can be limited to the preset lower limit, thereby preventing abnormal jumps in calibration output parameter values ​​due to calculation overflow.

[0070] In one possible embodiment, endpoint consistency correction can also be applied to the calibration output parameter values. Specifically, when the output detection value equals the lower limit detection feature value, the calibration output parameter value can be directly determined as the lower limit calibration parameter value; when the output detection value equals the upper limit detection feature value, the calibration output parameter value can be directly determined as the upper limit calibration parameter value. Through endpoint consistency correction, the calibration output parameter values ​​of adjacent target calibration intervals can be kept consistent at their common boundaries, reducing boundary jumps caused by different integer division truncation or rounding methods, thereby improving the stability of detection results under overload critical conditions.

[0071] In this way, the determination of the interval position ratio and the calculation of the calibration output parameter value do not rely on complex nonlinear fitting algorithms. Instead, local linear calibration is completed by detecting the offset, detecting the span value, fixing the ratio value, and calibrating the span value. This method can retain the ability of piecewise linear calibration to correct hardware nonlinear errors, reduce the controller's computing resource consumption, and reduce the interference caused by computational overflow or boundary jumps on the overload detection results of the safety switch.

[0072] Optionally, in the step of determining the corresponding reference output parameter value based on the target output state, when the target output state is a low-level output state, the low-level reference parameter value can be used as the reference output parameter value; when the target output state is a high-level output state, the high-level reference parameter value can be used as the reference output parameter value.

[0073] In this embodiment of the invention, the target output state can reflect the level type that the target safety output terminal should currently output. Since the normal output references differ between low-level and high-level output states, a matching reference output parameter value needs to be selected based on the target output state before overload judgment. When the target output state is low, the normal output of the target safety output terminal is usually close to the low-level reference value; therefore, the low-level reference parameter value can be used as the reference output parameter value. When the target output state is high, the normal output of the target safety output terminal is usually close to the supply voltage or the high-level reference value; therefore, the high-level reference parameter value can be used as the reference output parameter value.

[0074] For example, in an OSSD output voltage detection scenario, when the OSSD output is controlled to a low-level output state, the low-level reference parameter value can be a quantized value of 0V or close to 0V. The deviation of the calibration output parameter value relative to the low-level reference parameter value can be used to reflect the residual voltage under the low-level state. When the OSSD output is controlled to a high-level output state, the high-level reference parameter value can be a quantized value corresponding to the 24V supply voltage. The deviation of the calibration output parameter value relative to the high-level reference parameter value can be used to reflect the abnormal voltage drop under the high-level state. By selecting different reference output parameter values ​​according to different target output states, the inaccurate overload judgment caused by sharing the same judgment reference between low-level and high-level states can be avoided.

[0075] In one possible embodiment, the low-level reference parameter value and the high-level reference parameter value can be pre-configured fixed parameters, or they can be dynamically determined according to the actual power supply voltage, output terminal type, or product operating mode. For example, the high-level reference parameter value can be updated according to the currently collected power supply voltage, so that the target safety output terminal can still obtain a relatively accurate overload judgment result under different power supply specifications or power supply fluctuation conditions.

[0076] Optionally, in the step of determining whether the target safety output terminal is in an overload state based on the output deviation value, the output deviation value can be compared with a preset offset threshold to obtain a comparison result; based on the comparison result, it can be determined whether the target safety output terminal is in an overload state.

[0077] In this embodiment of the invention, the output deviation value can be compared with a preset offset threshold to determine whether the degree to which the current output of the target safety output terminal deviates from the normal output range has reached the overload judgment condition. The preset offset threshold can be set according to the output type, load capacity, safety level requirements, and allowable error range of the target safety output terminal, and is used to distinguish between normal output fluctuations and abnormal output deviations. If the output deviation value does not reach the preset offset threshold, it can be considered that the current output of the target safety output terminal is still within the allowable range; if the output deviation value reaches or exceeds the preset offset threshold, it can be considered that the target safety output terminal has abnormal voltage drop, residual voltage, or excessive load, thereby determining that the target safety output terminal is in an overload state.

[0078] For example, in an OSSD output voltage detection scenario, if the target output state is high, the high-level reference parameter is 24V, and the calibrated output parameter obtained after piecewise linear calibration is 23.7V, then the output deviation is 0.3V. If the preset offset threshold is 0.6V, the output deviation is less than the preset offset threshold, indicating that the OSSD output is not overloaded. If the calibrated output parameter obtained after piecewise linear calibration is 22.8V, the output deviation is 1.2V, which is greater than the preset offset threshold, indicating that the OSSD output is overloaded. As another example, when the target output state is low, if the low-level reference parameter is 0V, the calibrated output parameter is 0.8V, and the preset offset threshold is 0.6V, then the residual voltage deviation exceeding the allowable range indicates an anomaly at the target safety output.

[0079] In one possible embodiment, the preset offset threshold can be a fixed threshold or can be configured separately according to the target output state. For example, a first offset threshold can be configured in the low-level output state to determine whether the residual voltage is abnormal; a second offset threshold can be configured in the high-level output state to determine whether the output voltage drop is abnormal. The first offset threshold and the second offset threshold can be the same, or they can be set to different values ​​according to the circuit structure, supply voltage, and load characteristics of the safety output terminal to improve the overload detection adaptability of the safety switch in different output states.

[0080] In another possible embodiment, a state-based reference self-calibration method can be used to determine the reference output parameter value. A corresponding state reference table can be set for the target safety output terminal, including low-level reference parameter values ​​and high-level reference parameter values. When the target output state is low, the low-level reference parameter value can be read from the state reference table as the reference output parameter value; when the target output state is high, the high-level reference parameter value can be read from the state reference table as the reference output parameter value.

[0081] To reduce the impact of hardware component variability, temperature variations, or long-term aging on baseline parameter values, a small self-calibration can be performed on the corresponding baseline parameter values ​​in the state baseline table when the target safe output terminal is not in an overload state and the output state is stable. Output state stability can be understood as the target output state not switching within a preset stabilization time, and the output deviation values ​​obtained from multiple consecutive detection cycles being less than a preset stabilization threshold, where the preset stabilization threshold is less than the offset threshold used to determine the overload state.

[0082] For example, when the target output state is high-level, and the target safety output terminal has not been judged as overloaded in multiple consecutive detection cycles, and the fluctuation of multiple calibration output parameter values ​​is within the allowable range, the average or median of multiple calibration output parameter values ​​can be used as the high-level normal sample value, and the high-level reference parameter value can be updated with limiting based on the high-level normal sample value. In the low-level output state, the low-level reference parameter value can also be updated with limiting based on the low-level normal sample value.

[0083] When updating the baseline parameter values, the baseline correction amount can be determined based on the current baseline parameter values ​​and normal sample values, and the baseline correction amount can be limited within a preset correction step range. Then, the corresponding baseline parameter values ​​are updated based on the limited baseline correction amount. This avoids the baseline parameter values ​​from being rapidly skewed due to instantaneous sampling interference, load transients, or short-term disturbances. At the same time, the cumulative correction range of the baseline parameter values ​​can also be limited to a preset baseline allowable range to prevent the baseline parameter values ​​from deviating from the normal reference range of the safe output terminal.

[0084] In this way, the reference output parameter value does not always need to be a fixed theoretical value. Instead, it can be slowly corrected under stable and non-overload operating conditions at the target safe output terminal, thereby compensating for reference offsets caused by temperature drift, device variability, and long-term aging. This method makes the subsequent process of determining the output deviation value based on the calibration output parameter value and the reference output parameter value closer to the current hardware state. At the same time, by limiting the stability conditions, stability threshold, correction step size, and cumulative correction range, it avoids abnormal outputs being mistakenly absorbed as normal references, reducing the risk of overload misjudgment or missed judgment.

[0085] Optionally, in the step of determining whether the target safety output terminal is in an overload state based on the comparison result, if the comparison result shows that the output deviation value is greater than or equal to the offset threshold, then the target safety output terminal is determined to be in an overload state and the target safety output terminal is controlled to enter the protection state; if the comparison result shows that the output deviation value is less than the offset threshold, then the target safety output terminal is determined not to be in an overload state.

[0086] In this embodiment of the invention, the overload state of the target safety output terminal can be determined based on the comparison results. When the output deviation value is greater than or equal to the offset threshold, it indicates that the actual output of the target safety output terminal has significantly deviated from the normal output range under the current target output state, and there may be conditions such as overload, output terminal short circuit, abnormal residual voltage, or abnormal output voltage drop. Therefore, it can be determined that the target safety output terminal is in an overload state, and the target safety output terminal can be controlled to enter a protection state. The protection state may include shutting down the target safety output terminal, prohibiting the continued output of high level, outputting a fault indication signal, recording fault information, or sending alarm information to the upper control device.

[0087] When the output deviation is less than the offset threshold, it indicates that the output deviation of the target safety output terminal is still within the allowable range. This confirms that the target safety output terminal is not in an overload state and can maintain its current output state or continue to output according to the normal control logic of the safety switch. Therefore, the offset threshold can be used to distinguish normal device errors, sampling errors, or slight voltage fluctuations from actual overload anomalies, reducing false protection and missed protection situations.

[0088] For example, in an OSSD output voltage detection scenario, if the OSSD output is in a high-level output state with a supply voltage of 24V and the calibrated output voltage is 22.8V, the output deviation value is 1.2V. If the offset threshold is 0.6V, it can be determined that the OSSD output is in an overload state, and the OSSD output should be shut down or enter a safety protection state. If the calibrated output voltage is 23.7V, the output deviation value is 0.3V, which is less than the offset threshold, indicating that the OSSD output is not in an overload state and should continue to maintain normal output.

[0089] In one possible embodiment, after the target safety output terminal enters the protection state, a fault holding mechanism can also be activated to continuously prohibit the target safety output terminal from resuming normal output before the fault is eliminated; alternatively, after detecting that the output deviation value is less than the offset threshold multiple times in a row, the target safety output terminal can be allowed to exit the protection state to avoid frequent switching of the protection state caused by transient interference.

[0090] Furthermore, this invention provides a more specific embodiment applicable to OSSD overload protection scenarios. The target safe output terminal can be the OSSD output terminal, which is connected to the controller's sampling channel via a voltage divider resistor network. For example, a voltage divider resistor network can be constructed using 390kΩ and 47kΩ resistors to convert the 24V output voltage to a sampling range of 0V to 3.0V, with an upper limit margin of approximately 0.3V reserved to avoid affecting sampling reliability when the input voltage approaches the upper limit. The sampling module can utilize the 12-bit ADC channel of the APM32F103 chip, with an ADC conversion code value range of 0 to 4095 and a sampling frequency of 10kHz. The main control module can use an APM32F103 microcontroller to acquire the output detection value of the OSSD output terminal, the target output status, and a preset calibration feature point set, and to perform overload judgment based on the calibration output parameter values.

[0091] In the specific execution process, the calibration feature point set can be pre-stored in the microcontroller's Flash memory. For example, the detection feature value can be stored in the array adcTab[5]={0, 526, 2445, 3043, 3459}, and the corresponding calibration parameter value can be stored in the array volTab[5]={0, 340, 1844, 2341, 2735}. In this embodiment, the detection feature value can be the ADC sampling value, and the calibration parameter value can be the actual voltage quantization value. The actual voltage quantization value can use 0.01V as the unit, so 340 represents 3.40V, 1844 represents 18.44V, 2341 represents 23.41V, and 2735 represents 27.35V. Through the above two arrays, the correspondence between the detection feature value and the calibration parameter value can be established, and the range between two adjacent calibration feature points can be used as a calibration interval.

[0092] Once the main control module obtains the current output detection value, it can first determine the target calibration interval where the current output detection value falls based on the adcTab array. For example, if the current output detection value is less than or equal to 526, it matches the calibration interval corresponding to 0 to 526; if the current output detection value is greater than 526 and less than or equal to 2445, it matches the calibration interval corresponding to 526 to 2445; if the current output detection value is greater than 2445 and less than or equal to 3043, it matches the calibration interval corresponding to 2445 to 3043; if the current output detection value is greater than 3043 and less than or equal to 3459, it matches the calibration interval corresponding to 3043 to 3459. After determining the target calibration interval, the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values ​​can be read, and the calibration output parameter values ​​can be calculated based on the aforementioned piecewise linear calibration formula.

[0093] By comparing the OSSD output voltage detection values ​​before and after calibration through specific experiments, it can be concluded that: when the actual voltage is 3.4V, the detection voltage before calibration is 4.2V, and the detection voltage after calibration is 3.4V; when the actual voltage is 12V, the detection voltage before calibration is 15.1V, and the detection voltage after calibration is 12.2V, with an error of +0.2V; when the actual voltage is 18.44V, the detection voltage before calibration is 18.5V, and the detection voltage after calibration is 18.4V, with an error of -0.04V; when the actual voltage is 23.41V, the detection voltage before calibration is 22.9V, and the detection voltage after calibration is 23.5V, with an error of +0.09V; when the actual voltage is 27.35V, the detection voltage before calibration is 26.8V, and the detection voltage after calibration is 27.4V, with an error of +0.05V. This shows that after piecewise linear calibration, the output voltage detection error of the OSSD can be controlled within ±0.5V, which meets the overload protection accuracy requirements when the offset threshold is 600mV, or 0.6V.

[0094] During OSSD overload detection, the calibrated output parameter value can be used as the calibrated output voltage for the judgment. When the target output state is a low-level output state, the low-level reference parameter value can be used as the reference output parameter value, and the output deviation value is determined based on the deviation between the calibrated output parameter value and the low-level reference parameter value. When the target output state is a high-level output state, the high-level reference parameter value can be used as the reference output parameter value, and the output deviation value is determined based on the deviation between the high-level reference parameter value and the calibrated output parameter value. If the output deviation value is greater than or equal to 0.6V, the OSSD output terminal can be determined to be in an overload state, and the OSSD output terminal can be controlled to enter the protection state.

[0095] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0096] In one embodiment, an overload detection device for a safety switch is provided, which corresponds one-to-one with the overload detection method for the safety switch in the above embodiments. For example... Figure 2 As shown, the overload detection device for this safety switch includes an acquisition module 201, a determination module 202, a calibration module 203, and a detection module 204. Detailed descriptions of each functional module are as follows: The acquisition module 201 is used to acquire the output detection value of the target safety output terminal, the target output status, and a preset calibration feature point set. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, and each calibration feature point includes a detection feature value and a calibration parameter value corresponding to the detection feature value. The determining module 202 is used to determine the target calibration interval where the output detection value is located based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points, wherein the target calibration interval is determined by two adjacent calibration feature points; The calibration module 203 is used to perform piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, so as to obtain the calibration output parameter value; The detection module 204 is used to determine the corresponding reference output parameter value according to the target output state, determine the output deviation value based on the deviation between the calibration output parameter value and the reference output parameter value, and determine whether the target safety output terminal is in an overload state according to the output deviation value.

[0097] Optionally, the device further includes: The second acquisition module is used to acquire the detection feature value and calibration parameter value corresponding to the target safety output terminal under multiple calibration conditions. The generation module is used to generate the calibration feature point set based on the detection feature values ​​and calibration parameter values ​​corresponding to multiple calibration conditions; Among them, multiple calibration conditions cover the detection range of the simulated output parameters of the target safety output terminal.

[0098] Optionally, the determining module 202 is further configured to: The plurality of calibration feature points are arranged in order of magnitude of the detected feature values; The target calibration interval where the output detection value is located is determined from multiple calibration intervals formed by two adjacent calibration feature points; Wherein, the lower limit detection feature value of the target calibration interval is less than or equal to the output detection value, and the upper limit detection feature value of the target calibration interval is greater than or equal to the output detection value.

[0099] Optionally, the detection feature values ​​at both ends of the target calibration interval include a lower limit detection feature value and an upper limit detection feature value, and the calibration parameter values ​​corresponding to both ends of the target calibration interval include a lower limit calibration parameter value and an upper limit calibration parameter value. The calibration module 203 is further configured to: Based on the output detection value, the lower limit detection feature value, and the upper limit detection feature value, determine the interval position ratio of the output detection value in the target calibration interval; The calibration output parameter value is determined based on the interval position ratio, the lower limit calibration parameter value, and the upper limit calibration parameter value.

[0100] Optionally, the detection module 204 is further configured to: When the target output state is a low-level output state, the low-level reference parameter value is used as the reference output parameter value; When the target output state is a high-level output state, the high-level reference parameter value is used as the reference output parameter value.

[0101] Optionally, the detection module 204 is further configured to: The output deviation value is compared with a preset offset threshold to obtain the comparison result; Based on the comparison results, it is determined whether the target safety output terminal is in an overload state.

[0102] Optionally, the detection module 204 is further configured to: If the comparison result is that the output deviation value is greater than or equal to the offset threshold, then it is determined that the target safety output terminal is in an overload state, and the target safety output terminal is controlled to enter the protection state. If the comparison result shows that the output deviation value is less than the offset threshold, then it is determined that the target safety output terminal is not in an overload state.

[0103] The various modules in the overload detection device of the aforementioned safety switch can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0104] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement an overload detection method for a safety switch. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.

[0105] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, they implement the steps of the overload detection method of the safety switch described above.

[0106] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0107] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0108] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. An overload detection method for a safety switch, characterized in that, The method includes: The system acquires the output detection value of the target safety output terminal, the target output status, and a preset calibration feature point set. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, and each calibration feature point includes a detection feature value and a calibration parameter value corresponding to the detection feature value. Based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points, the target calibration interval in which the output detection value is located is determined, and the target calibration interval is determined by two adjacent calibration feature points; Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is subjected to piecewise linear calibration to obtain the calibration output parameter value; The corresponding reference output parameter value is determined based on the target output state, the output deviation value is determined based on the deviation between the calibration output parameter value and the reference output parameter value, and the target safety output terminal is determined to be in an overload state based on the output deviation value. Determining the corresponding baseline output parameter value based on the target output state includes: When the target output state is a low-level output state, the low-level reference parameter value is used as the reference output parameter value; When the target output state is a high-level output state, the high-level reference parameter value is used as the reference output parameter value.

2. The overload detection method for a safety switch as described in claim 1, characterized in that, Before acquiring the preset calibration feature point set, the method further includes: Under multiple calibration conditions, the detection feature values ​​and calibration parameter values ​​corresponding to the target safety output terminal are obtained respectively; The calibration feature point set is generated based on the detection feature values ​​and calibration parameter values ​​corresponding to multiple calibration conditions; Among them, multiple calibration conditions cover the detection range of the simulated output parameters of the target safety output terminal.

3. The overload detection method for a safety switch as described in claim 1, characterized in that, Determining the target calibration interval where the output detection value lies based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points includes: The plurality of calibration feature points are arranged in order of magnitude of the detected feature values; The target calibration interval where the output detection value is located is determined from multiple calibration intervals formed by two adjacent calibration feature points; Wherein, the lower limit detection feature value of the target calibration interval is less than or equal to the output detection value, and the upper limit detection feature value of the target calibration interval is greater than or equal to the output detection value.

4. The overload detection method for a safety switch as described in claim 1, characterized in that, The detection feature values ​​at both ends of the target calibration interval include a lower limit detection feature value and an upper limit detection feature value. The calibration parameter values ​​corresponding to both ends of the target calibration interval include a lower limit calibration parameter value and an upper limit calibration parameter value. Based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, the output detection value is subjected to piecewise linear calibration to obtain calibration output parameter values, including: Based on the output detection value, the lower limit detection feature value, and the upper limit detection feature value, determine the interval position ratio of the output detection value in the target calibration interval; The calibration output parameter value is determined based on the interval position ratio, the lower limit calibration parameter value, and the upper limit calibration parameter value.

5. The overload detection method for a safety switch as described in claim 1, characterized in that, Determining whether the target safety output terminal is in an overload state based on the output deviation value includes: The output deviation value is compared with a preset offset threshold to obtain the comparison result; Based on the comparison results, it is determined whether the target safety output terminal is in an overload state.

6. The overload detection method for a safety switch as described in claim 5, characterized in that, Determining whether the target safety output terminal is in an overload state based on the comparison result includes: If the comparison result is that the output deviation value is greater than or equal to the offset threshold, then it is determined that the target safety output terminal is in an overload state, and the target safety output terminal is controlled to enter the protection state. If the comparison result shows that the output deviation value is less than the offset threshold, then it is determined that the target safety output terminal is not in an overload state.

7. An overload detection device for a safety switch, characterized in that, The device includes: The acquisition module is used to acquire the output detection value of the target safety output terminal, the target output status, and a preset calibration feature point set. The output detection value is a value obtained by sampling the simulated output parameters of the target safety output terminal. The calibration feature point set includes multiple calibration feature points, and each calibration feature point includes a detection feature value and a calibration parameter value corresponding to the detection feature value. The determination module is used to determine the target calibration interval where the output detection value is located based on the interval relationship between the output detection value and the detection feature values ​​among the plurality of calibration feature points, wherein the target calibration interval is determined by two adjacent calibration feature points; The calibration module is used to perform piecewise linear calibration on the output detection value based on the detection feature values ​​at both ends of the target calibration interval and the corresponding calibration parameter values, so as to obtain the calibration output parameter value; The detection module is used to determine the corresponding reference output parameter value according to the target output state, determine the output deviation value based on the deviation between the calibration output parameter value and the reference output parameter value, and determine whether the target safety output terminal is in an overload state according to the output deviation value. The detection module is also used for: When the target output state is a low-level output state, the low-level reference parameter value is used as the reference output parameter value; When the target output state is a high-level output state, the high-level reference parameter value is used as the reference output parameter value.

8. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the overload detection method for the safety switch as described in any one of claims 1 to 6.

9. A readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by the processor, they implement the overload detection method for the safety switch as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Apparatus and method for controlling a security device

    CN115968500A

  • Sensor error calibration method and device, equipment and storage medium

    CN120489316A