Current measurement system and method applied to PLC motion control system
By building a current signal analysis model in the PLC motion control system and performing real-time data processing, the problem of insufficient accuracy and response speed of existing current measurement methods is solved, and accurate measurement and timely feedback of the system current are achieved.
Patent Information
- Application Number
- CN202510100925.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing current measurement methods are not very accurate in PLC motion control systems and have a slow response speed, making it difficult to meet the requirements of high-precision current monitoring.
By collecting the current measurement sample data of the PLC motion control system, the current signal analysis model is constructed, and the real-time current signal data is preprocessed and real-time analysis is performed to generate accurate real-time current value data, and the measurement quality is ensured through comprehensive analysis in multiple aspects.
It realizes accurate measurement and timely feedback of the current of the PLC motion control system, improves measurement accuracy and response speed, and meets the requirements of high-precision current monitoring.
Smart Images

Figure CN119511932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of current measurement, and in particular to a current measurement system and method applied to a PLC motion control system. Background Art
[0002] In PLC (Programmable Logic Controller) motion control systems, accurate measurement of the current of actuators such as motors is crucial for system operation status monitoring, fault diagnosis, and control strategy optimization. However, existing current measurement methods often have problems such as low measurement accuracy and slow response speed, which makes it difficult to meet the requirements of high-precision current monitoring required by current PLC motion control systems.
[0003] The Chinese invention patent with publication number CN116735942B introduces a measurement system and method for low-frequency current on the rotor side of a variable-speed generator motor. The secondary-side current information of the current transformer module is accurately obtained, and the local peak detection method is used to analyze the secondary-side current information to determine the envelope curve therein and obtain the secondary-side current envelope curve. Finally, the secondary-side current envelope curve is processed by a Fourier transform algorithm to obtain the primary-side current information of the current transformer module, determine the low-frequency current on the rotor side of the variable-speed generator motor, and improve the accuracy of the measurement results of the low-frequency current on the rotor side of the variable-speed generator motor. However, in the process of obtaining the primary-side current information, it is impossible to conduct a comprehensive analysis of the acquired data in many aspects, and it is difficult to ensure the quality and accuracy of the current measurement operation. Summary of the invention
[0004] In order to solve the deficiencies in the background technology, the present invention provides a current measurement system and method applied to a PLC motion control system, so as to achieve accurate measurement and timely feedback of the current of the PLC motion control system.
[0005] A current measurement method applied to a PLC motion control system comprises the following steps: S1, collect current measurement sample data of PLC motion control system; S2. constructing a current signal analysis model based on the current measurement sample data of the PLC motion control system; S3, collect real-time current signal data of PLC motion control system; S4, performing data preprocessing on the real-time current signal data of the PLC motion control system to generate standard real-time current signal data of the PLC motion control system; S5, performing real-time current signal analysis and processing according to the current signal analysis model and the real-time current signal data of the standard PLC motion control system to generate real-time current value data of the first PLC motion control system; S6, generating real-time current value data of a second PLC motion control system by performing real-time current value data measurement processing on the real-time current signal data of the standard PLC motion control system; S7. Construct standard PLC motion control system real-time current value data based on the first PLC motion control system real-time current value data and the second PLC motion control system real-time current value data, and push it to the PLC motion control system current measurement platform.
[0006] The present invention constructs a current signal analysis model through the collected current measurement sample data of the PLC motion control system, and performs data preprocessing on the collected real-time current signal data of the PLC motion control system to generate standard real-time current signal data of the PLC motion control system, performs real-time current signal analysis processing on the current signal analysis model and the standard real-time current signal data of the PLC motion control system to generate first real-time current value data of the PLC motion control system, and then performs real-time current value data metering processing on the real-time current signal data of the PLC motion control system to generate second real-time current value data of the PLC motion control system, constructs standard real-time current value data of the PLC motion control system based on the real-time current value data of the first PLC motion control system and the real-time current value data of the second PLC motion control system, and pushes the real-time current value data of the PLC motion control system to the current measurement platform of the PLC motion control system, so as to realize accurate measurement and timely feedback of the current of the PLC motion control system.
[0007] Preferably, the specific steps of collecting current measurement sample data of the PLC motion control system are as follows: S11, collect the current measurement sample data of the target PLC motion control system online through the current data management platform, and obtain the current measurement sample data set A={a1, a2, …, a i ,…,a k}, where a i represents the i-th current measurement sample data of the target PLC motion control system collected through the current data management platform, k represents the total number of current measurement sample data of the PLC motion control system, and the current measurement sample data includes current signal data and corresponding current value data.
[0008] Preferably, the specific steps of constructing a current signal analysis model based on the current measurement sample data of the PLC motion control system are as follows: S21, using the PLC motion control system current measurement sample data set as a sample data set; S22, constructing an initial SVM model, setting the penalty factor parameter to α and the radial basis kernel parameter to β; and setting the kernel function used by the initial SVM model to a Gaussian radial basis kernel function; the Gaussian radial basis kernel function formula is as follows: , Where K(x,y) represents the Gaussian radial basis kernel function, x and y represent the support vectors corresponding to any two sample data, and ||xy|| represents the Euclidean distance between vector x and vector y. S23, setting a training data ratio and a test data ratio, and dividing the sample data set according to the training data ratio and the test data ratio to obtain a training sample data set and a test sample data set; S24, setting a training error threshold and a maximum number of training times, inputting the training sample data in the training sample data set into the initial SVM model for training operation, if the training error of the initial SVM model is less than the training error threshold or the number of training times of the initial SVM model is greater than the maximum number of training times, then ending the training operation of the initial SVM model to obtain a trained SVM model; otherwise, continuing the training operation of the initial SVM model; S25, evenly dividing the test sample data set to obtain a first test sample data set and a second test sample data set; S26, setting a test accuracy threshold, inputting the first test sample data set and the second test sample data set into the trained SVM model for testing, respectively calculating the accuracy of the test results, generating a first test accuracy and a second test accuracy, using a mean formula to perform average numerical measurement processing on the first test accuracy and the second test accuracy, and obtaining a final test accuracy. When the final test accuracy is greater than or equal to the test accuracy threshold, the trained SVM model is used as a current signal analysis model; otherwise, returning to S22, and performing parameter tuning on the initial SVM model using a butterfly optimization algorithm; The parameter tuning of the initial SVM model by the butterfly optimization algorithm comprises the following steps: S261, construct parameter search butterfly population, set parameter search butterfly population size to N, switch probability to β, current iteration number to t, maximum iteration number to t max , the dimension of the SVM model parameter search space is P; The parameter setting range of the initial SVM model is used as the parameter data search space, N groups of SVM model parameters are randomly generated in the SVM model parameter search space, each group of SVM model parameters corresponds to a parameter search butterfly individual in the parameter search butterfly population, and the initial position set of the parameter search butterfly population is initialized as X={X1,X2,……,X i ,…,X N}, where X irepresents the initial position of the i-th parameter search butterfly individual in the parameter search butterfly population; S262, calculating the stimulus intensity value of each parameter search butterfly individual in the parameter search butterfly population, arranging each parameter search butterfly individual in the parameter search butterfly population from large to small according to the stimulus intensity value, and selecting the parameter search butterfly individual with the highest stimulus intensity value as the current optimal individual; the stimulus intensity value calculation formula is as follows: , Among them, I i represents the stimulus intensity value of the ith parameter-searching butterfly in the parameter-searching butterfly population, x i It represents the final test accuracy of the model obtained after the parameter tuning of the initial SVM model and the training operation by using the parameter data corresponding to the i-th parameter search butterfly individual in the parameter search butterfly population. Indicates the correction value; S263, when each parameter search butterfly individual in the butterfly population forages in the SVM model parameter search space, it will emit a fragrance to attract other parameter search butterfly individuals; the fragrance intensity calculation formula is as follows: , Among them, f i represents the fragrance intensity of the i-th parameter search butterfly individual in the parameter search butterfly population, α represents a random number between (0,1), and q t It represents the sensory factor of each parameter-searching butterfly individual in the parameter-searching butterfly population during the t-th iteration. The update formula of the sensory factor is as follows: , Among them, q t+1 It represents the sensory factor of each parameter-searching butterfly individual in the parameter-searching butterfly population during the t+1th iteration; S264, setting a control coefficient R for each parameter search butterfly individual in the parameter search butterfly population i , the control coefficient R i Represents a random number that is uniformly distributed between [0,1]; When the control coefficient R i When the switching probability is less than or equal to β, the i-th parameter search butterfly individual will move in the direction of the current optimal individual in the SVM model parameter search space to update its position; the position update formula is as follows: , in, and They represent the position of the i-th parameter search butterfly individual in the parameter search butterfly population after and before the position update, respectively, and X best represents the position of the current optimal individual, and rand1 represents a random number that is uniformly distributed between [0,1]; When the control coefficient R i When the switching probability is greater than β, the i-th parameter search butterfly individual will update its position by random walking in the SVM model parameter search space; the position update formula is as follows: , in, and They represent the positions of the jth parameter search butterfly individual and the zth parameter search butterfly individual randomly selected from the parameter search butterfly population during the tth iteration of the ith parameter search butterfly individual, respectively. rand2 represents a random number uniformly distributed between [0,1]. S265, calculating the stimulus intensity value after the position of each parameter search butterfly individual in the parameter search butterfly population is updated, if the fitness function value after the position of the parameter search butterfly individual is updated is greater than the original fitness function value, then the new position is used to replace the original position; otherwise, the original position is retained; Rearrange the parameter-searching butterfly individuals in the parameter-searching butterfly population from large to small according to the stimulus intensity value, and select the parameter-searching butterfly individual with the highest stimulus intensity value as the new current optimal individual; S266: Determine whether the current number of iterations t is less than the maximum number of iterations t max , if the current number of iterations t is less than the maximum number of iterations t max , the current number of iterations t is increased by 1, and the process returns to S263; otherwise, the current optimal individual is taken as the global optimal solution, the SVM model parameters corresponding to the global optimal solution are output as the optimal parameters, and the parameters of the initial SVM model are set as the optimal parameters.
[0009] The initial SVM model is trained and tested based on the current measurement sample data of the PLC motion control system, and a current signal analysis model is constructed to provide an accurate and reliable tool for the analysis of the current signal data, thereby realizing the scientific analysis of the current signal data and improving the speed and efficiency of the current measurement of the PLC motion control system. The initial SVM model is parameter-tuned by the butterfly optimization algorithm, and the optimal parameters that meet the current situation are accurately searched within the parameter setting range of the initial SVM model. The initial SVM model is parameter-tuned based on the optimal parameters, thereby improving the speed and efficiency of the training model and ensuring the quality of the current signal analysis operation performed by the acquired current signal analysis model.
[0010] Preferably, the specific steps of collecting real-time current signal data of the PLC motion control system are as follows: S31. The current signal between any two components during the operation of the PLC motion control system is collected in real time by a current sensor to obtain real-time current signal data C of the PLC motion control system.
[0011] Preferably, the specific steps of performing data preprocessing on the real-time current signal data of the PLC motion control system to generate the real-time current signal data of the standard PLC motion control system are as follows: S41, using a weighted mean filtering method to perform data noise reduction processing on the real-time current signal data C of the PLC motion control system to generate standard PLC motion control system real-time current signal data ; The data denoising process is as follows: S411, constructing a sliding filter window, and aligning the center position of the sliding filter window with each data point in the real-time current signal data of the PLC motion control system in sequence; S412, calculating the weight coefficient of each data point in the sliding filter window by a weighted kernel function formula; the weighted kernel function formula is as follows: , Among them, w i represents the weight coefficient of data point i, d i represents the Euclidean distance from the data point i to the center of the sliding filter window after Gaussian weighting, and ε represents the smoothing parameter of the weighted kernel function; S413, calculating the weighted average value of all data points in the sliding filter window, and using the weighted average value as the output value of the center position of the sliding filter window after data noise reduction processing; the weighted average value calculation formula is as follows: , Wherein, h represents the weighted average of all data points in the sliding filter window, and f i Represents the signal value at data point i.
[0012] The weighted mean filtering method is used to perform data noise reduction processing on the real-time current signal data of the PLC motion control system, so as to effectively remove the noise data in the real-time current signal data of the PLC motion control system, so that the acquired data can better reflect the characteristics of the current signal.
[0013] Preferably, the specific steps of performing real-time current signal analysis and processing according to the current signal analysis model and the real-time current signal data of the standard PLC motion control system to generate the real-time current value data of the first PLC motion control system are as follows: S51, the real-time current signal data of the standard PLC motion control system The current signal is input into the current signal analysis model for real-time current signal analysis and processing to generate real-time current value data D of the first PLC motion control system.
[0014] Preferably, the specific steps of generating the real-time current value data of the second PLC motion control system by performing real-time current value data measurement processing on the real-time current signal data of the standard PLC motion control system are as follows: S61, converting the real-time current signal of the standard PLC motion control system into Convert it into voltage signal, amplify it and generate real-time voltage signal data of standard PLC motion control system; S62, converting the real-time voltage signal data of the standard PLC motion control system into a digital signal through an A / D converter and performing real-time current value data measurement processing to generate a second PLC motion control system real-time current value data The A / D converter includes but is not limited to one of an integral A / D converter, a successive approximation A / D converter, a parallel comparison A / D converter and a serial comparison A / D converter; the real-time current value data measurement processing process is as follows: , Wherein, V represents the actual voltage value received by the selected A / D converter, λ represents the digital signal quantity obtained after the real-time voltage signal data of the standard PLC motion control system is converted by the selected A / D converter, and m and They respectively represent the number of bits and reference voltage value of the selected A / D converter, η represents the conversion ratio, and ν represents the amplification factor.
[0015] By converting, amplifying, reconverting and performing data measurement processing on the real-time current signal data of the standard PLC motion control system, the real-time current value data of the second PLC motion control system can be accurately obtained.
[0016] Preferably, the specific steps of constructing standard PLC motion control system real-time current value data based on the first PLC motion control system real-time current value data and the second PLC motion control system real-time current value data, and pushing it to the PLC motion control system current measurement platform are as follows: S71, using the mean formula to calculate the real-time current value data D of the first PLC motion control system and the real-time current value data D of the second PLC motion control system. Perform average numerical measurement processing to obtain real-time current value data of standard PLC motion control system ; S72, transmitting the real-time current value data of the standard PLC motion control system through a wireless communication network The data is pushed to the PLC motion control system current measurement platform and displayed on the display screen.
[0017] The mean formula is used to comprehensively analyze the real-time current value data of the first PLC motion control system and the real-time current value data of the second PLC motion control system, and the real-time current value data of the standard PLC motion control system is scientifically constructed to achieve accurate measurement of the current of the PLC motion control system.
[0018] The present invention also includes a current measurement system applied to a PLC motion control system, including a current measurement sample data acquisition module, a current signal analysis model construction module, a real-time current signal data acquisition module, a real-time current signal data preprocessing module, a real-time current signal data analysis module, a real-time current signal data calculation module, and a standard real-time current value data construction module; The current measurement sample data acquisition module acquires the current measurement sample data of the target PLC motion control system online through the current data management platform to obtain the current measurement sample data of the PLC motion control system; The current signal analysis model building module trains and tests the initial SVM model using the current measurement sample data of the PLC motion control system to build a current signal analysis model; The real-time current signal data acquisition module acquires the real-time current signal of the PLC motion control system during operation through the current sensor to obtain the real-time current signal data of the PLC motion control system; The real-time current signal data preprocessing module uses a weighted mean filtering method to perform data noise reduction processing on the real-time current signal data of the PLC motion control system to generate standard PLC motion control system real-time current signal data; The real-time current signal data analysis module generates the real-time current value data of the first PLC motion control system by inputting the real-time current signal data of the standard PLC motion control system into the current signal analysis model to perform real-time current signal analysis processing; The real-time current signal data calculation module generates the real-time voltage signal data of the standard PLC motion control system by converting the real-time current signal data of the standard PLC motion control system into a voltage signal and performing amplification processing, and selects a suitable A / D converter to convert the real-time voltage signal data of the standard PLC motion control system into a digital signal and performs data measurement processing to generate the real-time current value data of the second PLC motion control system; The standard real-time current value data construction module uses a mean formula to perform average numerical measurement processing on the real-time current value data of the first PLC motion control system and the real-time current value data of the second PLC motion control system to obtain standard PLC motion control system real-time current value data, which is pushed to the PLC motion control system current measurement platform through a wireless communication network and displayed on a display screen.
[0019] Beneficial Effects 1. The present invention constructs a current signal analysis model through the collected current measurement sample data of the PLC motion control system, and performs data preprocessing on the collected real-time current signal data of the PLC motion control system to generate standard real-time current signal data of the PLC motion control system, performs real-time current signal analysis processing on the current signal analysis model and the real-time current signal data of the standard PLC motion control system to generate first real-time current value data of the PLC motion control system, and then performs real-time current value data metering processing on the real-time current signal data of the PLC motion control system to generate second real-time current value data of the PLC motion control system, constructs standard real-time current value data of the PLC motion control system based on the real-time current value data of the first PLC motion control system and the real-time current value data of the second PLC motion control system, and pushes it to the current measurement platform of the PLC motion control system, so as to realize accurate measurement and timely feedback of the current of the PLC motion control system; 2. Based on the current measurement sample data of the PLC motion control system, the initial SVM model is trained and tested to construct a current signal analysis model, which provides an accurate and reliable tool for the analysis of current signal data, realizes scientific analysis of current signal data, and improves the speed and efficiency of current measurement of the PLC motion control system; 3. The initial SVM model is tuned by the butterfly optimization algorithm, and the optimal parameters that meet the current situation are accurately searched from the parameter setting range of the initial SVM model. The initial SVM model is tuned based on the optimal parameters, which improves the speed and efficiency of the training model and ensures the quality of the current signal analysis operation performed by the acquired current signal analysis model; 4. By converting, amplifying, reconverting and data metering the real-time current signal data of the standard PLC motion control system, the real-time current value data of the second PLC motion control system is accurately obtained, and a comprehensive analysis is performed with the real-time current value data of the first PLC motion control system to scientifically construct the real-time current value data of the standard PLC motion control system, thereby realizing accurate measurement of the current of the PLC motion control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0021] Figure 1 A flow chart of a current measurement method applied to a PLC motion control system provided by the present invention; Figure 2 A module schematic diagram of a current measurement system applied to a PLC motion control system provided by the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0024] Embodiment 1 is as follows: See also Figure 1 , a current measurement method applied to a PLC motion control system, comprising the following steps: S1, collect current measurement sample data of PLC motion control system; S11, collect the current measurement sample data of the target PLC motion control system online through the current data management platform, and obtain the current measurement sample data set A={a1, a2, …, a i ,…,a k}, where a i represents the i-th current measurement sample data of the target PLC motion control system collected through the current data management platform, k represents the total number of current measurement sample data of the PLC motion control system, and the current measurement sample data includes current signal data and corresponding current value data.
[0025] S2. constructing a current signal analysis model based on the current measurement sample data of the PLC motion control system; S21, using the PLC motion control system current measurement sample data set as a sample data set; S22, constructing an initial SVM model, setting the penalty factor parameter to α and the radial basis kernel parameter to β; and setting the kernel function used by the initial SVM model to a Gaussian radial basis kernel function; the Gaussian radial basis kernel function formula is as follows: , Where K(x,y) represents the Gaussian radial basis kernel function, x and y represent the support vectors corresponding to any two sample data, and ||xy|| represents the Euclidean distance between vector x and vector y. S23, setting a training data ratio and a test data ratio, and dividing the sample data set according to the training data ratio and the test data ratio to obtain a training sample data set and a test sample data set; S24, setting a training error threshold and a maximum number of training times, inputting the training sample data in the training sample data set into the initial SVM model for training operation, if the training error of the initial SVM model is less than the training error threshold or the number of training times of the initial SVM model is greater than the maximum number of training times, then ending the training operation of the initial SVM model to obtain a trained SVM model; otherwise, continuing the training operation of the initial SVM model; S25, evenly dividing the test sample data set to obtain a first test sample data set and a second test sample data set; S26, setting a test accuracy threshold, inputting the first test sample data set and the second test sample data set into the trained SVM model for testing, respectively calculating the accuracy of the test results, generating a first test accuracy and a second test accuracy, using a mean formula to perform average numerical measurement processing on the first test accuracy and the second test accuracy, and obtaining a final test accuracy. When the final test accuracy is greater than or equal to the test accuracy threshold, the trained SVM model is used as a current signal analysis model; otherwise, returning to S22, and performing parameter tuning on the initial SVM model using a butterfly optimization algorithm; The parameter tuning of the initial SVM model by the butterfly optimization algorithm comprises the following steps: S261, construct parameter search butterfly population, set parameter search butterfly population size to N, switch probability to β, current iteration number to t, maximum iteration number to t max , the dimension of the SVM model parameter search space is P; The parameter setting range of the initial SVM model is used as the parameter data search space, N groups of SVM model parameters are randomly generated in the SVM model parameter search space, each group of SVM model parameters corresponds to a parameter search butterfly individual in the parameter search butterfly population, and the initial position set of the parameter search butterfly population is initialized as X={X1,X2,……,X i ,…,X N}, where X i represents the initial position of the i-th parameter search butterfly individual in the parameter search butterfly population; S262, calculating the stimulus intensity value of each parameter search butterfly individual in the parameter search butterfly population, arranging each parameter search butterfly individual in the parameter search butterfly population from large to small according to the stimulus intensity value, and selecting the parameter search butterfly individual with the highest stimulus intensity value as the current optimal individual; the stimulus intensity value calculation formula is as follows: , Among them, I i represents the stimulus intensity value of the ith parameter-searching butterfly in the parameter-searching butterfly population, x i It represents the final test accuracy of the model obtained after the parameter tuning of the initial SVM model and the training operation by using the parameter data corresponding to the i-th parameter search butterfly individual in the parameter search butterfly population. Indicates the correction value; S263, when each parameter search butterfly individual in the butterfly population forages in the SVM model parameter search space, it will emit a fragrance to attract other parameter search butterfly individuals; the fragrance intensity calculation formula is as follows: , Among them, f i represents the fragrance intensity of the i-th parameter search butterfly individual in the parameter search butterfly population, α represents a random number between (0,1), and q t It represents the sensory factor of each parameter-searching butterfly individual in the parameter-searching butterfly population during the t-th iteration. The update formula of the sensory factor is as follows: , Among them, q t+1 It represents the sensory factor of each parameter-searching butterfly individual in the parameter-searching butterfly population during the t+1th iteration; S264, setting a control coefficient R for each parameter search butterfly individual in the parameter search butterfly population i , the control coefficient R i Represents a random number that is uniformly distributed between [0,1]; When the control coefficient R iWhen the switching probability is less than or equal to β, the i-th parameter search butterfly individual will move in the direction of the current optimal individual in the SVM model parameter search space to update its position; the position update formula is as follows: , in, and They represent the position of the i-th parameter search butterfly individual in the parameter search butterfly population after and before the position update, respectively, and X best represents the position of the current optimal individual, and rand1 represents a random number that is uniformly distributed between [0,1]; When the control coefficient R i When the switching probability is greater than β, the i-th parameter search butterfly individual will update its position by random walking in the SVM model parameter search space; the position update formula is as follows: , in, and They represent the positions of the jth parameter search butterfly individual and the zth parameter search butterfly individual randomly selected from the parameter search butterfly population during the tth iteration of the ith parameter search butterfly individual, respectively. rand2 represents a random number uniformly distributed between [0,1]. S265, calculating the stimulus intensity value after the position of each parameter search butterfly individual in the parameter search butterfly population is updated, if the fitness function value after the position of the parameter search butterfly individual is updated is greater than the original fitness function value, then the new position is used to replace the original position; otherwise, the original position is retained; Rearrange the parameter-searching butterfly individuals in the parameter-searching butterfly population from large to small according to the stimulus intensity value, and select the parameter-searching butterfly individual with the highest stimulus intensity value as the new current optimal individual; S266: Determine whether the current number of iterations t is less than the maximum number of iterations t max , if the current number of iterations t is less than the maximum number of iterations t max , the current number of iterations t is increased by 1, and the process returns to S263; otherwise, the current optimal individual is taken as the global optimal solution, the SVM model parameters corresponding to the global optimal solution are output as the optimal parameters, and the parameters of the initial SVM model are set as the optimal parameters.
[0026] S3, collect real-time current signal data of PLC motion control system; S31. The current signal between any two components during the operation of the PLC motion control system is collected in real time by a current sensor to obtain real-time current signal data C of the PLC motion control system.
[0027] S4, performing data preprocessing on the real-time current signal data of the PLC motion control system to generate standard real-time current signal data of the PLC motion control system; S41, using a weighted mean filtering method to perform data noise reduction processing on the real-time current signal data C of the PLC motion control system to generate standard PLC motion control system real-time current signal data ; The data denoising process is as follows: S411, constructing a sliding filter window, and aligning the center position of the sliding filter window with each data point in the real-time current signal data of the PLC motion control system in sequence; S412, calculating the weight coefficient of each data point in the sliding filter window by a weighted kernel function formula; the weighted kernel function formula is as follows: , Among them, w i represents the weight coefficient of data point i, d i represents the Euclidean distance from the data point i to the center of the sliding filter window after Gaussian weighting, and ε represents the smoothing parameter of the weighted kernel function; S413, calculating the weighted average value of all data points in the sliding filter window, and using the weighted average value as the output value of the center position of the sliding filter window after data noise reduction processing; the weighted average value calculation formula is as follows: , Wherein, h represents the weighted average of all data points in the sliding filter window, and f i Represents the signal value at data point i.
[0028] S5, performing real-time current signal analysis and processing according to the current signal analysis model and the real-time current signal data of the standard PLC motion control system to generate real-time current value data of the first PLC motion control system; S51, the real-time current signal data of the standard PLC motion control system The current signal is input into the current signal analysis model for real-time current signal analysis and processing to generate real-time current value data D of the first PLC motion control system.
[0029] S6, generating real-time current value data of a second PLC motion control system by performing real-time current value data measurement processing on the real-time current signal data of the standard PLC motion control system; S61, converting the real-time current signal data of the standard PLC motion control system into Convert it into voltage signal, amplify it and generate real-time voltage signal data of standard PLC motion control system; S62, converting the real-time voltage signal data of the standard PLC motion control system into a digital signal through an A / D converter and performing real-time current value data measurement processing to generate a second PLC motion control system real-time current value data The A / D converter includes but is not limited to one of an integral A / D converter, a successive approximation A / D converter, a parallel comparison A / D converter and a serial comparison A / D converter; the real-time current value data measurement processing process is as follows: , Wherein, V represents the actual voltage value received by the selected A / D converter, λ represents the digital signal quantity obtained after the real-time voltage signal data of the standard PLC motion control system is converted by the selected A / D converter, and m and They respectively represent the number of bits and reference voltage value of the selected A / D converter, η represents the conversion ratio, and ν represents the amplification factor.
[0030] S7, constructing standard PLC motion control system real-time current value data based on the first PLC motion control system real-time current value data and the second PLC motion control system real-time current value data, and pushing it to the PLC motion control system current measurement platform; S71, using the mean formula to calculate the real-time current value data D of the first PLC motion control system and the real-time current value data D of the second PLC motion control system. Perform average numerical measurement processing to obtain real-time current value data of standard PLC motion control system ; S72, transmitting the real-time current value data of the standard PLC motion control system through a wireless communication network The data is pushed to the PLC motion control system current measurement platform and displayed on the display screen.
[0031] Embodiment 2 is as follows: See also Figure 2 , a current measurement system applied to a PLC motion control system, comprising a current measurement sample data acquisition module, a current signal analysis model building module, a real-time current signal data acquisition module, a real-time current signal data preprocessing module, a real-time current signal data analysis module, a real-time current signal data calculation module, and a standard real-time current value data building module; The current measurement sample data acquisition module acquires the current measurement sample data of the target PLC motion control system online through the current data management platform to obtain the current measurement sample data of the PLC motion control system; The current signal analysis model building module trains and tests the initial SVM model using the current measurement sample data of the PLC motion control system to build a current signal analysis model; The real-time current signal data acquisition module acquires the real-time current signal of the PLC motion control system during operation through the current sensor to obtain the real-time current signal data of the PLC motion control system; The real-time current signal data preprocessing module uses a weighted mean filtering method to perform data noise reduction processing on the real-time current signal data of the PLC motion control system to generate standard PLC motion control system real-time current signal data; The real-time current signal data analysis module generates the real-time current value data of the first PLC motion control system by inputting the real-time current signal data of the standard PLC motion control system into the current signal analysis model to perform real-time current signal analysis processing; The real-time current signal data calculation module generates the real-time voltage signal data of the standard PLC motion control system by converting the real-time current signal data of the standard PLC motion control system into a voltage signal and performing amplification processing, and selects a suitable A / D converter to convert the real-time voltage signal data of the standard PLC motion control system into a digital signal and performs data measurement processing to generate the real-time current value data of the second PLC motion control system; The standard real-time current value data construction module uses a mean formula to perform average numerical measurement processing on the real-time current value data of the first PLC motion control system and the real-time current value data of the second PLC motion control system to obtain standard PLC motion control system real-time current value data, which is pushed to the PLC motion control system current measurement platform through a wireless communication network and displayed on a display screen.
[0032] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0033] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A current measurement method applied to a PLC motion control system, characterized in that: The steps include: S1, collect current measurement sample data of PLC motion control system; S2. constructing a current signal analysis model based on the current measurement sample data of the PLC motion control system; S3, collect real-time current signal data of PLC motion control system; S4, performing data preprocessing on the real-time current signal data of the PLC motion control system to generate standard real-time current signal data of the PLC motion control system; S5, performing real-time current signal analysis and processing according to the current signal analysis model and the real-time current signal data of the standard PLC motion control system to generate real-time current value data of the first PLC motion control system; S6, generating real-time current value data of a second PLC motion control system by performing real-time current value data measurement processing on the real-time current signal data of the standard PLC motion control system; S7. Construct standard PLC motion control system real-time current value data based on the first PLC motion control system real-time current value data and the second PLC motion control system real-time current value data, and push it to the PLC motion control system current measurement platform.
2. A current measurement method applied to a PLC motion control system according to claim 1, characterized in that: The S1 comprises the following steps: S11, collect the current measurement sample data of the target PLC motion control system online through the current data management platform, and obtain the current measurement sample data set A={a1, a2, …, a i ,…,a k }, where a i represents the i-th current measurement sample data of the target PLC motion control system collected through the current data management platform, k represents the total number of current measurement sample data of the PLC motion control system, and the current measurement sample data includes current signal data and corresponding current value data.
3. A current measurement method applied to a PLC motion control system according to claim 2, characterized in that: The S2 comprises the following steps: S21, using the PLC motion control system current measurement sample data set as a sample data set; S22, constructing an initial SVM model, setting the penalty factor parameter to α and the radial basis kernel parameter to β; and setting the kernel function used by the initial SVM model to a Gaussian radial basis kernel function; S23, setting a training data ratio and a test data ratio, and dividing the sample data set according to the training data ratio and the test data ratio to obtain a training sample data set and a test sample data set; S24, setting a training error threshold and a maximum number of training times, inputting the training sample data in the training sample data set into the initial SVM model for training operation, if the training error of the initial SVM model is less than the training error threshold or the number of training times of the initial SVM model is greater than the maximum number of training times, then ending the training operation of the initial SVM model to obtain a trained SVM model; otherwise, continuing the training operation of the initial SVM model; S25, evenly dividing the test sample data set to obtain a first test sample data set and a second test sample data set; S26. Set a test accuracy threshold, input the first test sample data set and the second test sample data set into the trained SVM model for testing, calculate the accuracy of the test results, generate a first test accuracy and a second test accuracy, use the mean formula to average the first test accuracy and the second test accuracy to obtain a final test accuracy. When the final test accuracy is greater than or equal to the test accuracy threshold, use the trained SVM model as the current signal analysis model; otherwise, return to S22, and perform parameter tuning on the initial SVM model through the butterfly optimization algorithm.
4. A current measurement method applied to a PLC motion control system according to claim 3, characterized in that: The parameter tuning of the initial SVM model by the butterfly optimization algorithm in S26 includes the following steps: S261, construct parameter search butterfly population, set parameter search butterfly population size to N, switch probability to β, current iteration number to t, maximum iteration number to t max , the dimension of the SVM model parameter search space is P; Using the parameter setting range of the initial SVM model as a parameter data search space, randomly generating N groups of SVM model parameters in the SVM model parameter search space, each group of SVM model parameters corresponding to a parameter search butterfly individual in the parameter search butterfly population, and initializing an initial position set of the parameter search butterfly population; S262, calculating the stimulus intensity value of each parameter search butterfly individual in the parameter search butterfly population; S263, when each parameter search butterfly individual in the butterfly population is foraging in the SVM model parameter search space, it will emit a fragrance to attract other parameter search butterfly individuals; S264, setting a control coefficient R for each parameter search butterfly individual in the parameter search butterfly population i , the control coefficient R i Represents a random number that is uniformly distributed between [0,1]; When the control coefficient R i When the switching probability is less than or equal to β, the i-th parameter search butterfly individual will move in the direction of the current optimal individual in the SVM model parameter search space to update its position; When the control coefficient R i When the switching probability is greater than β, the i-th parameter search butterfly individual will update its position by random walking in the SVM model parameter search space; S265, calculating the stimulus intensity value after the position of each parameter search butterfly individual in the parameter search butterfly population is updated, if the fitness function value after the position of the parameter search butterfly individual is updated is greater than the original fitness function value, then the new position is used to replace the original position; otherwise, the original position is retained; Rearrange the parameter-searching butterfly individuals in the parameter-searching butterfly population from large to small according to the stimulus intensity value, and select the parameter-searching butterfly individual with the highest stimulus intensity value as the new current optimal individual; S266, determine whether t is less than t max , if t is less than t max , then t is increased by 1, and the process returns to S263; otherwise, the current optimal individual is taken as the global optimal solution, the SVM model parameters corresponding to the global optimal solution are output as the optimal parameters, and the parameters of the initial SVM model are set as the optimal parameters.
5. A current measurement method applied to a PLC motion control system according to claim 4, characterized in that: The S3 comprises the following steps: S31. The current signal between any two components during the operation of the PLC motion control system is collected in real time by a current sensor to obtain real-time current signal data C of the PLC motion control system.
6. A current measurement method applied to a PLC motion control system according to claim 5, characterized in that: The S4 comprises the following steps: S41, using a weighted mean filtering method to perform data noise reduction processing on the real-time current signal data C of the PLC motion control system to generate standard PLC motion control system real-time current signal data ; The data denoising process is as follows: S411, constructing a sliding filter window, and aligning the center position of the sliding filter window with each data point in the real-time current signal data of the PLC motion control system in sequence; S412, calculating the weight coefficient of each data point in the sliding filter window by a weighted kernel function formula; S413, calculating the weighted average value of all data points in the sliding filter window, and using the weighted average value as the output value of the center position of the sliding filter window after data noise reduction processing.
7. A current measurement method applied to a PLC motion control system according to claim 6, characterized in that: The S5 comprises the following steps: S51, the real-time current signal data of the standard PLC motion control system The current signal is input into the current signal analysis model for real-time current signal analysis and processing to generate real-time current value data D of the first PLC motion control system.
8. The current measurement method applied to a PLC motion control system according to claim 7, characterized in that: The S6 comprises the following steps: S61, converting the real-time current signal data of the standard PLC motion control system into Convert it into voltage signal, amplify it and generate real-time voltage signal data of standard PLC motion control system; S62, converting the real-time voltage signal data of the standard PLC motion control system into a digital signal through an A / D converter and performing real-time current value data measurement processing to generate a second PLC motion control system real-time current value data The A / D converter includes but is not limited to one of an integral A / D converter, a successive approximation A / D converter, a parallel comparison A / D converter and a serial comparison A / D converter; the real-time current value data measurement processing process is as follows: , Wherein, V represents the actual voltage value received by the selected A / D converter, λ represents the digital signal quantity obtained after the real-time voltage signal data of the standard PLC motion control system is converted by the selected A / D converter, and m and They respectively represent the number of bits and reference voltage value of the selected A / D converter, η represents the conversion ratio, and ν represents the amplification factor.
9. A current measurement method applied to a PLC motion control system according to claim 8, characterized in that: The S7 comprises the following steps: S71, using the mean formula to calculate the real-time current value data D of the first PLC motion control system and the real-time current value data D of the second PLC motion control system. Perform average numerical measurement processing to obtain real-time current value data of standard PLC motion control system ; S72, transmitting the real-time current value data of the standard PLC motion control system through a wireless communication network The data is pushed to the PLC motion control system current measurement platform and displayed on the display screen.
10. A system for implementing the current measurement method applied to a PLC motion control system according to any one of claims 1 to 9.
Citation Information
Patent Citations
Measurement System and Method for Low-Frequency Current on the Rotor Side of Variable Speed Generator Motor
CN116735942B
Servo driver
CN106774119A
Multi-range current measurement calibration system based on machine learning
CN111458672A
Driving system of rotary table of continuous casting machine and state monitoring method of driving system
CN116944486A
Fault monitoring method and system for straw smashing and residual film recycling combined machine
CN117370756A
Cited By
Multi-axis synchronous control method based on VME and Transformer
CN121541604A