Photoelectric zero sensor automatic test system and test method thereof

By designing an automatic testing system for photoelectric zero-position sensors, an embedded computer and microcontroller realize automatic measurement of the electrical parameters of the photoelectric zero-position sensor and parallel automatic testing of zero width and zero-position accuracy, the problem of relying on external equipment in the existing technology is solved, and detection efficiency and accuracy are improved.

CN119915329APending Publication Date: 2025-05-02BEIJING DONGFANG MEASUREMENT & TEST INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510106371.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the prior art, the detection process of photoelectric zero-position sensors relies on external current sources and digital multi-meters, resulting in high waste of manpower and material resources, false detection rates and calculation error rates.

Method used

Design an automatic testing system for photoelectric zero-position sensors, including a measurement unit, a driving unit, a light emitting diode current source, a microcontroller and an embedded computer, to realize automatic measurement of the electrical parameters of the photoelectric zero-position sensor and parallel automatic testing of zero width and zero-position accuracy.

Benefits of technology

It realizes automatic measurement and data processing of photoelectric zero-position sensors, avoids errors and wastes of manual detection, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119915329A_ABST
    Figure CN119915329A_ABST
Patent Text Reader

Abstract

The invention provides a photoelectric zero sensor automatic test system and a test method thereof. The automatic test system comprises a measuring unit which comprises a photoelectric tube measuring module, a zero precision detection module, a zero width detection module, an operation step number measuring module and an operation frequency measuring module; the driving unit comprises a motor driving control circuit and a pulse generator; the light-emitting diode current source is used for providing driving current for a light-emitting diode of the photoelectric zero-position sensor through an analog-to-digital converter; the microcontroller is used for controlling the light-emitting diode current source, the pulse generator and the measuring unit and is communicated with the stepping motor at the same time; and the embedded computer is used for controlling the microcontroller, and the embedded computer is used for running an automatic test program. According to the automatic test system and the test method thereof, an external current source and a digital multimeter are not needed, manual recording of test data is not needed, and one-button zeroing of the mechanism and one-button automatic testing of related parameters can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to an automatic testing system and a testing method for a photoelectric zero position sensor. Background Art

[0002] At present, low-speed drive mechanisms in space include sailboard drive mechanisms, antenna drive mechanisms, thrust vector adjustment mechanisms, etc. The drive part uses a two-phase stepper motor as the power source. The two-phase stepper motor is a special motor that converts digital pulses into corresponding angular displacement or linear displacement. It is a core component of the spacecraft control system; the angle measurement part uses a zero-position sensor. Different transmission designs combined with the angle measurement components can realize the design of various low-speed drive mechanisms.

[0003] In order to achieve precise control of the spacecraft solar sail by the low-speed drive mechanism in space, it is necessary to complete comprehensive testing of the performance indicators of the stepper motor and angle measuring components used. Among them, the photoelectric zero position sensor is required to detect whether the stepper motor is at the zero position. Zero point position detection and control, as well as the real-time detection of the zero position width, zero position accuracy and corresponding electrical parameter indicators of the photoelectric zero position sensor are very important for realizing the precise detection of the zero position angle of the photoelectric zero position sensor.

[0004] In the prior art, the photoelectric zero position sensor is usually detected by manually controlling an external current source or an external digital multimeter, which wastes a lot of manpower and material resources. In addition, due to the large number and variety of measurement parameters, the measurement process has a high false detection rate and calculation error rate. Summary of the invention

[0005] In view of the above problems, the present invention proposes an automatic testing system for a photoelectric zero-position sensor, which can realize the drive control of the tested mechanism; realize the measurement of the corresponding electrical parameter signals such as voltage and current of the photoelectric zero-position sensor, and realize parallel automatic testing of the zero-position width and zero-position accuracy of the photoelectric zero-position sensor, and at the same time realize automatic collection, processing and storage of test data, avoiding many drawbacks of the existing technical solutions, and realizing the automatic measurement of the photoelectric zero-position sensor and the automatic processing of the measurement data.

[0006] The present application provides an automatic testing system for a photoelectric zero position sensor, comprising:

[0007] The measuring unit includes a photoelectric tube measuring module, a zero position accuracy detection module, a zero position width detection module, a running step number measuring module, and a running frequency measuring module. The photoelectric tube measuring module is used to measure the specified voltage, current, step number, and frequency signal;

[0008] The drive unit includes a motor drive control circuit and a pulse generator, wherein the motor drive control circuit is used to generate pulse currents of different frequencies to control the rotation of the stepper motor; the pulse generator is used to output drive signals to the running step measurement module, the running frequency measurement module, and the motor drive control circuit;

[0009] The light-emitting diode current source is used to provide a driving current to the light-emitting diode of the photoelectric zero position sensor through the analog-to-digital converter, by changing the output voltage V ref , adjust the driving current value output to the light emitting diode;

[0010] A microcontroller is used to control the light emitting diode current source, the pulse generator, and the measuring unit, and communicate with the stepper motor at the same time. The microcontroller also receives the running step number information and the running frequency information from the pulse generator, and controls the measuring unit according to the received running step number information and the running frequency information;

[0011] An embedded computer is used to control the microcontroller and the embedded computer is used to run the automated test program.

[0012] According to a system provided by one embodiment of the present application, the specified voltage, current, number of steps, and frequency include the current of the light-emitting diode in the photoelectric zero-position sensor, the collector-emitter voltage and collector current of the phototransistor, and the cumulative number of steps and frequency of the stepper motor.

[0013] The present application also provides an automatic testing method for a photoelectric zero position sensor, which uses the system described in claim 1 to perform automatic testing, and the method includes: functional performance normality test, zero point position test, zero control test, zero position width test, and zero position accuracy test.

[0014] According to a method provided by one embodiment of the present application, the step of functional performance normality testing includes:

[0015] By changing the output voltage V ref , adjust the driving current value output to the light-emitting diode, and use the photoelectric tube measurement module of the measuring unit to detect the collector current of the phototransistor. The embedded computer uses automatic testing software to determine whether the functional performance of the zero position sensor is normal based on the measured driving current value and the collector current of the phototransistor.

[0016] According to a method provided by one embodiment of the present application, the step of zero point position testing includes:

[0017] The photoelectric tube measurement module of the measurement unit is used to test the collector current of the phototransistor. If a zero-position signal is measured, it indicates that the stepper motor is at the zero position. If no zero-position signal is measured, it indicates that the stepper motor is not at the zero position and zeroing control is required.

[0018] According to a method provided by one embodiment of the present application, the step of zeroing control test includes:

[0019] Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, controlling the stepper motor to rotate toward the zero position;

[0020] While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at its maximum value, it indicates that the stepper motor has returned to the zero position. At this time, the driving signal is stopped from being output to the motor drive control circuit of the stepper motor.

[0021] According to a method provided by an embodiment of the present application, the step of zero width testing includes:

[0022] Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, controlling the stepper motor to rotate toward the zero position;

[0023] While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at its maximum value, the stepper motor continues to rotate until the collector current of the phototransistor decreases to a current threshold at the falling edge. The running step measurement module records the number of rotation steps A of the stepper motor, and the zero position width is A×step angle.

[0024] According to a method provided by one embodiment of the present application, the current threshold is 90uA.

[0025] According to a method provided by an embodiment of the present application, the step of zero position accuracy test includes:

[0026] Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, and controls the stepper motor to rotate toward the zero position;

[0027] While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at the maximum value, the current step number Bl of the stepper motor is recorded, and then the stepper motor continues to rotate to make the stepper motor continue to rotate out of the zero position.

[0028] The photoelectric tube measurement module measures the collector current of the phototransistor. When the measurement result decreases to a current threshold, the output of the driving signal is stopped, and the running step measurement module records the motor step number B2 when the motor stops.

[0029] The microcontroller controls the stepper motor to commutate counterclockwise and return to zero, and after stopping, the number of motor steps is recorded B3;

[0030] The zero position accuracy can be obtained by calculation: the electrical zero position accuracy of the zero position sensor = (B3-B2)-(B2-Bl).

[0031] The present application also provides a computer-readable storage medium having software instructions stored thereon, wherein the software instructions implement the above method when executed.

[0032] The photoelectric zero-position sensor automatic test system provided in the present application can realize automatic zero detection of the photoelectric zero-position sensor, does not require an external current source and a digital multimeter, does not require manual recording of test data, and can realize one-touch zeroing of the mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The following will further explain the above characteristics, technical features, advantages and implementation methods of the present application in a clear and understandable manner through the description of the preferred embodiments and in combination with the accompanying drawings. The following drawings are only intended to illustrate and explain the present application, and do not limit the scope of the present application. Among them:

[0034] Figure 1 A schematic diagram of a photoelectric zero position sensor is shown.

[0035] Figure 2 The principle of zero width test of photoelectric zero position sensor is shown.

[0036] Figure 3 The principle of zero-position accuracy testing of the photoelectric zero-position sensor is shown.

[0037] Figure 4 The automatic testing method of the photoelectric zero position sensor is shown.

[0038] Figure 5 The overall framework of the photoelectric zero position sensor automatic testing system is shown.

[0039] Figure 6 The photo-zero sensor current source circuit is shown.

[0040] Figure 7 The photoelectric zero position sensor measurement circuit is shown. DETAILED DESCRIPTION

[0041] In order to have a clearer understanding of the technical features, purposes and effects of the present application, the specific implementation methods of the present application are now described with reference to the accompanying drawings.

[0042] The stepper motor is usually equipped with a photoelectric zero position sensor. By testing the photoelectric zero position sensor, it can be detected whether the stepper motor is at the zero position. Figure 1As shown in the figure, the photoelectric zero position sensor is composed of a light emitting diode and a phototransistor. The light emitting diode and the phototransistor are blocked by an opaque object. Only when the stepper motor passes the zero position, the light emitted by the light emitting diode can turn on the phototransistor. At this time, the photoelectric zero position sensor is tested using the test system, and the zero position signal emitted by the photoelectric zero position sensor can be measured, indicating that the stepper motor is at the zero position.

[0043] In the prior art, the principle of the test system of the photoelectric zero position sensor is as follows:

[0044] 1) Stepper motor zero position detection

[0045] When using the photoelectric zero position sensor as an angle measurement component, due to the different steering definitions of different products, the requirements for zero detection polarity are also different. It is necessary to specify the zero detection requirements according to the polarity definition of the product. The polarity of the zero detection signal is defined as the output shaft stops at the rising edge of the transistor current when rotating clockwise and stops at the falling edge when rotating counterclockwise. Before starting the test, the zero detection polarity of the zero position sensor needs to be set according to the steering definition of the mechanism, that is, it is specified that the forward rotation stops at the rising edge or the falling edge. Therefore, if you want to detect whether the stepper motor is at the zero position, you can achieve this by testing the zero position signal of the photoelectric zero position sensor.

[0046] Before testing the photoelectric zero position sensor, we must first determine whether the functional performance of the zero position sensor is normal. The usual practice is to adjust the power supply current of the light-emitting diode of the photoelectric zero position sensor and detect the collector current and voltage parameters of the phototransistor to determine whether the functional performance of the zero position sensor is normal.

[0047] In the prior art, an external current source is used to power the light-emitting diode, and the current value of the light-emitting diode is adjusted by changing the output of the external current source. For detecting parameters such as the light-emitting diode current value and the collector current of the phototransistor in the photoelectric zero position sensor, the prior art solution uses an external digital multimeter to measure the voltage and current signals of the phototransistor and the light-emitting diode respectively, and manually record the test results.

[0048] For the existing technical solutions, when using the method of external current source and digital multimeter for detection, on the one hand, the test platform is very complicated to build, the cost is high, the test time is long, and a lot of manpower and material resources are wasted; on the other hand, wiring errors or incorrect test data recording are prone to occur during the measurement process, which can easily cause measurement errors. In addition, due to the large number and variety of measurement parameters, the measurement process has a high false detection rate and calculation error rate.

[0049] The method proposed in the present invention can realize the one-key setting of the diode current value in the automatic test software interface without the need for other external devices; when detecting electrical parameters, the existing technical solution requires an external digital multimeter for measurement, and the digital multimeter generally has only a single-channel measurement capability, and multiple digital multimeters are required to cooperate for simultaneous measurement of different electrical parameters; in addition, the measurement results need to be manually recorded, while the automatic test method proposed in the present invention can realize real-time measurement and online monitoring of electrical parameters, and the measurement results can be synchronized with the software interface in real time and automatically saved.

[0050] 2) Zero control

[0051] In the prior art, an external driving power supply is used to output a driving signal to the stepper motor through a motor driving control circuit to control the stepper motor to rotate toward the zero position; while continuously outputting the driving signal, an external digital multimeter is used to measure the voltage and current signals of the phototransistor and the light-emitting diode respectively. When the maximum value of the transistor collector current is detected, it indicates that the stepper motor has returned to the zero position, and at this time, the output of the driving signal to the motor driving control circuit of the stepper motor is stopped.

[0052] Therefore, the existing technical solution requires an external drive power supply to drive the zero position detection test platform. The platform construction is very complicated, costly, and will waste a lot of manpower and material resources; and the zero position needs to be detected in real time. When the zero position is reached, the drive signal needs to be manually disconnected, which has poor real-time performance and high measurement error.

[0053] 3) Zero width test

[0054] like Figure 2 As shown in the figure, the electrical zero width of the photoelectric zero position sensor = A2-A1. Among them, A1 and A2 are the cumulative running steps of the stepper motor when reaching the corresponding moment, A1 is the cumulative running steps of the motor at the rising edge of 90uA, and A2 is the cumulative running steps of the stepper motor at the falling edge of 90uA. The electrical zero width of the photoelectric zero position sensor is the number of steps between A2-A1.

[0055] In the prior art solution, an external driving power supply is first required to output a driving signal to drive the stepper motor forward / reverse; then, an external current source method is used to adjust the light-emitting diode current value by changing the current source output, and then an external digital multimeter method is used to measure the phototransistor current and the light-emitting diode voltage respectively, and the test results are manually recorded to detect whether the stepper motor is at the zero position. When it is detected that the stepper motor runs to the zero position, continue to rotate the zero position forward until the phototransistor current drops to 90uA at the falling edge, and record the number of rotation steps A of the stepper motor. The zero position width is A×step angle, and the number of steps corresponding to the zero position width is A.

[0056] The existing technical solution needs to combine the two test platforms of zero position detection and zero control, and then use an external digital multimeter to measure the transistor current value, manually record and calculate the number of rotation steps, and thus calculate the zero width. Therefore, this solution is very complicated in terms of building the test platform, with high cost and a large waste of manpower and material resources; on the other hand, for the zero width test, the control accuracy and real-time performance of the motor and current are very high. The use of the existing technical solution will result in large measurement errors and high test data error rates.

[0057] 4) Zero position accuracy test

[0058] like Figure 3 As shown, for the prior art solution, the zero position accuracy test of the photoelectric zero position sensor first requires an external driving power supply to output a driving signal to drive the stepper motor forward / reverse, and then adopts an external current source method to adjust the light emitting diode current value by changing the current source output, and then adopts an external digital multimeter method to measure the phototransistor current and the light emitting diode voltage respectively, and manually record the test results, and then detect whether the stepper motor is at the zero position. When it is detected that the stepper motor runs to the zero position, the current stepper motor step number Bl is recorded, and then the external driving power supply is used to drive the stepper motor to make the stepper motor continue to rotate out of the zero position; the phototransistor current is measured by a digital multimeter, and when the measurement result is reduced to about 10μA, the driving signal is stopped, and the motor step number B2 when stopped is recorded; then the external driving power supply is used to make the stepper motor commutate counterclockwise and return to zero, and the motor step number B3 is recorded after stopping, and the zero position accuracy can be obtained by calculation, and the zero position accuracy of the zero position sensor electrical zero position B=(B3-B2)-(B2-Bl).

[0059] The existing technical solution needs to combine the two test platforms of zero position detection and zero return control, and then use an external digital multimeter to measure and record the current, number of steps and other parameters to calculate the zero position accuracy. Therefore, on the one hand, the test platform of this solution is very complicated and costly; on the other hand, for the zero position accuracy test, the control accuracy and real-time requirements of the motor and current are also very high. The use of the existing technical solution will result in large measurement errors and high test data error rates.

[0060] In view of the above requirements, the present invention proposes an automatic test system for photoelectric zero position sensor, the overall framework of which is as follows: Figure 5 The automatic test system can realize the drive control of the stepper motor and the automatic measurement of the corresponding electrical parameter signals such as the voltage and current of the photoelectric zero position sensor, thereby completing the parallel automatic test of the zero position width and zero position accuracy of the photoelectric zero position sensor, and can also realize the automatic collection, processing and storage of test data, avoiding many disadvantages of the existing technical solutions.

[0061] 1)Automatic zero check

[0062] To check whether the stepper motor is at the zero position, it is necessary to detect the zero position signal of the photoelectric zero position sensor. Before the detection, the collector current and voltage parameters of the phototransistor are detected by adjusting the power supply current of the light-emitting diode to determine whether the zero position sensor function is normal.

[0063] For adjusting the light-emitting diode current, the automated test method uses the DA automated current control method. The current value input to the photodiode is set by the automated test software, and the output voltage V of the analog-to-digital converter is changed. ref To adjust the current value input to the light-emitting diode; for detecting parameters such as the light-emitting diode current and the phototransistor collector current in the photoelectric zero position sensor, the automatic testing method uses the photoelectric zero position sensor measurement circuit to perform real-time measurement and online monitoring of parameters such as the light-emitting diode current, the phototransistor collector-emitter voltage, and the collector current. The measurement results can be displayed in real time on the automatic testing software interface and saved in real time.

[0064] 2) Automatic zeroing

[0065] This method can realize the one-key automatic zeroing of the stepper motor. In the automatic test method, only the host computer software issues a zeroing command, and the pulse generator simultaneously outputs the four pulse signals required by the stepper motor, which cooperates with the automatic zeroing method to make the stepper motor return to zero.

[0066] 3)Automation control and data processing

[0067] For the zero width test and the zero precision test, in the automatic test method, the automatic test software only needs to send the zero width / precision test instruction, and the automatic test software will automatically run and calculate according to the test steps.

[0068] 4)Automated data recording and storage

[0069] The automatic test software is the control and display interface for the automatic test of the photoelectric zero-position sensor. It can display and automatically record the mechanism operating frequency, actual operating steps, angle value, limit angle, winding current, winding voltage, main and backup control status, electric limit enable status, etc. in real time, and can automatically save the test data after online processing, realizing true full-process automated testing.

[0070] The present invention proposes an automatic testing system for a photoelectric zero position sensor, the structure of which is as follows: Figure 4 The system can realize the drive control of the stepper motor, the measurement of the corresponding electrical parameter signals such as the voltage and current of the photoelectric zero position sensor, and the parallel automatic test of the zero position width and zero position accuracy of the photoelectric zero position sensor. At the same time, it can realize the automatic collection, processing and storage of test data, avoiding many disadvantages of the existing technical solutions.

[0071] The schematic diagram of the photoelectric zero position sensor automatic test system is as follows: Figure 5 As shown, through the automatic control of the test program, the main functions such as the drive control of the stepper motor, the test data collection and processing, and the automatic test of the zero width / precision are completed.

[0072] like Figure 4 As shown, the photoelectric zero position sensor automatic test system includes:

[0073] The measuring unit includes a photoelectric tube measuring module, a zero position accuracy detection module, a zero position width detection module, a running step number measuring module, and a running frequency measuring module. The photoelectric tube measuring module is used to measure the specified voltage, current, step number, frequency (including the current of the light-emitting diode in the photoelectric zero position sensor, the collector-emitter voltage of the phototransistor, the collector current, the cumulative number of steps and frequency of the stepping motor, etc.), and can use the signal conditioning, filtering and acquisition circuits known in the art to achieve accurate measurement;

[0074] The drive unit includes a motor drive control circuit and a pulse generator, wherein the motor drive control circuit is used to generate pulse currents of different frequencies to control the rotation of the stepper motor; the pulse generator is used to output drive signals to the running step measurement module, the running frequency measurement module, and the motor drive control circuit;

[0075] The light-emitting diode current source is used to provide a driving current to the light-emitting diode of the photoelectric zero position sensor through the analog-to-digital converter, by changing the output voltage V ref , the driving current value output to the light-emitting diode can be adjusted;

[0076] A microcontroller is used to control the light emitting diode current source, the pulse generator, and the measuring unit, and communicate with the stepper motor at the same time. The microcontroller also receives the set number of steps and the step cycle information from the pulse generator, and controls the measuring unit according to the received set number of steps and the step cycle information.

[0077] An embedded computer is used to control the microcontroller and the embedded computer is used to run the automated test software.

[0078] The present application also provides an automatic test method for a photoelectric zero position sensor. In order to complete a comprehensive test of the various performance indicators of the stepper motor and the angle measuring components used, it is necessary to detect the zero position signal of the photoelectric zero position sensor to verify its accuracy to determine whether the stepper motor is at the zero position. That is, before testing the stepper motor, by adjusting the current of the light-emitting diode, detecting the collector current of the phototransistor, and measuring the voltage parameters at the same time, it is possible to determine whether the zero position sensor functions normally, whether the mechanism is at the zero position, and to perform zero position width and zero position accuracy tests.

[0079] The present application also provides an automatic testing method for a photoelectric zero position sensor, which uses the above-mentioned photoelectric zero position sensor to perform automatic testing, and the test content includes: functional performance normality test, zero point position test, zero control test, zero position width test, and zero position accuracy test.

[0080] The specific steps of the functional performance normality test include: by changing the output voltage V ref , adjust the driving current value output to the light-emitting diode, and use the photoelectric tube measurement module of the measuring unit to detect the collector current of the phototransistor. The embedded computer uses automatic testing software to determine whether the functional performance of the zero position sensor is normal based on the measured driving current value and the collector current of the phototransistor.

[0081] The specific steps of the zero position test include: using the photoelectric tube measurement module of the measurement unit to test the collector current of the phototransistor. If a zero position signal is measured, it indicates that the stepper motor is at the zero position. If no zero position signal is measured, it indicates that the stepper motor is not at the zero position and zeroing control is required.

[0082] The specific steps of the zero control test include: under the control of the microcontroller, the pulse generator outputs a drive signal to the stepper motor through the motor drive control circuit to control the stepper motor to rotate toward the zero position; while continuously outputting the drive signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When the collector current of the phototransistor is detected to be the maximum value, it indicates that the stepper motor has returned to the zero position, and at this time, the drive signal is stopped from being output to the motor drive control circuit of the stepper motor.

[0083] The specific steps of the zero width test include: under the control of the microcontroller, the pulse generator outputs a drive signal to the stepper motor through the motor drive control circuit to control the stepper motor to rotate toward the zero position; while continuously outputting the drive signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at the maximum value (at this time the stepper motor runs to the zero position), the stepper motor continues to rotate until the collector current of the phototransistor decreases to a current threshold value (for example, 90uA) at the falling edge. The running step measurement module records the number of rotation steps A of the stepper motor, and the zero width is A×step angle.

[0084] The specific steps of the zero position accuracy test include: under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit to control the stepper motor to rotate toward the zero position; while continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor, and when it is detected that the collector current of the phototransistor is the maximum value (at this time, the stepper motor runs to the zero position), the current step number Bl of the stepper motor is recorded, and then the stepper motor continues to rotate to make the stepper motor continue to rotate out of the zero position; the photoelectric tube measurement module measures the collector current of the phototransistor, and when the measurement result decreases to a current threshold value (for example, 10μA), the output of the driving signal is stopped, and the running step number measurement module records the motor step number B2 when it stops; then the microcontroller controls the stepper motor to commutate counterclockwise and return to zero, and the motor step number B3 is recorded after stopping, and the zero position accuracy can be obtained by calculation, and the electrical zero position accuracy of the zero position sensor = (B3-B2)-(B2-Bl).

[0085] Zero width and zero accuracy detection is actually the detection of the number of running steps of the stepper motor (for example, electrical zero width A = A2-A1, where A1 and A2 are the cumulative number of running steps of the stepper motor when reaching the corresponding moment; electrical zero accuracy B = (B3-B2)-(B2-Bl)). By detecting the number of running steps in real time and cooperating with a microcontroller, automatic zero width and zero accuracy detection can be achieved.

[0086] Hereinafter, the specific implementation of each step in the photoelectric zero position sensor automatic testing method provided according to an embodiment of the present application will be further described in detail.

[0087] 1) Functional performance normality test

[0088] For adjusting the LED current, the automated test method uses the DA automated current control method, sets the photodiode output current value through the automated test software, and adjusts the LED drive current value by changing the analog-to-digital converter output voltage Vref; for detecting parameters such as the LED current and phototransistor collector current in the photoelectric zero position sensor, the automated test method uses the photoelectric zero position sensor's measurement unit to measure and monitor parameters such as the LED current, phototransistor collector-emitter voltage, and collector current in real time, and the measurement results can be displayed in real time on the automated test software interface and saved in real time. The specific automated zero detection method is as follows:

[0089] Automatic DA current control

[0090] I out = V ref / R s (1)

[0091] The automatic test system can set the photodiode output current value through the measurement and control software, such as Figure 6 As shown, the circuit changes the output voltage V ref To automatically adjust the driving current value of the light-emitting diode, I out is the output current of the constant current source circuit (unit: A); V ref The reference voltage source provided for DA (unit V); R s is the sampling resistance (unit: Ω). This method can realize DA automatic control of the light emitting diode current value.

[0092] 2) Zero point position test

[0093] Photoelectric zero position sensor measurement circuit Figure 7 As shown, the automatic test software is used to automatically measure the parameters that need to be measured in the photoelectric zero position sensor in real time. The measurement data is uploaded to the host computer software running in the embedded computer through the microcontroller in real time. The automatic test software determines whether the phototransistor is turned on by the uploaded phototransistor collector current, thereby automatically detecting whether the stepper motor is at the zero position.

[0094] 3) Zero control test

[0095] This method can realize the automatic zeroing of the stepper motor with one button. In the automatic test method, as long as the host computer software issues a zeroing command, the pulse generator simultaneously outputs the four pulse signals required by the stepper motor, and cooperates with the automatic zeroing method to make the mechanism zero. The specific implementation method of automatic zeroing is as follows:

[0096] The upper computer software sends the zeroing instruction including the drive pulse amplitude, subdivision number and waveform to the microcontroller STM32 single chip, and transmits the drive pulse parameters to the FPGA through the bus. Then the FPGA outputs the set values ​​in sequence under the action of the timer implemented inside it. The square wave pulse is directly output, and the sine and cosine pulses or trapezoidal pulses are converted into analog quantities by DA before output. In addition, independent counters and timers are set inside the FPGA to measure the motor rotation frequency and the number of drive steps, so as to drive the motor. In conjunction with the automatic zero detection device, the automatic zeroing operation can be completed.

[0097] 4) Zero width test and zero accuracy test

[0098] For the zero width test and zero accuracy test, in the automatic test method, the automatic test software only needs to issue the zero width / accuracy test instructions. The automatic test software will cooperate with the automatic zeroing and automatic zero detection devices in the measurement and control equipment to issue corresponding instructions, run automatically according to the test steps, and detect and collect the corresponding parameters in real time and calculate them.

[0099] 5)Automated data recording and storage

[0100] The automatic test software is the control and display interface for the automatic test of the photoelectric zero-position sensor. It can display and automatically record the mechanism operating frequency, actual operating steps, angle value, limit angle, winding current, winding voltage, main and backup control status, electric limit enable status, etc. in real time, and can automatically save the test data after online processing, realizing true full-process automated testing.

[0101] 1. The photoelectric zero position sensor automatic test system provided by the present application can realize the automatic zero detection of the photoelectric zero position sensor, without the need for an external current source and a digital multimeter, and manual recording of test data; the automatic test software can display in real time whether the mechanism is in the zero position, including automatic setting of diode current and real-time measurement and online monitoring of electrical parameters, and the measurement results are synchronized with the software interface in real time and automatically saved;

[0102] 2. The photoelectric zero position sensor automatic test system provided by this application can realize one-click zeroing of the mechanism. The traditional zeroing method requires an external power supply to output a driving signal, and needs to cooperate with the traditional zeroing scheme to synchronously observe whether the mechanism has reached the zero position. It involves too many external devices and the operation process is complicated; automatic zeroing can realize one-click automatic zeroing of the mechanism without the need for external devices;

[0103] 3. The photoelectric zero position sensor automatic test system provided by the present application can realize comprehensive testing and driving of various performance indicators of the photoelectric zero position sensor, including generating motor drive signals, measuring photoelectric tube current, photoelectric zero position sensor zero position accuracy detection, zero position width automatic detection, etc. It serves as a basis for judging whether the zero position sensor functions normally.

[0104] 4. The photoelectric zero-position sensor automatic testing method software proposed in this application performs automatic testing by setting the electric limit angle control measurement and control unit according to the input configuration file, thereby realizing the automation of measurement and online calculation and processing of measurement data, and solving the problems of traditional manual measurement and manual reporting methods that waste a lot of manpower and material resources and have a high error rate in test data.

[0105] 5. This application realizes the full-process automated testing of the photoelectric zero-position sensor. Through the measurement and control device, combined with the automatic testing software, it realizes the functions of test item automation, online processing of test data, and real-time storage of test data. It can automatically complete data collection, record test results and generate test reports.

[0106] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.

[0107] The above description is only an illustrative embodiment of the present application and is not intended to limit the scope of the present application. Any equivalent changes, modifications and combinations made by any technician in the field without departing from the concept and principle of the present application shall fall within the scope of protection of the present application.

Claims

1. An automatic test system for a photoelectric zero position sensor, comprising: The measuring unit includes a photoelectric tube measuring module, a zero position accuracy detection module, a zero position width detection module, a running step number measuring module, and a running frequency measuring module. The photoelectric tube measuring module is used to measure the specified voltage, current, step number, and frequency signal; The drive unit includes a motor drive control circuit and a pulse generator, wherein the motor drive control circuit is used to generate pulse currents of different frequencies to control the rotation of the stepper motor; the pulse generator is used to output drive signals to the running step measurement module, the running frequency measurement module, and the motor drive control circuit; The light-emitting diode current source is used to provide a driving current to the light-emitting diode of the photoelectric zero position sensor through the analog-to-digital converter, by changing the output voltage V ref , adjust the driving current value output to the light emitting diode; A microcontroller is used to control the light emitting diode current source, the pulse generator, and the measuring unit, and communicate with the stepper motor at the same time. The microcontroller also receives the running step number information and the running frequency information from the pulse generator, and controls the measuring unit according to the received running step number information and the running frequency information; An embedded computer is used to control the microcontroller and the embedded computer is used to run the automated test program.

2. The system according to claim 1, wherein: The specified voltage, current, number of steps, and frequency include the current of the light-emitting diode in the photoelectric zero position sensor, the collector-emitter voltage and collector current of the phototransistor, and the cumulative number of steps and frequency of the stepping motor.

3. A method for automatically testing a photoelectric zero position sensor, using the system of claim 1 to automatically test the sensor, the method comprising: Functional performance normality test, zero position test, zero control test, zero width test, zero accuracy test.

4. The method according to claim 3, wherein: The steps of functional performance normality testing include: By changing the output voltage V ref , adjust the driving current value output to the light-emitting diode, and use the photoelectric tube measurement module of the measuring unit to detect the collector current of the phototransistor. The embedded computer uses automatic testing software to determine whether the functional performance of the zero position sensor is normal based on the measured driving current value and the collector current of the phototransistor.

5. The method according to claim 3, wherein: The steps of zero position test include: The photoelectric tube measurement module of the measurement unit is used to test the collector current of the phototransistor. If a zero-position signal is measured, it indicates that the stepper motor is at the zero position. If no zero-position signal is measured, it indicates that the stepper motor is not at the zero position and zeroing control is required.

6. The method according to claim 3, wherein: The steps of the zero control test include: Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, controlling the stepper motor to rotate toward the zero position; While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at its maximum value, it indicates that the stepper motor has returned to the zero position. At this time, the driving signal is stopped from being output to the motor drive control circuit of the stepper motor.

7. The method according to claim 3, wherein: The steps of zero width test include: Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, controlling the stepper motor to rotate toward the zero position; While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at its maximum value, the stepper motor continues to rotate until the collector current of the phototransistor decreases to a current threshold at the falling edge. The running step measurement module records the number of rotation steps A of the stepper motor, and the zero position width is A×step angle.

8. The method according to claim 7, wherein: The current threshold is 90uA.

9. The method according to claim 3, wherein: The steps of zero accuracy test include: Under the control of the microcontroller, the pulse generator outputs a driving signal to the stepper motor through the motor drive control circuit, controlling the stepper motor to rotate toward the zero position; While continuously outputting the driving signal, the photoelectric tube measurement module measures the collector current of the phototransistor. When it is detected that the collector current of the phototransistor is at the maximum value, the current step number Bl of the stepper motor is recorded, and then the stepper motor continues to rotate to make the stepper motor continue to rotate out of the zero position. The photoelectric tube measurement module measures the collector current of the phototransistor. When the measurement result decreases to a current threshold, the output of the driving signal is stopped, and the running step measurement module records the motor step number B2 when the motor stops. The microcontroller controls the stepper motor to commutate counterclockwise and return to zero, and after stopping, the number of motor steps is recorded B3; The zero position accuracy can be obtained by calculation: the electrical zero position accuracy of the zero position sensor = (B3-B2)-(B2-Bl).

10. A computer-readable storage medium having stored thereon software instructions which, when executed, implement the method of any one of claims 3-9.