Water gate remote control system based on Internet of Things
By using the Internet of Things (IoT) remote control system for sluice gates, and by employing fluid pressure gradient calculation and fuzzy logic control, dynamic adjustment and high-precision positioning of the sluice gate opening and closing process are achieved. This solves the problems of mechanical vibration and response delay in traditional systems, and improves the system's adaptability and equipment lifespan.
Patent Information
- Application Number
- CN202610084171.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-04-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional IoT-based remote control systems for sluice gates lack the ability to dynamically adjust to changes in the fluid environment, which makes the gates prone to uneven stress during opening and closing, resulting in vibration or deformation. Furthermore, manual remote control suffers from response delays and makes it difficult to adjust the amplitude of movements in real time, leading to control positioning errors and reduced equipment lifespan.
The water gate remote control system based on the Internet of Things calculates the total stroke difference and the maximum pressure change rate threshold through the basic parameter initialization module. Combined with the fluid pressure gradient calculation module and fuzzy logic controller, it generates adaptive drive control commands. The segmented micro-stepping motion of the gate is realized by the discrete stepping drive execution module, and high-precision position locking is achieved through encoder feedback.
It achieves smooth opening and closing of the gate and high-precision position locking, avoids water hammer effect and mechanical damage, improves the system's adaptability and response speed, and extends the equipment's lifespan.
Smart Images

Figure CN121879200A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital data processing technology, and in particular to a remote control system for water gates based on the Internet of Things. Background Technology
[0002] In the field of digital data processing technology, digital data processing refers to the systematic technical means of acquiring, storing, retrieving, transforming, and transmitting various discrete or continuous data signals using computer hardware and software systems. It encompasses everything from the data throughput of the underlying hardware architecture to the execution of computational instructions in the upper-level software logic, aiming to achieve the interaction of information resources and the digital mapping of physical entities. Traditional IoT-based remote control systems for sluice gates involve installing water level sensors and gate opening sensors at the sluice gate site. These sensors are connected to a data acquisition unit (RTU) on-site via signal lines. The RTU is connected to a wireless communication module via an RS485 interface. The wireless communication module uses a mobile communication network to send the collected data packets to a server in a remote monitoring center. After parsing the packets, the server displays the data on a screen. Operators send control commands via keyboard or mouse through the host computer software interface. These commands are transmitted via the communication network to a relay group in the on-site control cabinet. Once the relay group is activated, it connects the three-phase power circuit of the gate hoist motor, driving the gate screw to move up and down.
[0003] Existing technology relies on relay groups to directly connect the three-phase power supply to drive the motor. This hard-wired control method lacks the ability to dynamically adjust to changes in the fluid environment. When facing complex hydrological conditions, the hoist motor continuously outputs a constant power and cannot sense the mechanical impact of sudden changes in water pressure on the gate body. This makes the gate prone to vibration or even deformation due to uneven force during opening and closing. Furthermore, there is a response delay when sending commands remotely, making it difficult to adjust the action amplitude in real time according to the fluid pressure gradient on site. The single and rigid drive logic results in poor gate operation stability, causing the accumulation of control positioning deviations and a reduction in the lifespan of the on-site actuator hardware. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a remote control system for water gates based on the Internet of Things.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a remote control system for water gates based on the Internet of Things includes:
[0006] The basic parameter initialization module calculates the total stroke difference based on the target opening value and the current gate position value, obtains the maximum pressure change rate threshold and the basic step action duration, and divides the total stroke difference to construct an initial discrete action sequence.
[0007] The fluid pressure gradient calculation module filters and processes real-time fluid pressure values to obtain denoised pressure values, and calculates real-time pressure gradient values based on the denoised pressure values and the sampling time interval.
[0008] The gate action adaptive shaping module calculates the pressure gradient deviation based on the maximum pressure change rate threshold and the real-time pressure gradient value, uses a fuzzy logic controller to calculate the action correction coefficient based on the pressure gradient deviation, and adjusts the initial discrete action sequence and the basic step action duration based on the action correction coefficient to generate a shaped drive control command.
[0009] The discrete step-drive execution module extracts the target pulse count and timer count value from the shaping drive control command, sends a control signal based on the target pulse count and the timer count value, calculates the absolute value of the positioning deviation between the real-time encoder value and the target opening value, and generates a brake lock command if the absolute value of the positioning deviation is less than the positioning error range.
[0010] As a further aspect of the present invention, the initial discrete action sequence includes small displacement segments divided according to a preset resolution, a default step speed parameter, and an initial pause interval value. The real-time pressure gradient value specifically refers to the differential result of the fluid pressure in the flow channel and the pressure fluctuation rate. The shaped drive control command includes the corrected target pulse number and the adjusted timer count value. The brake lock command includes a motor stop signal and a mechanical brake trigger signal.
[0011] As a further aspect of the present invention, the specific function of the basic parameter initialization module is as follows:
[0012] The stroke difference calculation submodule obtains the target opening value and the current gate position value, performs a numerical subtraction operation between the two to obtain the total stroke difference, and determines the opening or closing direction of the gate based on the positive or negative sign attribute of the total stroke difference.
[0013] The parameter matching submodule maps the absolute value of the total stroke difference to a preset system dynamics constraint table, extracts the corresponding maximum pressure change rate threshold and basic stepping motion duration, and ensures that the initial motion parameters comply with the safety specifications of water conservancy facilities.
[0014] The sequence construction submodule discretizes the total travel difference based on a preset minimum resolution coefficient, calculates the required total number of step segments, and generates an initial discrete motion sequence including several small displacement segments arranged in chronological order.
[0015] As a further aspect of the present invention, the specific function of the fluid pressure gradient calculation module is as follows:
[0016] The pressure data filtering submodule collects real-time fluid pressure values in the flow channel through a high-frequency sensor, and applies a sliding window averaging filtering algorithm to remove instantaneous electromagnetic interference noise, generating smooth, denoised pressure values.
[0017] The gradient calculation submodule obtains the denoised pressure values at the current sampling time and the previous sampling time, calculates the difference between the two and divides it by the sampling time interval, thereby obtaining the real-time pressure gradient value that characterizes the dynamic change trend of the current water flow impact force.
[0018] As a further aspect of the present invention, the specific function of the gate action adaptive shaping module is as follows:
[0019] The deviation analysis submodule obtains the maximum pressure change rate threshold and the real-time pressure gradient value, calculates the difference between the two to obtain the pressure gradient deviation, and uses it to quantitatively assess the remaining margin of the current water flow state from the safe critical point.
[0020] The coefficient reasoning submodule inputs the pressure gradient deviation to the fuzzy logic controller, maps the accurate numerical value into fuzzy language variables through the fuzzification interface, performs logical reasoning and defuzzification processing through the fuzzy rule base, and generates action correction coefficients.
[0021] The instruction reconstructing submodule uses the action correction coefficient to dynamically weight and adjust the duration of the basic step action in the initial discrete action sequence, changes the frequency characteristics of the pulse output, and generates a shaped drive control instruction that includes the corrected target pulse number and the adjusted timer count value.
[0022] As a further aspect of the present invention, the specific function of the discrete stepping drive execution module is as follows:
[0023] The pulse modulation transmission submodule parses the shaped drive control command to extract the target pulse number and the timer count value, generates a PWM control signal with corresponding frequency and duty cycle, and sends it to the motor driver to drive the gate to perform segmented micro-stepping motion.
[0024] The position closed-loop monitoring submodule collects real-time encoder values after each micro-step movement and calculates the absolute value of the difference between the value and the target opening value as the absolute value of the positioning deviation.
[0025] The braking logic triggering submodule compares the absolute value of the positioning deviation with a preset positioning error range. When the absolute value of the positioning deviation is continuously less than the positioning error range, it immediately generates a brake locking command that includes a motor stop signal and a mechanical brake trigger signal.
[0026] As a further aspect of the present invention, the process of calculating the real-time pressure gradient value includes:
[0027] Obtain the denoising pressure value at the current sampling time and the denoising pressure value at the previous sampling time. Combined with the sampling time interval, calculate the gradient value used to characterize the rate of pressure change according to the following formula:
[0028] ;
[0029] in, Represents the real-time pressure gradient value. This represents the denoising pressure value at the current sampling moment. This represents the denoising pressure value at the previous sampling time. This represents the sampling time interval.
[0030] As a further aspect of the present invention, the process of calculating the action correction coefficient includes:
[0031] A fuzzy linguistic variable set including three levels: "safety", "alert" and "danger" is established, and a membership function is constructed to transform the pressure gradient deviation into a fuzzy membership vector.
[0032] The reasoning is performed based on a preset fuzzy control rule base that states "if the deviation is large, the coefficient is high; if the deviation is small, the coefficient is low." The centroid method is used to defuzzify the reasoning results, and a scalar between 0 and 1 is output as the action correction coefficient, which is used to dynamically adjust the motor's action speed.
[0033] As a further aspect of the present invention, the process of generating the shaped drive control command includes:
[0034] Obtain the preset basic step action duration in the initial discrete action sequence, perform inverse weighted calculation using the action correction coefficient, and determine the adjusted time parameter according to the following formula:
[0035] ;
[0036] in, This represents the timer count value in the shaping drive control command. Represents the duration of the basic stepping motion. This represents the motion correction coefficient.
[0037] As a further aspect of the present invention, the process of generating the brake lock command includes:
[0038] After detecting that the absolute value of the positioning deviation is less than the positioning error range, a continuous stability verification counter is started to monitor whether the absolute value of the positioning deviation remains within the positioning error range in the subsequent preset period.
[0039] Only when the verification counter reaches the preset stability threshold is it confirmed that the gate has stably reached the target position. Then, the motor stop signal is output in parallel to cut off the power supply to the motor, and the mechanical brake trigger signal is output to lock the gate mechanical transmission mechanism.
[0040] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0041] In this invention, a dynamic monitoring mechanism is constructed by collecting real-time fluid pressure values and calculating pressure gradients, combined with the maximum pressure change rate threshold. A fuzzy logic controller is used to calculate the action correction coefficient based on the pressure gradient deviation, and adaptively shape the initial discrete action sequence and the duration of the basic step action. The continuous total stroke is divided into discrete step commands that can respond to changes in fluid pressure. When the fluid pressure fluctuates drastically, the drive strategy is automatically adjusted to smooth the mechanical force. In conjunction with the encoder, the positioning deviation is calculated in real-time feedback. This ensures the smoothness of the gate's opening and closing motion while achieving high-precision position locking, effectively avoiding water hammer effects and mechanical damage, and solving the problem of equipment vulnerability caused by the lack of adaptability in hard-wired control. Attached Figure Description
[0042] Figure 1 This is a block diagram illustrating the principle of the IoT-based remote control system for water gates according to the present invention.
[0043] Figure 2 This is a flowchart illustrating the logical structure of the basic parameter initialization module of this invention.
[0044] Figure 3 This is a flowchart illustrating the logical structure of the fluid pressure gradient calculation module of the present invention.
[0045] Figure 4 This is a flowchart illustrating the logic structure of the gate action adaptive shaping module of the present invention.
[0046] Figure 5 This is a flowchart illustrating the logical structure of the discrete step-driven execution module of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.
[0048] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.
[0049] Please see Figure 1 and Figure 2 The present invention provides a technical solution: a water gate remote control system based on the Internet of Things includes:
[0050] The basic parameter initialization module calculates the total stroke difference based on the target opening value and the current gate position value, obtains the maximum pressure change rate threshold and the basic step action duration, and constructs an initial discrete action sequence by dividing the total stroke difference.
[0051] The initial discrete motion sequence includes tiny displacement segments divided by a preset resolution, default step speed parameters, and initial pause interval values;
[0052] The specific functions of the basic parameter initialization module are as follows:
[0053] The stroke difference calculation submodule obtains the target opening value and the current gate position value, performs a numerical subtraction operation between the two to obtain the total stroke difference, and determines the opening or closing direction of the gate based on the positive or negative sign attribute of the total stroke difference.
[0054] The parameter matching submodule maps the absolute value of the total stroke difference to a preset system dynamics constraint table, extracts the corresponding maximum pressure change rate threshold and basic stepping motion duration, and ensures that the initial motion parameters comply with the safety specifications of water conservancy facilities.
[0055] The sequence construction submodule discretizes the total travel difference based on the preset minimum resolution coefficient, calculates the required total number of step segments, and generates an initial discrete motion sequence that includes several small displacement segments arranged in chronological order.
[0056] The basic parameter initialization module starts execution after the system is powered on and reset and receives a control request from the central control platform.
[0057] The travel difference calculation submodule first reads the register value of the gate absolute encoder through the Modbus-RTU communication protocol to obtain the current gate position value (denoted as ). ), and simultaneously parse the target aperture value (denoted as ) in the received TCP / IP data packets. The internal processor of this submodule performs double-precision floating-point subtraction, that is... The processor processes the results. The sign bit is used for logical judgment: if the sign bit is 0 (positive number), the direction control register of the motor driver is set to 1 and set to the open direction; if the sign bit is 1 (negative number), the direction control register is reset to 0 and set to the closed direction.
[0058] The Modbus-RTU communication protocol mentioned above is a serial communication protocol that adopts a master-slave architecture, transmits binary data through the RS-485 physical layer, and has CRC check function to ensure data integrity.
[0059] Subsequently, the parameter matching submodule calls the system dynamics constraint table pre-stored in the EEPROM. This table establishes the range of absolute values of stroke differences and the threshold of the maximum pressure change rate (…). ), basic stepping motion duration ( The mapping relationship. Processor calculation. A binary search algorithm is used to retrieve the corresponding row index in the interval column of the constraint table. For example, when the system sets the full stroke of the sluice gate to 5000mm, if it detects... Within the range [100mm, 500mm], the processor locks the data for that row, extracts the maximum pressure change rate threshold and the basic step action duration corresponding to that row through memory pointer operations, and loads these two parameters into a specific address in volatile memory (RAM) as the baseline constraint for subsequent control loops. This process ensures that a faster action rate is allowed to improve efficiency during long-stroke adjustments, while a slower rate is enforced during short-stroke fine-tuning to prevent water hammer effects.
[0060] Table 1 shows the preset dynamic constraint mapping data inside the gate control system of a certain type of water conservancy project, which is used for the table lookup operation of the parameter matching submodule, as shown in Table 1.
[0061] Table 1 Mapping table of system dynamics constraint parameters
[0062] The absolute value range of the travel difference in the indicator (mm) Maximum pressure change rate threshold (kPa / s) for the gauge head Basic step duration of the meter header (ms) [0,50) 20.0 200 [50,200) 50.0 150 [200,1000) 120.0 100 [1000,5000] 250.0 80
[0063] See Table 1, which defines the safe operating limits for different travel ranges. The sequence construction submodule reads parameters from RAM and sets the minimum resolution coefficient ( The smallest unit of displacement (e.g., 1 mm) is determined by the system hardware. The processor performs the division operation. The total number of steps is calculated by rounding down. Next, a structure array is allocated in the heap memory area, with an array length equal to... Each element in the array represents an initial discrete action sequence node, and each node is assigned the same default step speed parameter (from...). The sequence includes the initial pause interval value (e.g., set to a fixed 50ms dead time). After this sequence is generated, an unshaped, uniform open-loop control queue is formed, waiting for subsequent modules to make dynamic adjustments.
[0064] Please see Figure 1 and Figure 3 The fluid pressure gradient calculation module filters and processes real-time fluid pressure values to obtain denoised pressure values, and calculates real-time pressure gradient values based on denoised pressure values and sampling time intervals.
[0065] The real-time pressure gradient value specifically refers to the differential result of fluid pressure within the flow channel and the rate of pressure fluctuation.
[0066] The specific functions of the fluid pressure gradient calculation module are as follows:
[0067] The pressure data filtering submodule collects real-time fluid pressure values in the flow channel through a high-frequency sensor, and applies a sliding window averaging filtering algorithm to remove instantaneous electromagnetic interference noise, generating smooth, denoised pressure values.
[0068] The gradient calculation submodule obtains the denoised pressure values at the current sampling time and the previous sampling time, calculates the difference between the two and divides it by the sampling time interval, thereby obtaining the real-time pressure gradient value that characterizes the dynamic change trend of the current water flow impact force.
[0069] The process of calculating the real-time pressure gradient includes:
[0070] Obtain the denoising pressure value at the current sampling time and the denoising pressure value at the previous sampling time. Combined with the sampling time interval, calculate the gradient value used to characterize the rate of pressure change according to the following formula:
[0071] ;
[0072] in, Represents the real-time pressure gradient value. This represents the denoising pressure value at the current sampling moment. This represents the denoising pressure value at the previous sampling time. This represents the sampling time interval.
[0073] The fluid pressure gradient calculation module uses a piezoresistive pressure sensor installed on the upstream side of the gate bottom plate to perform monitoring tasks.
[0074] The pressure data filtering submodule is configured with a high-frequency ADC (analog-to-digital converter) at a sampling frequency of 1 kHz (i.e., sampling period). The module continuously reads analog voltage signals and converts them into digital pressure values. To eliminate high-frequency noise and electromagnetic interference caused by fluid turbulence, the submodule allocates a space of length [length missing] in the FPGA or DSP processor. A first-in, first-out (FIFO) circular queue. Whenever a new raw pressure data sample enters the tail of the queue, the oldest data at the head of the queue is removed. The processor iterates through all 20 data points in the current queue, performs an accumulation operation, and then divides by the window length. This yields the current value of the smoothing and denoising pressure. .
[0075] The aforementioned sliding window average filtering algorithm is a digital signal processing method that sequentially stores a certain number of the latest sampled data and calculates their arithmetic mean as the effective output at the current moment in order to suppress random interference noise.
[0076] The gradient calculation submodule is triggered at the end of each sampling period. It reads the currently calculated denoising pressure value from the register. And the denoising pressure value saved in the previous sampling period. The processor uses the floating-point unit (FPU) to perform differential operations and divides the result by the sampling time interval to quantify the pressure jump amplitude per unit time.
[0077] The formula for calculating the real-time pressure gradient is as follows:
[0078] ;
[0079] in, This represents the real-time pressure gradient value, in kilopascals per second (kPa). This parameter quantifies the instantaneous rate of change of the impact force of the water flow on the gate, reflecting the dynamic instability of the flow field; This is the denoising pressure value after applying a moving average filter at the current sampling time, in kilopascals (kPa). ); It is the previous sampling time (i.e. The denoising pressure value at time (in kPa) is expressed in kilopascals (kPa). ); This represents the sampling time interval, in seconds. This value is determined by the system clock frequency and the timer divider factor. The absolute value symbol in the formula... The method is used to calculate the magnitude of the change, treating both sharp increases and decreases in pressure as impacts on structural stability. The pressure difference is normalized to the time dimension through division, thus yielding the rate of change.
[0080] Actual calculation example:
[0081] Assuming the system is operating in the third gear as shown in Table 1, the ADC sampling time interval is set... (100Hz). In At any given moment, the pressure data filtering submodule outputs the denoised pressure value from the previous time step. .exist Time (i.e.) After acquiring new raw data and filtering it, the current denoising pressure value is output. Substitute the above values into the formula to calculate: .
[0082] The calculation result This indicates that the actual rate of pressure change has exceeded the system's set safety threshold (refer to the maximum rate of pressure change threshold in the range [200, 1000] in Table 1). This means that the current water flow is more turbulent than expected, and the gate operation must be slowed down immediately to smooth out the pressure fluctuations.
[0083] Please see Figure 1 and Figure 4 The gate action adaptive shaping module calculates the pressure gradient deviation based on the maximum pressure change rate threshold and the real-time pressure gradient value. It uses a fuzzy logic controller to calculate the action correction coefficient based on the pressure gradient deviation. Based on the action correction coefficient, it adjusts the initial discrete action sequence and the basic step action duration to generate the shaped drive control command.
[0084] The reshaping drive control command includes the corrected target pulse count and the adjusted timer count value;
[0085] The specific functions of the gate action adaptive shaping module are as follows:
[0086] The deviation analysis submodule obtains the maximum pressure change rate threshold and the real-time pressure gradient value, calculates the difference between the two to obtain the pressure gradient deviation, and uses it to quantitatively assess the remaining margin of the current water flow state from the safe critical point.
[0087] The coefficient inference submodule inputs the pressure gradient deviation to the fuzzy logic controller, maps the accurate numerical value to fuzzy linguistic variables through the fuzzification interface, performs logical inference and defuzzification through the fuzzy rule base, and generates action correction coefficients.
[0088] The instruction reconfiguration submodule uses the action correction coefficient to dynamically weight and adjust the duration of the basic step action in the initial discrete action sequence, changes the frequency characteristics of the pulse output, and generates a shaped drive control instruction that includes the corrected target pulse number and the adjusted timer count value.
[0089] The process of calculating the motion correction factor includes:
[0090] Establish a fuzzy linguistic variable set including three levels: "safety", "alert" and "danger", and construct a membership function to transform the pressure gradient deviation into a fuzzy membership vector;
[0091] The reasoning is performed based on the preset fuzzy control rule library that "the coefficient is high if the deviation is large and the coefficient is low if the deviation is small". The centroid method is used to defuzzify the reasoning results and output a scalar between 0 and 1 as the action correction coefficient, which is used to dynamically adjust the action speed of the motor.
[0092] The process of generating shaped drive control instructions includes:
[0093] Obtain the preset basic step duration in the initial discrete action sequence, perform inverse weighting calculation using action correction coefficients, and determine the adjusted time parameters according to the following formula:
[0094] ;
[0095] in, This represents the timer count value in the shaping drive control command. Represents the duration of the basic stepping motion. This represents the motion correction coefficient.
[0096] The gate action adaptive shaping module first receives data from the deviation analysis submodule. This submodule retrieves the maximum pressure change rate threshold (denoted as ) determined by the basic parameter initialization module from memory. ), and receive the real-time pressure gradient values output by the fluid pressure gradient calculation module ( The processor performs a subtraction operation. The pressure gradient deviation is obtained. This deviation value... The physical meaning is clear: if This indicates that the current rate of pressure change is below the safe limit, and there is a margin for accelerating or maintaining the speed; if This indicates that the current rate of pressure change has exceeded the limit, and the speed must be reduced.
[0097] The coefficient inference submodule will The input is fed into the embedded fuzzy logic controller. The controller internally establishes three fuzzy sets: "Negative," "Zero," and "Positive." The membership function is defined as follows:
[0098] "Danger":
[0099] Using the Z-type membership function, when When the membership degree is 1, When the membership degree is 0;
[0100] "Safety":
[0101] Using an S-shaped membership function, when When the membership degree is 0, The membership degree is 1.
[0102] "alert":
[0103] The trigonometric membership function is used, varying between -50 and 50, with a peak at 0.
[0104] The fuzzy rule base is set as follows:
[0105] If the deviation is considered "safe", then the action correction factor ( High (value close to 1.0);
[0106] If the deviation is classified as "alert", the action correction factor is moderate (ranging from 0.5 to 0.8).
[0107] If the deviation is classified as "dangerous", the action correction factor is low (ranging from 0.1 to 0.4).
[0108] The inference engine employs the Mamdani inference method and finally uses the centroid method for defuzzification to output a precise scalar. .
[0109] The aforementioned centroid method refers to a fuzzy logic defuzzification algorithm that converts fuzzy quantities into precise output control quantities by calculating the geometric centroid abscissa of the area enclosed by the membership function curve of the fuzzy set and the horizontal axis.
[0110] The instruction refactoring submodule reads the preset base step duration of the currently executed segment from the initial discrete action sequence. Using the calculated It is modulated. The process of generating the shaped drive control command involves the following formula:
[0111] ;
[0112] in, This represents the timer count value in the shaping drive control instruction, in milliseconds (ms). The number of timer count cycles or the number of timer count cycles directly determines the period length of the stepper motor drive pulse; It is the basic step duration obtained from the table lookup, in milliseconds. ), representing the ideal operating speed under standard operating conditions; These are the motion correction coefficients output by the fuzzy controller, which are dimensionless scalars with a range of values. This is used to dynamically adjust the motor's operating speed based on the pressure gradient deviation. The formula achieves adjustment through an inverse proportional relationship: when... The smaller the value (i.e., the more dangerous), the smaller the denominator, and the higher the calculated value. The larger the value, the longer the pulse period and the lower the frequency, resulting in a significantly slower motor operation; conversely, when... When it approaches 1, near Maintain the preset speed.
[0113] Actual calculation example: Continuing from the previous example, the maximum pressure change rate threshold is known. (Source: Table 1) The real-time pressure gradient values calculated by the previous module .
[0114] Calculate the deviation:
[0115] .
[0116] Fuzzy reasoning:
[0117] The deviation of -15.0 is in the overlapping zone of "danger" and "alert".
[0118] Assuming the motion correction coefficients are output after defuzzification using the center-of-gravity method This indicates that the system has determined the current situation to be at a high risk, requiring the movement speed to be reduced to approximately 45% of its original speed. Parameter adjustment: The base step movement duration for the current travel range is known. (From Table 1). Substitute the parameters into the formula to calculate the adjusted timer count value:
[0119] .
[0120] The calculation result This indicates that a micro-step movement originally scheduled to complete in 100ms has now been extended to 222.22ms. The timer will load this value, causing the motor pulse frequency to decrease from 10Hz (1 / 0.1s) to approximately 4.5Hz (1 / 0.222s). This significant deceleration will effectively reduce the instantaneous impact of the water flow on the gate, allowing for a smoother transition in the next moment. Returning to a safe range.
[0121] Please see Figure 1 and Figure 5 The discrete stepping drive execution module extracts the target pulse count and timer count value from the shaping drive control command, sends control signals based on the target pulse count and timer count value, calculates the absolute value of the positioning deviation between the real-time encoder value and the target opening value, and generates a brake lock command if the absolute value of the positioning deviation is less than the positioning error range.
[0122] Brake locking commands include motor stop signals and mechanical brake trigger signals;
[0123] The specific functions of the discrete step-driven execution module are as follows:
[0124] The pulse modulation transmission submodule parses the shaping drive control command to extract the target pulse number and timer count value, generates a PWM control signal with corresponding frequency and duty cycle, and sends it to the motor driver to drive the gate to perform segmented micro-stepping motion.
[0125] The position closed-loop monitoring submodule collects real-time encoder values after each micro-stepping motion and calculates the absolute value of the difference between the value and the target opening value as the absolute value of the positioning deviation.
[0126] The braking logic triggering submodule compares the absolute value of the positioning deviation with the preset positioning error range. When the absolute value of the positioning deviation is continuously less than the positioning error range, it immediately generates a brake locking command that includes a motor stop signal and a mechanical brake trigger signal.
[0127] The process of generating a brake lock command includes:
[0128] After detecting that the absolute value of the positioning deviation is less than the positioning error range, the continuous stability verification counter is started to monitor whether the absolute value of the positioning deviation remains within the positioning error range in the subsequent preset period.
[0129] Only when the verification counter reaches the preset stability threshold is it confirmed that the gate has stably reached the target position. Then, a motor stop signal is output in parallel to cut off the motor power supply, and a mechanical brake trigger signal is output to lock the gate's mechanical transmission mechanism.
[0130] The discrete step drive execution module is the physical actuation end of the system.
[0131] The pulse modulation transmission submodule directly operates the microcontroller's hardware timer. It uses the timer calculated by the previous module. The clock cycle number (e.g., 222.22ms) is written to the timer's Automatic Reload Register (ARR), and the Duty Cycle Register (CCR) is set to 50% of the ARR value to generate a square wave. Simultaneously, a pulse counter is set based on the number of pulses corresponding to the tiny displacement segments defined in the initial discrete motion sequence (e.g., 100 pulses for 1mm). When the timer starts, the GPIO pin outputs a PWM control signal of a specified frequency to the motor driver, driving the stepper motor to rotate the lead screw, causing the gate to perform a micro-step.
[0132] The aforementioned PWM control signal refers to a pulse width modulation signal, which obtains the required waveform (including shape and amplitude) by modulating the width of a series of pulses. Here, it is used to control the speed and position of the motor.
[0133] During the interval between each micro-step movement (i.e., after pulse transmission), the position closed-loop monitoring submodule reads the values from the multi-turn absolute encoder via the SSI synchronous serial interface. The processor then processes the actual position fed back by the encoder. ) and the target opening value set by the system ( Compare the results and calculate the absolute value of the positioning deviation. .
[0134] The braking logic triggering submodule has a predefined positioning error range (e.g.) The processor executes the comparison logic in real time. If the condition is not met, the system continues to execute the next action sequence; if the condition is met, it indicates that the gate has entered the tolerance zone of the target position. At this time, to prevent gate shaking or false positioning caused by water flow impact, the module starts a continuous stability verification counter. This counter checks once every control cycle (e.g., 10ms). If it continues to remain at Within the specified range, the counter increments by 1; once it exceeds the specified range, the counter is reset to zero.
[0135] The braking logic trigger submodule only determines "truly in place" when the verification counter reaches a preset stability threshold (e.g., set to 50 times, i.e., stable for 0.5 seconds). At this point, the processor executes two hardware operations in parallel:
[0136] Reset the PWM output pin and pull the Enable pin of the motor driver low to cut off the motor coil current and output a motor stop signal;
[0137] Pulling the relay control pin high supplies power to the mechanical brake electromagnet (or de-energizes it, depending on the specific brake type), outputting a mechanical brake trigger signal, and physically locking the drive shaft.
[0138] Table 2 shows a fragment of the execution data stream log when the module is approaching the target location.
[0139] Table 2. Footprint driver execution module end-positioning data log
[0140] Header timestamp (ms) Target position of the meter header (mm) Real-time encoder value (mm) on the meter Absolute value of indicator positioning deviation (mm) Header counter status Header Actions 1000 2500.0 2495.0 5.0 0 Continue step by step 1250 2500.0 2498.5 1.5 1 Pause / Monitoring 1260 2500.0 2498.4 1.6 2 Monitoring and maintenance … … … … … … 1750 2500.0 2498.5 1.5 50 Trigger the brakes
[0141] As shown in Table 2, by introducing a stability verification counter, the system effectively avoids overshoot or repeated fine-tuning oscillations caused by water flow fluctuations, ensuring the reliability of the final lock.
[0142] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the scope of protection defined by the claims of the present invention.
Claims
1. An Internet of Things-based water gate remote control system, characterized in that, The system includes: The basic parameter initialization module calculates the total stroke difference based on the target opening value and the current gate position value, obtains the maximum pressure change rate threshold and the basic step action duration, and divides the total stroke difference to construct an initial discrete action sequence. The fluid pressure gradient calculation module filters and processes real-time fluid pressure values to obtain denoised pressure values, and calculates real-time pressure gradient values based on the denoised pressure values and the sampling time interval. The gate action adaptive shaping module calculates the pressure gradient deviation based on the maximum pressure change rate threshold and the real-time pressure gradient value, uses a fuzzy logic controller to calculate the action correction coefficient based on the pressure gradient deviation, and adjusts the initial discrete action sequence and the basic step action duration based on the action correction coefficient to generate a shaped drive control command. The discrete step-drive execution module extracts the target pulse count and timer count value from the shaping drive control command, sends a control signal based on the target pulse count and the timer count value, calculates the absolute value of the positioning deviation between the real-time encoder value and the target opening value, and generates a brake lock command if the absolute value of the positioning deviation is less than the positioning error range. 2.The Internet of Things based water gate remote control system according to claim 1, characterized in that, The initial discrete action sequence includes tiny displacement segments divided by a preset resolution, a default step speed parameter, and an initial pause interval value. The real-time pressure gradient value specifically refers to the differential result of the fluid pressure in the flow channel and the pressure fluctuation rate. The shaped drive control command includes the corrected target pulse number and the adjusted timer count value. The brake lock command includes a motor stop signal and a mechanical brake trigger signal. 3.The Internet of Things based water gate remote control system according to claim 1, characterized in that, The specific function of the basic parameter initialization module is as follows: The stroke difference calculation submodule obtains the target opening value and the current gate position value, performs a numerical subtraction operation between the two to obtain the total stroke difference, and determines the opening or closing direction of the gate based on the positive or negative sign attribute of the total stroke difference. The parameter matching submodule maps the absolute value of the total stroke difference to a preset system dynamics constraint table, extracts the corresponding maximum pressure change rate threshold and basic stepping motion duration, and ensures that the initial motion parameters comply with the safety specifications of water conservancy facilities. The sequence construction submodule discretizes the total travel difference based on a preset minimum resolution coefficient, calculates the required total number of step segments, and generates an initial discrete motion sequence including several small displacement segments arranged in chronological order. 4.The Internet of Things based water gate remote control system according to claim 1, wherein, The specific function of the fluid pressure gradient calculation module is as follows: The pressure data filtering submodule collects real-time fluid pressure values in the flow channel through a high-frequency sensor, and applies a sliding window averaging filtering algorithm to remove instantaneous electromagnetic interference noise, generating smooth, denoised pressure values. The gradient calculation submodule obtains the denoised pressure values at the current sampling time and the previous sampling time, calculates the difference between the two and divides it by the sampling time interval, thereby obtaining the real-time pressure gradient value that characterizes the dynamic change trend of the current water flow impact force. 5.The Internet of Things based water gate remote control system according to claim 1, wherein, The specific function of the gate action adaptive shaping module is as follows: The deviation analysis submodule obtains the maximum pressure change rate threshold and the real-time pressure gradient value, calculates the difference between the two to obtain the pressure gradient deviation, and uses it to quantitatively assess the remaining margin of the current water flow state from the safe critical point. The coefficient reasoning submodule inputs the pressure gradient deviation to the fuzzy logic controller, maps the accurate numerical value into fuzzy language variables through the fuzzification interface, performs logical reasoning and defuzzification processing through the fuzzy rule base, and generates action correction coefficients. The instruction reconstructing submodule uses the action correction coefficient to dynamically weight and adjust the duration of the basic step action in the initial discrete action sequence, changes the frequency characteristics of the pulse output, and generates a shaped drive control instruction that includes the corrected target pulse number and the adjusted timer count value. 6.The Internet of Things based water gate remote control system according to claim 1, wherein, The specific functions of the discrete step driving execution module are as follows: The pulse modulation transmission submodule parses the shaped drive control command to extract the target pulse number and the timer count value, generates a PWM control signal with corresponding frequency and duty cycle, and sends it to the motor driver to drive the gate to perform segmented micro-stepping motion. The position closed-loop monitoring submodule collects real-time encoder values after each micro-step movement and calculates the absolute value of the difference between the value and the target opening value as the absolute value of the positioning deviation. The braking logic triggering submodule compares the absolute value of the positioning deviation with a preset positioning error range. When the absolute value of the positioning deviation is continuously less than the positioning error range, it immediately generates a brake locking command that includes a motor stop signal and a mechanical brake trigger signal.
7. The IoT-based remote control system for water gates according to claim 4, characterized in that, The process of calculating the real-time pressure gradient includes: Obtain the denoising pressure value at the current sampling time and the denoising pressure value at the previous sampling time. Combined with the sampling time interval, calculate the gradient value used to characterize the rate of pressure change according to the following formula: ; in, Represents the real-time pressure gradient value. This represents the denoising pressure value at the current sampling moment. This represents the denoising pressure value at the previous sampling time. This represents the sampling time interval.
8. The IoT-based remote control system for water gates according to claim 5, characterized in that, The process of calculating the motion correction coefficient includes: Establish a fuzzy linguistic variable set including three levels: "safety", "alert" and "danger", and construct a membership function to transform the pressure gradient deviation into a fuzzy membership vector; The reasoning is performed based on a preset fuzzy control rule base that states "if the deviation is large, the coefficient is high; if the deviation is small, the coefficient is low." The centroid method is used to defuzzify the reasoning results, and a scalar between 0 and 1 is output as the action correction coefficient, which is used to dynamically adjust the motor's action speed.
9. The IoT-based remote control system for water gates according to claim 5, characterized in that, The process of generating the shaped drive control command includes: Obtain the preset basic step duration in the initial discrete action sequence, perform inverse weighted calculation using the action correction coefficient, and determine the adjusted time parameter according to the following formula: ; in, This represents the timer count value in the shaping drive control command. Represents the duration of the basic stepping motion. This represents the motion correction coefficient.
10. The IoT-based remote control system for water gates according to claim 6, characterized in that, The process of generating the brake lock command includes: After detecting that the absolute value of the positioning deviation is less than the positioning error range, a continuous stability verification counter is started to monitor whether the absolute value of the positioning deviation remains within the positioning error range in the subsequent preset period. Only when the verification counter reaches the preset stability threshold is it confirmed that the gate has stably reached the target position. Then, the motor stop signal is output in parallel to cut off the power supply to the motor, and the mechanical brake trigger signal is output to lock the gate mechanical transmission mechanism.