Output error system identification method and system based on PRBS excitation signal
Through the output error system identification method based on PRBS excitation signal, the problem of time-consuming and insufficient accuracy of system identification in the prior art is solved, efficient and accurate system model identification is achieved, and the performance and response accuracy of the control system are improved.
Patent Information
- Application Number
- CN202411550521.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-14
AI Technical Summary
The existing system identification algorithms consume time and insufficient accuracy, white noise signal calculation errors, hardware implementation consumes a lot of resources, and the order of the controlled system cannot be known in advance, which affects the performance and response accuracy of the control system.
The output error system identification method based on PRBS excitation signal is adopted. By generating the PRBS signal to excite the controlled system, recording the output value, designing the predictor, building the cost function, and optimizing the parameters by nonlinear optimization method, obtaining the real model parameters of the system and loading it. Verify in the physical device.
It improves the accuracy and efficiency of system identification, reduces the consumption of hardware resources, flexibly selects the order and form of the model, adapts to complex dynamic characteristics, and improves the performance and response accuracy of the control system.
Smart Images

Figure CN119441945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servo system identification methods, and in particular to an output error system identification method and system based on a PRBS excitation signal. Background Art
[0002] In the field of modern control, high-performance control algorithms such as pole placement, robust control, H2, H infinity control, optimal control, switching adaptation, loop shaping and model predictive control often rely on the accuracy of the controlled system model. Especially in vibration suppression and observer design, accurate system modeling is particularly important. In addition, the accuracy of signal processing and spectrum analysis also puts forward requirements for the selection of excitation signals.
[0003] However, there are many problems with the system identification algorithms and excitation modes commonly used in the industry. Some methods use batch injection of sine waves of different frequencies to obtain the amplitude-frequency response of the controlled system, thereby fitting the transfer function. It is usually necessary to inject more than 100 sine waves in sequence and wait for more than 5 times the time constant after each injection to ensure that the system is stable. This process is time-consuming and difficult to achieve high accuracy, especially in the application of collaborative robots, where the six joints of each robot need to be identified, and the identification time of a single joint may take a week. In some process control environments with long time constants, it may even take several months or even half a year to complete a model identification. In addition, this method will introduce additional errors when fitting the amplitude-frequency response of each frequency point into the frequency domain transfer function and converting the frequency domain model into a discrete model, which ultimately leads to insufficient accuracy of the identification result. Some industries use zero-mean random white noise signals to excite the response of the entire frequency domain at one time. However, in the system identification process, key parameters such as autocorrelation function and cross-correlation function need to be calculated, and accurate calculation of these functions requires a complete understanding of the infinite past and future response data of the signal, which is unrealistic. In practical applications, estimated autocorrelation and cross-correlation functions are usually relied on, which introduces significant errors at the source. In addition, since the excitation intensity of white noise in the frequency domain is relatively low, and if the windowing method is used to improve the calculation accuracy of the autocorrelation function, it may cause a smoothing effect in the frequency domain, resulting in the loss of key resonant frequency points, especially in the case of rapidly changing frequency domain responses, which is fatal to vibration suppression. In addition, the generation of zero-mean random white noise in embedded devices is also difficult, usually requiring a complex random generator, which is difficult to implement in low-priced embedded MCUs, and the storage and calculation requirements of floating-point data points are also high (the number of data points of white noise is also much more than PRBS). In practical applications, the model and its order required for the actual working conditions are usually unknown. Using empirical models may lead to the loss of key information. Therefore, a model identification method with higher order and degree of freedom is needed to better adapt to complex dynamic characteristics. In traditional servo control, when using a standard speed loop (for example, setting the q-axis current to the speed output), the two-inertia oscillation system introduced by the harmonic reducer may not be fully perceived. This will result in the controller design failing to fully consider the impact of vibration, affecting the overall performance of the system.
[0004] Therefore, it is necessary to design a new method to solve the problems faced by the current system identification algorithm, such as the multi-frequency excitation method is time-consuming and inaccurate, the white noise signal calculation error, the hardware implementation consumes a lot of resources, and the order of the controlled system cannot be known in advance, so as to improve the performance and response accuracy of the control system. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide an output error system identification method and system based on a PRBS excitation signal.
[0006] To achieve the above object, the present invention adopts the following technical solution: an output error system identification method based on a PRBS excitation signal, comprising:
[0007] Generate PRBS excitation signal;
[0008] Obtaining the time constant and input gain of the controlled system to be identified;
[0009] Recording the output value of the PRBS excitation signal acting on the controlled system to be identified to obtain an actual output value;
[0010] Designing a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculating a predicted output value;
[0011] Constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and optimizing the parameters involved in the cost function by using a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtaining a model of the controlled system;
[0012] The model of the controlled system is loaded into a physical device, and whether the identified model is accurate is determined based on the loading result.
[0013] A further technical solution is: generating a PRBS excitation signal comprises:
[0014] A pseudo-random binary sequence is generated through a software register with a specific number of bits to obtain a periodic PRBS signal.
[0015] A further technical solution is: constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and using a nonlinear optimization method to optimize the parameters involved in the cost function to obtain the real parameters of the controlled system to be identified, and then obtaining a model of the controlled system, including:
[0016] A cost function is constructed, with the sum of squares of the prediction errors of the actual output value and the predicted output value as the optimization target, and a nonlinear optimization method is used to minimize the optimization function to obtain the true parameters of the controlled system to be identified, and then obtain the model of the controlled system.
[0017] A further technical solution is: generating a PRBS excitation signal comprises:
[0018] Get the time constant and input gain of the speed loop control closed-loop control system;
[0019] A PRBS excitation signal is generated according to the time constant and the input gain.
[0020] A further technical solution is: recording the output value of the PRBS excitation signal acting on the controlled system to be identified to obtain the actual output value includes:
[0021] Remove the position loop, open the speed loop, and put the speed loop in an open circuit state;
[0022] The PRBS excitation signal is input to the q-axis current, and the speed data of the motor shaft side is collected in real time;
[0023] The collected speed signal is filtered to remove noise to obtain the actual output value.
[0024] A further technical solution is: constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and using a nonlinear optimization method to optimize the parameters involved in the cost function to obtain the real parameters of the controlled system to be identified, and then obtaining a model of the controlled system, including:
[0025] Arrange the actual output value, the PRBS excitation signal and the sampling time into a set data format to obtain an arrangement result;
[0026] Remove the trend from the data to get the removed result;
[0027] The oe function of MATLAB is used in combination with the removal result to identify the model of the output error structure, so as to obtain the model of the controlled system.
[0028] A further technical solution is: loading the model of the controlled system into a physical device and determining whether the identified model is accurate according to the loading result, including:
[0029] The model of the controlled system is converted into a differential polynomial and applied to the physical device, and the same excitation signal as the speed loop controller is input to obtain the output speed value;
[0030] Whether the identified model is correct is determined based on whether the output speed value is consistent with the output value of the real physical device.
[0031] A further technical solution is: determining whether the identified model is correct according to whether the output speed value is consistent with the output value of the real physical device includes:
[0032] When the output speed value is consistent with the output value of the real physical device, the model identification is determined to be successful to obtain an identification result; when the output speed value is inconsistent with the output value of the real physical device or there is a delay, it is necessary to adjust the delay points or order of the model of the controlled system to update the model of the controlled system and reload it into the physical device.
[0033] The present invention also provides an output error system identification system based on a PRBS excitation signal, comprising:
[0034] A signal generating unit, used for generating a PRBS excitation signal;
[0035] A system acquisition unit, used for acquiring a time constant and an input gain of a controlled system to be identified;
[0036] an actual output value recording unit, used to record the output value of the PRBS excitation signal acting on the controlled system to be identified, so as to obtain an actual output value;
[0037] A prediction unit, used to design a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculate a predicted output value;
[0038] An optimization solving unit, used for constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and optimizing the parameters involved in the cost function by using a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtain the model of the controlled system;
[0039] The loading unit is used to load the model of the controlled system into the physical device and determine whether the identification model is accurate according to the loading result.
[0040] A further technical solution is: the signal generating unit is used to generate a pseudo-random binary sequence through a software register of a specific number of bits to obtain a periodic PRBS signal.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention generates a PRBS excitation signal and applies it to a controlled system to be identified, records the output value of the system, and obtains actual output data; designs a predictor, calculates the predicted value according to the PRBS signal and the system output, and constructs a cost function to measure the prediction error; uses a nonlinear optimization method to optimize the parameters of the cost function to obtain the true model parameters of the system; loads the model to a physical device to verify the identification result, solves the time-consuming and precision problems of multi-frequency excitation, the high resource consumption of hardware implementation, and the problem that the order of the controlled system cannot be known in advance, and improves the performance and response accuracy of the control system.
[0042] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0044] Figure 1 A schematic diagram of a flow chart of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a sub-process of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a sub-process of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of a sub-process of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of a sub-process of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention;
[0049] Figure 6 A schematic diagram of a process for generating a PRBS excitation signal provided in an embodiment of the present invention;
[0050] Figure 7 A curve diagram of a PRBS excitation signal provided in an embodiment of the present invention Figure 1 ;
[0051] Figure 8 A curve diagram of a PRBS excitation signal provided in an embodiment of the present invention Figure 2 ;
[0052] Fig. 9 A schematic diagram of an output error system provided by an embodiment of the present invention;
[0053] Fig.10 A schematic block diagram of an output error system identification system based on a PRBS excitation signal provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] 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 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.
[0055] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0056] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0057] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0058] See also Figure 1 , Figure 1 A flow chart of an output error system identification method based on a PRBS excitation signal provided in an embodiment of the present invention. The method of this embodiment adopts an output error system identification method based on a PRBS (pseudo-random binary sequence) excitation signal. This method generates an efficient PRBS signal to excite the controlled system, thereby quickly acquiring its output data. By constructing a cost function, calculating the error between the actual output and the predicted output, and using nonlinear optimization technology to adjust parameters, the recognition accuracy can be effectively improved. Finally, the identified system model is loaded into the physical device to achieve performance improvement of the control system and improvement of response accuracy.
[0059] Figure 1 FIG. 1 is a flow chart of an output error system identification method based on a PRBS excitation signal provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110 to S160.
[0060] S110, generating a PRBS excitation signal.
[0061] In this embodiment, a pseudo-random binary sequence is generated through a software register with a specific number of bits to obtain a PRBS (Pseudo Random Binary Sequence) signal of one period.
[0062] See also Figure 6 and Figure 7For example, to generate a four-bit binary number (any binary number that is not all zeros). Each time it is generated, the last two bits are added and modulo 2, and then the result is inserted into the highest bit of the four-bit binary number. This process causes the original four-digit number to be right-shifted in sequence, the rightmost digit is discarded, and the new highest bit is output. We can apply an amplitude to the highest bit as needed to amplify or reduce the signal.
[0063] For a four-bit register, it can generate a pseudo-random binary sequence (PRBS) within a cycle with a cycle length of 2 4 -1 = 15 data points. The signal generated by only four bits of register is similar to the superposition of 15 sine waves of different frequencies, and the amplitude of the signal can be precisely controlled, greatly improving efficiency. This method can excite all frequency bands from zero to the sampling frequency in just a few seconds, perfectly covering the working bandwidth.
[0064] like Figure 8 As shown in Figure 1, within a single cycle, the signal exhibits randomness and has the statistical characteristics of zero-mean white noise. However, from a macroscopic point of view, the signal is periodic, so we only need one cycle of data to accurately calculate key values such as autocorrelation and cross-correlation functions required for system identification, without the need for infinite past and future data like zero-mean white noise.
[0065] Using PRBS signals as excitation signals for system identification can obtain more accurate results. In addition, generating such signals only requires simple binary addition and subtraction operations, so high computing power or large amounts of memory are not required, and excessive resources will not be occupied, making it possible to implement complex on-site system identification algorithms directly on the servo drive's microcontroller (MCU).
[0066] In addition, from the frequency domain point of view, the PRBS signal is significantly better than the Gaussian random signal and the zero-mean white noise signal in terms of excitation intensity. Although the time domain amplitudes of the three signals are all 0.5, the PRBS signal can effectively overcome resistance such as the friction dead zone of the physical device and excite enough frequency points with a large enough density in the range of 0 to the sampling frequency, thereby obtaining a more accurate model. In contrast, the red zero-mean white noise signal has a relatively low intensity, especially in some frequency bands, and the Gaussian noise also has a large amplitude variation at different frequency points, and the overall intensity is uneven.
[0067] S120: Obtain the time constant and input gain of the controlled system to be identified.
[0068] In this example, see Fig. 9 , showing a realistic model, which means that its parameters are completely accurate and can accurately describe the behavior of the physical device.
[0069] In this model, u(k) represents the input excitation signal, which is the pseudo-random binary sequence (PRBS) signal mentioned earlier. The exact model of the controlled system is represented by G0, which is in discrete form, where A0 is the denominator polynomial, B0 is the numerator polynomial, and d0 is the delay. The coefficients of the numerator and denominator polynomials are the parameters of the controlled system that need to be identified, and these true parameters have yet to be determined.
[0070] y p (k) is the output of the system, n(k) is the interference, and it is assumed that the interference is a zero-mean steady-state random noise. This assumption is consistent with the sampling interference characteristics of the position sensor under servo conditions. Ultimately, the system output y(k) is the superposition of the system output and the interference. Therefore, the following two formulas can be obtained: y(k)=G0(q -1 )u(k)+n(k); the predictor can be designed as follows Specifically, if the G0 parameter is accurate, the prediction error is It can be seen that this error result has good statistical characteristics (zero mean random white noise) and is independent of the input signal u(k). In fact, the parameters of the system model G0 are unknown at the beginning. By using a pseudo-random binary sequence (PRBS) signal to stimulate the system and collect enough device outputs y(k), the actual output is compared with the output of the prediction model at each moment to calculate the error. This results in the following cost function, which is the sum of the squares of the errors at each moment, where N means there are N moments. In the cost function, k and θ in brackets indicate that the error is a function of time and the controlled system parameter θ. If the value of θ is accurate, then this set of parameters is called θ0, which is the true and accurate parameters of the system. By optimizing the following cost function and minimizing it, the true parameters of the system model G0 can be obtained.
[0071] S130, recording the output value of the PRBS excitation signal acting on the controlled system to be identified to obtain an actual output value;
[0072] S140 , designing a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculating a predicted output value.
[0073] S150, constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and using a nonlinear optimization method to optimize the parameters involved in the cost function to obtain the real parameters of the controlled system to be identified, and then obtain a model of the controlled system.
[0074] In this embodiment, a cost function is constructed, with the sum of the squares of the prediction errors of the actual output value and the predicted output value as the optimization target, and a nonlinear optimization method is used to minimize the optimization function to obtain the true parameters of the controlled system to be identified, and then obtain the model of the controlled system.
[0075] Specifically, the sum of squared errors is used as the cost function:
[0076] Where N is the total number of sample points.
[0077] Use a nonlinear optimization algorithm to minimize the cost function J(θ). The final parameter θ is the optimal parameter of the system to be identified.
[0078] Use the identified model G0(θ0,u) to perform system simulation or actual testing; compare the actual output with the predicted output to verify the effectiveness of the model.
[0079] This method does not require the structure of the model to be determined in advance, and the order and form of the model can be flexibly selected. It can handle random noise in the system and obtain more comprehensive frequency domain characteristics through PRBS signal excitation. It can be directly implemented in the servo drive MCU on site to adapt to complex industrial applications.
[0080] The application of this output error identification method in servo control systems can effectively capture the dynamic characteristics of the system, thereby designing a more accurate controller.
[0081] S160: Load the model of the controlled system into a physical device, and determine whether the identified model is accurate based on the loading result.
[0082] The above method does not require modeling of the noise, but uses a nonlinear optimization method (which can be implemented using MATLAB). Most importantly, we can choose arbitrarily high orders and model forms to find the model structure that best describes the behavior of the controlled system, without having to fix the model structure before performing system identification. The model obtained by this method is the discretized model and does not need further processing.
[0083] In traditional servo control, when using the standard speed loop model (inputting the q-axis current into the speed output), the two-inertia oscillation phenomenon introduced by the harmonic reducer is often not detected, so the controller designed on this basis is also difficult to fully consider the vibration effect. However, this method can fully consider these factors, thereby improving the performance and robustness of the control system.
[0084] In one embodiment, the above method is applied to the identification process of the speed loop controller model under the FOC three-loop servo drive condition. Specifically, please refer to Figure 2, the above-mentioned step S110 may include steps S111 to S112.
[0085] S111, obtaining the time constant and input gain of the speed loop control closed-loop control system.
[0086] During the test, the position loop was removed first so that the focus could be placed on the performance of the speed loop. In this way, the response characteristics of the speed controller could be evaluated more accurately.
[0087] Inputting a suitable speed step signal is a key step. The step signal needs to meet the following conditions:
[0088] The amplitude should be enough for the system to overcome friction and other resistance to ensure that the device can start and reach the target speed steadily. If the step signal amplitude is too small, the device may not move.
[0089] The amplitude should be selected so that the speed of the device can quickly reach the set value without obvious tailing.
[0090] After the step signal is input, the output of the speed loop controller (i.e., the q-axis current) is monitored and its amplitude (denoted as a) is recorded. At the same time, the time between 10% and 90% of the speed signal is collected. This time period is called the time constant τ.
[0091] S112. Generate a PRBS excitation signal according to the time constant and input gain.
[0092] In this embodiment, the duration of the PRBS signal is determined based on the above time constant τ, which is usually selected between 5τ and 10τ, for example, 8τ.
[0093] Sampling time Ts = 500 μs, the corresponding sampling frequency is
[0094] Convert 8τ to the number of data points: Make sure that the number of data points can meet the system frequency response requirements.
[0095] You can choose an appropriate PRBS signal length. According to experience, in the frequency response test, choose 2 7 -1 = 127 frequency points are usually sufficient. Therefore, the software register length can be set to 7 bits. A larger length, such as 8 bits, 10 bits, etc., can be selected as needed.
[0096] After ensuring that the generated PRBS signal period is 127 points, the entire signal is stored and its amplitude is multiplied by the previously recorded a value. This step ensures that the amplitude of the signal matches the response of the system.
[0097] Using PRBS signals for system identification can effectively stimulate the dynamic characteristics of the system and provide more accurate frequency response information. Through step signal testing, the time it takes for the system to reach a stable state from a static state can be observed, providing valuable data for controller design. After system identification, the controller parameters can be optimized based on the obtained model to improve the robustness and response speed of the system. The randomness of PRBS signals can effectively stimulate the nonlinear characteristics of the system, making the analysis results more comprehensive.
[0098] Through the above steps, a suitable PRBS signal can be generated in the speed loop of the FOC control system, so as to effectively carry out system identification and performance evaluation, thereby improving the control strategy and enhancing the system performance.
[0099] In this embodiment, the above step S130 may include steps S131 to S133.
[0100] S131, remove the position loop, open the speed loop, and put the speed loop in an open circuit state;
[0101] S132, inputting the PRBS excitation signal into the q-axis current, and collecting the speed data of the motor shaft side in real time;
[0102] S133: Filter the collected speed signal to remove noise to obtain an actual output value.
[0103] Specifically, when performing system identification and performance evaluation of the speed loop of the FOC (field oriented control) system, effective data acquisition and noise interference removal are crucial. The following will detail how to operate the speed loop in an open circuit state and collect speed data by inputting a PRBS signal and filtering.
[0104] Before performing an open-circuit test on the speed loop, the position loop must be removed first. This is to ensure that only the dynamic characteristics of the speed controller are focused on, without being affected by the position control.
[0105] Setting the speed loop to an open state means that the controller output (q-axis current) is directly controlled by an external signal instead of being adjusted by a feedback signal. At this time, two pre-stored PRBS signals can be input to the speed controller. The characteristics of the PRBS (pseudo-random binary sequence) signal enable it to provide rich excitation in the frequency domain, thereby better identifying system characteristics.
[0106] After the PRBS signal is input to the q-axis current, the speed points are collected sequentially on the motor shaft side. The following points should be noted in this process:
[0107] Synchronous acquisition: Ensure that the acquisition time of the input signal and the output signal (mechanical angular velocity) are synchronized to ensure the validity and comparability of the data.
[0108] Timestamp recording: Record the corresponding timestamp for each collected speed point to facilitate subsequent analysis.
[0109] The collected speed data is usually interfered by various noises, including electrical noise, mechanical vibration, etc. Therefore, it is necessary to filter the speed data to remove these interferences. The following are the specific steps:
[0110] Select the filter type:
[0111] A low-pass filter is used to retain low-frequency signals by removing high-frequency noise.
[0112] Select an appropriate cutoff frequency based on the bandwidth of the control system. For a speed loop bandwidth of approximately 150 Hz, consider setting the cutoff frequency of the low-pass filter to 200 Hz or lower, which can effectively filter out noise.
[0113] Filter Design:
[0114] Cutoff frequency selection: Set the cutoff frequency of the low-pass filter (e.g. 200Hz) to ensure that it is higher than the bandwidth of the speed loop, but low enough to remove unnecessary high-frequency noise.
[0115] Implementation method: It can be implemented using digital filters, such as Butterworth filter and Bessel filter, to ensure that their phase and amplitude characteristics are suitable for processing velocity data.
[0116] Filtering process:
[0117] In actual filtering, it is necessary to process the input signal (PRBS signal) and the output signal (speed signal) at the same time.
[0118] During the filtering process, it is ensured that the input and output signals at each moment are accurately aligned to avoid data inconsistency due to delays or time deviations.
[0119] After filtering, the output speed signal and the input PRBS signal need to maintain timing consistency to ensure accurate correspondence between the input and output signals during analysis.
[0120] When performing OE identification, modeling is performed directly in the discrete domain. First, the delay and the order of the system numerator and denominator are selected to determine the basic structure of the discrete domain model. Next, the coefficients of the numerator and denominator in the model are determined, which are reflected as coefficients of various orders in the transformed difference equation. Through the optimization of the resolver, the error is minimized, and these coefficients are directly obtained, and finally the model is constructed.
[0121] By removing the position loop, opening the speed loop and inputting the PRBS signal, combined with effective filtering of the collected speed data, the system identification can be completed well. This method not only improves the reliability of the data, but also effectively identifies the dynamic characteristics of the control system, providing an important basis for further control algorithm design and optimization. Ensuring the accuracy of synchronous acquisition and filtering is a key link in the whole process.
[0122] In this embodiment, the above-mentioned step S150 may include steps S151 to S153.
[0123] S151, arranging the actual output value, the PRBS excitation signal and the sampling time into a set data format to obtain an arrangement result;
[0124] S152, removing the trend in the data to obtain a removal result;
[0125] S153, using the oe function of MATLAB in combination with the removal result to identify the model of the output error structure, so as to obtain the model of the controlled system.
[0126] Specifically, prepare the input signal u (PRBS signal) and the output signal y (open-loop speed signal after filtering). Use the iddata function to convert these two signals and the sampling time Ts into a suitable data format. The purpose of this line of code is to prepare for subsequent system identification: Z = iddata (y, u, Ts);
[0127] In order to remove the trend component in the signal (for example, the mean of the signal), the detrend function is used. This is an important step because in system identification, the trend of the signal may affect the accuracy of the model. After removing the trend, the input and output data sets are: Zd = detrend(Z);
[0128] The last step is to use the output error (OE) structure to identify the system. This step involves building a discrete time model. The specific code is as follows:
[0129] G1 = oe(Zd, [6 6 1]);
[0130] In this function, [6 6 1] is a vector containing three elements, representing:
[0131] The order of the numerator polynomial (6): represents the dynamic characteristics of the model.
[0132] The order of the denominator polynomial (6): also affects the dynamic response of the system. Note that the order of the denominator polynomial cannot be less than the order of the numerator polynomial, otherwise the model may become unstable.
[0133] Delay (1): This is the delay of the input signal, set to one sampling point. The setting of the delay is critical to the recognition accuracy of the system.
[0134] In this model, the relationship between the system's output y(t) and input u(t) can be expressed as: Where e(t) is the noise, which is usually assumed to be white noise. B(q) is the function of the system molecular polynomial, q -1 is the time delay operator.
[0135] The controlled target of the speed loop can be described by a transfer function in the following form: Where current_closed_loop is the current loop transfer function, which is designed as a low-pass filter with a corner frequency equal to the current loop bandwidth. P is the number of motor poles (not the number of pole pairs). f is the rotor flux of the PMSM (permanent magnet synchronous motor). J is the total moment of inertia of the motor, including the moment of inertia of the motor rotor and the load (if any) converted to the motor rotor side through the reducer. s is the Laplace operator, which is used to describe the dynamic characteristics of the system.
[0136] From the transfer function, we can see that the numerator is of order 0 (constant) and the denominator is of order 1, which indicates that the system is a first-order delay system. Considering the possible existence of harmonics and two-inertia vibration models, the numerator order can be set to 2 and the denominator order can be set to 4 in the initial attempt, which can better capture the dynamic characteristics of the system.
[0137] Through the above steps, the speed control system was modeled using MATLAB's system identification tool. In practical applications, by adjusting the order of the polynomial and the delay parameters, the model can be continuously optimized to improve the control performance of the system. Ensuring the stability and performance of the system is an important consideration in the modeling process.
[0138] In this embodiment, the above-mentioned step S160 may include steps S161 - S162 .
[0139] S161, converting the model of the controlled system into a differential polynomial, applying it to a physical device, and inputting the same excitation signal as the speed loop controller to obtain an output speed value;
[0140] S162: Determine whether the identified model is correct based on whether the output speed value is consistent with the output value of the real physical device.
[0141] Specifically, when the output speed value is consistent with (or very close to) the output value of the real physical device, the model identification is determined to be successful to obtain an identification result; when the output speed value is inconsistent with the output value of the real physical device or there is a delay, it is necessary to adjust the delay points or order of the model of the controlled system to update the model of the controlled system and reload it into the physical device.
[0142] In this embodiment, in system identification, successfully building an accurate discretization model is a key step to achieve precise control. In the process you mentioned, we convert the identified discrete model into a differential polynomial and apply it to the actual physical device. The following will explain this process and the method of model verification and optimization in detail.
[0143] After system identification, a discretized model is obtained, which is usually expressed as a transfer function or state space model. In order to implement the model in a physical device, we need to convert it into a differential polynomial form.
[0144] The difference polynomial form can be written as:
[0145] y[k]=a1y[k-1]+a2y[k-2]+…+a n y[kn]+b0u[k]+
[0146] b1u[k-1]+…+b m u[km];
[0147] Where: y[k] is the system output (i.e., the speed value); u[k] is the system input (i.e., the actual q-axis current). ai and bi are coefficients obtained through system identification, corresponding to the effects of output and input, respectively. k is the index of discrete time.
[0148] After writing the above differential polynomial into the servo control system of the physical device, the system can calculate the corresponding output (speed value) based on the given input (real q-axis current). This process usually involves the following steps:
[0149] The real q-axis current is used as the model input. This signal is calculated in the controller and input to the physical device in real time.
[0150] In the servo control system of the physical device, observe and record the actual speed value after filtering.
[0151] In order to verify the validity of the model, it is necessary to compare the model output with the speed value measured on the physical device. The main verification steps are as follows:
[0152] Consistency verification: observe the velocity value y calculated by the model model[k] and the actual measured speed value y actual [k] is consistent under different working conditions. If the difference between the two is within an acceptable range, it means that the model identification is successful.
[0153] Delay adjustment: If there is a time delay between the output of the model and the actual output, the number of delay points needs to be adjusted in the model. This usually involves adding a delay term in the difference equation (our delay starts from 1 point, and the discrete system has at least 1 point of delay, so usually the delay is the actual physical device relative to the model) to more accurately reflect the dynamic response of the system. For example, if it is found that the actual speed output is delayed relative to the model, it is necessary to add an appropriate delay to the model.
[0154] In practical applications, especially in certain critical working conditions, signal mutations and spikes may occur. In order to improve the accuracy of the model, the following points should be noted:
[0155] Mutation signal: If at certain key points, the output signal of the physical device shows obvious mutations or spikes, but the model output signal does not have such changes, it means that the dynamic characteristics of the model are insufficient. At this time, you can consider increasing the order of the model and adding more dynamic characteristics to adapt to these changes.
[0156] Downsizing: On the other hand, if the output signal of the model appears to be too complex under certain working conditions (for example, too much oscillation or too sensitive response), you can consider reducing the order of the model to achieve a smoother output.
[0157] Model validation is usually an iterative process:
[0158] Run the model: Run the model on a physical device and record input and output data.
[0159] Compare and Analyze: Compare model output with actual measurement data and analyze the differences.
[0160] Adjust the model: Adjust the parameters of the model based on the feedback, such as the number of delay points, order, etc.
[0161] Revalidation: Validation is performed again to ensure that the difference between the model's output and the actual device output is minimized.
[0162] Through this iterative approach, the model can be continuously optimized to adapt to actual operating conditions, thereby improving the control performance and reliability of the system.
[0163] By applying the discretized model to the actual physical equipment and verifying and adjusting the model output, the stability and response accuracy of the control system under various working conditions can be ensured. This process not only enhances the practicality of the system, but also provides a data basis for future optimization and improvement. The success of system identification is directly related to the operating efficiency of the equipment, so continuous monitoring and feedback are crucial.
[0164] In addition, when testing the time constant and appropriate input gain of the system, only the position loop is enabled, while the speed loop is still in a closed-loop control state. The gain at this time is obviously related to the speed. However, considering that the PRBS signal needs to be applied to the q-axis current later, it is necessary to observe the corresponding q-axis current value at this time. It is worth noting that when the PRBS signal is applied, the position loop is turned on, and the speed loop is open-loop, and the q-axis current is directly used as the input signal of the controlled target of the speed loop. Another method is to let the speed loop operate normally, remove the position loop, and then superimpose the PRBS signal on the q-axis current signal of the normally operating system.
[0165] The above-mentioned output error system identification method based on PRBS excitation signal generates a PRBS excitation signal and applies it to the controlled system to be identified, records the output value of the system, and obtains the actual output data; designs a predictor, calculates the prediction value according to the PRBS signal and the system output, and constructs a cost function to measure the prediction error; uses a nonlinear optimization method to optimize the parameters of the cost function to obtain the true model parameters of the system; loads the model to the physical device, verifies the identification result, solves the time-consuming and precision problems of multi-frequency excitation, the high resource consumption of hardware implementation, and the problem of being unable to know the order of the controlled system in advance, and improves the control system performance and response accuracy.
[0166] Fig.10 FIG. 3 is a schematic block diagram of an output error system identification system 300 based on a PRBS excitation signal provided by an embodiment of the present invention. Fig.10 As shown, corresponding to the above output error system identification method based on PRBS excitation signal, the present invention also provides an output error system identification system 300 based on PRBS excitation signal. The output error system identification system based on PRBS excitation signal includes a unit for executing the above output error system identification method based on PRBS excitation signal, and the system can be configured in a server. Specifically, please refer to Fig.10 The output error system identification system 300 based on the PRBS excitation signal includes a signal generating unit 301, a system acquiring unit 302, an actual output value recording unit 303, a predicting unit 304, an optimization solving unit 305 and a loading unit 306.
[0167] A signal generating unit 301 is used to generate a PRBS excitation signal; a system acquiring unit 302 is used to acquire the time constant and input gain of the controlled system to be identified; an actual output value recording unit 303 is used to record the output value of the PRBS excitation signal acting on the controlled system to be identified, so as to obtain the actual output value; a prediction unit 304 is used to design a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculate the predicted output value; an optimization solving unit 305 is used to construct a cost function to calculate the actual output value and the prediction error of the predicted output value, and optimize the parameters involved in the cost function by using a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtain the model of the controlled system; a loading unit 306 is used to load the model of the controlled system into a physical device, and determine whether the identified model is accurate according to the loading result.
[0168] In one embodiment, the signal generating unit 301 is used to generate a pseudo-random binary sequence through a software register of a specific bit number to obtain a periodic PRBS signal.
[0169] In one embodiment, the optimization solution unit 305 is used to construct a cost function, taking the sum of squares of the prediction errors of the actual output value and the predicted output value as the optimization target, and using a nonlinear optimization method to minimize the optimization function to obtain the true parameters of the controlled system to be identified, and then obtain the model of the controlled system.
[0170] In one embodiment, the signal generating unit 301 includes:
[0171] The time constant and gain acquisition subunit is used to acquire the time constant and input gain of the speed loop control closed-loop control system; the signal generation subunit is used to generate a PRBS excitation signal according to the time constant and input gain.
[0172] In one embodiment, the actual output value recording unit 303 includes:
[0173] The open circuit setting subunit is used to remove the position loop, open the speed loop, and put the speed loop in an open circuit state; the input subunit is used to input the PRBS excitation signal into the q-axis current and collect the speed data of the motor shaft side in real time; the filtering subunit is used to filter the collected speed signal and remove noise to obtain the actual output value.
[0174] In one embodiment, the optimization solution unit 305 includes:
[0175] The sorting subunit is used to sort the actual output value, the PRBS excitation signal and the sampling time into a set data format to obtain a sorting result; the removal subunit is used to remove the trend in the data to obtain a removal result; the identification subunit is used to use the oe function of MATLAB combined with the removal result to identify the model of the output error structure to obtain a model of the controlled system.
[0176] In one embodiment, the loading unit 306 includes:
[0177] The conversion subunit is used to convert the model of the controlled system into a differential polynomial, and apply it to the physical device, input the same excitation signal as the speed loop controller to obtain the output speed value; the generation subunit is used to determine whether the identified model is correct according to whether the output speed value is consistent with the output value of the real physical device. Specifically, when the output speed value is consistent with the output value of the real physical device, it is determined that the model identification is successful to obtain the identification result; when the output speed value is inconsistent with the output value of the real physical device or there is a delay, it is necessary to adjust the delay points or order of the model of the controlled system to update the model of the controlled system and reload it into the physical device.
[0178] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned output error system identification system based on PRBS excitation signal and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0179] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0180] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0181] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the system of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0183] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. The output error system identification method based on PRBS excitation signal is characterized in that: include: Generate PRBS excitation signal; Obtaining the time constant and input gain of the controlled system to be identified; Recording the output value of the PRBS excitation signal acting on the controlled system to be identified to obtain an actual output value; Designing a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculating a predicted output value; Constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and optimizing the parameters involved in the cost function by using a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtaining a model of the controlled system; The model of the controlled system is loaded into a physical device, and whether the identification model is accurate is determined based on the loading result.
2. The output error system identification method based on PRBS excitation signal according to claim 1 is characterized in that: The generating of the PRBS excitation signal comprises: A pseudo-random binary sequence is generated through a software register with a specific number of bits to obtain a periodic PRBS signal.
3. The output error system identification method based on PRBS excitation signal according to claim 2 is characterized in that: The cost function is constructed to calculate the actual output value and the prediction error of the predicted output value, and the parameters involved in the cost function are optimized by a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtain the model of the controlled system, including: A cost function is constructed, with the sum of squares of the prediction errors of the actual output value and the predicted output value as the optimization target, and a nonlinear optimization method is used to minimize the optimization function to obtain the true parameters of the controlled system to be identified, and then obtain the model of the controlled system.
4. The output error system identification method based on PRBS excitation signal according to claim 3 is characterized in that: The generating of the PRBS excitation signal comprises: Get the time constant and input gain of the speed loop control closed-loop control system; A PRBS excitation signal is generated according to the time constant and the input gain.
5. The output error system identification method based on PRBS excitation signal according to claim 4 is characterized in that: The recording of the output value of the PRBS excitation signal acting on the controlled system to be identified to obtain an actual output value includes: Remove the position loop, open the speed loop, and put the speed loop in an open circuit state; The PRBS excitation signal is input to the q-axis current, and the speed data of the motor shaft side is collected in real time; The collected speed signal is filtered to remove noise to obtain the actual output value.
6. The output error system identification method based on PRBS excitation signal according to claim 5 is characterized in that: The cost function is constructed to calculate the actual output value and the prediction error of the predicted output value, and the parameters involved in the cost function are optimized by a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtain the model of the controlled system, including: Arrange the actual output value, the PRBS excitation signal and the sampling time into a set data format to obtain an arrangement result; Remove the trend from the data to get the removed result; The oe function of MATLAB is used in combination with the removal result to identify the model of the output error structure, so as to obtain the model of the controlled system.
7. The output error system identification method based on PRBS excitation signal according to claim 6 is characterized in that: The step of loading the model of the controlled system into a physical device and determining whether the identified model is correct according to the loading result includes: The model of the controlled system is converted into a differential polynomial and applied to the physical device, and the same excitation signal as the speed loop controller is input to obtain the output speed value; Whether the identified model is correct is determined based on whether the output speed value is consistent with the output value of the real physical device.
8. The output error system identification method based on PRBS excitation signal according to claim 7 is characterized in that: The determining whether the identified model is correct according to whether the output speed value is consistent with the output value of the real physical device includes: When the output speed value is consistent with the output value of the real physical device, the model identification is determined to be successful to obtain an identification result; when the output speed value is inconsistent with the output value of the real physical device or there is a delay, it is necessary to adjust the delay points or order of the model of the controlled system to update the model of the controlled system and reload it into the physical device.
9. An output error system identification system based on a PRBS excitation signal, characterized in that: include: A signal generating unit, used for generating a PRBS excitation signal; A system acquisition unit, used for acquiring a time constant and an input gain of a controlled system to be identified; an actual output value recording unit, used to record the output value of the PRBS excitation signal acting on the controlled system to be identified, so as to obtain the actual output value; A prediction unit, used to design a predictor according to the PRBS excitation signal and the controlled system to be identified, and calculate a predicted output value; An optimization solving unit, used for constructing a cost function to calculate the actual output value and the prediction error of the predicted output value, and optimizing the parameters involved in the cost function by using a nonlinear optimization method to obtain the real parameters of the controlled system to be identified, and then obtain the model of the controlled system; The loading unit is used to load the model of the controlled system into the physical device and determine whether the identified model is accurate according to the loading result.
10. The output error system identification system based on PRBS excitation signal according to claim 9, characterized in that: The signal generating unit is used to generate a pseudo-random binary sequence through a software register of a specific bit number to obtain a PRBS signal of a period.