PLC intelligent dynamic regulation method for programmable control box

By acquiring temperature and environmental data in the PLC control box, calculating thermodynamic and vibration risk values, and dynamically adjusting the scanning cycle, the problems of PLC control logic malfunction and equipment damage under mining conditions are solved, and stable operation and efficient processing of equipment are achieved.

CN122194828APending Publication Date: 2026-06-12LUOYANG BOYANG INTELLIGENT TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LUOYANG BOYANG INTELLIGENT TECH CO LTD
Filing Date
2026-05-14
Publication Date
2026-06-12

Smart Images

  • Figure CN122194828A_ABST
    Figure CN122194828A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of industrial automation control, in particular to a PLC intelligent dynamic regulation and control method for a programmable control box. The method comprises the following steps: acquiring a temperature matrix of a circuit board of the programmable control box, determining a thermodynamic characteristic index based on the temperature matrix; determining a tremor risk degree value by using a noise spectrum of an environment and a mechanical vibration sequence; determining an electrical urgency value by using a channel current sequence of a plurality of analog quantity channels of the programmable control box; determining a gain adjustment term according to the tremor risk degree value, determining a suppression adjustment term according to the electrical urgency value, determining a boundary compensation term according to the thermodynamic characteristic index, and adjusting a reference scanning period to obtain a target scanning period according to the gain adjustment term, the suppression adjustment term and the boundary compensation term, so as to control the PLC to operate according to the target scanning period. Through the above technical scheme, the scanning period of the programmable control box can be intelligently and dynamically regulated and controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial automation control technology, and in particular to a PLC intelligent dynamic control method for programmable controller boxes. Background Technology

[0002] PLC (Programmable Logic Controller) is a core basic control device in the field of industrial automation control. In mining production scenarios, PLC is the core control hub of mining crushing systems, ore conveying systems, and large mining equipment scheduling systems. Programmable control boxes equipped with PLC can undertake key functions such as equipment logic interlocking, start-stop control, operation status monitoring, and emergency fault protection.

[0003] The scan cycle refers to the total time required for a PLC to complete a full cycle of input sampling, user program execution, and output refresh. It is a core indicator that determines the overall control performance of the PLC. The length of the scan cycle determines the sampling frequency and acquisition accuracy of the PLC for external input signals, as well as the PLC's ability to filter out transient interference signals.

[0004] If a short fixed scan cycle is set, the PLC may mistakenly collect the high-frequency micro-bounce of the terminals and relay contacts as valid electrical signals, causing control logic malfunctions or unplanned equipment shutdowns. If a long fixed scan cycle is set, the PLC may miss the best fault protection opportunity due to sampling and execution delays, leading to equipment damage or even safety accidents.

[0005] When the control box is blocked from heat dissipation due to dust accumulation or the internal temperature rises, the fixed high-frequency scanning cycle will continuously increase the computing load and thermal stress on the processor chip, which can easily cause chip thermal overload, calculation errors, or even system crashes. Therefore, given the dynamic changes in mining conditions, it is necessary to intelligently and dynamically adjust the scanning cycle of the programmable control box. Summary of the Invention

[0006] To intelligently and dynamically control the scan cycle of a programmable logic controller (PLC), this application provides a PLC intelligent dynamic control method for a PLC, comprising: acquiring the temperature matrix of the circuit board of the PLC; determining thermodynamic characteristic indicators based on the difference between the measured temperature and the reference operating temperature in the temperature matrix; the thermodynamic characteristic indicators are used to characterize the heat dissipation of the circuit board; acquiring the ambient noise spectrum and mechanical vibration sequence; determining the proportion of high-frequency energy in the noise spectrum; determining the vibration risk value using the mechanical vibration sequence and the proportion of high-frequency energy; acquiring the channel current sequence of multiple analog channels of the PLC; determining the relative change rate of the channel current sequence relative to its corresponding upper limit within adjacent time steps; taking the largest relative change rate among all analog channels as the electrical urgency value; determining a gain adjustment term based on the vibration risk value; determining a suppression adjustment term based on the electrical urgency value; determining a boundary compensation term based on the thermodynamic characteristic indicators; and adjusting the reference scan cycle based on the gain adjustment term, the suppression adjustment term, and the boundary compensation term to obtain the target scan cycle, thereby controlling the PLC to operate according to the target scan cycle.

[0007] In this way, the scanning cycle of the programmable controller can be intelligently and dynamically adjusted based on the actual situation of the programmable controller.

[0008] Optionally, thermodynamic characteristic indicators are determined by performing attenuation calculations based on the difference between the measured temperature and the reference operating temperature in the temperature matrix. This includes: for any target location point in the temperature matrix, determining the square of the measured temperature at the target location point in the temperature matrix, and the square difference between the square of the measured temperature and the reference operating temperature; taking the average of the square differences corresponding to all location points as the average temperature deviation rate; performing a ratio calculation between the average temperature deviation rate and the square of the reference operating temperature, and using the sum of the ratio calculation result and a first preset positive number as the attenuation base; performing a natural logarithmic operation on the attenuation base to obtain a logarithmic product value, and using the reciprocal of the logarithmic product value as the thermodynamic characteristic indicator.

[0009] In this way, by calculating the squared difference between the measured temperature and the reference operating temperature at each location point, the weight of abnormally high temperature nodes can be nonlinearly amplified, thereby improving the sensitivity of thermodynamic characteristic indicators to local hot spots.

[0010] Optionally, determining the high-frequency energy proportion of high-frequency noise energy in the noise spectrum includes: determining a preset low-frequency starting point, mid-frequency boundary point, and high-frequency ending point from the noise spectrum; extracting the high-frequency power spectral density between the mid-frequency boundary point and the high-frequency ending point from the noise spectrum; integrating the high-frequency power spectral density to obtain the high-frequency noise energy; integrating the power spectral density of all noise in the noise spectrum between the low-frequency starting point and the high-frequency ending point to determine the total energy; and using the ratio of high-frequency noise energy to the total energy as the high-frequency energy proportion.

[0011] Optionally, the tremor risk value is determined using the mechanical vibration sequence and the proportion of high-frequency energy, including: using the ratio of the root mean square value of the vibration energy of the mechanical vibration sequence to the reference vibration energy as the energy overflow multiple; using the natural exponential function to calculate the energy overflow multiple to obtain the exponential calculation result; using the reciprocal of the exponential calculation result as the vibration attenuation coefficient; using the difference between the second preset positive number and the vibration attenuation coefficient as the exponential attenuation value; and using the product of the proportion of high-frequency energy and the exponential attenuation value as the tremor risk value; the second preset positive number is greater than the upper limit of the vibration attenuation coefficient.

[0012] In this way, by converting the mechanical vibration sequence into the root mean square value of vibration energy and calculating the energy overflow factor, the vibration attenuation coefficient is obtained by using the natural exponential function to calculate the energy overflow factor and taking its reciprocal. This amplifies the impact of more severe mechanical shocks and improves the sensitivity of the vibration risk value to the mechanical structural instability of the programmable control box.

[0013] Optionally, the channel current sequence of multiple analog channels of the programmable controller box can be obtained, including: continuously monitoring different analog channels of the programmable controller box to obtain the channel current sequence of different analog channels; the different analog channels correspond to different external devices controlled by the programmable controller box.

[0014] Optionally, the gain adjustment term and the suppression adjustment term are determined as follows: multiply the tremor risk value by a preset tremor sensitivity coefficient to obtain a first adjustment factor, perform a hyperbolic tangent operation on the first adjustment factor to obtain a first mapping value, and add a third preset positive number to the first mapping value to obtain a gain adjustment term; multiply the electrical urgency value by a preset urgency sensitivity coefficient to obtain a second adjustment factor, perform a hyperbolic tangent operation on the second adjustment factor to obtain a second mapping value, and add a third preset positive number to the second mapping value to obtain a suppression adjustment term.

[0015] In this way, by using hyperbolic tangent operation to perform nonlinear mapping processing on the first and second adjustment factors, the problem of abnormal interference causing the gain adjustment term or suppression adjustment term to diverge out of bounds is avoided, thus ensuring the stability of the adjustment strategy for the target scanning period.

[0016] Optionally, the boundary compensation term is determined based on thermodynamic characteristic indicators, including: adding the thermodynamic characteristic indicators to the preset anti-overflow constant and taking the reciprocal to obtain the degradation compensation base, normalizing the degradation compensation base by natural logarithm, and using the result of natural logarithm normalization to determine the boundary compensation term.

[0017] Optionally, the target scan period is determined by using the ratio of the gain adjustment term to the suppression adjustment term as the risk adjustment coefficient, and the product of the risk adjustment coefficient, the boundary compensation term, and the baseline scan period as the target scan period.

[0018] Optionally, the method further includes: dynamically embedding the value of the target scan cycle into the end of the data bits of the communication message sent by the master station of the programmable control box to each slave device, so as to control each slave device to parse the value of the target scan cycle carried in the communication message; and the slave device rewrites the waiting time register parameter of the electronic watchdog in the communication chip in real time based on the parsed value of the target scan cycle.

[0019] Optionally, the method further includes: determining the digital sampling frequency of the current period based on the value of the target scanning period; determining the maximum Shannon sampling bandwidth value that is synchronously matched with the target scanning period based on the digital sampling frequency; converting the maximum Shannon sampling bandwidth value into a resistor adjustment value instruction for matching the corresponding bandwidth; and outputting the resistor adjustment value instruction to control the adjustable analog low-pass filter at the front end of the analog input module to lower the corresponding hardware pre-cutoff frequency.

[0020] Optionally, acquiring the ambient noise spectrum and mechanical vibration sequence includes: acquiring the ambient audio signal received at the outer shell of the programmable control box, and acquiring the single-axis dynamic deformation data of the outer shell surface of the programmable control box; performing time-domain truncation processing on the ambient audio signal and the single-axis dynamic deformation data to obtain the target audio signal and target deformation data within the same sampling time period; converting the target audio signal to the frequency domain dimension to obtain the noise spectrum, and determining the distribution combination of the target deformation data along the time axis as the mechanical vibration sequence.

[0021] Optionally, the ambient audio signal and the single-axis dynamic deformation data are subjected to time-domain truncation processing to obtain the target audio signal and target deformation data within the same sampling time period. This includes: obtaining the first time-series timestamp corresponding to the ambient audio signal and the second time-series timestamp corresponding to the single-axis dynamic deformation data; comparing the first time-series timestamp and the second time-series timestamp; extracting the target intersection interval where the first time-series timestamp and the second time-series timestamp overlap; truncating the data segment of the ambient audio signal within the target intersection interval as the target audio signal, and truncating the data segment of the single-axis dynamic deformation data within the target intersection interval as the target deformation data.

[0022] In this way, by extracting the target intersection interval where the first time-series timestamp and the second time-series timestamp overlap and performing alignment truncation, the time phase error caused by asynchronous sampling of multiple acoustic and vibration sensors is eliminated, and the consistency of the physical state of the target audio signal and the target deformation data in the time domain dimension is improved.

[0023] The technical solutions provided by the embodiments of this application may include the following beneficial effects: thermodynamic characteristic indicators are calculated by the temperature matrix of the programmable control box to characterize the local heat dissipation limitation state; the vibration risk value determined by the high frequency energy ratio and mechanical vibration sequence can accurately assess the impact of external physical environment fluctuations; the electrical urgency value is determined by the relative change rate of the channel current sequence; and the target scan cycle is obtained by integrating multi-dimensional indicators to adaptively adjust the reference scan cycle. This improves the adaptability and task processing timeliness of the programmable control box under complex working conditions and avoids the problems of control logic lag or waste of computing resources caused by fixed scan cycles.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating an intelligent dynamic control method for a programmable controller box using a PLC, according to an exemplary embodiment. Figure 2 This is a schematic diagram of the scanning cycle adjustment results in the embodiments of this application. Detailed Implementation

[0026] To address the aforementioned technical problems, this application provides a PLC intelligent dynamic control method for a programmable controller box. Figure 1 This is a flowchart illustrating a PLC intelligent dynamic control method for a programmable controller box according to an exemplary embodiment, such as... Figure 1 As shown, the method includes the following steps.

[0027] In step S101, the temperature matrix of the circuit board of the programmable control box is obtained, and the thermodynamic characteristic index is determined by attenuation calculation based on the difference between the measured temperature and the reference operating temperature in the temperature matrix.

[0028] During the execution of automated control logic by the programmable controller, the central processing unit chip, as well as various power modules and communication modules deployed inside the programmable controller, continuously perform high-intensity electrical signal conversion and digital logic operations. The high-intensity electrical energy flow is accompanied by a large amount of Joule heat generation, which causes the physical temperature of various areas of the circuit board inside the programmable controller to change dynamically.

[0029] To obtain the temperature distribution in different areas of the circuit board surface, multiple temperature sensor arrays can be pre-deployed at key heat-generating nodes of the circuit board inside the programmable control box. By periodically reading the temperature sampling values ​​of each temperature sensor, a temperature matrix reflecting the spatial distribution can be constructed. The temperature matrix can record the overall average heat level of the circuit board and can also reflect the heat accumulation in local high-power component areas through row and column coordinates.

[0030] Based on the obtained temperature matrix, the measured temperature corresponding to each spatial sampling point in the temperature matrix is ​​determined, and the measured temperature is compared and analyzed with the pre-calibrated reference operating temperature, which refers to the ideal operating temperature of the programmable control box under standard environment.

[0031] By analyzing the difference between the measured temperature and the reference operating temperature, the severity of the programmable controller's current deviation from the ideal operating state can be effectively assessed. Further attenuation calculations are performed on the difference characteristics, which can convert the linear temperature difference into a nonlinear performance degradation measure, thereby outputting thermodynamic characteristic indicators.

[0032] Thermodynamic characteristics are used to characterize the heat dissipation of a circuit board. These characteristics describe the degree to which the circuit board is well-ventilated or unaffected by high ambient temperatures within its current enclosed operating space.

[0033] The higher the value of the thermodynamic characteristic index, the lower the heat accumulation of the components inside the circuit board, and the less the heat dissipation restricts the operation of the components inside the circuit board. The lower the value of the thermodynamic characteristic index, the higher the heat accumulation of the components inside the circuit board, the more the heat dissipation restricts the operation of the components inside the circuit board, and the more the PLC scanning cycle needs to be extended.

[0034] In one embodiment, the thermodynamic characteristic index is determined by attenuation calculation based on the difference between the measured temperature and the reference operating temperature in the temperature matrix. This includes: for any target location point in the temperature matrix, determining the square of the measured temperature at the target location point in the temperature matrix, and the square difference between the square of the measured temperature and the reference operating temperature; taking the average of the square differences corresponding to all location points as the average temperature deviation rate; performing a ratio calculation between the average temperature deviation rate and the square of the reference operating temperature, and using the sum of the ratio calculation result and a first preset positive number as the attenuation base; performing a natural logarithmic operation on the attenuation base to obtain a logarithmic product value, and using the reciprocal of the logarithmic product value as the thermodynamic characteristic index.

[0035] For a specific spatial distribution area covered by the temperature matrix, the coordinate system nodes in the temperature matrix can be traversed one by one to select any target location point, read the measured temperature recorded in the temperature matrix at the target location point, calculate the square value of the measured temperature, obtain the square value of the reference operating temperature, and subtract the square value of the reference operating temperature from the square value of the measured temperature to obtain the square difference value.

[0036] The summation of the squared differences at all spatial sampling nodes is divided by the total number of nodes to obtain the average temperature deviation rate, which represents the global nonlinear thermal deviation state of the circuit board. The ratio calculation output is obtained by dividing the average temperature deviation rate by the square of the reference operating temperature. The ratio calculation eliminates the physical dimension constraint of the temperature measurement unit and reflects the relative deviation. The output of the ratio calculation is added to the first preset positive number to construct the attenuation base.

[0037] The first preset positive number can usually be a value greater than 1. The purpose of the first preset positive number is to ensure that the result of the natural logarithm operation is at least greater than 0. The logarithmic accumulation value is obtained by performing a nonlinear compression mapping on the decay base using the natural logarithm function. The reciprocal of the logarithmic accumulation value is used as a thermodynamic characteristic index to characterize the degree of heat dissipation limitation.

[0038] For example, a programmable control box deployed inside the control panel can have 25 temperature sensors arranged in a 5x5 temperature matrix on its internal circuit board. Assume that the reference operating temperature of the circuit board under normal heat dissipation conditions is 40 degrees Celsius.

[0039] When the ambient temperature in the workshop rises sharply, causing the measured temperature at some target locations collected by the temperature sensor to rise to 55 degrees Celsius, a huge difference in squares will occur between the square of the measured temperature and the square of the baseline operating temperature.

[0040] The leakage current parameter of semiconductor devices exhibits a nonlinear deterioration trend with increasing temperature. The squared difference value can amplify and penalize abnormal nodes with extremely high local temperatures, making the final calculated average temperature deviation rate more sensitive to capture local hot spots.

[0041] The greater the deviation of the measured temperature from the reference operating temperature, the larger the logarithmic product value, and the smaller the thermodynamic characteristic index obtained by taking the reciprocal. This can objectively reflect the decrease in the switching frequency of the microprocessor transistors inside the programmable controller caused by high temperature, providing a parameter basis for actively reducing the dynamic power consumption of the chip in the future.

[0042] In step S102, the noise spectrum and mechanical vibration sequence of the environment are obtained, the proportion of high-frequency energy in the high-frequency noise energy in the noise spectrum is determined, and the vibration risk value is determined using the mechanical vibration sequence and the proportion of high-frequency energy.

[0043] The industrial environment in which programmable control boxes are located is often accompanied by the start-stop interference of large motors and the physical impact of heavy machinery. Through external microphone sensors and triaxial piezoelectric accelerometers, the fluctuation state of the external physical field can be captured in real time.

[0044] The system acquires the noise spectrum in the environmental acoustic dimension, which contains comprehensive information on the frequency distribution and corresponding intensity of sound waves in the spatial environment; it also acquires the mechanical vibration sequence in the physical contact dimension, which records the changes in acceleration impact experienced by the programmable control box on the time axis.

[0045] Based on the acquired noise spectrum, the energy accumulation in the high-frequency region of the noise spectrum data can be analyzed, and the proportion of high-frequency noise energy in the total energy of the entire frequency band can be calculated to obtain the high-frequency energy ratio. The high-frequency energy ratio reflects the degree of influence of high-energy acoustic radio frequency interference on the metal shielding layer of the programmable control box.

[0046] By combining the mechanical vibration sequence that reflects the intensity of physical impact with the high-frequency energy proportion that characterizes the penetration interference of sound waves, a coupled calculation can be performed to determine the flutter risk value. The flutter risk value is used to assess the overall probability of electrical communication interruption caused by microscopic physical displacement of the connectors inside the programmable control box under the current combined acoustic and vibration interference.

[0047] In one embodiment, acquiring the noise spectrum and mechanical vibration sequence of the environment includes: acquiring the ambient audio signal received at the outer shell of the programmable control box, and acquiring the uniaxial dynamic deformation data of the outer shell surface of the programmable control box; performing time-domain truncation processing on the ambient audio signal and the uniaxial dynamic deformation data to obtain the target audio signal and target deformation data within the same sampling time period; converting the target audio signal to the frequency domain dimension to obtain the noise spectrum, and determining the distribution combination of the target deformation data along the time axis as the mechanical vibration sequence.

[0048] By installing miniature microphones around the metal casing of the programmable controller box, ambient audio signals received at the casing of the programmable controller box can be continuously collected. The ambient audio signals can reflect the fluctuations in ambient acoustic energy.

[0049] By installing high-frequency strain gauge sensors on the surface of the programmable controller enclosure, uniaxial dynamic deformation data of the enclosure surface can be obtained, which can reflect the degree of mechanical impact.

[0050] To eliminate the asynchronous time difference that may exist between acoustic sensors and strain gauge sensors when reporting data, time-domain truncation processing can be performed on continuously recorded environmental audio signals and single-axis dynamic deformation data to ensure that the two types of data have consistent start and end points, thereby obtaining the target audio signal and target deformation data within the same sampling time period.

[0051] The target audio signal in the time domain is converted to the frequency domain by using the Fast Fourier Transform algorithm, and the frequency components and amplitude distribution features are extracted to obtain the noise spectrum. The original time series attributes of the target deformation data are preserved, and the distribution combination of the target deformation data along the time axis is sequentially concatenated to obtain a mechanical vibration sequence that reflects the fluctuation state of the impact.

[0052] For example, in the application scenario of the control panel next to the injection molding machine, the ambient audio signal collected by the miniature microphone includes the audio information emitted by the hydraulic pump of the injection molding machine when it is working, and the uniaxial dynamic deformation data collected by the high-frequency strain gauge records the structural vibration generated by the hydraulic pump of the injection molding machine at the moment of mold closure.

[0053] When performing time-domain truncation processing, the truncation time window length can be set to, for example, 1000 milliseconds. The acoustic vibration in the industrial field occurs synchronously with the mechanical impact. By extracting the target audio signal and target deformation data within the same strictly aligned sampling time period for joint analysis, the true physical process of external environmental interference compounding on the programmable control box can be accurately restored.

[0054] By converting the target audio signal to the frequency domain to obtain the noise spectrum, the location of high-frequency sound wave bands can be intuitively reflected. By combining the distribution to form a mechanical vibration sequence, the peak evolution process of the impact force in time can be restored, which improves the processing accuracy of converting the original monitoring data into a usable analytical feature sequence and avoids the problem of time sequence disorder caused by non-time domain alignment.

[0055] In one embodiment, time-domain truncation processing is performed on the ambient audio signal and single-axis dynamic deformation data to obtain the target audio signal and target deformation data within the same sampling time period. This includes: obtaining a first time-series timestamp corresponding to the ambient audio signal and a second time-series timestamp corresponding to the single-axis dynamic deformation data; comparing the first time-series timestamp and the second time-series timestamp; extracting the target intersection interval where the first time-series timestamp and the second time-series timestamp overlap; truncating the data segment of the ambient audio signal within the target intersection interval as the target audio signal; and truncating the data segment of the single-axis dynamic deformation data within the target intersection interval as the target deformation data.

[0056] When receiving ambient audio signals and single-axis dynamic deformation data, the timestamp information attached to the header of each data packet can be parsed to extract the first time-series timestamp that identifies the acquisition time of the ambient audio signal and the second time-series timestamp that identifies the acquisition time of the single-axis dynamic deformation data.

[0057] The first and second time-series timestamps are input into the time axis for point-by-point scanning and alignment. Data time periods that do not overlap are discarded, and the target intersection intervals where the first and second time-series timestamps completely overlap in the time dimension are extracted.

[0058] Based on the start and end time nodes of the determined target intersection interval, continuous waveform segments of the environmental audio signal within the specific interval are cut out as the target audio signal, and the measurement value sequence of the single-axis dynamic deformation data within the same interval is cut out as the target deformation data.

[0059] Environmental audio signals and single-axis dynamic deformation data can reflect the physical interference state from the outside world. There is usually a synergistic relationship between the two signals. Communication delays can cause data misalignment, which can lead to the failure of subsequent analysis. By extracting the target intersection interval and forcibly aligning and cropping the target audio signal and target deformation data, the two can be made consistent in the time domain dimension, which ensures the strong correlation between noise assessment and vibration analysis objects in time slices.

[0060] In one embodiment, determining the high-frequency energy proportion of high-frequency noise energy in the noise spectrum includes: determining a preset low-frequency start point, mid-frequency boundary point, and high-frequency end point from the noise spectrum; extracting the high-frequency power spectral density between the mid-frequency boundary point and the high-frequency end point from the noise spectrum; integrating the high-frequency power spectral density to obtain the high-frequency noise energy; integrating the power spectral density of all noise in the noise spectrum between the low-frequency start point and the high-frequency end point to determine the total energy; and using the ratio of high-frequency noise energy to the total energy as the high-frequency energy proportion.

[0061] After obtaining the complete noise spectrum, three key anchor point parameters for spectrum segmentation can be pre-configured: the low-frequency start point, the mid-frequency boundary point, and the high-frequency end point.

[0062] Using the mid-frequency boundary and the high-frequency endpoint as the spectrum truncation boundary, the high-frequency power spectral density curve located within the frequency band is extracted from the global noise spectrum. The extracted high-frequency power spectral density curve is subjected to definite integral mathematical operation along the frequency coordinate axis, and the distributed energy within the frequency band is accumulated to calculate the high-frequency noise energy.

[0063] To assess the absolute proportion of high-frequency noise in the overall environmental background, a complete integration calculation is performed on the power spectral density of all noise extending from the low-frequency starting point to the high-frequency ending point, thus determining the total energy characterizing the overall energy of the environment.

[0064] The high-frequency noise energy is divided by the total energy, and the resulting ratio is used as the proportion of high-frequency energy. For example, the low-frequency starting point can be set to 20 Hz, the mid-frequency dividing point to 1000 Hz, and the high-frequency ending point to 20000 Hz.

[0065] For example, the high-frequency power spectral density between 1000 Hz and 20000 Hz can be extracted from the noise spectrum and integrated to solve for the high-frequency noise energy. Low-frequency sound waves have longer wavelengths and exhibit strong penetrating power, but they are difficult to excite resonant potentials on the pins of the circuit board. In contrast, high-frequency sound wave energy can penetrate into the control box through the gaps in the casing and generate an acoustic-electric coupling effect with the internal analog traces, thereby inducing destructive high-frequency voltage interference on weak signal transmission lines.

[0066] The high-frequency noise energy is obtained by integration and its ratio to the total energy to determine the proportion of high-frequency energy. This filters out the misleading interference from low-frequency background noise, allowing the proportion of high-frequency energy to better reflect the impact of high-frequency interference that threatens the signal integrity of the programmable controller in the current environment.

[0067] In one embodiment, determining the tremor risk value using a mechanical vibration sequence and the proportion of high-frequency energy includes: using the ratio of the root mean square value of the vibration energy of the mechanical vibration sequence to the reference vibration energy as the energy overflow multiple; performing an exponential calculation on the energy overflow multiple using a natural exponential function to obtain an exponential calculation result; using the reciprocal of the exponential calculation result as the vibration attenuation coefficient; using the difference between a second preset positive number and the vibration attenuation coefficient as the exponential attenuation value; and using the product of the proportion of high-frequency energy and the exponential attenuation value as the tremor risk value; wherein the second preset positive number is greater than the upper limit of the vibration attenuation coefficient.

[0068] The root mean square value of vibration energy over the entire time period is calculated by determining the discrete amplitude observation values ​​in the mechanical vibration sequence. The root mean square value of vibration energy, which represents the severity of the actual physical impact, is divided by the reference vibration energy of the programmable control box within the safe fatigue threshold. The energy overflow factor, which characterizes the actual vibration exceeding the safe limit, is then calculated.

[0069] A natural exponential function is constructed using the base of the natural logarithm, and an exponential operation is performed on the energy overflow factor to obtain the exponential operation result. The reciprocal of the exponential operation result is then used to invert and compress the amplified value to the vibration attenuation coefficient within the range of 0 to 1.

[0070] The exponential decay value is obtained by subtracting the calculated vibration attenuation coefficient from a second preset positive number that is greater than the upper limit theoretical value of the vibration attenuation coefficient. The exponential decay value can represent the degree of physical impact.

[0071] Multiplying the proportion of high-frequency energy, which represents the degree of high-frequency interference, with the exponential decay value, which represents the degree of physical impact, yields a tremor risk value used to characterize the overall level of danger.

[0072] For example, the root mean square value of the vibration energy calculated from the mechanical vibration sequence is 1.5 units of gravitational acceleration, and the reference vibration energy can be equal to 0.3 units of gravitational acceleration. The ratio of the two represents an energy overflow factor of 5.

[0073] When the solder joints of the circuit board inside the programmable control box are subjected to mechanical vibration, the natural exponential function can sensitively amplify the destructive energy exceeding the threshold. After obtaining the reciprocal to get the vibration attenuation coefficient, it can be subtracted from the second preset positive number to convert it into an exponential attenuation value. This means that the more severe the mechanical vibration, the greater the exponential attenuation value obtained.

[0074] In step S103, the channel current sequence of multiple analog channels of the programmable control box is obtained, the relative rate of change of the channel current sequence with respect to the upper limit of its respective range within adjacent time steps is determined, and the largest relative rate of change among all analog channels is taken as the electrical urgency value.

[0075] The programmable controller is equipped with multiple input expansion modules to access sensor feedback signals from various parts of the industrial site. It can acquire the analog-to-digital conversion results flowing in multiple analog channels on the internal bus array of the programmable controller in real time, determine the current monitoring samples that fluctuate with time in each channel, and form multiple channels current sequences.

[0076] Since the external measured physical quantity is in a state of continuous fluctuation, the absolute value of the current jump between two consecutive and adjacent system time steps of the current sequence of each channel is calculated, and the absolute value of the current jump is divided by the upper limit value of the range pre-configured for the channel to obtain the relative change rate that eliminates the inherent dimensional deviation of the channel.

[0077] After calculating the relative change rate of each channel, a global sorting and comparison is performed. The highest relative change rate among all analog channels is taken as the global electrical urgency value. The electrical urgency value reflects the most severe external state changes currently faced by the programmable controller and reflects the current need for the programmable controller to read and process data at a higher frequency.

[0078] In one embodiment, obtaining the channel current sequence of multiple analog channels of a programmable controller includes: continuously monitoring different analog channels of the programmable controller to obtain the channel current sequence of different analog channels; the different analog channels correspond to different external devices controlled by the programmable controller.

[0079] The low-level driver interface inside the programmable controller can be activated to continuously monitor the data buffer of different analog channels configured in the programmable controller. The discrete digital conversion results on the time series of different analog channels can be recombined and spliced ​​to obtain the channel current sequence corresponding to the complete change trajectory of each channel.

[0080] Different analog channels are connected to different external devices via different cables. For example, the first analog channel can be connected to a pressure sensor for monitoring water pressure, and the second analog channel can be connected to a pipeline flow meter.

[0081] Different types of external devices have different upper limits for the range of feedback current signals. For example, the upper limit of the range of feedback current signals of a water pressure sensor may be 20 mA, while the upper limit of the range of feedback current signals of a flow meter may be 10 mA. The specific range can be determined in advance according to the parameters of the device controlled by the programmable controller box. This application will not elaborate on this aspect in the embodiments.

[0082] The core task of industrial field control is to respond to the status of external equipment. When a continuous channel current sequence is acquired, it can capture the dynamic evolution trend of the equipment status and determine the relative rate of change based on the upper limit of each corresponding range. It can evaluate the changes of different equipment through a unified relative rate of change.

[0083] By using the largest relative rate of change in all channels as the electrical urgency value, the programmable control box can respond to more critical equipment as quickly as possible, thus improving the control system's response priority to sudden physical events.

[0084] In step S104, a gain adjustment term is determined based on the vibration risk level, a suppression adjustment term is determined based on the electrical urgency level, and a boundary compensation term is determined based on the thermodynamic characteristic index. The reference scan cycle is then adjusted based on the gain adjustment term, the suppression adjustment term, and the boundary compensation term to obtain the target scan cycle, so as to control the PLC to operate according to the target scan cycle.

[0085] By using the flutter risk value, which represents the degree of threat from external acoustic and vibration interference, a gain adjustment term for extending the scan cycle can be calculated; by using the electrical urgency value, which represents the demand for drastic fluctuations in the state of external controlled equipment, a suppression adjustment term for reducing the scan cycle can be calculated; and by using the thermodynamic characteristic index, which represents the degree of internal heat accumulation in the programmable control box, a boundary compensation term can be calculated.

[0086] The reference scan cycle refers to the standard time quota consumed by the programmable controller to complete one full cycle under ideal working conditions. By comprehensively calculating the gain adjustment term, suppression adjustment term, and boundary compensation term, the original fixed reference scan cycle is dynamically scaled and adjusted to obtain the target scan cycle that conforms to the characteristics of the current comprehensive working conditions.

[0087] By overwriting the target scan cycle into the system timer configuration register, the PLC's scheduling kernel can be controlled to run according to the target scan cycle and execute instructions in a pipelined manner.

[0088] In one embodiment, the gain adjustment term and the suppression adjustment term are determined as follows: multiplying the tremor risk value by a preset tremor sensitivity coefficient to obtain a first adjustment factor, performing a hyperbolic tangent operation on the first adjustment factor to obtain a first mapping value, and adding a third preset positive number to the first mapping value to obtain a gain adjustment term; multiplying the electrical urgency value by a preset urgency sensitivity coefficient to obtain a second adjustment factor, performing a hyperbolic tangent operation on the second adjustment factor to obtain a second mapping value, and adding a third preset positive number to the second mapping value to obtain a suppression adjustment term.

[0089] Determine the tremor risk value, multiply the tremor risk value with a preset tremor sensitivity coefficient that reflects the system's tolerance threshold to environmental disturbances, and output the first adjustment factor; use the hyperbolic tangent function to perform a nonlinear mapping on the first adjustment factor, constrain the value within a specific bounded interval, and thus obtain a smooth first mapping value.

[0090] The gain adjustment term is obtained by adding the third preset positive number, which is always greater than zero, to the first mapping value; the electrical urgency value is determined, and the electrical urgency value is multiplied by the urgency sensitivity coefficient to obtain the second adjustment factor.

[0091] The second adjustment factor is subjected to hyperbolic tangent operation to suppress extreme large values ​​to obtain the second mapping value, and the third preset positive number is added to the second mapping value to obtain the suppression adjustment term. In actual system deployment, the preset tremor sensitivity coefficient can be set to 0.4, and the third preset positive number can be set to 1, for example, or it can be pre-calibrated according to the actual situation. The process of pre-calibrating the preset value in this application embodiment will not be described in detail.

[0092] Sudden environmental changes and electrical signal spikes in industrial settings have extreme transient peak characteristics. If the linear product result is used directly to adjust the scanning cycle, it can easily cause violent oscillations in the system control cycle or even cause the scheduler to crash. The hyperbolic tangent function has saturation characteristics and can maintain good response sensitivity when the input factor is small, converging the first mapping value of the mapping output to the constant boundary.

[0093] By adding the third preset positive number to the first and second mapping values ​​to determine the gain adjustment term and the suppression adjustment term, the ability to adapt to minor environmental changes is preserved.

[0094] In one embodiment, determining the boundary compensation term based on thermodynamic characteristic indicators includes: adding the thermodynamic characteristic indicators to a preset anti-overflow constant and taking the reciprocal to obtain a degradation compensation base; normalizing the degradation compensation base using the natural logarithm; and determining the boundary compensation term using the result of the natural logarithm normalization.

[0095] Determine the thermodynamic characteristic index that represents the degree of good internal heat dissipation. To prevent the thermodynamic characteristic index from approaching zero at extreme low temperatures and causing calculation abnormalities in division operations, a very small preset anti-overflow constant can be added in advance.

[0096] A natural logarithm normalization algorithm is initiated for the degradation compensation base, which is compressed using the smooth function growth curve of the natural logarithm, and the result of the natural logarithm normalization is used as the boundary compensation term.

[0097] When the programmable controller box faces severe heat accumulation, if the influx of external high-frequency acquisition tasks is not restricted, the central processing unit will continue to operate at full load and high speed, which may burn out the hardware structure. The reciprocal operation causes the degradation compensation base to show a steep upward trend in the high temperature range. Natural logarithmic normalization can significantly improve the value of the term to attract the attention of the system, while avoiding excessive expansion that interferes with the normal control term ratio weight.

[0098] The boundary compensation term is determined by normalizing the natural logarithm. The boundary compensation term can limit the adjustment range and ensure that the programmable controller has a heat dissipation time window when operating under high intensity and full load. The value of the boundary compensation term is greater than or equal to 1, and the smaller the thermodynamic characteristic index, the greater the impact on the internal heat dissipation of the PLC. The larger the value of the boundary compensation term, the longer the scan cycle of the PLC can be extended.

[0099] In one embodiment, the target scan period is determined by using the ratio of the gain adjustment term to the suppression adjustment term as the risk adjustment coefficient, and the product of the risk adjustment coefficient, the boundary compensation term, and the baseline scan period as the target scan period.

[0100] After completing the calculations for each dimension, the gain adjustment term is used as the numerator and the suppression adjustment term is used as the denominator. The ratio is used to make the two terms engage in a positive and negative adversarial game in the mathematical formula, and the result of the ratio calculation is established as the risk adjustment coefficient.

[0101] The target scanning period is obtained by multiplying the risk adjustment coefficient, the boundary compensation term, and the baseline scanning period together.

[0102] For example, if the baseline scan period is set to 10 milliseconds, the determined gain adjustment term is 1.5, the suppression adjustment term is 1, and the ratio of the gain adjustment term to the suppression adjustment term, i.e., the risk adjustment coefficient, is 1.5; the boundary compensation term is kept at 1.

[0103] Calculating the target scan period by multiplying the risk adjustment coefficient, boundary compensation term, and baseline scan period can fully leverage the scaling effect of each dimension adjustment term.

[0104] When the risk adjustment coefficient is greater than 1, it indicates that the harsh acoustic and vibration environment forces the system to slow down its processing pace in order to obtain more data error correction redundancy and filter high-frequency glitches. The target scan period is obtained by multiplying the three multipliers together. For example, the fixed 10-millisecond period can be adaptively extended to 15 milliseconds. This allows the programmable control box to adapt to processing needs when facing complex working conditions, and the central processing unit resources are allocated to a state that is more in line with the actual situation.

[0105] Figure 2 This is a schematic diagram of the scanning cycle adjustment results in the embodiments of this application, as shown below. Figure 2 As shown, by adjusting the scanning cycle of the PLC through the embodiments of this application, compared with the PLC working according to a fixed scanning cycle, the actual working conditions of the PLC can be matched with the scanning cycle, thereby improving the adaptability of the PLC when working.

[0106] In one embodiment, the value of the target scan cycle can be dynamically embedded into the end of the data bits of the communication message sent from the master station of the programmable control box to each slave device, so as to control each slave device to parse the value of the target scan cycle carried in the communication message; based on the parsed value of the target scan cycle, the slave device rewrites the waiting time register parameter of the electronic watchdog in the communication chip in real time.

[0107] After the main control processor calculates the new target scanning cycle, in order to ensure the timing synchronization of the overall distributed control network, the main control processor can dynamically insert the specific value of the target scanning cycle into the end area of ​​the data bits of the communication message when constructing the next round of communication messages to be sent to the slave devices.

[0108] Communication messages with periodic change notification instructions are broadcast to all slave devices via the fieldbus. After receiving the frame data, each slave device calls the message parsing program to extract and parse the value of the target scan period carried in the communication message.

[0109] Based on the parsed target scan cycle value, the slave device rewrites the wait time register parameters of the electronic watchdog in the communication chip, which is responsible for monitoring the communication heartbeat survival status.

[0110] For example, the master station originally polled for communication at 10 milliseconds, and the electronic watchdog timer register parameter of each slave station device was set to 25 milliseconds. When the programmable controller extends the target scan cycle to 30 milliseconds, it dynamically inserts the value of the target scan cycle into the end of the data bits of the communication message.

[0111] Since the master station takes 30 milliseconds to process one round of tasks, which exceeds the slave station's set 25 milliseconds, if this parameter is not dynamically adjusted, the slave devices may collectively misjudge that the master station has crashed and automatically cut off the power to the field actuators, causing the entire line to fail.

[0112] By controlling each slave device to parse and rewrite the waiting time register parameters of the electronic watchdog in real time, the time scale of the communication connection timeout judgment standard between the master station and each slave node is unified, and the timing fault-tolerant collaborative control in the context of dynamic frequency modulation is realized.

[0113] In one embodiment, the digital sampling frequency of the current period can be determined based on the value of the target scanning period, and the maximum Shannon sampling bandwidth value that is synchronously matched with the target scanning period can be determined based on the digital sampling frequency. The maximum Shannon sampling bandwidth value is converted into a resistor adjustment value instruction for matching the corresponding bandwidth, and the resistor adjustment value instruction is output to control the adjustable analog low-pass filter at the front end of the analog input module to lower the corresponding hardware pre-cutoff frequency.

[0114] After establishing the target scanning period, the programmable controller uses the reciprocal of the target scanning period as the digital sampling frequency for initiating data acquisition of external analog signals. According to Shannon's sampling theorem in the field of digital signal processing, the highest frequency component of the analog signal that can be recovered without distortion is less than or equal to half of the digital sampling frequency.

[0115] Based on the calculated digital sampling frequency, the maximum Shannon sampling bandwidth value that is synchronously matched with the target scanning cycle is determined, and the maximum Shannon sampling bandwidth value representing the theoretical anti-aliasing boundary is determined, which is then converted into a resistor adjustment command for matching the corresponding bandwidth.

[0116] The programmable controller outputs a resistance adjustment command to the analog input module to directly control the adjustable analog low-pass filter embedded in the front end of the analog input module. By sending digital pulses, the input resistance value of the feedback network inside the adjustable analog low-pass filter is changed, thereby lowering the corresponding hardware pre-cutoff frequency.

[0117] For example, if the baseline scan period is 10 milliseconds, the digital sampling frequency is 100 Hz, and the maximum Shannon sampling bandwidth determined by Shannon's law is 50 Hz; when the target scan period is compressed to 5 milliseconds, the number of samples per second increases to 200, and the digital sampling frequency jumps to 200 Hz.

[0118] The maximum Shannon sampling bandwidth value, which is determined to be synchronized with the target scanning cycle, has been increased to 100 Hz. The maximum Shannon sampling bandwidth value is converted into a resistor adjustment command, which dynamically controls the adjustable analog low-pass filter at the front end of the analog input module to lower the corresponding hardware cutoff frequency, so that the frequency selection channel width of the hardware signal conditioning circuit can match the data processing capability of the software kernel.

[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only.

[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A PLC intelligent dynamic control method for a programmable controller box, characterized in that, include: The temperature matrix of the circuit board of the programmable control box is obtained, and the thermodynamic characteristic index is determined by the attenuation calculation based on the difference between the measured temperature and the reference operating temperature in the temperature matrix. Thermodynamic characteristics are used to characterize the heat dissipation performance of a circuit board. Obtain the noise spectrum and mechanical vibration sequence of the environment, determine the proportion of high-frequency energy in the high-frequency noise spectrum, and use the mechanical vibration sequence and the proportion of high-frequency energy to determine the vibration risk value; Obtain the channel current sequence of multiple analog channels of the programmable controller box, determine the relative rate of change of the channel current sequence with respect to the upper limit of their respective ranges within adjacent time steps, and take the largest relative rate of change among all analog channels as the electrical urgency value. The gain adjustment term is determined based on the vibration risk level, the suppression adjustment term is determined based on the electrical urgency level, and the boundary compensation term is determined based on the thermodynamic characteristic index. The reference scan cycle is then adjusted based on the gain adjustment term, the suppression adjustment term, and the boundary compensation term to obtain the target scan cycle, so as to control the PLC to operate according to the target scan cycle.

2. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, Thermodynamic characteristic indices are determined by attenuation calculations based on the difference between the measured temperature and the reference operating temperature in the temperature matrix, including: For any target location point in the temperature matrix, determine the squared value of the measured temperature of the target location point in the temperature matrix and the squared value of the reference operating temperature. The average value of the squared differences corresponding to all location points is taken as the average temperature deviation rate. The average temperature deviation rate is compared with the square of the reference operating temperature, and the sum of the ratio and the first preset positive number is used as the attenuation base. The natural logarithm of the attenuation base is used to obtain the logarithmic accumulation value, and the reciprocal of the logarithmic accumulation value is used as the thermodynamic characteristic index.

3. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, Determine the proportion of high-frequency energy in the noise spectrum, including: The preset low-frequency starting point, mid-frequency boundary point, and high-frequency ending point are determined from the noise spectrum. The high-frequency power spectral density between the mid-frequency boundary point and the high-frequency ending point is extracted from the noise spectrum. The high-frequency noise energy is obtained by integrating the high-frequency power spectral density. The total energy is determined by integrating the power spectral density of all noise from the low-frequency start point to the high-frequency end point. The ratio of high-frequency noise energy to total energy is taken as the high-frequency energy percentage.

4. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, The tremor risk level is determined using mechanical vibration sequences and the proportion of high-frequency energy, including: The ratio of the root mean square value of the vibration energy of the mechanical vibration sequence to the reference vibration energy is used as the energy overflow factor. The natural exponential function is used to calculate the energy overflow factor to obtain the exponential calculation result. The reciprocal of the exponential calculation result is used as the vibration attenuation coefficient. The difference between the second preset positive number and the vibration attenuation coefficient is used as the exponential attenuation value, and the product of the high-frequency energy ratio and the exponential attenuation value is used as the tremor risk value; the second preset positive number is greater than the upper limit of the vibration attenuation coefficient.

5. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, Obtain the channel current sequence of multiple analog channels of the programmable controller box, including: The different analog channels of the programmable controller are continuously monitored to obtain the channel current sequence of each analog channel; each analog channel corresponds to a different external device controlled by the programmable controller.

6. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, The gain adjustment term and the suppression adjustment term are determined in the following way: The tremor risk value is multiplied by the preset tremor sensitivity coefficient to obtain the first adjustment factor, and the first adjustment factor is subjected to hyperbolic tangent operation to obtain the first mapping value. The third preset positive number is added to the first mapping value to obtain the gain adjustment term. The electrical urgency value is multiplied by a preset urgency sensitivity coefficient to obtain a second adjustment factor, and a hyperbolic tangent operation is performed on the second adjustment factor to obtain a second mapping value. A third preset positive number is added to the second mapping value to obtain a suppression adjustment term.

7. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, The boundary compensation term is determined based on thermodynamic characteristic parameters, including: The degradation compensation base is obtained by adding the thermodynamic characteristic index to the preset anti-overflow constant and taking the reciprocal. The degradation compensation base is then normalized by the natural logarithm, and the boundary compensation term is determined using the result of the natural logarithm normalization.

8. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, The target scanning cycle is determined in the following way: The ratio of the gain adjustment term to the suppression adjustment term is used as the risk adjustment coefficient, and the product of the risk adjustment coefficient, the boundary compensation term, and the baseline scan period is used as the target scan period.

9. The PLC intelligent dynamic control method for a programmable controller box according to claim 1, characterized in that, Obtain the noise spectrum and mechanical vibration sequence of the environment, including: The ambient audio signal received at the outer shell of the programmable control box is acquired, and the uniaxial dynamic deformation data of the outer shell surface of the programmable control box is obtained. Time-domain truncation processing is performed on environmental audio signals and single-axis dynamic deformation data to obtain target audio signals and target deformation data within the same sampling time period. The target audio signal is converted to the frequency domain to obtain the noise spectrum, and the distribution of the target deformation data along the time axis is combined to determine the mechanical vibration sequence.

10. The PLC intelligent dynamic control method for a programmable controller box according to claim 9, characterized in that, Time-domain truncation processing is performed on the environmental audio signal and single-axis dynamic deformation data to obtain the target audio signal and target deformation data within the same sampling time period, including: Obtain the first time-series timestamp corresponding to the environmental audio signal and the second time-series timestamp corresponding to the single-axis dynamic deformation data. Compare the first time-series timestamp and the second time-series timestamp and extract the target intersection interval where the first time-series timestamp and the second time-series timestamp overlap. The data segment of the ambient audio signal within the target intersection interval is extracted as the target audio signal, and the data segment of the single-axis dynamic deformation data within the target intersection interval is extracted as the target deformation data.