Penicillin bottle cap opening method and system for automatic dispensing machine
By setting up an XYZ three-dimensional spatial coordinate system and using visual recognition technology, the robot arm coordinate points are corrected by calculating compensation values. This solves the problem that fixed-parameter mechanical capping devices cannot adapt to vials of different sizes, and enables efficient and accurate capping operation of the automatic dispensing machine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 美蓝(杭州)医药科技有限公司
- Filing Date
- 2026-03-30
- Publication Date
- 2026-05-12
AI Technical Summary
In the existing technology, mechanical capping devices with fixed parameters cannot adapt to vials of different sizes, resulting in capping failure or inaccuracy, which affects the efficiency and accuracy of automatic dispensing machines.
By setting up an XYZ three-dimensional spatial coordinate system, the size of the vial is obtained through visual recognition, the compensation value is calculated and the actual positioning coordinate point of the robotic arm is corrected, and the robotic arm is controlled to perform adaptive cap opening operation.
It enables accurate opening of vials of different sizes, improving the efficiency and accuracy of the automatic dispensing machine and reducing the risks of manual operation.
Smart Images

Figure CN122010028A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated operation of dispensing equipment, and in particular to a method and system for opening vials in an automatic dispensing machine. Background Technology
[0002] In the medical field, the application of automated dispensing machines has brought tremendous value in improving the efficiency and accuracy of medication dispensing. With the continuous development of medical technology, the functional and performance requirements for automated dispensing machines are also increasing. Automated dispensing machines can reduce errors and contamination risks in the manual dispensing process, ensuring the safety and effectiveness of patient medication. In the medication dispensing process, the opening of the vial is a crucial step, and its efficiency and accuracy directly affect the smoothness of the entire dispensing process. Previously, several methods were conventionally used for opening vials in automated dispensing machines. One common method is manual opening, where operators rely on experience and skill, using simple tools such as tweezers or forceps to open the vials. While this method can complete the opening task to a certain extent, it is inefficient and easily affected by individual differences in operators, leading to inconsistent opening results. Another method is to use a mechanical opening device with fixed parameters. This device opens the vials according to preset parameters, regardless of the size differences of the vials. This method is efficient when handling vials of relatively uniform size, but it often fails to accurately open vials of different sizes. The shortcomings of existing technology are that manual opening is inefficient, unsuitable for large-scale dispensing needs, and prone to human error, increasing the risk during the dispensing process. Meanwhile, mechanical opening devices with fixed parameters cannot adapt to vials of different sizes; when encountering vials with significant size differences, inaccurate gripping and opening failures may occur, affecting the overall performance and accuracy of the automated dispensing machine. Summary of the Invention
[0003] This invention solves the problem that mechanical capping devices with fixed parameters cannot adapt to vials of different sizes. It proposes a method and system for opening vials in automatic dispensing machines. By using a method to adjust the capping position according to the size of the vial, it can adapt to the capping operation of vials of different sizes, thereby improving the efficiency and accuracy of capping.
[0004] To achieve the above objectives, the following technical solution is proposed: A method for opening vials in an automated dispensing machine, applicable to a robotic arm's front-end gripper grasping the vial onto an opening mechanism, includes the following steps: S1, set the XYZ three-dimensional coordinate system for the movement of the robotic arm, the front gripper picks up the smallest size vial and moves it to the working position of the capping mechanism, and calibrates the coordinate point of the center position of the front gripper at this time as the reference coordinate (X0, Y0, Z0). S2, based on the set segment interval of the bottle diameter, and set the slope and intercept corresponding to each segment interval, calculate the target value according to the linear function; S3, obtain the bottle diameter and total height H of the vial through visual recognition; S4, Calculate the compensation value used to correct the actual position of the robotic arm: Compensation value = (Target value - Bottle diameter / 2) - Calibration bias term; S5, correct the actual positioning coordinates of the front gripper center position based on the compensation value and the total height H of the bottle; S6 inputs the preset robotic arm pose parameters and the calculated actual positioning coordinates into the robotic arm control system, controlling the robotic arm to move to the target pose and perform the opening operation.
[0005] This invention, through steps such as setting a coordinate system, calculating target values in segments, obtaining vial dimensions, calculating compensation values, and correcting coordinate points, enables a robotic arm to accurately grasp and open vials of different sizes. This overcomes the shortcomings of existing technologies, such as low efficiency of manual opening and the inability of fixed-parameter mechanical opening devices to adapt to vials of different sizes. It improves the dispensing efficiency and accuracy of automatic dispensing machines and reduces the risks in the dispensing process.
[0006] Preferably, the process of constructing the XYZ three-dimensional spatial coordinate system for the robotic arm motion is as follows: a reference origin is set, the horizontal forward direction of the robotic arm is taken as the X-axis, the horizontal rightward lateral movement direction of the robotic arm is taken as the Y-axis, and the vertical upward movement direction of the robotic arm is taken as the Z-axis.
[0007] Preferably, step S2 specifically includes the following steps: Based on the set diameter of the bottle, the segments are divided into 3 sections: The first interval is (11, 15.77] mm. The slope is set to 0.1333 and the intercept to 6.1467. At this time, the target value is 0.1333 × bottle diameter + 6.1467. The second interval is (15.77, 18.3] mm. The slope is set to 0.085 and the intercept to 6.73. At this time, the target value is 0.085 × bottle diameter + 6.73. The third interval is (18.3, 26] mm. The slope is set to 0.09 and the intercept to 6.5. At this time, the target value is 0.09 × bottle diameter + 6.5.
[0008] This application calculates the target value segmented according to the bottle diameter (mm) (units are in the same coordinate system, assumed to be mm). Because the gripper holds bottles of different diameters at different positions, it is necessary to calculate the offset based on the bottle diameter.
[0009] Preferably, S5 specifically includes: calculating the actual positioning coordinates (X1, Y1, Z1) of the center position of the front gripper, wherein: X1 = X0 - compensation value; Y1 = Y0; Z1 = Z0 - (H - bottle cap height correction item) + ΔZ, where ΔZ is the offset in the Z-axis direction, which is a preset calibration parameter.
[0010] Preferably, step S4 further includes the following step before calculating the compensation value: Determine if the bottle diameter is within the segmented range. If so, calculate the compensation value; otherwise, the robotic arm directly throws out the vial, and the feedback information is that the diameter is not within the valid segmented range.
[0011] Preferably, the robotic arm's pose parameters include the robotic arm's roll angle, pitch angle, and yaw angle in space.
[0012] Preferably, the opening operation includes rotating to unscrew or pulling out vertically, or rotating to loosen and then pulling out vertically.
[0013] A vial opening system for an automatic dispensing machine, applicable to the aforementioned vial opening method for an automatic dispensing machine, comprising: The visual recognition module is used to obtain the diameter of the vial body and the total height H of the vial. The cap opening mechanism is equipped with cap grippers for holding the cap of the vial; The robotic arm control system includes a data storage module, a data processing module, and an execution control module. The data processing module has an actual positioning coordinate calculation program, the data storage module stores all preset calculation parameters and calculation results, and the execution control module controls the front gripper to perform the opening operation based on the actual positioning coordinate. The front gripper is used to hold the vial.
[0014] Preferably, the front-end gripper includes a first gripper and a second gripper arranged symmetrically on the left and right, and a limiting member disposed between the first gripper and the second gripper. The first gripper and the second gripper are driven by a pneumatic cylinder or an electric cylinder and move towards or away from the limiting member at the same time.
[0015] The vial is positioned between the first clamp, the second clamp, and the limiting member.
[0016] The beneficial effects of this invention are as follows: By setting a coordinate system and obtaining the specific dimensions of the vials, a compensation value is calculated to correct the actual positioning coordinates of the center position of the front gripper. Then, the robotic arm is controlled to move to the target pose to perform the capping operation, achieving the effect of accurately opening vials of different sizes. Different sizes of vials require different gripping positions and opening forces when opening. By correcting the coordinate points, the robotic arm can accurately grasp and open vials of different sizes. Attached Figure Description
[0017] Figure 1 This is a flowchart of the method of the present invention.
[0018] Figure 2 This is a schematic diagram of the XY axis of the present invention.
[0019] Figure 3 This is a schematic diagram of the XZ axis of the present invention.
[0020] The components include: 1. robotic arm; 2. vial; 3. first gripper; 4. second gripper; 5. limiting component; and 6. cap opening mechanism. Detailed Implementation
[0021] The technical solutions in the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments are only possible technical implementations of the present invention, but are not limited thereto. Those skilled in the art can certainly combine the embodiments of the present invention to obtain other embodiments without creative effort, which are also within the protection scope of the present invention. This application mainly adopts a method of modifying the capping position according to the size of the vial, which achieves the effect of adapting to the capping operation of vials of different sizes, improving the efficiency and accuracy of capping. The following is a further detailed description of this application. Example
[0022] The vial opening method for an automatic dispensing machine provided in this application includes steps such as setting a coordinate system, calculating a target value, obtaining the vial size, calculating a compensation value, correcting the actual positioning coordinate point, and controlling the robotic arm to perform the opening operation. Specifically, by setting a coordinate system and obtaining the specific dimensions of the vial, the compensation value is calculated to correct the actual positioning coordinate point of the center position of the front gripper. Then, the robotic arm is controlled to move to the target pose to perform the opening operation, achieving the effect of accurately opening vials of different sizes. This is because different sizes of vials require different gripping positions and opening forces when opening. By correcting the coordinate point, the robotic arm can accurately grasp and open vials of different sizes. Figure 1 The specific steps include: When setting up the XYZ three-dimensional coordinate system for the robotic arm's movement, a reference origin must first be established. The horizontal forward direction of the robotic arm is used as the X-axis, the horizontal rightward movement direction as the Y-axis, and the vertical upward movement direction as the Z-axis. The reference origin can be a fixed point on the automatic dispensing machine, such as a corner of the machine's base. This coordinate system accurately describes the robotic arm's position in space. In practical applications, other suitable reference points can be selected to construct the coordinate system based on the specific structure and layout of the dispensing machine. The system is then divided into segments based on the bottle diameter, with each segment defined by its slope and intercept. The target value is calculated using a linear function. The bottle diameter was set into three intervals: the first interval was (11, 15.77] mm, with a slope of 0.1333 and an intercept of 6.1467; the target value was 0.1333 × bottle diameter + 6.1467. The second interval was (15.77, 18.3] mm, with a slope of 0.085 and an intercept of 6.73; the target value was 0.085 × bottle diameter + 6.73. The third interval was (18.3, 26] mm, with a slope of 0.09 and an intercept of 6.5; the target value was 0.09 × bottle diameter + 6.5. This segmented calculation was performed because the offset pattern of the vial gripping position differed across different size intervals. In practice, the intervals could be further subdivided based on more experimental data to improve the accuracy of the calculation.
[0023] The diameter and total height (H) of a vial are obtained through visual recognition. Visual recognition can be implemented using industrial cameras and image processing algorithms. Industrial cameras can clearly capture images of the vials, and image processing algorithms can analyze these images to accurately measure the diameter and total height. In some special cases, other measurement methods such as laser rangefinders can also be used to obtain this dimensional information.
[0024] When calculating the compensation value used to correct the actual position of the robotic arm, the compensation value is calculated as follows: Compensation value = (Target value - Bottle diameter / 2) - Calibration bias term. Before calculating the compensation value, it is necessary to determine whether the bottle diameter is within the segmented range. If so, the compensation value is calculated; otherwise, the robotic arm directly throws the vial, and the feedback information indicates that the diameter is not within the valid segmented range. This avoids invalid operations on vials that do not meet the size requirements, thus improving medication dispensing efficiency.
[0025] The actual positioning coordinates of the front gripper center are corrected based on the compensation value and the total bottle height H. The actual positioning coordinates (X1, Y1, Z1) of the front gripper center are calculated, where: X1 = X0 - compensation value; Y1 = Y0; Z1 = Z0 - (H - bottle cap height correction item) + ΔZ, where ΔZ is the offset in the Z-axis direction, a preset calibration parameter. By correcting the coordinates, the robotic arm can accurately reach the opening position of vials of different sizes.
[0026] The preset robotic arm pose parameters and the calculated actual positioning coordinates are input into the robotic arm control system to control the robotic arm to move to the target pose and perform the cap opening operation. The robotic arm pose parameters include the robotic arm's roll angle, pitch angle, and yaw angle in space. The cap opening operation includes rotating to unscrew, vertically pulling out, or first rotating to loosen and then vertically pulling out. Different cap opening methods can be selected according to the bottle cap type and actual situation. The implementation principle of this embodiment is as follows: This embodiment, through steps such as setting a coordinate system, calculating the target value in segments, obtaining the bottle size, calculating compensation values, and correcting coordinate points, enables the robotic arm to accurately grasp and open bottles of different sizes, overcoming the shortcomings of low efficiency of manual cap opening and the inability of fixed-parameter mechanical cap opening devices to adapt to bottles of different sizes in the prior art, improving the dispensing efficiency and accuracy of the automatic dispensing machine, and reducing the risks in the dispensing process. Embodiment 2: The difference between this embodiment and the above embodiment is that the bottle cap opening system for the automatic dispensing machine includes a vision recognition module, a cap opening mechanism, a robotic arm control system, and a front-end gripper. The visual recognition module is used to obtain the bottle's diameter and total height H. It employs a high-precision industrial camera and advanced image processing algorithms to quickly and accurately acquire the bottle's dimensional information. In applications requiring even higher precision, multiple cameras can be used to capture images from different angles to improve measurement accuracy. (Reference) Figure 3 The cap-opening mechanism 6 is equipped with cap grippers for holding the caps of vials 2. These grippers can be made of special materials, such as high-friction rubber, to ensure they do not slip when gripping the caps. The opening and closing force of the grippers can be precisely controlled via a hydraulic or electric system to accommodate different types of caps. The robotic arm control system includes a data storage module, a data processing module, and an execution control module. The data processing module has a program for calculating the actual positioning coordinates, the data storage module stores all preset calculation parameters and results, and the execution control module controls the front-end grippers to perform the cap-opening operation based on the actual positioning coordinates. The data storage module can use a large-capacity hard drive or flash memory to store a large amount of calculation parameters and results. The data processing module can use a high-performance processor, such as a multi-core CPU or GPU, to improve calculation speed. (Reference) Figure 2The robotic arm 1 has a front-end gripper comprising a first gripper 3 and a second gripper 4 symmetrically arranged on both sides, and a limiting member 5 positioned between the first and second grippers. The first gripper 3 and the second gripper 4 are driven by either a pneumatic cylinder or an electric cylinder, moving simultaneously towards or away from the limiting member. The vial 2 is positioned between the first gripper 3, the second gripper 4, and the limiting member 5. Pneumatic cylinder drive has the advantages of fast response and high force, while electric cylinder drive has the advantages of high control precision and good stability. In practical applications, a suitable driving method can be selected according to specific needs. The implementation principle of this embodiment is as follows: the vial opening system of this embodiment, through the coordinated work of various modules, can accurately obtain the size information of the vial, calculate the actual positioning coordinates, and control the front-end gripper and the opening mechanism to open vials of different sizes. Compared with the prior art, it improves the efficiency and accuracy of opening, reduces the error and risk of manual operation, and meets the needs of automatic dispensing machines for opening vials of different sizes. The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for opening vials in an automatic dispensing machine, applicable to the gripper at the front end of a robotic arm grasping the vial to the opening mechanism, characterized in that, Includes the following steps: S1, set the XYZ three-dimensional coordinate system for the movement of the robotic arm, the front gripper picks up the smallest size vial and moves it to the working position of the capping mechanism, and calibrates the coordinate point of the center position of the front gripper at this time as the reference coordinate (X0, Y0, Z0). S2, based on the set segment interval of the bottle diameter, and set the slope and intercept corresponding to each segment interval, calculate the target value according to the linear function; S3, obtain the bottle diameter and total height H of the vial through visual recognition; S4, Calculate the compensation value used to correct the actual position of the robotic arm: Compensation value = (Target value - Bottle diameter / 2) - Calibration bias term; S5, correct the actual positioning coordinates of the front gripper center position based on the compensation value and the total height H of the bottle; S6 inputs the preset robotic arm pose parameters and the calculated actual positioning coordinates into the robotic arm control system, controlling the robotic arm to move to the target pose and perform the opening operation.
2. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, The process of constructing the XYZ three-dimensional spatial coordinate system for the robotic arm motion is as follows: Set a reference origin, take the horizontal forward direction of the robotic arm as the X-axis, take the horizontal rightward lateral movement direction of the robotic arm as the Y-axis, and take the vertical upward movement direction of the robotic arm as the Z-axis.
3. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, S2 specifically includes the following steps: Based on the set diameter of the bottle, the segments are divided into 3 sections: The first interval is (11, 15.77] mm. The slope is set to 0.1333 and the intercept to 6.1467. At this time, the target value is 0.1333 × bottle diameter + 6.1467. The second interval is (15.77, 18.3] mm. The slope is set to 0.085 and the intercept to 6.
73. At this time, the target value is 0.085 × bottle diameter + 6.
73. The third interval is (18.3, 26] mm. The slope is set to 0.09 and the intercept to 6.
5. At this time, the target value is 0.09 × bottle diameter + 6.
5.
4. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, S5 specifically includes: calculating the actual positioning coordinates (X1, Y1, Z1) of the center position of the front gripper, wherein: X1 = X0 - compensation value; Y1 = Y0; Z1 = Z0 - (H - bottle cap height correction item) + ΔZ, where ΔZ is the offset in the Z-axis direction, which is a preset calibration parameter.
5. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, Before calculating the compensation value, step S4 also includes the following steps: Determine if the bottle diameter is within the segmented range. If so, calculate the compensation value; otherwise, the robotic arm directly throws out the vial, and the feedback information is that the diameter is not within the valid segmented range.
6. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, The robotic arm's pose parameters include its roll angle, pitch angle, and yaw angle in space.
7. The vial opening method for an automatic dispensing machine according to claim 1, characterized in that, The opening operation includes rotating to open or pulling out vertically, or rotating to loosen and then pulling out vertically.
8. A vial opening system for an automatic dispensing machine, applicable to the vial opening method for an automatic dispensing machine as described in any one of claims 1-7, characterized in that it comprises: The visual recognition module is used to obtain the diameter of the vial body and the total height H of the vial. The cap opening mechanism is equipped with cap grippers for holding the cap of the vial; The robotic arm control system includes a data storage module, a data processing module, and an execution control module. The data processing module has an actual positioning coordinate calculation program, the data storage module stores all preset calculation parameters and calculation results, and the execution control module controls the front gripper to perform the opening operation based on the actual positioning coordinate. The front gripper is used to hold the vial.
9. A vial opening system for an automatic dispensing machine according to claim 8, characterized in that, The front-end gripper includes a first gripper and a second gripper arranged symmetrically on the left and right, and a limiting member disposed between the first gripper and the second gripper. The first gripper and the second gripper are driven by a pneumatic cylinder or an electric cylinder and move towards or away from the limiting member at the same time.