An intelligent medicine selling system based on the Internet of Things and a medicine management method
By combining the thermal field reconstruction, baseline self-learning, and servo escape modules of the IoT-based smart medicine dispensing system, the problems of medicine boxes getting stuck due to moisture and physical deadlocks are solved. This enables accurate monitoring and adaptive judgment of medicine box moisture, avoids misjudgment of status and mechanical damage, and improves the reliability and safety of the equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU TONGJI ZHIYI TECH CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-05-29
AI Technical Summary
Existing intelligent medicine dispensing systems cannot accurately reflect the problem of medicine boxes becoming damp and stuck due to local temperature and humidity differences. Furthermore, they lack adaptive judgment and safety escape mechanisms when physical deadlock occurs, which can easily lead to misjudgment of status and mechanical damage.
The system employs an IoT-based intelligent drug dispensing system, which combines a thermal field reconstruction module, a baseline self-learning module, a risk assessment module, and a servo escape module. Through temperature and humidity sensors and a brushless DC motor, it monitors and adjusts the local temperature and condensation risk of the drug dispensing channel in real time, dynamically updates the baseline operating envelope, and executes alternating escape actions to avoid jamming and prevent mechanical damage.
It achieves accurate monitoring and adaptive judgment of medicine box dampness and jamming, avoiding misjudgment of status and mechanical damage, and improving the reliability and safety of the equipment.
Smart Images

Figure CN122116524A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent devices and automated control technology, specifically to an intelligent drug dispensing system and drug management method based on the Internet of Things. Background Technology
[0002] In actual operation, the varying drug inventory levels in different dispensing aisles of an intelligent self-service drug dispensing system alter the airflow distribution within the cabinet. Existing dispensing equipment typically relies on a small number of sensors fixed inside the casing for global environmental monitoring, which is insufficient to accurately reflect localized temperature and humidity differences in each dispensing aisle caused by variations in internal air resistance. When temperature differences or high humidity occur inside the cabinet, the paper-based drug packaging boxes are prone to absorbing moisture, causing the surface of the boxes to soften and increasing frictional resistance, making them highly susceptible to physical jamming during dispensing.
[0003] Furthermore, the reduction gearbox and other transmission components of the dispensing mechanism in a vending machine experience mechanical wear after long-term high-frequency operation, leading to a gradual increase in the motor's basic operating resistance. Existing motor control programs typically use fixed current thresholds to determine if the dispensing channel is jammed, failing to consider the aging and drift of transmission components and changes in stiffness of the medicine box after it becomes damp. This makes the equipment prone to misjudging a deadlock state under complex operating conditions. Moreover, after confirming a jam, existing equipment usually resorts to directly outputting maximum current to forcibly push or performing a single reverse rotation to extricate itself. This approach fails to effectively release the compressive stress already formed within the transmission mechanism, and the forced drive can easily generate rigid impacts. This not only fails to resolve the jam but can also easily lead to breakage of the reduction gear or complete crushing and damage to the medicine packaging box.
[0004] Therefore, this invention proposes an intelligent drug dispensing system and drug management method based on the Internet of Things to address the shortcomings of existing technologies. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an intelligent drug dispensing system and drug management method based on the Internet of Things. This solves the problems of existing intelligent drug dispensing systems where medicine boxes become damp and stuck due to local temperature and humidity changes, and where the lack of adaptive judgment and safe escape mechanisms in the event of physical deadlock easily leads to misjudgment of status and mechanical damage.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an intelligent drug dispensing system based on the Internet of Things (IoT), comprising a main control microcontroller, and a brushless DC motor, a magnetic field orientation control driver, a thermistor array, a temperature and humidity sensor, and an IoT communication module, all communicatively connected to the main control microcontroller; the brushless DC motor includes a reduction gearbox assembly for driving the drug dispensing channel; the main control microcontroller has an embedded operating program for running: The thermal field reconstruction module acquires the temperature data of the thermistor array, calculates the local estimated temperature of each drug delivery channel by combining the spatial flow field distribution parameters, and performs a locking operation on the drug delivery channel where the temperature exceeds the limit according to the temperature compliance conditions. The baseline self-learning module records the torque and current characteristics when the brushless DC motor drives the drug dispensing, and updates the baseline operating envelope data of the currently driven drug dispensing channel when the set conditions are met. The risk assessment module calculates the condensation risk index of the currently driven drug delivery channel based on the dew point temperature inside the computer cabinet, which is obtained from the data of the temperature and humidity sensor, and in combination with the estimated local temperature. The servo escape module receives the condensation risk index, generates dynamic fault tolerance parameters, and sends them to the magnetic field orientation control driver. The magnetic field orientation control driver detects the operating current of the brushless DC motor based on the dynamic fault tolerance parameters. When a physical deadlock is detected, the servo escape module controls the brushless DC motor to perform alternating escape actions. The IoT communication module uploads the local estimated temperature, the condensation risk index, and the operating status parameters of the brushless DC motor through the IoT communication module, and receives instructions from the cloud server.
[0007] Preferably, the thermal field reconstruction module calculates the local estimated temperature of each drug delivery channel by combining spatial flow field distribution parameters, specifically including: Obtain the inventory quantity information of the drug delivery channel and perform normalization processing to generate an inventory mask vector; The inventory mask vector is used to perform wind resistance compensation calculation on the steady-state empty topology matrix to generate a real-time topology matrix. In the compensation calculation, the wind resistance penalty weight of the fully loaded drug delivery channel is distributed to the drug delivery channels in the surrounding locations using the inverse proportional function of spatial distance. The local estimated temperature is obtained by multiplying the real-time topology matrix with the spatial temperature vector formed by the temperature data using matrix multiplication.
[0008] Preferably, the thermal field reconstruction module performs a locking operation on the drug delivery channel where the temperature exceeds the limit based on temperature compliance conditions, specifically including: When the estimated local temperature of the dispensing channel where the temperature exceeds the legal upper limit for drug storage is continuously higher than the upper limit for a duration that reaches the compliance time threshold, a virtual locking command is executed on the dispensing channel where the temperature exceeds the limit at the software application layer to refuse to respond to the dispensing command.
[0009] Preferably, the baseline self-learning module updates the baseline operating envelope data of the currently driven drug delivery channel when it determines that the set conditions are met. The set conditions specifically include: Extract the condensation risk index corresponding to the currently driven drug delivery channel, and the statistical variance of the rate of change of the current in the cross-axis current sequence collected by the magnetic field orientation control driver as a torque current feature; The condensation risk index is verified to be strictly less than the safety risk threshold, and the statistical variance is strictly less than the smooth variance threshold.
[0010] Preferably, the baseline self-learning module updates the baseline operating envelope data of the currently driven drug delivery channel, specifically including: Using the rotor position feedback data of the brushless DC motor, the quadrature-axis current sequence is mapped from the time domain to the spatial position domain to generate a torque-current characteristic curve with the mechanical stroke parameter as the abscissa. An exponentially weighted moving average algorithm with a forgetting factor is used to weight the torque-current characteristic curve with historical reference operating envelope data, and the latest reference operating envelope data is obtained by updating it point by point.
[0011] Preferably, the risk assessment module calculates the condensation risk index of the currently driven drug delivery channel, specifically including: The difference between the locally estimated temperature and the dew point temperature inside the cabinet is calculated using a discretized two-way physical integral over the time dimension. When the dew point temperature inside the cabinet is greater than the locally estimated temperature, the discretized two-way physical integral calculation uses the condensation absorption rate coefficient; when the dew point temperature inside the cabinet is less than or equal to the locally estimated temperature, the discretized two-way physical integral calculation uses the air drying evaporation rate coefficient.
[0012] Preferably, the dynamic fault-tolerant parameters include an upper limit for the dynamic current change rate and a fault-tolerant time window. The magnetic field-oriented control driver determines a physical deadlock state by: The actual rate of change of the operating current is extracted during the drug dispensing process; Timing begins when the actual current change rate exceeds the upper limit of the dynamic current change rate; if the duration of exceeding the upper limit of the dynamic current change rate reaches the fault tolerance time window, and the operating current does not decrease during the process of exceeding the upper limit of the dynamic current change rate, then it is determined that a physical deadlock state has been entered.
[0013] Preferably, the reduction gearbox assembly has a pre-installed mechanical backlash, and the alternating escape action includes: The magnetic field orientation control driver is controlled to apply a critical negative current to the brushless DC motor; Driven by the critical negative current, the rotor of the brushless DC motor reverses to reduce the mechanical backlash, and stops outputting the critical negative current when the reverse angle is detected to reach the backlash threshold.
[0014] Preferably, the alternating escape action further includes: The output positive probing current drives the rotor to idle across the mechanical back gap. During the idling process across the mechanical back gap, the sliding mode observer inside the magnetic field orientation control driver estimates the electrical angular velocity of the brushless DC motor, and the angular acceleration is extracted by differentiating the electrical angular velocity with respect to time. When it is determined that the downward angular acceleration breaks through the preset impact deceleration threshold, the gear contact point is confirmed, the control mode is switched to open-loop current feedforward control and a high-slope peak pulse current is output.
[0015] This invention also provides a drug management method based on the Internet of Things, comprising the following steps: The temperature data of the thermistor array is obtained, and the local estimated temperature of each drug delivery channel is calculated by combining the spatial flow field distribution parameters. Based on the temperature compliance conditions, the drug delivery channel with excessive temperature is locked. Record the torque and current characteristics when the brushless DC motor drives the drug dispensing process, and update the reference operating envelope data of the currently driven drug dispensing channel when the set conditions are met. Based on the dew point temperature inside the computer cabinet, as measured by the temperature and humidity sensor, and combined with the estimated local temperature, the condensation risk index of the currently driven drug delivery channel is calculated. The system receives the condensation risk index, generates dynamic fault tolerance parameters, and sends them to the magnetic field orientation control driver. The magnetic field orientation control driver detects the operating current of the brushless DC motor based on the dynamic fault tolerance parameters. When a physical deadlock is detected, the system controls the brushless DC motor to perform an alternating escape action. The local estimated temperature, the condensation risk index, and the operating status parameters of the brushless DC motor are uploaded through the IoT communication module, and instructions are received from the cloud server.
[0016] This invention provides an intelligent drug dispensing system and drug management method based on the Internet of Things (IoT). It has the following beneficial effects: 1. This invention generates an inventory mask vector by acquiring inventory quantity information of the dispensing channels. Using this inventory mask vector, it performs wind resistance compensation calculations on the steady-state unloaded topology matrix to generate a real-time topology matrix, thereby estimating the local temperature of each dispensing channel. Simultaneously, the system combines the dew point temperature inside the cabinet with the local estimated temperature, and performs bidirectional physical integration calculations based on the unequal rates of condensation absorption and evaporation to derive a condensation risk index. These features overcome the local temperature monitoring deviation caused by changes in air resistance inside the cabinet, objectively quantifying the cumulative state of moisture absorption in paper-based medicine boxes, and providing an accurate environmental data foundation for subsequent mechanical control and fault diagnosis.
[0017] 2. After acquiring the quadrature-axis current sequence of the brushless DC motor, this invention performs a dual-threshold health status verification using the condensation risk index and the statistical variance of the current change rate. Upon successful verification, an exponentially weighted moving average algorithm with a forgetting factor is used to update the baseline operating envelope data of the drug delivery channel. These features enable the control system to dynamically track the gradual increase in mechanical wear and frictional resistance of the reduction gearbox assembly and drug delivery mechanism due to long-term operation, avoiding the miscalculation of abnormal biases into the operating baseline. This prevents baseline drift caused by mechanical aging from affecting the accuracy of subsequent deadlock determination.
[0018] 3. This invention transforms the condensation risk index into a dynamic upper limit for the rate of change of current and a fault-tolerant time window. Upon determining that the dispensing mechanism is in a physical deadlock state, a critical negative current is preferentially applied to drive the motor rotor in reverse to reduce mechanical backlash and release compressive stress. Subsequently, a positive probing current is applied to detect the gear contact point, and at the instant the angular acceleration breaks through the preset threshold, open-loop control is switched to output a peak pulse current. These features can adaptively adjust the jamming judgment boundary according to the stiffness changes of the medicine box under different dry and wet conditions. By releasing stress first and then finding the contact point for transient impact, the physical jamming is eliminated, and gear breakage caused by directly applying a large current is avoided. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the method flow of the present invention; Figure 3 This is a schematic diagram showing the relationship between the internal temperature of the cabinet and the condensation risk index over time, wherein (a) is the relationship curve of the internal temperature of the cabinet over time, and (b) is the relationship curve of the condensation risk index over time. Figure 4 This is a schematic diagram of the transient response curves of the quadrature-axis current and angular acceleration of the brushless DC motor of the present invention, wherein (a) is the transient response curve of the quadrature-axis current of the brushless DC motor, and (b) is the transient response curve of the angular acceleration of the brushless DC motor. Figure 5 This is a schematic diagram comparing the statistical indicators of the control group and the experimental group under 1000 ticulosis induction tests according to the present invention.
[0020] Among them, 100 is the thermal field reconstruction module; 200 is the baseline self-learning module; 300 is the risk assessment module; 400 is the servo escape module; and 500 is the Internet of Things communication module. Detailed Implementation
[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] See attached document Figure 1 The present invention provides an intelligent drug dispensing system based on the Internet of Things, comprising: a thermal field reconstruction module 100, a baseline self-learning module 200, a risk assessment module 300, a servo escape module 400, and an Internet of Things communication module 500.
[0023] The hardware components of the IoT-based smart drug dispensing system include a main control microcontroller, a brushless DC motor, a field-oriented control driver, a thermistor array, temperature and humidity sensors, and an IoT communication module. The brushless DC motor, equipped with a reduction gearbox assembly, is located inside the cabinet and drives the drug dispensing mechanism within the vending machine. The field-oriented control driver connects the main control microcontroller to the brushless DC motor, executing servo control commands for the motor. The thermistor array contains multiple NTC thermistors distributed throughout the cabinet's internal space, collecting temperature data from within the cabinet. The temperature and humidity sensors are located at the main and return air vents of the cabinet, collecting temperature and humidity data from the return air. The IoT communication module connects to the main control microcontroller for wireless data exchange with the cloud network.
[0024] The main control microcontroller is connected to the thermistor array, temperature and humidity sensor, magnetic field orientation control driver, and IoT communication module. The main control microcontroller has embedded running programs for running the thermal field reconstruction module 100, baseline self-learning module 200, risk assessment module 300, servo escape module 400, and IoT communication module 500.
[0025] The thermal field reconstruction module 100 acquires the temperature data collected by the thermistor array, calculates the local temperature of each drug delivery channel by combining the spatial flow field distribution parameters, and performs a locking operation on the corresponding delivery channel according to the temperature compliance conditions.
[0026] The baseline self-learning module 200 records the torque and current characteristics when the brushless DC motor drives the target channel to dispense medicine, and updates the reference current envelope of the target channel when the set conditions are met.
[0027] The risk assessment module 300 calculates the condensation risk index of the target cargo channel based on the return air data collected by the temperature and humidity sensor, the dew point temperature inside the computer cabinet, and the local temperature output by the thermal field reconstruction module 100.
[0028] The servo escape module 400 receives the condensation risk index, generates dynamic fault-tolerant parameters, and sends them to the field-oriented control driver. The field-oriented control driver detects the operating current of the brushless DC motor based on the dynamic fault-tolerant parameters. When a physical deadlock is detected, the servo escape module 400 controls the brushless DC motor to perform alternating escape actions.
[0029] The IoT communication module 500 uploads the local temperature, condensation risk index, and brushless DC motor operating status parameters of each drug delivery channel to the cloud server through the IoT communication module, and receives business scheduling and remote configuration instructions issued by the cloud server.
[0030] See attached document Figure 2 This invention provides a drug administration method, comprising the following steps: S100: Obtain the temperature vector inside the cabinet, calculate the local estimated temperature of the cargo channel using the flow field distribution parameters, and lock the corresponding cargo channel when the local estimated temperature exceeds the set value. S200 verifies environmental data and brushless DC motor operating data, and extracts torque current characteristic curves when the verification is successful, and updates the reference operating envelope data of the cargo channel. S300 acquires dew point data inside the cabinet, performs numerical integration calculations, and generates condensation risk indices for each cargo channel. S400 converts the condensation risk index into a judgment threshold for the servo control layer. When the brushless DC motor current parameter is detected to exceed the judgment threshold, the brushless DC motor is controlled to perform an alternating escape action. The S500 packages local estimated temperature, condensation risk index, and operating parameters, uploads them to the cloud server via the IoT communication module, and simultaneously receives cloud control commands.
[0031] To further clarify the implementation of each technical aspect of the present invention, the following will provide a detailed description of the implementation of each functional module involved above and its internal processing flow.
[0032] See attached document Figure 1 In this embodiment, the hardware of the IoT-based smart drug dispensing system includes a main control microcontroller, a brushless DC motor, a field-oriented control driver, a thermistor array, a temperature and humidity sensor, and an IoT communication module. The main control microcontroller has an embedded program that supports the logical operations and control flow of the thermal field reconstruction module 100, the baseline self-learning module 200, the risk assessment module 300, the servo escape module 400, and the IoT communication module 500.
[0033] In this embodiment, the main control microcontroller serves as the computation and control center of the entire intelligent drug dispensing system. As a preferred embodiment, the main control microcontroller is constructed using a 32-bit microprocessor with a hardware floating-point unit. To prevent internal bus congestion between polling from multiple low-frequency sensors and high-frequency motor control commands, the main control microcontroller's operating frequency is set above 144 MHz. Combined with an interrupt-driven hierarchical scheduling mechanism, sufficient hardware computing power is used to simultaneously support the high-frequency interrupt computations of upper-level thermodynamic calculations and lower-level brushless DC motor servo control.
[0034] For the underlying actuator, the brushless DC motor is housed inside the cabinet and fixedly installed at the tail end of each drug dispensing channel. The output end of the brushless DC motor is mechanically connected to a reduction gearbox assembly, and the output shaft of this reduction gearbox assembly is mechanically connected to the drug-pushing screw of the drug dispensing channel. As a preferred embodiment, a mechanical backlash of 0.5 to 2.0 degrees is reserved between the transmission gears inside the reduction gearbox assembly. This mechanical backlash is established based on the following: when the backlash is less than 0.5 degrees, the gear movement space generated by the reverse output critical current of the brushless DC motor is insufficient, making it difficult to completely release the macroscopic wedge-shaped compressive stress between the paper-based medicine box and the drug-pushing screw; when the backlash is greater than 2.0 degrees, the kinetic energy accumulated by the rotor in the subsequent forward no-load gap is too large, easily leading to violent gear impact and breakage. Therefore, this range of mechanical backlash provides physical space for subsequent stress release and escape actions. Additionally, the field-oriented control driver is electrically connected to the main control microcontroller and the brushless DC motor. The main control microcontroller connects to the field-oriented control driver via a pulse width modulation signal interface, thereby regulating the operating phase current of the brushless DC motor. For the hardware circuit design of the field-oriented control driver, those skilled in the art can refer to a conventional three-phase inverter bridge topology for construction; its basic circuit structure is well-known in the field and will not be elaborated upon here.
[0035] In this embodiment, the system uses a sensor network to perceive the microclimate parameters inside the cabinet in real time. Specifically, the thermistor array includes multiple NTC thermistors. These NTC thermistors are sparsely distributed according to three-dimensional spatial coordinates at the edges of various shelf panels and dead corners of the air ducts inside the cabinet, and communicate with the main control microcontroller through a high-precision analog-to-digital converter interface. Simultaneously, a temperature and humidity sensor is fixedly arranged at the main return air vent of the cabinet. Since the main return air vent is the convergence channel for air circulation inside the cabinet, the temperature and humidity sensor located there can accurately collect temperature and relative humidity data of the overall mixed-flow return air inside the cabinet. This temperature and humidity sensor establishes a digital communication connection with the main control microcontroller through an integrated circuit bus interface.
[0036] Furthermore, since the drug delivery channel primarily stores paper-based medicine boxes, the interior of the cabinet needs to maintain a specific microclimate environment. As a preferred approach, the compliant storage temperature range inside the cabinet is set to 2°C to 20°C, and the relative humidity range is controlled between 35% and 75%. The reference wind speed at the main return air vent of the cabinet is maintained between 1.5 m / s and 3.0 m / s to ensure the stability of the internal airflow distribution. To ensure the validity of the data for subsequent micro-condensation risk assessment calculations, the temperature measurement accuracy of the temperature and humidity sensors is set to ±0.3°C, the relative humidity measurement accuracy to ±2%, and the temperature measurement accuracy of the thermistor array to ±0.5°C.
[0037] In this embodiment, the IoT communication module is located in an area with unobstructed network signals at the top of the cabinet and is connected to the main control microcontroller via a universal asynchronous transceiver interface. The IoT communication module utilizes a cellular mobile communication network to establish a wireless data connection with the cloud server, thereby providing a physical communication carrier for remote data interaction for the IoT communication module 500.
[0038] S110 performs synchronous acquisition of space temperature data. In specific implementation, the main control microcontroller triggers an analog-to-digital conversion interrupt via a hardware timer to read the voltage feedback values of each NTC thermistor in the thermistor array at a preset polling cycle. To avoid misalignment of the space flow field state due to polling time differences, the main control microcontroller uses a direct memory access mechanism to synchronously move the acquired multi-channel analog-to-digital conversion data to a memory buffer for timestamp alignment. After time alignment, the main control microcontroller uses a pre-established nonlinear temperature conversion model to convert the acquired analog voltage quantity into the corresponding Celsius physical quantity. For this hardware voltage-to-temperature conversion, those skilled in the art can use conventional lookup table methods or the Steinhart-Hart equation; the conversion process is well-known in the field and will not be elaborated here. The processed temperature data constitutes a space temperature vector. In this embodiment, the cabinet is provided with... An NTC thermistor, space temperature vector The dimension is .
[0039] S120 calculates the real-time topology matrix based on the flow conservation law. Since the cooling air driven by the fan within the cabinet tends to flow along the path of least resistance, when a dispensing aisle is full of medicine boxes, its internal airflow channel narrows, causing a sharp increase in local resistance. This forces the cool air to detour and overflow into surrounding empty aisles with less inventory and lower resistance. Therefore, the heat transfer weight between the fixed-position NTC thermistor and each dispensing aisle is not constant and must be compensated for by adjusting the spatial flow field according to the dynamic distribution of inventory in the aisles.
[0040] Based on the above principles, the cabinet contains Each dispensing channel has its own independent drug delivery channel. Under standard no-load test conditions, due to the unobstructed airflow inside the cabinet, a fixed thermodynamic mapping relationship exists between the thermistor array and each drug delivery channel. This relationship is pre-calibrated and stored in the main control microcontroller, and is represented as a steady-state no-load topology matrix. Its dimensions are In actual operation, the main control microcontroller reads the inventory quantity information of the vending machine's bottom-level sensors in real time, divides it by the maximum design capacity of a single vending lane for normalization, and thus generates a dimension of... Inventory mask vector Subsequently, the thermal reconstruction module 100 utilizes the stock mask vector. For steady-state unloaded topology matrix Perform element-by-element dynamic drag compensation calculations to generate a real-time topology matrix. The compensation calculation formula is as follows: ; In the formula, Represents the real-time topology matrix The Middle The corresponding drug delivery channel The dynamic weighting value of each NTC thermistor; the outermost layer of the formula uses The function constructs boundary truncation logic to prevent the summation compensation term from being too large under extreme full-load aggregation conditions, which would cause the weight to have a negative value that violates the laws of physics; Represents the steady-state unloaded topology matrix The basic weight values in; The self-restriction heating coefficient is used to characterize the local heating effect caused by the reduction of cold air inflow when the cargo channel is fully loaded. As a preferred method, the value of the self-restriction heating coefficient is between 0.15 and 0.25. The specific value is obtained by experimental calibration based on the ratio of the total pressure parameter of the fan inside the cabinet to the cross-sectional area of the cargo channel. Indicates the first The inventory mask value of each drug delivery channel ranges from 0 to 1, where 0 indicates completely empty and 1 indicates completely full. This represents the overflow cooling coefficient, which characterizes the additional cooling effect of the cold air expelled from other fully loaded lanes on the current lane. Its value is set between 0.05 and 0.10. Indicates the first The inventory mask value of each drug delivery channel; Indicates the first The drug delivery channel and the first The physical Euclidean distance of each drug delivery channel in the three-dimensional space inside the cabinet is expressed in meters. As a smoothing constant, its value is set to 0.01 to prevent the risk of deadlock due to computational overflow caused by the denominator approaching zero when the spatial distance is extremely close. This step accurately allocates the wind resistance penalty weight of the fully loaded lane to the surrounding lanes through an inverse proportional function of spatial distance, so that the matrix parameters iterate in real time with the physical inventory status. To ensure the consistency of the Celsius dimension and the principle of physical conservation in the subsequent temperature calculation, after completing the above dynamic compensation calculation, the thermal field reconstruction module 100 further performs a normalization operation on each row of dynamic weight values calculated to ensure... This avoids the final generated real-time topology matrix In relation to the space temperature vector The overall numerical value drifts when multiplying.
[0041] S130 performs local temperature calculation and compliance lockout determination. This is done while acquiring the real-time topology matrix. Subsequently, the thermal reconstruction module 100 uses matrix multiplication to calculate the entire rack. Local estimated temperature vector of the drug delivery channel The calculation formula is as follows: ; In the formula, For dimension The column vector, whose internal... element This represents the number of units inside the rack. The current local estimated temperature of the drug delivery channel, its unit relative to the spatial temperature vector. The temperature is kept consistent at degrees Celsius. The main microcontroller calculates the local estimated temperature vector. Continuous monitoring shall be conducted, and the storage temperature shall be in accordance with the established legal limits for drug storage. Numerical comparisons were performed. As a preferred method, this was combined with regulations on cool storage environments for pharmaceuticals and the legally mandated upper limit for pharmaceutical storage temperatures. Set to 20 degrees Celsius.
[0042] To avoid frequent false triggering due to short-term thermal noise drift of a single-point NTC thermistor, the system output determination no longer relies on a single-dimensional extreme value, but instead incorporates a confidence time window to form an anti-jitter mechanism. In this embodiment, when the main microcontroller detects a specific drug delivery channel... Local estimated temperature Continuously exceeding the legal upper limit of drug storage temperature When this happens, an internal hardware timer is started. If the duration of this overrun reaches the compliance time threshold... The main microcontroller then controls the first... The drug delivery channel executes a virtual lock command. As a preferred method, a compliance time threshold... The timeout is set to 30 minutes to filter out sudden temperature fluctuations caused by brief opening of the cabinet door during customer medication collection. Medication dispensing channels in a virtual locked state will refuse to respond to any externally issued dispensing commands until their local estimated temperature is reached. Restore to the legally mandated upper limit for drug storage temperature The main microcontroller can only be unlocked after the preset time has elapsed.
[0043] In this embodiment, the baseline self-learning module 200 is used to perform the operation step S200 of verifying the environment and operating data and updating the baseline operating envelope data. During the long-term operation of the intelligent drug dispensing system, the mechanical friction resistance of each dispensing channel will slowly drift due to the aging and wear of components. The main control microcontroller, by running the baseline self-learning module 200, can dynamically track the above-mentioned gradual change process, while avoiding mislearning sudden abnormal resistance as a normal baseline. Specifically, this includes the following steps: S210 performs health status gating verification of the self-learning data. If the paper-based medicine box absorbs water and swells due to high humidity in the target cargo channel environment, or if the dispensing mechanism experiences a sudden mechanical jam, the input brushless DC motor torque data will carry a significant abnormal bias. If this abnormal bias is directly used as the normal mechanical reference for updating the reference operating envelope data, it will cause the main control microcontroller to make a threshold misjudgment during subsequent deadlock detection. Therefore, the main control microcontroller must implement strict double-threshold blocking before data input.
[0044] Based on the above technical principles, in this embodiment, after the target channel completes a single drug dispensing action, the main control microcontroller extracts the condensation risk index corresponding to the target channel, which is output in real time by the risk assessment module 300. Condensation Risk Index The values are normalized and range from 0 to 1. Higher values indicate a greater probability of condensation and softening on the surface of the paper medicine box. Simultaneously, during this dispensing process, the magnetic field-oriented control actuator collects the quadrature-axis current sequence of the brushless DC motor at a preset high-frequency sampling rate. and the cross-axis current sequence Uploaded to the main microcontroller. For field-oriented control technology, the quadrature-axis current is directly proportional to the electromagnetic torque of the brushless DC motor, accurately reflecting the mechanical resistance overcome by the propellant screw. This fundamental principle is well-known in the field and will not be elaborated upon here. Considering that the main microcontroller actually operates in the discrete-time domain, the main microcontroller... Instead of continuous-time differentiation, discrete difference calculations are performed between adjacent sampling points to calculate the statistical variance of the current change rate. .
[0045] After acquiring the two aforementioned characteristic indicators, the main control microcontroller performs a dual-state determination. As a preferred approach, a security risk threshold is pre-set within the system. and smooth variance threshold Main control microcontroller verification condensation risk index Is it strictly less than the safety risk threshold? And the statistical variance of the rate of change of current. Is it strictly less than the smooth variance threshold? In this embodiment, the security risk threshold... Set to 0.15 to ensure a safe environment with extremely low humidity; smoothness variance threshold. The baseline is set to 0.5 square amperes per square second, a value obtained through experimental calibration based on the background current noise level of a brushless DC motor operating smoothly under normal lubrication conditions. Only when both of the above conditions are met simultaneously will the baseline self-learning module 200 determine the acquired quadrature-axis current sequence. This provides healthy self-learning data, allowing the master microcontroller to flow down to the baseline update stage.
[0046] S220 extracts the torque-current characteristic curve and performs baseline update. After the health state gating verification passes, the absolute running time of each drug dispensing operation may fluctuate due to extremely small load differences. If the time axis is directly used for data alignment, it will cause misalignment of current characteristic points at the same position. Therefore, the main control microcontroller uses the rotor position feedback data of the brushless DC motor to update the quadrature-axis current sequence. By mapping from the time domain to the spatial location domain, a torque-current characteristic curve is generated with the mechanical stroke parameters as the abscissa. ,in This represents the discretized stroke position of the pusher screw.
[0047] After completing the spatial domain data alignment, the main control microcontroller uses an exponentially weighted moving average algorithm with a forgetting factor to update the baseline operating envelope data of the target cargo channel point by point. This mathematical calculation process can smoothly incorporate the latest wear evolution information while preserving historical long-term mechanical resistance characteristics. The baseline operating envelope update formula is as follows: ; In the formula, Indicates the target cargo path at the discretized travel position point Passing through the first The latest baseline operating envelope data after the update, in amperes; This indicates the location of the extraction point during this drug delivery process. The torque-current characteristic curve data at the location, in amperes; Indicates the target cargo channel is in the first... The historical baseline operating envelope data retained during this update is in amperes. Specifically, this is when the system is in its first run or factory reset state. Under the working conditions, The initial value is set to the inherent triboelectric baseline current obtained under standard no-load test conditions before leaving the factory. The forgetting factor is used to adjust the weighting of old and new data. As a preferred method, the forgetting factor... The value range is set between 0.05 and 0.15. This range is determined based on the fact that when the forgetting factor... When the value is too large, the baseline operating envelope data is easily overcorrected due to minor frictional disturbances during a single run; when the forgetting factor... When the speed is too low, the update of the baseline operating envelope data is too slow to effectively track the gradual increase in actual resistance caused by long-term wear of the reduction gearbox assembly. Through this calculation logic, the system can enable each drug delivery channel to have an independent servo reference that dynamically iterates with the physical aging state, thereby providing a high-precision dynamic comparison basis for subsequent deadlock determination.
[0048] In this embodiment, the risk assessment module 300 is used to perform operation step S300 of calculating the dew point and assessing the condensation risk index inside the cabinet. Paper-based medicine boxes, after becoming damp and softened, significantly increase the mechanical friction resistance of the medicine delivery channel. Therefore, the main control microcontroller, by running the risk assessment module 300, can quantify the cumulative degree of this damp softening in real time. The specific implementation includes the following steps: S310, calculate the dew point temperature inside the server rack. In a physical environment, humidity and temperature together determine the critical temperature at which water vapor in the air reaches saturation and condenses into tiny water droplets; this critical temperature is the dew point temperature. In this embodiment, the main control microcontroller acquires relative humidity data and ambient temperature data from the main return air vent collected by the temperature and humidity sensor via the integrated circuit bus interface. The main return air vent is chosen as the acquisition point because the airflow at this location is a mixed average of air that has circulated throughout the entire server rack, and its temperature and humidity data can most objectively reflect the overall macroscopic water vapor distribution within the server rack. After acquiring the above basic parameters, the main control microcontroller uses the relative humidity data and ambient temperature data to calculate the dew point temperature inside the server rack. For the specific conversion of dew point temperature, those skilled in the art can use the conventional Magnus-Tyton approximation formula or a preset environmental parameter table for calculation. The calculation process is well-known in the field and will not be elaborated here. The calculated cabinet dew point temperature... The unit is Celsius, which represents the water vapor condensation boundary of the overall airflow field inside the cabinet.
[0049] S320 calculates the condensation risk index based on bidirectional physical integration. Before performing specific mathematical integration calculations, it is necessary to clarify that the softening of paper-based medicine boxes due to moisture absorption is a continuous, cumulative physical process, not an instantaneous phenomenon caused by a sudden temperature exceedance. When the actual local temperature of the medicine dispensing channel is lower than the dew point temperature, moisture will condense on the surface of the medicine box and be absorbed by the paper fibers, causing a decrease in the material's mechanical strength. Conversely, when the local temperature rises above the dew point temperature, the moisture absorbed inside the medicine box will gradually evaporate with the airflow, causing the material's mechanical strength to slowly recover. Therefore, to accurately assess the real-time physical state of paper-based medicine boxes, it is not sufficient to rely solely on absolute temperature comparisons at a single moment; a bidirectional cumulative tracking over time must be performed on the difference between the local temperature and the dew point temperature.
[0050] Considering the dew point temperature inside the rack The temperature is calculated in real time by temperature and humidity sensors, while the estimated local temperature of each drug delivery channel is periodically calculated by the thermal field reconstruction module. The update frequencies of these two sets of data differ. To ensure the rigor of the bidirectional physical integral calculation, in this embodiment, the main control microcontroller aligns the time axis of the aforementioned multi-source heterogeneous data using timestamp matching and a zero-order hold algorithm before performing the integral operation. This ensures that the temperature parameters at the same discrete moment strictly correspond under operating conditions. After completing the data time axis alignment, the main control microcontroller obtains the estimated local temperature vector of each drug delivery channel from the thermal field reconstruction module 100. For the first one The main microcontroller extracts the current local estimated temperature from the drug delivery channel. And combined with the dew point temperature inside the cabinet Regarding the first Each drug delivery channel performs discretized two-way physical integral calculations to generate a condensation risk index. The specific two-way physical integral formula is as follows: ; In the formula, Indicates the first The individual drug delivery channel is in the current discrete moment. The condensation risk index is a dimensionless parameter; the outermost layer of the formula uses... The function constructs upper and lower boundary truncation logic for the integral result to ensure that the condensation risk index is strictly limited to the safe range of 0 to 1, avoiding integral saturation overflow caused by long-term deviation from the dew point temperature; where 0 represents that the paper-based medicine box is in a completely dry state, and 1 represents that the paper-based medicine box is in a completely water-absorbing and softened state. Indicates the first The drug delivery channel at the previous discrete moment The condensation risk index; in particular, during system cold starts or microcontroller reset initialization, due to the lack of historical accumulated data, the initial condensation risk index of all drug delivery channels is... All are set to 0 by default; This indicates the overall dew point temperature inside the server rack, expressed in degrees Celsius. Indicates the first The estimated local temperature of the drug delivery channel, in degrees Celsius; This represents the time step between two consecutive operations, in seconds; as a preferred method, the time step... Set to 60 seconds; This is the dynamic rate coefficient, with dimensions in reciprocal Celsius-second, i.e., 1 / (°C·s), to ensure that the product terms in the formula cancel out the Celsius and second dimensions, resulting in a dimensionless value. This dynamic rate coefficient... The value depends on the polarity of the temperature difference, and its segmented value logic is as follows: when the dew point temperature inside the cabinet... Greater than the local estimated temperature When this occurs, it indicates that the environment is currently in a condensation state. The value is taken as the condensation absorption rate coefficient. When the dew point temperature inside the cabinet Less than or equal to the locally estimated temperature This indicates that the current environment is dry. The value is taken as the air-drying evaporation rate coefficient. .
[0051] As a preferred method, the condensation water absorption rate coefficient The value range is set between 0.0008 and 0.0012, and the air-drying evaporation rate coefficient is... The value range is set between 0.0001 and 0.0003. The asymmetric setting of these coefficients is based on the fact that the physical rate at which paper-based fibers actively absorb water through capillary action is much greater than the physical rate at which water naturally evaporates into the air overcoming internal fiber resistance. Therefore, the condensation absorption rate coefficient... It needs to be significantly greater than the air-drying evaporation rate coefficient. This setting accurately reflects the unequal-weighted physical characteristics of the medicine box, which absorbs moisture quickly but dries slowly. Through the aforementioned bidirectional physical integral logic, the risk assessment module 300 transforms continuous environmental microclimate changes into a condensation risk index that precisely reflects the mechanical strength of the medicine box, thereby providing a reliable digital physical criterion for subsequent gating verification of self-learning data and adaptive selection of servo escape strategies.
[0052] In this embodiment, the servo escape module 400 is used to execute the adaptive deadlock determination and mechanical escape operation steps S400. During the actual operation of the dispensing mechanism, the dryness or wetness of the paper-based medicine box significantly alters its deformation characteristics under pressure, thus affecting the current response curve of the brushless DC motor. The main control microcontroller and the magnetic field orientation control driver work together to operate the servo escape module 400, which can avoid misjudgments caused by a single fixed threshold and execute precise escape actions after confirming a physical deadlock. The specific implementation includes the following steps: S410 performs dynamic generation of fault-tolerant parameters. Regarding physical deformation characteristics, when the paper-based medicine box is dry, its mechanical stiffness is high. If jamming occurs, the quadrature-axis current of the brushless DC motor will experience a sharp, extremely high rate of increase. However, when the medicine box becomes damp and softens, its material can absorb some of the mechanical compression energy, causing the current increase rate during jamming to slow down, but the duration of the deadlock state is longer. Therefore, the main control microcontroller reads the condensation risk index corresponding to the target channel, calculated and output in real time by the risk assessment module 300. Based on this, the upper limit of the dynamic current change rate is pre-calculated. With fault tolerance time window The specific formula for calculating the dynamic fault tolerance parameter is as follows: ; ; In the formula, This indicates the upper limit of the target dynamic current change rate of the freight channel, calculated in amperes per second. This represents the upper limit of the rate of change of the base current measured under standard, fully dry test conditions. As a preferred method, the upper limit of the rate of change of the base current is... The value is set to 15.0 amperes per second; It is the current slope derating factor, in amperes per second, with a set value of 5.0 amperes per second, used to proportionally reduce the trigger threshold of the current change rate when the medicine box is damp; The condensation risk index of the target cargo channel at the current moment is a dimensionless parameter with a value between 0 and 1. This represents the pre-calculated fault tolerance time window, in milliseconds. This represents the basic fault tolerance time window, which is set to 50 milliseconds. This is the time window extension factor, measured in milliseconds, set to 100 milliseconds. It provides the system with a longer deformation tolerance period when the medicine box softens, preventing normal dispensing from being mistaken for deadlock. Through the negative and positive correlation mathematical mapping constructed using the above formula, the system can adaptively relax or tighten the boundary conditions for deadlock detection based on the moisture environment. After calculation, the main microcontroller sends these dynamic parameters to the underlying field-oriented control actuator.
[0053] S420 performs a physical deadlock determination. After receiving dynamic parameters, the magnetic field orientation control actuator continuously samples the cross-axis current sequence at millisecond intervals during the drug dispensing process. The digital signal processor inside the magnetic field orientation control actuator, combined with a non-zero fixed sampling period... Discrete-difference operations are performed on the cross-axis currents of adjacent cycles to extract the current actual current change rate. After extracting this actual current change rate data, the field-oriented control actuator compares the actual current change rate with the upper limit of the dynamic current change rate. Perform numerical comparison. When the actual current change rate is greater than the upper limit of the dynamic current change rate... At this time, the hardware timer inside the field-oriented control driver starts counting; if the duration of this over-limit state reaches or exceeds the fault-tolerant time window... If the quadrature axis current does not drop during this period, the magnetic field orientation control driver determines that the current drug dispensing mechanism has fallen into a physical deadlock state and immediately cuts off the positive drive signal.
[0054] S430, executes mechanical stress relief. After deadlock is detected and the escape process is triggered, directly applying a larger positive current will not only fail to overcome the accumulated significant static friction, but may also easily lead to tooth breakage in the reduction gearbox assembly. Therefore, the servo escape module 400 controls the field-oriented control driver to apply a critical negative current to the brushless DC motor to overcome the rotor's static resistance. As a preferred method, the amplitude of this critical negative current is set to 1.2 times the rated no-load operating current of the brushless DC motor. Driven by the critical negative current, the brushless DC motor rotor performs a slight reverse rotation, utilizing the inherent mechanical backlash between the gears in each stage of the reduction gearbox assembly for retraction. This reverse rotation does not involve macroscopic displacement of the pusher screw; its technical purpose is to release the macroscopic compressive stress accumulated at the jamming point, allowing the gears to disengage from a tightly meshed state. To avoid excessive reverse rotation of the brushless DC motor leading to mechanism misalignment, the main control microcontroller monitors the rotor's reverse rotation in real time through the position estimation logic within the field-oriented control driver. When the reverse rotation angle reaches the preset backlash threshold, the output of the critical negative current is immediately stopped. In this embodiment, the back gap threshold is set to a mechanical angle of 5° to 8°.
[0055] S440 performs electrical detection of gear meshing status. After mechanical stress relief, the servo recovery module 400 needs to find the optimal moment to apply force. The servo recovery module 400 controls the field-oriented control driver to output a positive polling current. This current amplitude is small and is only used to drive the rotor to idle across the mechanical backlash inside the reduction gearbox assembly. During this extremely short idle period, due to the lack of direct position sensors, the servo recovery module 400 uses the sliding mode observer inside the field-oriented control driver to reconstruct the back electromotive force based on the phase voltage and phase current of the brushless DC motor, and then estimates the electrical angular velocity of the brushless DC motor. The sensorless velocity estimation process based on the sliding mode observer described above is a well-known technique in the field and will not be elaborated further here. To avoid interference from high-frequency electromagnetic noise on the differential operation, the servo escape module 400 uses a first-order low-pass filter to filter the estimated electrical angular velocity. The surface is smoothed, and then the angular acceleration is extracted by taking its derivative with respect to time. When the gear crosses the backlash and momentarily impacts the front load-side tooth surface, reaching the contact point, the rotor experiences a strong reaction force, resulting in angular acceleration. An extremely steep negative pulse peak appears. The servo escape module 400 monitors angular acceleration in real time. When determining angular acceleration Downward penetration of the preset impact deceleration threshold At that moment, the servo escape module 400 recognizes and captures the characteristic pulse, thereby achieving precise electrical detection of the gear's contact point. As a preferred method, the impact deceleration threshold... Set to -500 radians per square second.
[0056] S450 executes close-range impact escape. The instant the servo escape module 400 detects the peak value of the negative angular acceleration pulse, it indicates that the gear has just completed close-range engagement and has not yet undergone elastic deformation. At this moment, the servo escape module 400 immediately switches the control mode from conventional proportional-integral regulation to open-loop current feedforward control, instantaneously outputting a high-slope peak pulse current. As a preferred method, the amplitude of this high-slope peak pulse current reaches 0.9 times the limit peak current of the brushless DC motor, and the current rise time is limited to within 2 milliseconds. The transient electromagnetic torque generated by the high-slope peak pulse current is directly converted into mechanical impact force in the gear's backlash-free engagement state, effectively breaking the static friction at the jamming point, forcing the pusher screw to resume rotation, and ultimately completing the entire servo escape logic.
[0057] In this embodiment, the IoT communication module 500 is used to execute the data reporting and cloud command issuance operation steps S500. In the application scenario of a distributed deployment of an intelligent drug dispensing system, individual devices need to maintain real-time status synchronization with the cloud server to achieve clustered remote monitoring and control. The specific implementation includes the following steps: The S510 performs the packaging and uploading of operational data. To ensure that the device status can be accurately tracked by the cloud server, the main control microcontroller periodically gathers multi-dimensional operational data from various internal modules. Specifically, the main control microcontroller extracts the estimated local temperature of each drug dispensing channel output by the thermal field reconstruction module 100, the corresponding condensation risk index generated by the risk assessment module 300, and the brushless DC motor operating parameters such as quadrature-axis current and bus voltage recorded by the magnetic field directional control driver during drug dispensing. Considering that wireless cellular networks may experience connection interruptions in the actual physical environment due to signal obstruction or base station switching, as a preferred method to avoid irreversible loss of the above-mentioned critical operational data, the main control microcontroller first writes the above-mentioned operational data along with the system timestamp into local non-volatile memory before uploading the data, thereby constructing a circular queue for network outage caching.
[0058] When the network status indication of the IoT communication module is detected as normal, the main control microcontroller encapsulates the running data in the aforementioned cache queue into frames according to a preset lightweight IoT communication protocol. In this embodiment, the system uses a message queue telemetry transmission protocol for data interaction. The main control microcontroller uses the system timestamp and the device's unique identification code as the header of the data frame; it encodes the local estimated temperature, condensation risk index, and brushless DC motor operating parameters according to a unified serialization format as the payload of the data frame; and it appends a cyclic redundancy check (CRC) code to the tail of the data frame. For the specific generation algorithm of the CRC code and the underlying transmission mechanism of the message queue telemetry transmission protocol, those skilled in the art can implement them using conventional communication standards and specifications; their calculation and transmission logic are well-known technologies in the field and will not be elaborated here. The encapsulated data frame is pushed to the IoT communication module via the hardware communication bus, and then uploaded by the IoT communication module to the cloud server via a wireless radio frequency network, thereby providing basic data support for the cloud server to manage the device cluster. After receiving the data reception response message from the cloud server, the main control microcontroller releases the corresponding running data cache space in its local non-volatile memory, thereby completing a reliable closed-loop upload.
[0059] The S520 performs cloud-based command parsing and service scheduling. While maintaining data reporting, the IoT communication module continuously monitors various downlink data packets sent to the device from the cloud server. Upon receiving a downlink data packet, the IoT communication module transparently transmits it to the main microcontroller. To improve data transfer efficiency and reduce kernel overhead, as a preferred method, the direct memory access controller within the main microcontroller directly transfers the transparent data stream to a designated receiving memory area. After completing the underlying data transfer, the main microcontroller extracts the cyclic redundancy check (CRC) code from the downlink data packet and performs validity checks to eliminate invalid data packets that have encountered errors during network transmission.
[0060] After successful verification, the main microcontroller deserializes and parses the message payload to extract the specific instructions carried within. The system executes differentiated processing branches based on the parsed instruction type. If a business scheduling instruction is parsed, such as a remote drug dispensing instruction triggered by a user placing an order in the terminal application, the main microcontroller extracts the target channel number and drug dispensing quantity parameters, and sends these parameters to the corresponding field-oriented control driver, thereby initiating the complete brushless DC motor servo-driven drug dispensing action. If a remote configuration instruction is parsed, such as various control parameters issued by the cloud server during system policy updates, the main microcontroller extracts the parameter key-value pairs in the message and updates the upper limit of the base current change rate. Basic fault tolerance time window The values are then overwritten to the local non-volatile memory. Through the above remote configuration logic, the system can remotely and dynamically adjust the internal operating parameters of core control modules such as the servo recovery module 400 and the baseline self-learning module 200 without the need for manual on-site disassembly and maintenance, thereby improving the overall operation and maintenance efficiency of the equipment.
[0061] To verify the operational performance of the IoT-based intelligent drug dispensing system provided by this invention in a high humidity environment, the following description is provided in conjunction with specific application examples and comparative experimental data.
[0062] A prototype of an IoT-based intelligent drug dispensing system was constructed, featuring an independent drug dispensing channel. The main control microcontroller employed a microprocessor with a single-precision hardware floating-point unit. The rated no-load operating current of the brushless DC motor was set to 0.5A, and the mechanical backlash of the reduction gearbox assembly was set to 1.2 degrees. The test environment temperature was set to vary between 18℃ and 25℃, and the relative humidity was maintained above 85%. The test object was a paper-based medicine box. This experiment established a control group and an experimental group: the control group employed a fixed threshold servo control strategy, i.e., a fixed current change rate threshold of 15.0A / s, and after determining a physical deadlock state, controlled the brushless DC motor to perform a fixed amplitude reverse and then forward dragging action; the experimental group used the IoT-based intelligent drug dispensing system provided by this invention.
[0063] See attached document Figure 3 During the experimental period from hour 2 to hour 6, the estimated local temperature was lower than the dew point temperature inside the cabinet, causing the cabinet to enter a condensation state. During this period, the risk assessment module 300 performed a positive integral based on the condensation absorption rate coefficient, resulting in a non-linear increase in the condensation risk index, which peaked at approximately 0.55 around hour 5, indicating that the paper-based medicine boxes had become damp. After hour 6, the estimated local temperature was higher than the dew point temperature inside the cabinet, causing the cabinet to enter a drying state. The risk assessment module 300 then performed calculations based on the drying evaporation rate coefficient, resulting in a decrease in the condensation risk index. This process verifies that the condensation risk index can objectively reflect the physical deformation characteristics of the paper-based medicine boxes under different operating conditions.
[0064] See attached document Figure 4 In the 8th hour of the experiment, the paper-based medicine box was artificially induced to jam in the dispensing channel. At this time, the condensation risk index was 0.72, and the mechanical stiffness of the paper-based medicine box decreased. For the experimental group, the servo escape module 400 adjusted the upper limit of the dynamic current change rate to 11.4 A / s and the fault tolerance time window to 122 ms. When the slope of the cross-axis current change of the brushless DC motor reached 11.4 A / s and lasted for more than 122 ms, the servo escape module 400 identified a physical deadlock state. In the subsequent escape action phase, the servo escape module 400 controlled the brushless DC motor to output a negative current to reduce the mechanical backlash of the reduction gearbox assembly, and then controlled the brushless DC motor to output a positive probing current. When a negative pulse appeared on the angular acceleration curve and broke through the preset impact deceleration threshold (i.e., the attached...), the servo escape module 400 detected the physical deadlock state. Figure 4 When the acceleration threshold is reached (as indicated by the standard), the servo escape module 400 switches to open-loop current feedforward control mode, outputting pulse current to the brushless DC motor to overcome static friction and complete the escape action of the drug delivery channel.
[0065] See attached document Figure 5Experimental statistics show that: First, under the condition of paper-based medicine boxes becoming damp and stuck, the control group had a 27.4% misjudgment rate of continuous overload of the brushless DC motor due to the rate of change of the quadrature-axis current not reaching the fixed threshold. The experimental group, through the dynamic fault-tolerant parameter adjustment of the servo escape module 400, reduced the misjudgment rate of continuous overload of the brushless DC motor to 1.2%. Second, the control group controlled the brushless DC motor to perform a fixed-amplitude reverse-forward dragging action, achieving a 62.5% success rate in escaping the obstacle. The experimental group, by controlling the brushless DC motor to output pulse current in a zero-backlash state using the servo escape module 400, increased the success rate to 98.7%. Third, post-experiment inspection of the reduction gearbox assembly revealed that the control group had a 14.3% rate of broken teeth and wear on the reduction gearbox assembly. The experimental group, by using angular acceleration for state detection and outputting pulse current in a zero-backlash state, reduced the physical damage rate of the reduction gearbox assembly to below 0.5%.
[0066] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A smart drug dispensing system based on the Internet of Things, characterized in that, The system includes a main control microcontroller, and a brushless DC motor, a field-oriented control driver, a thermistor array, a temperature and humidity sensor, and an IoT communication module, all of which are communicatively connected to the main control microcontroller. The brushless DC motor has a reduction gearbox assembly for driving the drug delivery channel. The main control microcontroller has an embedded program for running the following: The thermal field reconstruction module acquires the temperature data of the thermistor array, calculates the local estimated temperature of each drug delivery channel by combining the spatial flow field distribution parameters, and performs a locking operation on the drug delivery channel where the temperature exceeds the limit according to the temperature compliance conditions. The baseline self-learning module records the torque and current characteristics when the brushless DC motor drives the drug dispensing, and updates the baseline operating envelope data of the currently driven drug dispensing channel when the set conditions are met. The risk assessment module calculates the condensation risk index of the currently driven drug delivery channel based on the dew point temperature inside the computer cabinet, which is obtained from the data of the temperature and humidity sensor, and in combination with the estimated local temperature. The servo escape module receives the condensation risk index, generates dynamic fault-tolerant parameters, and sends them to the magnetic field orientation control driver. The magnetic field orientation control driver detects the operating current of the brushless DC motor according to the dynamic fault tolerance parameters. When a physical deadlock is detected, the servo escape module controls the brushless DC motor to perform alternating escape actions. The IoT communication module uploads the local estimated temperature, the condensation risk index, and the operating status parameters of the brushless DC motor through the IoT communication module, and receives instructions from the cloud server.
2. The IoT-based intelligent drug dispensing system according to claim 1, characterized in that, The thermal field reconstruction module, in conjunction with spatial flow field distribution parameters, calculates the local estimated temperature of each drug delivery channel, specifically including: Obtain the inventory quantity information of the drug delivery channel and perform normalization processing to generate an inventory mask vector; The inventory mask vector is used to perform wind resistance compensation calculation on the steady-state empty topology matrix to generate a real-time topology matrix. In the compensation calculation, the wind resistance penalty weight of the fully loaded drug delivery channel is distributed to the drug delivery channels in the surrounding locations using the inverse proportional function of spatial distance. The local estimated temperature is obtained by multiplying the real-time topology matrix with the spatial temperature vector formed by the temperature data using matrix multiplication.
3. The IoT-based intelligent drug dispensing system according to claim 2, characterized in that, The thermal field reconstruction module performs a locking operation on the drug delivery channel where the temperature exceeds the limit, based on temperature compliance conditions. Specifically, this includes: When the estimated local temperature of the dispensing channel where the temperature exceeds the legal upper limit for drug storage is continuously higher than the upper limit for a duration that reaches the compliance time threshold, a virtual locking command is executed on the dispensing channel where the temperature exceeds the limit at the software application layer to refuse to respond to the dispensing command.
4. The IoT-based intelligent drug dispensing system according to claim 1, characterized in that, The baseline self-learning module updates the baseline operating envelope data of the currently driven drug delivery channel when it determines that the set conditions are met. The set conditions specifically include: Extract the condensation risk index corresponding to the currently driven drug delivery channel, and the statistical variance of the rate of change of the current in the cross-axis current sequence collected by the magnetic field orientation control driver as a torque current feature; The condensation risk index is verified to be strictly less than the safety risk threshold, and the statistical variance is strictly less than the smooth variance threshold.
5. The IoT-based intelligent drug dispensing system according to claim 4, characterized in that, The baseline self-learning module updates the baseline operating envelope data of the currently driven drug delivery channel, specifically including: Using the rotor position feedback data of the brushless DC motor, the quadrature-axis current sequence is mapped from the time domain to the spatial position domain to generate a torque-current characteristic curve with the mechanical stroke parameter as the abscissa. An exponentially weighted moving average algorithm with a forgetting factor is used to weight the torque-current characteristic curve with historical reference operating envelope data, and the latest reference operating envelope data is obtained by updating it point by point.
6. The intelligent drug dispensing system based on the Internet of Things according to claim 1, characterized in that, The risk assessment module calculates the condensation risk index of the currently driven drug delivery channel, specifically including: The difference between the locally estimated temperature and the dew point temperature inside the cabinet is calculated using a discretized two-way physical integral over the time dimension. When the dew point temperature inside the cabinet is greater than the locally estimated temperature, the discretized two-way physical integral calculation uses the condensation absorption rate coefficient; when the dew point temperature inside the cabinet is less than or equal to the locally estimated temperature, the discretized two-way physical integral calculation uses the air drying evaporation rate coefficient.
7. The intelligent drug dispensing system based on the Internet of Things according to claim 1, characterized in that, The dynamic fault-tolerant parameters include the upper limit of the dynamic current change rate and the fault-tolerant time window. The magnetic field orientation control driver determines the occurrence of a physical deadlock state, specifically including: The actual rate of change of the operating current is extracted during the drug dispensing process; Timing begins when the actual current change rate exceeds the upper limit of the dynamic current change rate; if the duration of exceeding the upper limit of the dynamic current change rate reaches the fault tolerance time window, and the operating current does not drop during the process of exceeding the upper limit of the dynamic current change rate, then it is determined that a physical deadlock state has been entered.
8. The IoT-based intelligent drug dispensing system according to claim 7, characterized in that, The reduction gearbox assembly has a pre-installed mechanical backlash, and the alternating escape action includes: The magnetic field orientation control driver is controlled to apply a critical negative current to the brushless DC motor; Driven by the critical negative current, the rotor of the brushless DC motor reverses to reduce the mechanical backlash, and stops outputting the critical negative current when the reverse angle is detected to reach the backlash threshold.
9. The IoT-based intelligent drug dispensing system according to claim 8, characterized in that, The alternating escape maneuver also includes: The output positive probing current drives the rotor to idle across the mechanical back gap. During the idling process across the mechanical back gap, the sliding mode observer inside the magnetic field orientation control driver estimates the electrical angular velocity of the brushless DC motor, and the angular acceleration is extracted by differentiating the electrical angular velocity with respect to time. When it is determined that the downward angular acceleration breaks through the preset impact deceleration threshold, the gear contact point is confirmed, the control mode is switched to open-loop current feedforward control and a high-slope peak pulse current is output.
10. A drug management method based on the Internet of Things, applied to the intelligent drug dispensing system according to any one of claims 1-9, characterized in that, Includes the following steps: The temperature data of the thermistor array is obtained, and the local estimated temperature of each drug delivery channel is calculated by combining the spatial flow field distribution parameters. Based on the temperature compliance conditions, the drug delivery channel with excessive temperature is locked. Record the torque and current characteristics when the brushless DC motor drives the drug dispensing process, and update the reference operating envelope data of the currently driven drug dispensing channel when the set conditions are met. Based on the dew point temperature inside the computer cabinet, as measured by the temperature and humidity sensor, and combined with the estimated local temperature, the condensation risk index of the currently driven drug delivery channel is calculated. The system receives the condensation risk index, generates dynamic fault tolerance parameters, and sends them to the magnetic field orientation control driver. The magnetic field orientation control driver detects the operating current of the brushless DC motor based on the dynamic fault tolerance parameters. When a physical deadlock is detected, the system controls the brushless DC motor to perform an alternating escape action. The local estimated temperature, the condensation risk index, and the operating status parameters of the brushless DC motor are uploaded through the IoT communication module, and instructions are received from the cloud server.