A blood collection tube label edge finding control algorithm
By using a blood collection tube label edge-finding control algorithm, combined with photoelectric sensors and delay control, the problem of accurately positioning the labeling position of blood collection tubes in existing technologies has been solved, achieving low-cost, high-precision edge-finding and viewing window reservation for blood collection tube labels.
Patent Information
- Application Number
- CN202310314298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-03-28
AI Technical Summary
It is difficult to accurately locate the labeling position of the blood collection tube label with existing technology, and the laser position sensor is expensive and has high requirements for hardware design, which may lead to large edge-finding errors and affect the blood collection visual line and visual window.
An edge-finding control algorithm for blood collection tube labels is adopted, including edge-finding control of original labels and edge-finding control of the initial position of labeling. The MCU controls the ADC to sample the data of the photoelectric sensor, and combined with delay control and photoelectric sensor, accurate positioning is achieved. A reflective photoelectric sensor and a stepper motor are used to drive the blood collection tube to rotate at a constant speed.
It achieves low-cost, high-precision edge detection for blood collection tube labels, ensuring that a viewing window and scale lines are reserved after labeling. The operation is simple, reduces hardware costs, and improves labeling accuracy.
Smart Images

Figure CN116853643B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent labeling, and in particular to a control algorithm for edge finding of blood collection tube labels. Background Art
[0002] Conventional blood collection tubes must be accompanied by a paper factory label with relevant information such as the production date, serial number, reagent type, and blood collection scale line. When using a labeling machine for intelligent labeling, it is necessary to prevent the newly attached information label from covering the blood collection scale line, while ensuring that a suitable visual window position is left on the tube body to facilitate observation inside the tube body. Regarding how to accurately locate the labeling position, the existing technical field has not disclosed a detailed technical solution, and it is not yet known whether accurate positioning is possible; in addition, the direct use of a laser position sensor is a high-cost setting solution. The laser position sensor is expensive and has high requirements for hardware circuit design. If the motor speed is too fast, it is likely to cause the edge-finding error to become larger, thereby affecting the blood collection visual line and visual window. Summary of the Invention
[0003] Based on this, the purpose of the present invention is to provide a control algorithm for edge finding of blood collection tube labels in order to address the deficiencies of the prior art.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] A blood collection tube label edge-finding control algorithm includes original label edge-finding control and label initial position edge-finding control; the original label edge-finding control includes data acquisition and edge-finding judgment, the data acquisition is the MCU controlling the ADC to sample the data returned by the photoelectric sensor when the blood collection tube rotates; the edge-finding judgment makes a real-time judgment on the sampled value of the data acquisition, and performs judgment analysis based on two adjacent sampling nodes. If the current sampling value is greater than the next sampling value, it is considered to meet a path judgment. When the path judgment is met for at least five consecutive times, the original label edge-finding is judged to be successful. The label initial position edge-finding control includes a first delay t0 control and a second delay t0 / Control; the first delay t0 control is the time required for the blood collection tube to rotate one circle minus the time required for the printer to print the label paper and contact the blood collection tube wall, the second delay t0 / Controls the time required to reserve an interval for the visible window.
[0006] As a further improvement of the present invention, the first delay t0= t2- t1=2πr / v 采 -L1 / V 打 ;in:
[0007] t2 is the time required for the blood collection tube to rotate one circle.
[0008] t1 is the time required for the printer to print the label paper and contact the wall of the blood collection tube.
[0009] r is the radius of the blood collection tube,
[0010] v 采 is the blood collection tube speed,
[0011] L1 is the distance from the printer label outlet to the blood collection tube.
[0012] V 打 The speed at which the printer outputs labels.
[0013] As a further improvement of the present invention, the second delay t0 / =1 / 3(2πr-L 标 ) / V 采 ∽5 / 7(2πr-L 标 ) / V 采 ;L 标 The length of thermal label paper.
[0014] As a further improvement of the present invention, the first delay t0 and the second delay t0 / The sum is the total labeling delay.
[0015] As a further improvement of the present invention, it also includes a blood collection tube drive, in which the blood collection tube is clamped by an electromagnet rubber roller, a stepping motor drives a driving wheel, and the driving wheel drives the blood collection tube to achieve uniform rotation of the blood collection tube.
[0016] As a further improvement of the present invention, the photoelectric sensor is a reflective photoelectric sensor.
[0017] As a further improvement of the present invention, the MCU controls the ADC to collect AD sampling values of the photoelectric sensor every 2 ms.
[0018] As a further improvement of the present invention, it is necessary to ensure that the sampling frequencies are the same when collecting data.
[0019] The beneficial effects of the present invention are:
[0020] 1. By setting up a control algorithm for edge-finding of blood collection tube labels, the operation process is simpler, more accurate, and less costly than existing designs. Specifically, by setting up data acquisition, blood collection tube point sampling can be performed directly, and by setting up edge-finding judgment, the blood collection tube point sampling values during the collection process can be directly judged. Only when the corresponding path judgment conditions are met can the original label edge-finding be considered successful. This is fast and convenient, prevents misjudgments, and greatly improves accuracy. At the same time, the above functions can be achieved by combining a general reflective photoelectric sensor with this control algorithm, making the design more reasonable and simple, with stronger system coordination and lower cost.
[0021] 2. By setting the first delay t0 control and the second delay t0 / The control is used to determine the total delay of labeling, and the final determined position is the initial labeling position, and it is ensured that the surface of the blood collection tube after labeling at the initial labeling position has a visual window and scale line area reserved, which is more convenient for medical staff to operate. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 paying any creative work.
[0023] Attachment Figure 1 This is a flow chart of the control algorithm for edge finding of blood collection tube labels of the present invention.
[0024] Attachment Figure 2 This is a diagram of the ADC collecting blood collection tube wall data of the present invention.
[0025] Attachment Figure 3 This is a factory picture of the blood collection tube of the present invention.
[0026] Attachment Figure 4 This is a labeling diagram for the blood collection tube of the present invention. Implementation Method
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0028] like Figure 1 、 2 As shown, a blood collection tube label edge-finding control algorithm includes original label edge-finding control and label initial position edge-finding control. Original label edge-finding control includes data acquisition and edge-finding judgment. Data acquisition involves the MCU controlling the ADC to sample the data returned by the photoelectric sensor during the blood collection tube rotation. Edge-finding judgment performs real-time judgment on the sampled values of the data acquisition, performing judgment analysis based on two adjacent sampling nodes. A path judgment is considered satisfied when the current sampled value is greater than the next sampled value. When this path judgment is satisfied at least five times in a row, the original label edge-finding is considered successful. This design uses at least five consecutive path judgments to determine the decreasing trend of the collected data, which can greatly improve accuracy and prevent judgment errors caused by fluctuations in ADC collected values.
[0029] Furthermore, the label initial position edge search control includes the first delay t0 control and the second delay t0 / Control, first delay t0 and second delay t0 / The sum is the total labeling delay, which is calculated from the time when the original label finds the edge. The first delay t0 is the time required for the blood collection tube to rotate one circle minus the time required for the printer to print the label paper and contact the blood collection tube wall. The second delay t0 / Controls the time required to reserve an interval for the visible window.
[0030] The first delay t0 = t2- t1 = 2πr / v 采 -L1 / V 打 ;in:
[0031] t2 is the time required for the blood collection tube to rotate one circle.
[0032] t1 is the time required for the printer to print the label paper and contact the wall of the blood collection tube.
[0033] r is the radius of the blood collection tube,
[0034] v 采 is the blood collection tube speed,
[0035] L1 is the distance from the printer label outlet to the blood collection tube.
[0036] V 打 The speed at which the printer outputs labels.
[0037] The second delay t0 / =1 / 3(2πr-L 标 ) / V 采 ∽5 / 7(2πr-L 标 ) / V 采 ;
[0038] L 标 The length of thermal label paper.
[0039] Thermal label paper is the label paper printed by the labeling machine on the blood collection tube, which is used to record user information, etc.
[0040] Furthermore, it also includes blood collection tube driving, which realizes uniform rotation of the blood collection tube by clamping the blood collection tube with an electromagnet rubber roller, driving the driving wheel with a stepping motor, and driving the blood collection tube with the driving wheel.
[0041] Furthermore, the photoelectric sensor is a reflective photoelectric sensor.
[0042] Furthermore, the MCU controls the ADC to collect the AD sampling value of the photoelectric sensor every 2ms.
[0043] Furthermore, the sampling frequency must be the same when collecting data.
[0044] Specifically, the present invention performs the above design by rotating the blood collection tube counterclockwise. The edge finding control is used to determine whether the edge finding is successful. The edge finding position is the leftmost edge of the original factory label on the blood collection tube. In order to ensure that the edge finding position is the labeling position, a first delay t0 is set. At the same time, in order to ensure that a suitable viewing window area is reserved for the blood collection tube after labeling, a viewing window delay, i.e., a second delay t0, is designed. / Through the first delay t0 and the second delay t0 / The total delay setting of labeling can achieve labeling of blood collection tubes to the ideal area, reserve visual windows and scale lines, and make the operation more convenient for medical staff. / It can be set in advance according to work needs and is not limited to the order indicated in the flowchart.
[0045] like Figure 3 、 4 As shown in detail, the scale line of the blood collection tube label is located at the left edge area of the factory label of the blood collection tube. When a reasonable paper output delay of the labeling machine is set, it can be ensured that the subsequent labeling position falls into the visual window position specified by the factory label, ensuring that a part of the visual window area is reserved for the finished product after labeling, and the scale line of the original label of the blood collection tube is not covered. Through the original label edge finding control and the first delay t0 and the second delay t0 of this application / The settings can be achieved.
[0046] The above is an implementation method of the embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.
Claims
1. A blood collection tube label edge finding control algorithm, characterized in that: Including original label edge-finding control and label initial position edge-finding control; The original tag edge-finding control includes data collection and edge-finding judgment. The data collection is that the MCU controls the ADC to sample the data returned by the photoelectric sensor when the blood collection tube rotates; The edge search judgment performs real-time judgment on the sampling value of data collection, and performs judgment analysis based on two adjacent sampling nodes. If the current sampling value is greater than the next sampling value, it is considered that a path judgment is satisfied. When the path judgment is satisfied at least five times in a row, it is determined that the original tag edge search is successful; The labeling initial position edge finding control includes the first delay t0 control and the second delay t0 / Control; the first delay t0 control is the time required for the blood collection tube to rotate one circle minus the time required for the printer to print the label paper and contact the blood collection tube wall, the second delay t0 / Controls the time required to reserve an interval for the visible window.
2. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: The first delay t0 = t2 - t1 = 2πr / v 采 -L1 / V 打 ; in: t2 is the time required for the blood collection tube to rotate one circle. t1 is the time required for the printer to print the label paper and contact the wall of the blood collection tube. r is the radius of the blood collection tube, v 采 is the blood collection tube speed, L1 is the distance from the printer label outlet to the blood collection tube. V 打 The speed at which the printer outputs labels.
3. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: The second delay t0 / =1 / 3(2πr-L 标 ) / V 采 ∽5 / 7(2πr-L 标 ) / V 采 ; L 标 The length of thermal label paper.
4. A blood collection tube label edge finding control algorithm according to claim 2 or 3, characterized in that: The first delay t0 and the second delay t0 / The sum is the total labeling delay.
5. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: It also includes a blood collection tube drive, which clamps the blood collection tube through an electromagnet rubber roller, drives an active wheel through a stepper motor, and drives the blood collection tube through the active wheel, thereby achieving uniform rotation of the blood collection tube.
6. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: The photoelectric sensor is a reflective photoelectric sensor.
7. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: The MCU controls the ADC to collect the AD sampling value of the photoelectric sensor every 2 ms.
8. The blood collection tube label edge finding control algorithm according to claim 1, characterized in that: When collecting data, the sampling frequency must be the same.
Citation Information
Patent Citations
Labeling device for automatic test-tube setting-up device
CN102459008A
Band steel edge part pin hole detecting method
CN102632090A