Motor precision control unmanned intelligent self-service cabinet system based on serial communication
By using a precision motor control system based on serial communication, the problems of low control accuracy, poor compatibility, and insufficient scalability of unmanned intelligent self-service cabinet systems have been solved. This system achieves efficient and reliable motor control and fault diagnosis, and supports rapid deployment and low maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HAOBO PRINTING CO LTD
- Filing Date
- 2026-01-24
- Publication Date
- 2026-05-29
AI Technical Summary
Existing unmanned intelligent self-service kiosks suffer from problems such as low control precision, poor compatibility, insufficient scalability, and low fault diagnosis accuracy, making it difficult to meet the technical requirements of rapid deployment, flexible adaptation, and low operation and maintenance costs.
A precision motor control system based on serial communication is adopted, including hardware system architecture and software system architecture. The hardware system adopts strong and weak current isolation design and modular interface, while the software system adopts serial port protocol, custom byte frame structure, fuzzy PID control algorithm and multi-source sensor fusion fault diagnosis to achieve precise motor control and fault diagnosis.
It significantly improves control accuracy and reliability, shortens deployment time, reduces operation and maintenance costs, supports parallel control of multiple motors and rapid function iteration, and improves system scalability and fault diagnosis accuracy.
Smart Images

Figure CN122116520A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of unmanned intelligent self-service cabinet technology, specifically relating to an unmanned intelligent self-service cabinet system with precise motor control based on serial communication. Background Technology
[0002] As an important carrier of unmanned retail and services, intelligent self-service lockers have been widely integrated into diverse scenarios such as entertainment (e.g., blind box vending machines), shopping (e.g., convenience store self-service terminals), and fresh food (e.g., community cold chain lockers). Their core functions rely heavily on motor-driven key actions such as channel control, locker door opening and closing, and item transfer. However, existing technological solutions have revealed significant shortcomings during large-scale deployment and operation, mainly manifested in systemic problems caused by excessive hardware dependence.
[0003] Traditional solutions suffer from three main technical bottlenecks: First, limited scalability. Traditional systems use a direct hardware connection architecture, requiring redesigned circuit interfaces and control logic for new product lane types, leading to extended feature iteration cycles. Second, insufficient compatibility. Communication protocols between motor controllers from different manufacturers differ by more than 40%, necessitating the development of additional adapter modules for cross-brand integration. Third, low intelligence. Control modes relying on fixed parameter configurations cannot dynamically adapt to changes in product weight and size, resulting in high motor stall failure rates. These hardware-driven design approaches are no longer sufficient to meet the technical requirements of unmanned intelligent self-service lockers for rapid deployment, flexible adaptation, and low maintenance costs. There is an urgent need to build more universal control solutions through software algorithm innovation. Summary of the Invention
[0004] The main objective of this invention is to provide a motor precision control unmanned intelligent self-service cabinet system based on serial communication, aiming to solve the technical problems existing in the current unmanned intelligent self-service cabinet system, such as low control precision, poor compatibility, insufficient scalability, low fault diagnosis accuracy, and high deployment and maintenance costs.
[0005] To achieve the above objectives, this invention provides a motor precision control unmanned intelligent self-service cabinet system based on serial communication, comprising a hardware system architecture and a software system architecture, wherein: The hardware system architecture includes an integrated control board, actuators, and an environmental sensing module. The integrated control board adopts a double-layer PCB layout with physical isolation between high-voltage and low-voltage areas. The high-voltage area integrates a motor drive module and a power management unit, while the low-voltage area is equipped with a main control chip and a serial communication interface. The two areas are electrically isolated through isolation slots and optocouplers. The actuators include a DC geared motor and an encoder. The environmental sensing module integrates a temperature and humidity sensor, an infrared photocell, and a Hall switch to achieve real-time monitoring of the cargo channel status. All components are plug-and-play through standardized interfaces, and the motor drive module has a reserved PWM speed control interface and encoder signal feedback channel. The software system architecture includes: Serial communication layer: Implements bidirectional transmission of control commands and status data based on serial port protocol, using a custom byte frame structure; Instruction processing layer: includes trajectory planner, PID controller and exception handling unit, which parses the host computer instructions in real time and generates motor control signals; Application interaction layer: Provides interfaces for integration with the Web management platform, supporting remote parameter configuration, online firmware upgrades, and operation log uploads; The data flow between the hardware system architecture and the software system architecture adopts a vertical closed-loop design, including: Downlink control flow: The instructions from the application interaction layer are serialized into JSON and transmitted to the serial port server via Ethernet. They are then converted into Modbus instructions and sent to the hardware system architecture by the serial communication layer. The instruction processing layer dynamically adjusts the PWM output duty cycle based on the deviation between the current position of the motor and the target position. Uplink feedback stream: Sensor data is sampled by the ADC and uploaded to the instruction processing layer. After being processed by the filtering algorithm, a status report is generated and finally pushed to the cloud platform via the MQTT protocol.
[0006] As a further preferred technical solution to the above technical solution, the byte frame structure of the serial communication layer is defined as follows: frame header, function code, motor ID, target position, speed parameter, reserved bits and check code; The check code uses an accumulation and check algorithm, and the calculation formula is: check code = 0xFF - (frame header + function code + motor ID + target position high byte + ... + reserved bits) % 0x100. This mechanism effectively detects bit flip errors during transmission.
[0007] As a further preferred technical solution to the above technical solution, for the instruction processing layer: The anomaly handling unit adopts a multi-source information fusion scheme of micro-switches and magnetic switches. Based on the DS evidence theory, a basic probability allocation function is constructed to divide the switch state into three focal elements: normal, mechanical jamming, and sensor failure. The evidence combination rules are applied to fuse and calculate the multi-source sensor data, and finally the fault diagnosis result is output based on the synthetic confidence level.
[0008] As a further preferred technical solution to the above technical solution, for the application interaction layer, the interaction logic is designed for two roles: user and administrator, wherein: The user side implements the pickup code verification process: enter a 6-digit pickup code through the touch screen, and after the system verifies the validity of the code value, it automatically triggers the motor drive command of the corresponding compartment. The administrator provides a remote control interface, which supports accessing the device management platform via TCP / IP protocol to realize cabinet door status monitoring, parameter configuration and fault log query functions.
[0009] As a further preferred technical solution to the above technical solution, the software system architecture includes a fuzzy PID motor adaptive control algorithm. Based on a fusion architecture of traditional PID control and fuzzy logic, it achieves high-precision positioning control through sensor feedback and parameter adaptive mechanisms. Specifically, the implementation is as follows: Construction of PID control mathematical model: First, a continuous-time domain mathematical model of classic PID control is established, and its control output formula is as follows: ; in, This is the motor drive voltage output. This represents the deviation between the current position and the target position. Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively. The proportional element quickly responds to the deviation, the integral element eliminates static error, and the derivative element suppresses overshoot. Fuzzy control rule system design: Based on two input variables, the deviation e and the rate of change of deviation ec, during the operation of the motor, a control rule base containing seven fuzzy subsets is designed to form a multi-dimensional control decision matrix, thereby realizing dynamic parameter configuration under different operating conditions. Fuzzy reasoning and defuzzification implementation: The Mamdani inference method is adopted, and the fuzzy set of input variables is mapped to the fuzzy space of output parameters through fuzzy relation synthesis operation. After the deviation and the rate of change of deviation are fuzzified by the membership function, the control rule with the highest matching degree in the rule base is activated, and the fuzzy membership degree of the output parameters is calculated by the minimum-maximum synthesis method. Hardware closed-loop feedback mechanism: Using position deviation e and deviation rate ec as inputs, the PID parameters are dynamically adjusted through fuzzy inference. The control process includes fuzzification, rule base matching, and defuzzification.
[0010] As a further preferred technical solution to the above technical solution, the implementation steps of the fuzzy PID motor adaptive control algorithm are as follows: Step S1: Fuzzy control rule design: A three-input single-output fuzzy control structure is adopted. The input variables are position deviation e, deviation change rate ec, and current speed level v. Each variable is divided into 5 fuzzy subsets. A control decision table is constructed. The rule design follows the deviation priority principle. When the absolute value of the position deviation is large, the maximum control quantity is output first to quickly eliminate the deviation; when the deviation is small, fine-tuning is performed according to the deviation change rate. Step S2: Serial communication and algorithm timing coordination: An asynchronous coordination mechanism with a 10ms position sampling period and a 20ms control period is adopted: The main control chip reads encoder data through the USART1 interface, triggers a DMA receive interrupt every 10ms, and stores the position data in a double buffer queue; the control algorithm extracts the latest two sampled values from the buffer queue every 20ms, calculates the deviation and rate of change, performs fuzzy inference, generates a PWM duty cycle instruction, and outputs it to the motor drive module through the TIM3 timer; Step S3: Parameter tuning method: Adaptive parameter adjustment is achieved by combining the 5-speed adjustment button of the hardware: When the user selects different speeds, the system automatically loads the corresponding fuzzy rule table gain coefficient and output limiting threshold, and the parameters are switched in real time through the external interrupt triggered by the button.
[0011] As a further preferred technical solution to the above technical solution, the software system architecture also includes a dynamic task scheduling module, which adopts a priority-based preemptive scheduling algorithm, sets user interaction tasks as high priority, sets background maintenance tasks as low priority, and allows high-priority tasks to interrupt the execution of low-priority tasks.
[0012] The beneficial effects of this invention are as follows: 1. Significantly improved control accuracy: The adoption of an adaptive control algorithm based on fuzzy PID improves the accuracy of motor speed regulation and motor positioning. 2. Significantly enhanced reliability: Through hardware-level opto-isolation design, dual-sensor fusion mechanism and software-level CRC check and DS evidence theory fault diagnosis, the accuracy of fault diagnosis is improved; 3. Significantly improved operating efficiency: The application of standardized serial port protocols reduces communication latency to a minimum. Combined with smooth transition control of motor start and stop, the average storage and retrieval cycle is reduced from 8 seconds to 5.2 seconds. The deployment time for a single unit is reduced from 6 hours to 2 hours, improving deployment efficiency, reducing the types of spare parts inventory, and significantly reducing operation and maintenance costs. 4. Significantly optimized scalability: The modular control architecture supports parallel control of up to 16 motors. The hardware layer reserves 4 expansion serial ports and 8 GPIO interfaces to support dynamic access to new devices. The software layer adopts a plug-in architecture, which can upgrade functions by loading algorithm modules without modifying the underlying communication protocol. Through a unified communication interface protocol, peripheral devices such as temperature sensors and warehouse level detection can be quickly integrated, greatly shortening the function iteration cycle. Attached Figure Description
[0013] Figure 1 This is a schematic diagram of the present invention. Detailed Implementation
[0014] The following description is intended to disclose the present invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description can be applied to other embodiments, modifications, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the invention.
[0015] In the preferred embodiments of the present invention, those skilled in the art should note that the host computer and the like involved in the present invention can be considered as prior art.
[0016] Preferred embodiment.
[0017] like Figure 1 As shown, this invention discloses a motor precision control unmanned intelligent self-service cabinet system based on serial communication, including a hardware system architecture and a software system architecture, wherein: The hardware system architecture includes an integrated control board, actuators, and an environmental sensing module. The integrated control board adopts a double-layer PCB layout with physical isolation between high-voltage and low-voltage areas. The high-voltage area integrates a motor drive module and a power management unit, while the low-voltage area is equipped with a main control chip (STM32H743) and a serial communication interface. The two areas are electrically isolated through isolation slots and optocouplers (effectively suppressing electromagnetic interference (EMI)). The actuators include a DC geared motor and an encoder. The environmental sensing module integrates a temperature and humidity sensor, an infrared photocell, and a Hall effect switch to achieve real-time monitoring of the cargo channel status. All components communicate via standardized interfaces (such as RS-485, I / O, etc.). 2 C) Plug and play is achieved, with the motor drive module reserving a PWM speed regulation interface and encoder signal feedback channel (providing hardware support for precise control algorithms). The software system architecture includes: Serial communication layer: Implements bidirectional transmission of control commands and status data based on serial port protocol, using a custom byte frame structure; Command processing layer: includes a trajectory planner (using S-shaped acceleration / deceleration algorithm), a PID controller (position loop proportional coefficient Kp=8.5, integral coefficient Ki=0.12) and an exception handling unit, which parses the host computer commands in real time and generates motor control signals; Application Interaction Layer: Provides an interface (RESTful-API) to interface with the Web management platform, supporting remote parameter configuration (such as updating the cargo channel mapping table), online firmware upgrade (implemented via the YModem protocol), and operation log upload function; The data flow between the hardware system architecture and the software system architecture adopts a vertical closed-loop design, including: Downlink control flow: The instructions from the application interaction layer are serialized into JSON and transmitted to the serial port server via Ethernet. They are then converted into Modbus instructions and sent to the hardware system architecture by the serial communication layer. The instruction processing layer dynamically adjusts the PWM output duty cycle based on the deviation between the current position of the motor (encoder feedback) and the target position. Uplink feedback stream: Sensor data (such as the status of the cargo channel and the speed of the motor) is sampled by the ADC and uploaded to the instruction processing layer. After being processed by the filtering algorithm, a status report is generated and finally pushed to the cloud platform via the MQTT protocol.
[0018] Specifically, the byte frame structure of the serial communication layer is defined as follows: frame header (1 byte, fixed as 0xB5), function code (1 byte), motor ID (1 byte), target position (4 bytes, 32-bit integer), speed parameter (2 bytes, 16-bit integer), reserved bits (1 byte) and check code (1 byte). The check code uses an accumulation and check algorithm, and the calculation formula is: check code = 0xFF - (frame header + function code + motor ID + target position high byte + ... + reserved bits) % 0x100. This mechanism effectively detects bit flip errors during transmission.
[0019] At the code implementation level, the communication layer provides the sendRawBytes function as the core interface, and its pseudocode is as follows: pseudocode for the sendRawBytes function; Input:motor_id(uint8),position(int32),speed(uint16); Output: bool (successful sending flag); 1. Initialize an 11-byte array frame[]; 2. frame[0] = 0xB5 (frame header); 3.frame[1]=0x01 (Function code: position control); 4.frame[2]=motor_id; 5. Convert the position to 4-byte big-endian format and store it in frame[3-6]; 6. Convert speed to 2-byte big-endian format and store it in frame[7-8]; 7.frame[9]=0x00 (reserved bits); 8. Calculate the check code: sum = frame[0] + ... + frame[9]; frame
[10] = 0xFF - (sum % 0x100); 9. Send the frame array via the UART interface; 10. Wait 10ms for a timeout and check for an ACK response; 11. Return the sending result.
[0020] More specifically, for the instruction processing layer: The anomaly handling unit adopts a multi-source information fusion scheme using a micro switch (to detect the opening and closing status of the cabinet door) and a magnetic switch (to detect the zero position of the motor). Based on the DS evidence theory, a basic probability allocation function is constructed, dividing the switch status into three focal elements: normal, mechanical jamming, and sensor failure. The evidence combination rule is applied to fuse and calculate the multi-source sensor data, and finally outputs the fault diagnosis result based on the composite confidence level. (When the micro switch detects that the cabinet door is not closed (confidence level 0.8) and the magnetic switch shows that the motor is not at zero (confidence level 0.7), the composite confidence level of the mechanical jamming hypothesis calculated by the evidence combination rule reaches 0.92, achieving accurate identification of the fault type.)
[0021] Furthermore, for the application interaction layer, interaction logic is designed for two roles: users and administrators, including: The user side implements the pickup code verification process: After the user enters a 6-digit pickup code through the touch screen, the system verifies the validity of the code value (including timeliness judgment and anti-replay mechanism) and automatically triggers the motor drive command of the corresponding slot. The administrator provides a remote control interface that supports accessing the device management platform via TCP / IP protocol, enabling functions such as cabinet door status monitoring (real-time display of the opening and closing status of each compartment), parameter configuration (adjusting PID parameters and communication baud rate), and fault log query (storing the 100 most recent fault records, including timestamps and fault codes).
[0022] Furthermore, the software system architecture incorporates a fuzzy PID motor adaptive control algorithm. Based on a fusion architecture of traditional PID control and fuzzy logic, it achieves high-precision positioning control through sensor feedback and parameter adaptation mechanisms. Specifically, the implementation is as follows: Construction of PID control mathematical model: First, a continuous-time domain mathematical model of classic PID control is established, and its control output formula is as follows: ; in, This is the motor drive voltage output. This represents the deviation between the current position and the target position. Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively. The proportional element quickly responds to the deviation, the integral element eliminates static error, and the derivative element suppresses overshoot (providing a basic mathematical framework for motor control). Fuzzy control rule system design: (To solve the parameter mismatch problem of traditional PID under nonlinear disturbances such as load changes and mechanical friction, the system introduces fuzzy control rules to achieve adaptive parameter adjustment.) Based on the two input variables, deviation e and deviation change rate ec, during motor operation, a control rule base containing 7 fuzzy subsets (negative large, negative medium, negative small, zero, positive small, positive medium, positive large) is designed (typical rule is: when e is positive large and ec is positive large, Kp takes positive large, Ki takes zero, and Kd takes positive small), forming a multi-dimensional control decision matrix to realize dynamic parameter configuration under different operating conditions; Fuzzy reasoning and defuzzification implementation: The Mamdani inference method is adopted, which maps the fuzzy set of input variables to the fuzzy space of output parameters through fuzzy relation synthesis. After the deviation and the rate of change of deviation are fuzzified by the membership function (Gaussian type), the control rule with the highest matching degree in the rule base is activated. The fuzzy membership degree of the output parameters is calculated by the minimum-maximum synthesis method. (To convert the fuzzy output into precise control quantity, the system uses the centroid method as the defuzzifier, and its calculation formula is as follows:) This method allows for continuous and smooth parameter adjustments, avoiding system oscillations caused by traditional switching control. Hardware closed-loop feedback mechanism: Using position deviation e (the difference between the target position and the encoder feedback) and deviation rate ec (the first derivative of e) as inputs, the PID parameters are dynamically adjusted through fuzzy inference. The control process includes: fuzzification (mapping e and ec to 7 fuzzy subsets of the [-3,3] domain), rule base matching (using 49 control rules, such as "if e is positive and ec is positive, then ΔKp is positive") and defuzzification (calculating the PID parameter correction using the centroid method).
[0023] Preferably, the implementation steps of the fuzzy PID motor adaptive control algorithm are as follows: Step S1: Fuzzy Control Rule Design: A three-input single-output fuzzy control structure is adopted. The input variables are position deviation e, deviation change rate ec, and current speed level v. Each variable is divided into 5 fuzzy subsets (NB, NS, ZO, PS, PB). A control decision table is constructed. The rule design follows the deviation priority principle. When the absolute value of the position deviation is large (NB / PB), the maximum control quantity is output first to quickly eliminate the deviation; when the deviation is small (ZO), fine-tuning is performed according to the deviation change rate. Example of core logic for fuzzy rule tables: 1. If e=NB, ec=NB, and v=low speed, then the output = PB; 2. If e = ZO, ec = PS, and v = high speed, then the output = NS; 3. If e=PB, ec=NS, and v=medium speed, then the output =NB.
[0024] Step S2: Serial communication and algorithm timing coordination: An asynchronous coordination mechanism with a 10ms position sampling period and a 20ms control period is adopted: The main control chip reads encoder data through the USART1 interface, triggers a DMA receive interrupt every 10ms, and stores the position data in a double buffer queue; the control algorithm extracts the latest two sampled values from the buffer queue every 20ms, calculates the deviation and rate of change, performs fuzzy inference, generates a PWM duty cycle instruction, and outputs it to the motor drive module through the TIM3 timer; Step S3: Parameter tuning method: Adaptive parameter adjustment is achieved by combining the 5-speed adjustment button of the hardware: When the user selects different speeds, the system automatically loads the corresponding fuzzy rule table gain coefficients (Kp1~Kp5) and output limiting thresholds (for example, speed 1 (low speed) corresponds to Kp=0.8 and output limiting ±30%, which is suitable for precise positioning scenarios; speed 5 (high speed) corresponds to Kp=1.5 and output limiting ±80%, which is suitable for rapid transfer scenarios). The parameters are switched in real time through the external interrupt (EXTI_Line0) triggered by the button.
[0025] Preferably, the software system architecture further includes a dynamic task scheduling module, employing a priority-based preemptive scheduling algorithm. User interaction tasks are assigned high priority, while background maintenance tasks are assigned low priority. High-priority tasks can interrupt the execution of low-priority tasks. To achieve efficient multi-task processing in the unmanned intelligent self-service cabinet system, this system designs a priority-based preemptive scheduling algorithm, ensuring real-time response to critical operations through task grading and resource mutual exclusion mechanisms. This scheduling framework divides system tasks into different priority levels. User interaction tasks (such as retrieval code input and cabinet door status detection) are assigned high priority, while background maintenance tasks (such as device status reporting and log synchronization) are classified as low priority. When a high-priority task is triggered, the system can immediately interrupt the currently executing low-priority task, resuming its execution flow only after the high-priority task is completed, thereby significantly improving the response speed of user operations.
[0026] It is worth mentioning that the technical features such as the host computer involved in this patent application should be regarded as prior art. The specific structure, working principle, and possible control methods and spatial arrangement of these technical features can be adopted using conventional choices in the field, and should not be regarded as the inventive point of this patent. This patent will not be further elaborated in detail.
[0027] For those skilled in the art, modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the protection scope of this invention.
Claims
1. A motor precision control unmanned intelligent self-service cabinet system based on serial communication, characterized in that, This includes hardware system architecture and software system architecture, among which: The hardware system architecture includes an integrated control board, actuators, and an environmental sensing module. The integrated control board adopts a double-layer PCB layout with physical isolation between high-voltage and low-voltage areas. The high-voltage area integrates a motor drive module and a power management unit, while the low-voltage area is equipped with a main control chip and a serial communication interface. The two areas are electrically isolated through isolation slots and optocouplers. The actuators include a DC geared motor and an encoder. The environmental sensing module integrates a temperature and humidity sensor, an infrared photocell, and a Hall switch to achieve real-time monitoring of the cargo channel status. All components are plug-and-play through standardized interfaces, and the motor drive module has a reserved PWM speed control interface and encoder signal feedback channel. The software system architecture includes: Serial communication layer: Implements bidirectional transmission of control commands and status data based on serial port protocol, using a custom byte frame structure; Instruction processing layer: includes trajectory planner, PID controller and exception handling unit, which parses the host computer instructions in real time and generates motor control signals; Application interaction layer: Provides interfaces for integration with the Web management platform, supporting remote parameter configuration, online firmware upgrades, and operation log uploads; The data flow between the hardware system architecture and the software system architecture adopts a vertical closed-loop design, including: Downlink control flow: The instructions from the application interaction layer are serialized into JSON and transmitted to the serial port server via Ethernet. They are then converted into Modbus instructions and sent to the hardware system architecture by the serial communication layer. The instruction processing layer dynamically adjusts the PWM output duty cycle based on the deviation between the current position of the motor and the target position. Uplink feedback stream: Sensor data is sampled by the ADC and uploaded to the instruction processing layer. After being processed by the filtering algorithm, a status report is generated and finally pushed to the cloud platform via the MQTT protocol.
2. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 2, characterized in that, The byte frame structure of the serial communication layer is defined as follows: frame header, function code, motor ID, target position, speed parameter, reserved bits, and check code; The check code uses an accumulation and check algorithm, and the calculation formula is: check code = 0xFF - (frame header + function code + motor ID + target position high byte + ... + reserved bits) % 0x100. This mechanism effectively detects bit flip errors during transmission.
3. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 2, characterized in that, For the instruction processing layer: The anomaly handling unit adopts a multi-source information fusion scheme of micro-switches and magnetic switches. Based on the DS evidence theory, a basic probability allocation function is constructed to divide the switch state into three focal elements: normal, mechanical jamming, and sensor failure. The evidence combination rules are applied to fuse and calculate the multi-source sensor data, and finally the fault diagnosis result is output based on the synthetic confidence level.
4. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 3, characterized in that, For the application interaction layer, interaction logic is designed for two roles: users and administrators. The user side implements the pickup code verification process: enter a 6-digit pickup code through the touch screen, and after the system verifies the validity of the code value, it automatically triggers the motor drive command of the corresponding compartment. The administrator provides a remote control interface, which supports accessing the device management platform via TCP / IP protocol to realize cabinet door status monitoring, parameter configuration and fault log query functions.
5. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 4, characterized in that, The software system architecture includes a fuzzy PID motor adaptive control algorithm. Based on a fusion architecture of traditional PID control and fuzzy logic, it achieves high-precision positioning control through sensor feedback and parameter adaptation mechanisms. Specifically, the implementation is as follows: Construction of PID control mathematical model: First, a continuous-time domain mathematical model of classic PID control is established, and its control output formula is as follows: ; in, This is the motor drive voltage output. This represents the deviation between the current position and the target position. Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively. The proportional element quickly responds to the deviation, the integral element eliminates static error, and the derivative element suppresses overshoot. Fuzzy control rule system design: Based on two input variables, the deviation e and the rate of change of deviation ec, during the operation of the motor, a control rule base containing seven fuzzy subsets is designed to form a multi-dimensional control decision matrix, thereby realizing dynamic parameter configuration under different operating conditions. Fuzzy reasoning and defuzzification implementation: The Mamdani inference method is adopted, and the fuzzy set of input variables is mapped to the fuzzy space of output parameters through fuzzy relation synthesis operation. After the deviation and the rate of change of deviation are fuzzified by the membership function, the control rule with the highest matching degree in the rule base is activated, and the fuzzy membership degree of the output parameters is calculated by the minimum-maximum synthesis method. Hardware closed-loop feedback mechanism: Using position deviation e and deviation rate ec as inputs, the PID parameters are dynamically adjusted through fuzzy inference. The control process includes fuzzification, rule base matching, and defuzzification.
6. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 5, characterized in that, The implementation steps of the fuzzy PID motor adaptive control algorithm are as follows: Step S1: Fuzzy control rule design: A three-input single-output fuzzy control structure is adopted. The input variables are position deviation e, deviation change rate ec, and current speed level v. Each variable is divided into 5 fuzzy subsets. A control decision table is constructed. The rule design follows the deviation priority principle. When the absolute value of the position deviation is large, the maximum control quantity is output first to quickly eliminate the deviation; when the deviation is small, fine-tuning is performed according to the deviation change rate. Step S2: Serial communication and algorithm timing coordination: An asynchronous coordination mechanism with a 10ms position sampling period and a 20ms control period is adopted: The main control chip reads encoder data through the USART1 interface, triggers a DMA receive interrupt every 10ms, and stores the position data in a double buffer queue; the control algorithm extracts the latest two sampled values from the buffer queue every 20ms, calculates the deviation and rate of change, performs fuzzy inference, generates a PWM duty cycle instruction, and outputs it to the motor drive module through the TIM3 timer; Step S3: Parameter tuning method: Adaptive parameter adjustment is achieved by combining the 5-speed adjustment button of the hardware: When the user selects different speeds, the system automatically loads the corresponding fuzzy rule table gain coefficient and output limiting threshold, and the parameters are switched in real time through the external interrupt triggered by the button.
7. The unmanned intelligent self-service cabinet system for precise motor control based on serial communication according to claim 6, characterized in that, The software system architecture also includes a dynamic task scheduling module, which adopts a priority-based preemptive scheduling algorithm. User interaction tasks are set to high priority, and background maintenance tasks are set to low priority. High-priority tasks can interrupt the execution of low-priority tasks.