A method and device for calibrating an analog photoelectric sensor
By adjusting the current in the analog photoelectric sensor without medium and with medium, and dynamically correcting the working current, the problem of working curve deviation caused by aging and dust accumulation is solved, and the adaptive ability and service life of the sensor are improved.
Patent Information
- Application Number
- CN202011637614.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Analog photoelectric sensors are prone to working curve deviation due to aging or dust accumulation after long-term use, affecting their environmental adaptability and service life.
By gradually adjusting the current at the transmitter in the absence of medium and with medium obstruction, the best working point is found, and the working current is dynamically corrected to ensure accurate detection of the sensor in both states, and the optimal operation is approached from large to small granularity. point.
The adaptive capability and service life of the analog photoelectric sensor are improved, and the impact of the working curve shift on the detection accuracy is avoided.
Smart Images

Figure CN113253360B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photoelectric sensors, and in particular to a calibration method and device for an analog photoelectric sensor. Background Art
[0002] The working principle of photoelectric sensors is to detect objects by converting changes in light intensity into changes in electrical signals. Analog photoelectric sensors are photoelectric sensors that output analog electrical signals. Analog photoelectric sensors include a transmitting diode and a receiving transistor. The transmitting end selects a suitable working current. Under this working current, the light intensity it generates is emitted to the collector of the receiving transistor. The sensor's volt-ampere characteristic curve can clearly distinguish the presence or absence of a medium, that is, detect the presence or absence of an object.
[0003] Generally speaking, under the selected transmitting end working current, if there is a medium, the medium will block the light path, and the voltage collected by the receiving end is in the cutoff region; if there is no medium, the voltage collected by the receiving end is in the saturation region. However, after working for a long time, analog photoelectric sensors often age or accumulate dust, causing the working curve to shift to the right, thereby affecting the normal state collection function, reducing the environmental adaptability of the sensor, and shortening the service life of the sensor. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide an analog photoelectric sensor calibration method that overcomes the above problems or at least partially solves the above problems.
[0005] The embodiment of the present invention further provides an analog photoelectric sensor calibration device to ensure the implementation of the above method.
[0006] In order to solve the above problem, an embodiment of the present invention discloses a calibration method for an analog photoelectric sensor, wherein the analog photoelectric sensor includes a transmitting end and a receiving end, and the method includes:
[0007] When the analog photoelectric sensor is in a state without dielectric shielding, an initial saturation current value is obtained; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working region not greater than the saturation critical line;
[0008] Determine an adjustment current value greater than the initial saturation current value, and input a current of the adjustment current value to the transmitting end;
[0009] In a case where the current current value of the transmitting end is the adjusted current value, if it is detected that the voltage of the receiving end is still in the saturation region, determining a reference current value between the adjusted current value and the initial saturation current value;
[0010] When the analog photoelectric sensor is in a state of being shielded by a medium, a current of the reference current value is input to the transmitting end, and a voltage at the receiving end is detected to be in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line;
[0011] If it is detected that the voltage of the receiving end is in the cut-off region, the reference current value is determined to be a correction current value, and the working current value of the transmitting end before correction is corrected to the correction current value;
[0012] If it is detected that the voltage at the receiving end is not in the cut-off region, a next reference current value is determined between the reference current value and the initial saturation current value until it is detected that the voltage at the receiving end is in the cut-off region.
[0013] Optionally, obtaining an initial saturation current value when the analog photoelectric sensor is in a state where there is no medium shielding includes:
[0014] When the analog photoelectric sensor is in a state without being shielded by a medium, an increasing current is inputted to the transmitting end starting from an initial current value until it is detected that the voltage at the receiving end initially reaches a saturation region;
[0015] When the voltage at the receiving end initially reaches the saturation region, an initial saturation current value is obtained.
[0016] Optionally, the determining an adjustment current value greater than the initial saturation current value and inputting a current of the adjustment current value to the transmitting end includes:
[0017] Starting from the initial saturation current value, increasing according to a preset current step to obtain an adjusted current value;
[0018] A current with the adjusted current value is input to the transmitting end.
[0019] Optionally, when the current current value of the transmitting end is the adjusted current value, if it is detected that the voltage of the receiving end is still in the saturation region, determining a reference current value between the adjusted current value and the initial saturation current value includes:
[0020] When the current value of the transmitting end is the adjusted current value, detecting whether the voltage of the receiving end is still in the saturation region;
[0021] If it is detected that the voltage of the receiving end is still in the saturation region, a first intermediate value between the adjusted current value and the initial saturation current value is calculated;
[0022] The first intermediate value is determined as a reference current value.
[0023] Optionally, when the analog photoelectric sensor is in a state of being shielded by a medium, inputting a current of the reference current value to the transmitting end, and detecting whether the voltage of the receiving end is in a cut-off region, comprises:
[0024] When the analog photoelectric sensor is in a state of being shielded by a medium, starting from the adjusted current value, a reduced current is input to the transmitting end until the reference current value is reached;
[0025] When the current value of the transmitting end is the reference current value, it is detected whether the voltage of the receiving end is in the cut-off region.
[0026] Optionally, if it is detected that the voltage of the receiving end is not in the cut-off region, determining a next reference current value between the reference current value and the initial saturation current value until it is detected that the voltage of the receiving end is in the cut-off region, comprises:
[0027] If it is detected that the voltage of the receiving end is not in the cut-off region, a second intermediate value between the reference current value and the initial saturation current value is calculated;
[0028] Determine the second intermediate value as a next reference current value;
[0029] Starting from the reference current value, inputting a decreasing current to the transmitting end until the next reference current value is reached;
[0030] When the current value of the transmitting end is the next reference current value, detecting whether the voltage of the receiving end is in a cut-off region;
[0031] If it is detected that the voltage of the receiving end is in the cut-off region, the next reference current value is determined to be a correction current value, and the operating current value stored in the transmitting end is corrected to the next reference current value.
[0032] Optionally, the method further comprises:
[0033] If the third intermediate value between the next reference current value and the initial saturation current value is close to the initial saturation current value and the voltage at the receiving end is still not in the cut-off region, an alarm signal is issued.
[0034] The embodiment of the present invention further provides an analog photoelectric sensor calibration device, wherein the analog photoelectric sensor includes a transmitting end and a receiving end, and the device includes:
[0035] An acquisition module, used for acquiring an initial saturation current value when the analog photoelectric sensor is in a state without dielectric shielding; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working region not greater than a saturation critical line;
[0036] A first input module, used for determining an adjustment current value greater than the initial saturation current value, and inputting a current of the adjustment current value to the transmitting end;
[0037] A first determining module is used to determine a reference current value between the adjusted current value and the initial saturation current value if it is detected that the voltage of the receiving end is still in the saturation region when the current current value of the transmitting end is the adjusted current value;
[0038] A second input module is used to input the current of the reference current value to the transmitting end when the analog photoelectric sensor is in a state of being shielded by a medium, and detect whether the voltage of the receiving end is in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line;
[0039] A correction module, configured to determine the reference current value as a correction current value if it is detected that the voltage of the receiving end is in a cut-off region, and to correct the working current value of the transmitting end before correction to the correction current value;
[0040] The second determination module is used to determine a next reference current value between the reference current value and the initial saturation current value if it is detected that the voltage of the receiving end is not in the cut-off region, until it is detected that the voltage of the receiving end is in the cut-off region.
[0041] Optionally, the acquisition module includes:
[0042] A first detection submodule is used to input an increasing current to the transmitting end starting from an initial current value when the analog photoelectric sensor is in a state without being blocked by a medium, until it is detected that the voltage at the receiving end initially reaches a saturation region;
[0043] The acquisition submodule is used to acquire an initial saturation current value when the voltage at the receiving end initially reaches the saturation region.
[0044] Optionally, the first input module includes:
[0045] A first calculation submodule is used to increase the initial saturation current value according to a preset current step to obtain an adjusted current value;
[0046] The first input submodule is used to input the current of the adjusted current value to the transmitting end.
[0047] Optionally, the first determining module includes:
[0048] A second detection submodule, used for detecting whether the voltage of the receiving end is still in the saturation region when the current current value of the transmitting end is the adjustment current value;
[0049] A second calculation submodule, configured to calculate a first intermediate value between the adjustment current value and the initial saturation current value if it is detected that the voltage of the receiving end is still in the saturation region;
[0050] The first determining submodule is configured to determine the first intermediate value as a reference current value.
[0051] Optionally, the second input module includes:
[0052] A second input submodule, used for inputting a decreasing current to the transmitting end starting from the adjusted current value until the reference current value is reached when the analog photoelectric sensor is in a state of being shielded by a medium;
[0053] The third detection submodule is used to detect whether the voltage of the receiving end is in a cut-off region when the current value of the transmitting end is the reference current value.
[0054] Optionally, the second determining module includes:
[0055] a third calculation submodule, configured to calculate a second intermediate value between the reference current value and the initial saturation current value if it is detected that the voltage of the receiving end is not in the cut-off region;
[0056] A second determining submodule, used for determining that the second intermediate value is a next reference current value;
[0057] A third input submodule, configured to input a decreasing current to the transmitting end starting from the reference current value until a current value of the transmitting end reaches the next reference current value;
[0058] A fourth detection submodule, used for detecting whether the voltage of the receiving end is in a cut-off region when the current current value of the transmitting end is the next reference current value;
[0059] The correction submodule is used to correct the operating current value of the transmitting end to the next reference current value if it is detected that the voltage of the receiving end is in the cut-off region.
[0060] Optionally, the device further comprises:
[0061] The alarm signal issuing module is used to issue an alarm signal if the third intermediate value between the next reference current value and the initial saturation current value is close to the initial saturation current value and the voltage at the receiving end is still not in the cut-off region.
[0062] An embodiment of the present invention also provides an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, including for executing an analog photoelectric sensor calibration method as described in any one of the embodiments of the present invention.
[0063] An embodiment of the present invention further provides a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the analog photoelectric sensor calibration method as described in any one of the embodiments of the present invention.
[0064] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0065] In the embodiment of the present invention, the sensor is first placed in a state without dielectric obstruction, and the initial saturation current of the transmitting end is found when the voltage of the receiving end initially reaches the saturation zone; then an adjustment current greater than the initial saturation current is determined; based on the adjustment current, if it is detected that the voltage of the receiving end is still in the saturation zone, a reference current is determined between the adjustment current and the initial saturation current; then the sensor is placed in a state with dielectric obstruction, and based on the reference current, if it is detected that the voltage of the receiving end is in the cutoff zone, the reference current is determined as the correction current, otherwise the current is continued to be reduced until the voltage of the receiving end is detected in the cutoff zone. By finding the working point in the two states of with and without dielectric obstruction, the method from large granularity to small granularity is adopted to gradually approach the optimal working point, realize dynamic correction of the working current of the transmitting end, improve the adaptive ability of the sensor, and extend the service life of the sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0067] Figure 1 is a working schematic diagram of the through-beam photoelectric sensor provided by an embodiment of the present invention;
[0068] Figure 2 is a volt-ampere characteristic curve of an analog photoelectric sensor without a medium provided by an embodiment of the present invention;
[0069] Figure 3 is a flowchart of a method for calibrating an analog photoelectric sensor provided by an embodiment of the present invention;
[0070] Figure 4 is a volt-ampere characteristic curve of the analog photoelectric sensor provided by an embodiment of the present invention;
[0071] Figure 5 It is a structural block diagram of an analog photoelectric sensor calibration device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] Photoelectric sensor is a sensor that uses photoelectric element as detection element. It converts the measured change into the change of light signal, and then further converts the light signal into electrical signal with the help of photoelectric element. Analog photoelectric sensor is a photoelectric sensor that outputs electrical signal in analog type, and through-beam photoelectric sensor is one type of analog photoelectric sensor. Figure 1 , shows a working schematic diagram of the through-beam photoelectric sensor provided in an embodiment of the present invention, SC01_T_LED is an infrared diode at the transmitting end, SC1 / 1P is a transistor at the receiving end, and prisms, media, and external interference (such as ambient light and dust) are objects that the light path of the through-beam photoelectric sensor may pass through.
[0074] The through-beam photoelectric sensor can separate the transmitter and the receiver, so that the detection distance is increased. The detection distance can be as high as several meters or even tens of meters. When using the through-beam photoelectric sensor, the transmitter and the receiver can be installed on both sides of the path through which the detection object passes. When the detection object passes, the light path is blocked, and the receiver outputs a voltage signal. The transmitter selects a suitable working current. Under this working current, the light intensity it generates is emitted to the collector of the transistor at the receiving end. The sensor's volt-ampere characteristic curve can clearly distinguish the presence or absence of the medium, that is, detect the presence or absence of the detection object.
[0075] Generally speaking, under the selected transmitting end working current, if there is a medium, the medium will block the light path, and the voltage collected by the receiving end is in the cutoff area of the sensor's volt-ampere characteristic curve; if there is no medium, the voltage collected by the receiving end is in the saturation area of the sensor's volt-ampere characteristic curve. However, after working for a long time, analog photoelectric sensors often age or accumulate dust, causing the working curve to shift to the right. Figure 2, shows the volt-ampere characteristic curve of the analog photoelectric sensor without a medium provided by an embodiment of the present invention, the horizontal axis represents the current emitted by the transmitting end, the vertical axis represents the voltage collected by the receiving end, the line segment marked 203 in the figure represents the saturation critical line, the area below the saturation critical line represents the saturation zone, the line segment marked 204 in the figure represents the cut-off critical line, the area above the cut-off critical line represents the cut-off zone, and the area between the reference numerals 203 and 204 represents the amplification zone.
[0076] When the analog photoelectric sensor is not blocked by a medium, the curve marked with reference numeral 201 is a normal curve, and the curve marked with reference numeral 202 is a curve when an abnormality occurs. The abnormality may be aging of the analog photoelectric sensor or dust accumulation in the analog photoelectric sensor, and the present invention does not limit this. The straight line marked with reference numeral 205 represents the selected transmitting end working current PWM1. The straight line marked with reference numeral 205 intersects with the curve marked with reference numeral 201 at the intersection point A; the straight line marked with reference numeral 205 intersects with the curve marked with reference numeral 202 at the intersection point B. The intersection points A and B are both the same working current PWM1. At the working current PWM1, the intersection point A is located in the area below the saturation critical line, that is, the intersection point A is located in the saturation zone; the intersection point B is located in the area above the cut-off critical line, that is, the intersection point B is located in the cut-off zone. It can be determined that for the abnormal analog photoelectric sensor, that is, the curve marked 202 in the figure, the working current PWM1 is not a reliable working current. This is because when the analog photoelectric sensor is not blocked by a medium, the voltage collected by the receiving end is normally in the saturation region, and in the working current PWM1, the intersection B is in the cut-off region. Therefore, the working current PWM1 is not a reliable working current for the abnormal analog photoelectric sensor.
[0077] After working for a long period of time, the analog photoelectric sensor often ages or accumulates dust, causing the working curve to shift to the right, such as the curve marked with reference numeral 202. The shift caused by aging is irreversible, while the shift caused by dust accumulation is reversible, and the shift will disappear as the dust is cleaned in time. In any case, the analog photoelectric sensor in operation needs to have the ability to dynamically adjust the working current to ensure that the working curve shift does not affect the normal state acquisition function, so as to improve the sensor's adaptive ability and extend the sensor's service life.
[0078] refer to Figure 3 , shows a flowchart of a method for calibrating an analog photoelectric sensor provided by an embodiment of the present invention, wherein the analog photoelectric sensor includes a transmitting end and a receiving end, and the method may specifically include the following steps:
[0079] Step 301, when the analog photoelectric sensor is in a state without dielectric obstruction, obtain an initial saturation current value; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working area not greater than the saturation critical line.
[0080] In the embodiment of the present invention, the medium can be a gas, liquid, solid or other substance. The analog photoelectric sensor emits a light beam through the transmitting end, and the receiving end collects the light beam. Then, the volt-ampere characteristic curve of the analog photoelectric sensor can be used to clearly distinguish whether there is a medium passing through the optical path between the transmitting end and the receiving end. If there is a medium passing through the optical path, the medium will block the light beam, and the voltage value collected by the receiving end will be in the cut-off area, so the presence of the medium can be detected, and the analog photoelectric sensor can send a detection alarm signal; if there is no medium passing through the optical path, the optical path between the transmitting end and the receiving end is unobstructed, and the voltage value collected by the receiving end will be in the saturation area, so the absence of the medium can be detected.
[0081] However, for abnormal analog photoelectric sensors, such as those that are aged or dusty, their working curves will shift to the right. This is because the light intensity emitted by the transmitting end of the abnormal analog photoelectric sensor will be weakened, causing the voltage collected by the receiving end to be greatly weakened. Compared with normal analog photoelectric sensors, both use the same working current, but the voltage collected by the receiving end of the abnormal analog photoelectric sensor will be greatly weakened. Therefore, the abnormal analog photoelectric sensor cannot guarantee detection accuracy, and it is easy for the abnormal analog photoelectric sensor to produce erroneous detection alarm signals.
[0082] The embodiment of the present invention provides a calibration system for realizing calibration of an analog photoelectric sensor. The calibration system includes an upper computer and a lower computer. A user can send a calibration instruction to the lower computer through the upper computer. After receiving the calibration instruction, the lower computer can calibrate the analog photoelectric sensor. In particular, the calibration system can dynamically calibrate the operating current of the transmitting end of the analog photoelectric sensor that is aged or has dust accumulation, so as to avoid the phenomenon that the working curve is shifted to the right.
[0083] In the embodiment of the present invention, the power supply device provides power to the analog photoelectric sensor, and the calibration system controls the magnitude of the current input to the transmitter by the power supply device. Figure 4, shows the volt-ampere characteristic curve of the analog photoelectric sensor provided by the embodiment of the present invention, the horizontal axis represents the current emitted by the transmitting end, the vertical axis represents the voltage collected by the receiving end, the line segment with reference numeral 403 represents the saturation critical line, the area below the saturation critical line represents the saturation zone, the line segment with reference numeral 404 represents the cut-off critical line, the area above the cut-off critical line represents the cut-off zone, and the area between reference numerals 403 and 404 represents the amplification zone. The curve with reference numeral 401 is the working curve of the analog photoelectric sensor in the state of no medium shielding, and the curve with reference numeral 402 is the working curve of the analog photoelectric sensor in the state of medium shielding. The embodiment of the present invention needs to first ensure that there is no medium shielding on the optical path of the analog photoelectric sensor, and then the correction system adjusts the current of the transmitting end until it is detected that the voltage of the receiving end initially reaches the saturation zone, and when the voltage of the receiving end initially reaches the saturation zone, the initial saturation current value is obtained.
[0084] In an optional embodiment of the present invention, step 301 may include the following sub-steps:
[0085] When the analog photoelectric sensor is in a state without dielectric obstruction, an increasing current is input to the transmitting end starting from an initial current value until it is detected that the voltage at the receiving end initially reaches a saturation region; when the voltage at the receiving end initially reaches a saturation region, an initial saturation current value is obtained.
[0086] refer to Figure 4 , shows the volt-ampere characteristic curve of the analog photoelectric sensor provided by the embodiment of the present invention. When the analog photoelectric sensor is in a state without dielectric shielding, the correction system controls the power supply device to input a gradually increasing current to the transmitting end from an initial current value, for example, from 0, or a smaller current value, until it is detected that the voltage at the receiving end initially reaches the saturation region, such as Figure 4 The intersection point 405 shown is the intersection point of the curve marked with reference numeral 401 and the line segment marked with reference numeral 403, that is, the intersection point 405 is the inflection point where the voltage at the receiving end initially reaches the saturation region, indicating that the voltage at the receiving end initially reaches the saturation region. At this time, the initial saturation current value PWM2 is obtained.
[0087] Step 302: determine an adjusted current value greater than the initial saturation current value, and input a current of the adjusted current value to the transmitting end.
[0088] After the embodiment of the present invention finds the inflection point where the voltage at the receiving end initially reaches the saturation zone, the initial saturation current value of the transmitting end is obtained at this inflection point, and then an adjustment current value greater than the initial saturation current value is determined, and the correction system controls the power supply device to input a current of the adjustment current value to the transmitting end.
[0089] In an optional embodiment of the present invention, step 302 may include the following sub-steps:
[0090] Starting from the initial saturation current value, the current is increased according to a preset current step to obtain an adjusted current value; and a current of the adjusted current value is input to the transmitting end.
[0091] In the embodiment of the present invention, the correction system controls the power supply device to increase the current input according to the preset current step from the initial saturation current value PWM2 to obtain the adjusted current value PWM3. For example, the preset current step is deltaStep=200, the initial saturation current value I_PWMcur1=200, and the embodiment of the present invention can calculate the adjusted current value I_PWMcur2 according to the following formula:
[0092] I_PWMcur2=I_PWMcur1+deltaStep=200+200=400
[0093] The embodiment of the present invention obtains the adjusted current value I_PWMcur2, that is, Figure 4 PWM3 shown, then it is necessary to determine whether the adjusted current value PWM3 meets the constraints. There are two constraints. One is to stay away from the inflection point as much as possible, that is, the adjusted current value needs to be significantly different from the initial saturation current value; the other is that the adjusted current cannot be too large, because too large a current will accelerate the aging of the transmitter, or even burn it. The embodiment of the present invention confirms that the adjusted current value PWM3 is both away from the initial saturation current value PWM2 and not too large, satisfying the above two constraints. The above examples are only used to enable those skilled in the art to better understand the embodiments of the present invention, and the present invention does not limit this.
[0094] Step 303, when the current current value of the transmitting end is the adjusted current value, if it is detected that the voltage of the receiving end is still in the saturation region, a reference current value is determined between the adjusted current value and the initial saturation current value.
[0095] In an embodiment of the present invention, after inputting a current with an adjusted current value into the transmitting end, if it is detected that the voltage at the receiving end is still in the saturation zone when the current current value at the transmitting end is the adjusted current value, it means that the adjusted current value PWM3 is reliable for the state without dielectric obstruction. The embodiment of the present invention needs to further find the optimal correction current for both the state with dielectric obstruction and the state with dielectric obstruction. Therefore, the embodiment of the present invention can determine the reference current value between the adjusted current value PWM3 and the initial saturation current value PWM2.
[0096] In an optional embodiment of the present invention, step 303 may include the following sub-steps:
[0097] If the current current value of the transmitting end is the adjusted current value, detect whether the voltage of the receiving end is still in the saturation region; if it is detected that the voltage of the receiving end is still in the saturation region, calculate a first intermediate value between the adjusted current value and the initial saturation current value; determine the first intermediate value as the reference current value.
[0098] Specifically, when the current value PWM3 is adjusted, the curve of reference numeral 401 determines whether the intersection 406 is located in the saturation region, that is, when the current value of the transmitting end is the adjusted current value, it is detected whether the voltage of the receiving end is still in the saturation region. If it is detected that the voltage of the receiving end is still in the saturation region, then the first intermediate value of the adjusted current value PWM3 and the initial saturation current value PWM2 can be calculated, and then the first intermediate value can be determined as the reference current value. The embodiment of the present invention can calculate the first intermediate value according to the following formula:
[0099]
[0100] Among them, the initial saturation current value is I_PWMcur1, the adjustment current value is I_PWMcur2, and the first intermediate value is I_PWMcur12. Then I_PWMcur12 is determined as the reference current value, such as Figure 4 PWM4 is shown, where PWM4 is the reference current value.
[0101] Step 304, when the analog photoelectric sensor is in a state of being shielded by a medium, input a current of the reference current value to the transmitting end, and detect whether the voltage at the receiving end is in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line.
[0102] The embodiment of the present invention first ensures that there is no medium blocking the optical path of the analog photoelectric sensor, finds the reference current value PWM4, and then ensures that there is a medium blocking the optical path of the analog photoelectric sensor. Figure 4 The curve marked with reference numeral 402 is the working curve of the analog photoelectric sensor when it is blocked by a medium. The correction system controls the power supply device to input the reference current PWM4 to the transmitting end. When the curve marked with reference numeral 402 is at the reference current value PWM4, it is determined whether the curve 402 is in the cut-off zone, that is, when the current current value of the transmitting end is the reference current value, it is detected whether the voltage of the receiving end is in the cut-off zone.
[0103] In an optional embodiment of the present invention, step 304 may include the following sub-steps:
[0104] When the analog photoelectric sensor is in a state where there is a medium blocking it, starting from the adjusted current value, a decreasing current is input to the transmitting end until the reference current value is reached; when the current current value of the transmitting end is the reference current value, it is detected whether the voltage of the receiving end is in the cut-off region.
[0105] In the embodiment of the present invention, when the analog photoelectric sensor is in a state of being obstructed by a medium, the correction system controls the power supply device to start from adjusting the current value PWM3, inputting a gradually decreasing current to the transmitting end until the reference current value is reached, and then, when the current current value of the transmitting end is the reference current value, detects whether the voltage of the receiving end is in the cut-off region, that is, when the current current value of the transmitting end is the reference current value, determines whether the curve marked with reference mark 402 is in the cut-off region.
[0106] Step 305: If it is detected that the voltage of the receiving end is in the cut-off region, the reference current value is determined to be a correction current value, and the working current value of the transmitting end before correction is corrected to the correction current value.
[0107] If it is detected that the voltage at the receiving end is in the cut-off region, that is, the curve of reference numeral 402 is located in the cut-off region above the line segment of reference numeral 404, wherein the line segment of reference numeral 407 represents the extension line of the reference current value PWM4, the line segment of reference numeral 407 intersects with the curve of reference numeral 401, and the intersection point is C; the line segment of reference numeral 407 intersects with the curve of reference numeral 402, and the intersection point is D. The intersection point C is located in the area below the line segment of reference numeral 403, and it is determined that the intersection point C is located in the saturation region. The intersection C is on the curve marked with reference numeral 401, that is, the intersection C is on the working curve of the analog photoelectric sensor in the state of no medium shielding, indicating that the reference current value PWM4 is reliable when the analog photoelectric sensor is in the state of no medium shielding; the intersection D is located in the area above the line segment marked with reference numeral 404, and it is determined that the intersection D is located in the cut-off area, and the intersection D is on the curve marked with reference numeral 401, that is, the intersection D is on the working curve of the analog photoelectric sensor in the state of medium shielding, indicating that the reference current value PWM4 is reliable when the analog photoelectric sensor is in the state of medium shielding. Therefore, the reference current value PWM4 is reliable for both the state of no medium shielding and the state of medium shielding, and the reference current is the optimal working current, which can give full play to the detection function. The correction system corrects the working current value before the transmitter is corrected to the correction current value, so that the correction current can be used when the analog photoelectric sensor is working, and the correction work of the correction system is completed.
[0108] Step 306: If it is detected that the voltage at the receiving end is not in the cut-off region, determine a next reference current value between the reference current value and the initial saturation current value until it is detected that the voltage at the receiving end is in the cut-off region.
[0109] If it is detected that the voltage at the receiving end is not in the cut-off zone, that is, the curve marked 402 is not in the cut-off zone above the line segment marked 404, it means that the reference current value PWM4 is not a reliable working current and further correction work is required until it is detected that the voltage at the receiving end is in the cut-off zone.
[0110] In an optional embodiment of the present invention, step 306 may include the following sub-steps:
[0111] If it is detected that the voltage at the receiving end is not in the cut-off region, a second intermediate value between the reference current value and the initial saturation current value is calculated; the second intermediate value is determined to be a next reference current value; starting from the reference current value, a decreasing current is input to the transmitting end until the next reference current value is reached; if the current current value of the transmitting end is the next reference current value, whether the voltage at the receiving end is in the cut-off region is detected; if it is detected that the voltage at the receiving end is in the cut-off region, the next reference current value is determined to be a correction current value, and the operating current value stored at the transmitting end is corrected to the next reference current value.
[0112] If it is detected that the voltage at the receiving end is not in the cut-off region, a second intermediate value between the reference current value and the initial saturation current value is calculated, and the second intermediate value is determined as the next reference current value. The embodiment of the present invention can calculate the second intermediate value according to the following formula:
[0113]
[0114] The initial saturation current value is I_PWMcur1, the reference current value is I_PWMcur12, and the second intermediate value is I_PWMcur112. Then, I_PWMcur112 is determined as the next reference current value.
[0115] The correction system controls the power supply device to input a gradually decreasing current to the transmitting end starting from the reference current value PWM4 until the next reference current value is reached, and then, when the current current value of the transmitting end is the next reference current value, detects whether the voltage of the receiving end is in the cut-off region, that is, when the current current value of the transmitting end is the next reference current value, whether the curve marked 402 in the reference figure is in the cut-off region. If it is detected that the voltage of the receiving end is in the cut-off region, that is, the curve marked 402 in the reference figure is in the cut-off region, it means that the analog photoelectric sensor is in a state of medium obstruction, and the next reference current value is reliable. Therefore, the reference current value PWM4 is reliable for both the state of no medium obstruction and the state of medium obstruction, and the next reference current value is the optimal working current, which can give full play to the detection function, and the lower computer of the correction system stores the next reference current value, and when the analog photoelectric sensor is working, the working current of its transmitting end is corrected to the next reference current, and the correction work of the correction system is completed.
[0116] In an optional embodiment of the present invention, the method may further include:
[0117] If the third intermediate value between the next reference current value and the initial saturation current value is close to the initial saturation current value and the voltage at the receiving end is still not in the cut-off region, an alarm signal is issued.
[0118] The third intermediate value can be calculated according to the following formula:
[0119]
[0120] Among them, the initial saturation current value is I_PWMcur1, the next reference current value is I_PWMcur12, and the third intermediate value is I_PWMcur1112. If I_PWMcur1112≈I_PWMcur1, the voltage at the receiving end is still not in the cut-off zone, indicating that this calibration has failed, and the analog photoelectric sensor may be seriously aged or too dusty, requiring alarm and manual intervention. If I_PWMcur1112<I_PWMcur1, that is, the third intermediate value between the next reference current value and the initial saturation current value is not close to the initial saturation current value, the current value of the transmitting end can be further reduced according to the above steps until the voltage at the receiving end is detected to be in the cut-off zone.
[0121] The correction system supports active and controlled correction of analog photoelectric sensors. The embodiments of the present invention can realize autonomous correction and controlled correction by programming in the lower computer. Active correction can be that the lower computer selects its own idle state within the working cycle and autonomously completes the correction of the analog photoelectric sensor. The closed-loop control of the active correction process can be realized on the lower computer. Controlled correction can be that the lower computer provides an interface to the upper computer to complete the appropriate way of starting the correction. When the lower computer receives the correction instruction from the upper computer, the lower computer interacts with the upper computer to complete the correction of the analog photoelectric sensor. In the embodiments of the present invention, when the analog photoelectric sensor is in an idle state, that is, the analog photoelectric sensor is not in a working state, the correction system can periodically and automatically complete the correction of the analog photoelectric sensor.
[0122] In the embodiment of the present invention, the sensor is first placed in a state without dielectric obstruction, and the initial saturation current of the transmitting end is found when the voltage of the receiving end initially reaches the saturation zone; then an adjustment current greater than the initial saturation current is determined; based on the adjustment current, if it is detected that the voltage of the receiving end is still in the saturation zone, a reference current is determined between the adjustment current and the initial saturation current; then the sensor is placed in a state with dielectric obstruction, and based on the reference current, if it is detected that the voltage of the receiving end is in the cutoff zone, the reference current is determined as the correction current, otherwise the current is continued to be reduced until the voltage of the receiving end is detected in the cutoff zone. By finding the working point in the two states of with and without dielectric obstruction, the method from large granularity to small granularity is adopted to gradually approach the optimal working point, realize dynamic correction of the working current of the transmitting end, improve the adaptive ability of the sensor, and extend the service life of the sensor.
[0123] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0124] The embodiment of the present invention further provides an analog photoelectric sensor calibration device, wherein the analog photoelectric sensor includes a transmitting end and a receiving end, and the device includes:
[0125] refer to Figure 5 , shows a structural block diagram of an analog photoelectric sensor calibration device provided by an embodiment of the present invention, which may specifically include the following modules:
[0126] The acquisition module 501 is used to acquire an initial saturation current value when the analog photoelectric sensor is in a state without dielectric shielding; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working region not greater than the saturation critical line;
[0127] A first input module 502, configured to determine an adjusted current value greater than the initial saturation current value, and input a current of the adjusted current value to the transmitting end;
[0128] A first determining module 503 is configured to determine a reference current value between the adjusted current value and the initial saturated current value if it is detected that the voltage of the receiving end is still in the saturation region when the current current value of the transmitting end is the adjusted current value;
[0129] The second input module 504 is used to input the current of the reference current value to the transmitting end when the analog photoelectric sensor is in a state of being shielded by a medium, and detect whether the voltage of the receiving end is in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line;
[0130] A correction module 505, configured to determine the reference current value as a correction current value if it is detected that the voltage of the receiving end is in a cut-off region, and to correct the working current value of the transmitting end before correction to the correction current value;
[0131] The second determination module 506 is configured to determine a next reference current value between the reference current value and the initial saturation current value if it is detected that the voltage at the receiving end is not in the cut-off region, until it is detected that the voltage at the receiving end is in the cut-off region.
[0132] In an optional embodiment of the present invention, the acquisition module 501 may include:
[0133] A first detection submodule is used to input an increasing current to the transmitting end starting from an initial current value when the analog photoelectric sensor is in a state without being blocked by a medium, until it is detected that the voltage at the receiving end initially reaches a saturation region;
[0134] The acquisition submodule is used to acquire an initial saturation current value when the voltage at the receiving end initially reaches the saturation region.
[0135] In an optional embodiment of the present invention, the first input module 502 includes:
[0136] A first calculation submodule is used to increase the initial saturation current value according to a preset current step to obtain an adjusted current value;
[0137] The first input submodule is used to input the current of the adjusted current value to the transmitting end.
[0138] In an optional embodiment of the present invention, the first determining module 503 includes:
[0139] A second detection submodule, used for detecting whether the voltage of the receiving end is still in the saturation region when the current current value of the transmitting end is the adjustment current value;
[0140] A second calculation submodule, configured to calculate a first intermediate value between the adjustment current value and the initial saturation current value if it is detected that the voltage of the receiving end is still in the saturation region;
[0141] The first determining submodule is configured to determine the first intermediate value as a reference current value.
[0142] In an optional embodiment of the present invention, the second input module 504 includes:
[0143] A second input submodule, used for inputting a decreasing current to the transmitting end starting from the adjusted current value until the reference current value is reached when the analog photoelectric sensor is in a state of being shielded by a medium;
[0144] The third detection submodule is used to detect whether the voltage of the receiving end is in a cut-off region when the current value of the transmitting end is the reference current value.
[0145] In an optional embodiment of the present invention, the second determining module 506 includes:
[0146] a third calculation submodule, configured to calculate a second intermediate value between the reference current value and the initial saturation current value if it is detected that the voltage of the receiving end is not in the cut-off region;
[0147] A second determining submodule, used for determining that the second intermediate value is a next reference current value;
[0148] A third input submodule, configured to input a decreasing current to the transmitting end starting from the reference current value until a current value of the transmitting end reaches the next reference current value;
[0149] A fourth detection submodule, used for detecting whether the voltage of the receiving end is in a cut-off region when the current current value of the transmitting end is the next reference current value;
[0150] The correction submodule is used to correct the operating current value of the transmitting end to the next reference current value if it is detected that the voltage of the receiving end is in the cut-off region.
[0151] In an optional embodiment of the present invention, the device further comprises:
[0152] The alarm signal issuing module is used to issue an alarm signal if the third intermediate value between the next reference current value and the initial saturation current value is close to the initial saturation current value and the voltage at the receiving end is still not in the cut-off region.
[0153] In the embodiment of the present invention, the sensor is first placed in a state without dielectric obstruction, and the initial saturation current of the transmitting end is found when the voltage of the receiving end initially reaches the saturation zone; then an adjustment current greater than the initial saturation current is determined; based on the adjustment current, if it is detected that the voltage of the receiving end is still in the saturation zone, a reference current is determined between the adjustment current and the initial saturation current; then the sensor is placed in a state with dielectric obstruction, and based on the reference current, if it is detected that the voltage of the receiving end is in the cutoff zone, the reference current is determined as the correction current, otherwise the current is continued to be reduced until the voltage of the receiving end is detected in the cutoff zone. By finding the working point in the two states of with and without dielectric obstruction, the method from large granularity to small granularity is adopted to gradually approach the optimal working point, realize dynamic correction of the working current of the transmitting end, improve the adaptive ability of the sensor, and extend the service life of the sensor.
[0154] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0155] An embodiment of the present invention also provides an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, including for executing an analog photoelectric sensor calibration method as described in any one of the embodiments of the present invention.
[0156] An embodiment of the present invention further provides a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the analog photoelectric sensor calibration method as described in any one of the embodiments of the present invention.
[0157] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0158] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0159] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0161] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0162] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0163] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0164] The above is a detailed introduction to an analog photoelectric sensor calibration method, device, electronic device and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A calibration method for an analog photoelectric sensor, characterized in that: The analog photoelectric sensor includes a transmitting end and a receiving end, and the method includes: When the analog photoelectric sensor is in a state without dielectric shielding, an initial saturation current value is obtained; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working region not greater than the saturation critical line; Determine an adjustment current value greater than the initial saturation current value, and input a current of the adjustment current value to the transmitting end; In the case where the current current value of the transmitting end is the adjusted current value, if it is detected that the voltage of the receiving end is still in the saturation region, determining the arithmetic mean of the adjusted current value and the initial saturation current value as the reference current value; When the analog photoelectric sensor is in a state of being shielded by a medium, starting from the adjusted current value, a reduced current is input to the transmitting end until the reference current value is reached; When the current value of the transmitting end is the reference current value, detecting whether the voltage of the receiving end is in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line; If it is detected that the voltage of the receiving end is in the cut-off region, the reference current value is determined to be a correction current value, and the working current value of the transmitting end before correction is corrected to the correction current value; If it is detected that the voltage of the receiving end is not in the cut-off region, a second intermediate value between the reference current value and the initial saturation current value is calculated; Determine the second intermediate value as a next reference current value; Starting from the reference current value, inputting a decreasing current to the transmitting end until the next reference current value is reached; When the current value of the transmitting end is the next reference current value, detecting whether the voltage of the receiving end is in a cut-off region; If it is detected that the voltage of the receiving end is in the cut-off region, the next reference current value is determined to be a correction current value, and the working current value of the transmitting end before correction is corrected to the correction current value.
2. The method according to claim 1, characterized in that The step of obtaining an initial saturation current value when the analog photoelectric sensor is in a state where there is no medium shielding includes: When the analog photoelectric sensor is in a state without being shielded by a medium, an increasing current is inputted to the transmitting end starting from an initial current value until it is detected that the voltage at the receiving end initially reaches a saturation region; When the voltage at the receiving end initially reaches the saturation region, an initial saturation current value is obtained.
3. The method according to claim 1, characterized in that The step of determining an adjustment current value greater than the initial saturation current value and inputting a current of the adjustment current value to the transmitting end includes: Starting from the initial saturation current value, increasing according to a preset current step to obtain an adjusted current value; A current with the adjusted current value is input to the transmitting end.
4. The method according to claim 1, characterized in that: The method further comprises: If the third intermediate value between the next reference current value and the initial saturation current value is close to the initial saturation current value and the voltage at the receiving end is still not in the cut-off region, an alarm signal is issued.
5. An analog photoelectric sensor calibration device, characterized in that: The analog photoelectric sensor includes a transmitting end and a receiving end, and the device includes: An acquisition module, used for acquiring an initial saturation current value when the analog photoelectric sensor is in a state without dielectric shielding; wherein the initial saturation current value is the current value of the transmitting end when the voltage of the receiving end initially reaches the saturation region; the saturation region is a working region not greater than a saturation critical line; A first input module, used for determining an adjustment current value greater than the initial saturation current value, and inputting a current of the adjustment current value to the transmitting end; A first determining module is used for determining an arithmetic mean of the adjusted current value and the initial saturated current value as a reference current value if it is detected that the voltage of the receiving end is still in a saturation region when the current current value of the transmitting end is the adjusted current value; A second input module is used to input the current of the reference current value to the transmitting end when the analog photoelectric sensor is in a state of being shielded by a medium, and detect whether the voltage of the receiving end is in a cut-off region; wherein the cut-off region is a working region not less than a cut-off critical line; A correction module, configured to determine the reference current value as a correction current value if it is detected that the voltage of the receiving end is in a cut-off region, and to correct the working current value of the transmitting end before correction to the correction current value; A second determination module is used to determine a next reference current value between the reference current value and the initial saturation current value if it is detected that the voltage of the receiving end is not in the cut-off region, until it is detected that the voltage of the receiving end is in the cut-off region; The second input module comprises: A second input submodule, used for inputting a decreasing current to the transmitting end starting from the adjusted current value until the reference current value is reached when the analog photoelectric sensor is in a state of being shielded by a medium; A third detection submodule, configured to detect whether the voltage at the receiving end is in a cut-off region when the current current value at the transmitting end is the reference current value; The second determination module includes: a third calculation submodule, configured to calculate a second intermediate value between the reference current value and the initial saturation current value if it is detected that the voltage of the receiving end is not in the cut-off region; A second determining submodule, used for determining that the second intermediate value is a next reference current value; A third input submodule, configured to input a decreasing current to the transmitting end starting from the reference current value until a current value of the transmitting end reaches the next reference current value; A fourth detection submodule, used for detecting whether the voltage of the receiving end is in a cut-off region when the current current value of the transmitting end is the next reference current value; The correction submodule is used to determine the next reference current value as the correction current value if it is detected that the voltage of the receiving end is in the cut-off region, and correct the working current value of the transmitting end before correction to the correction current value.
6. An electronic device, characterized in that: It comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the analog photoelectric sensor calibration method as described in any one of method claims 1-4.
7. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the analog photoelectric sensor calibration method as described in any one of method claims 1-4.
