The present disclosure relates to methods for automatically adjusting parameters, and, more particularly, to a tuning method that facilitates users in adjusting parameters and a tuning system using the same.
With the rapid development of automatic machine tools, processing operations carried out by input of related parameters has become mainstream these days. These machine tools are usually subjected to tuning before they leave the factory. By adjusting the relevant parameters, the machine tools will be able to meet certain performance indices and the requirements specified by the clients.
However, after leaving the factory, the original machine performance is often influenced by factors such as site installation, site construction, and environmental issues. In addition, mechanical components may take a lot of wear and tear or even have structural deformations due to vibration, friction, dust, or the like after a long period of operation, which may cause changes in the characteristics of the machine, resulting in performance degradation. It would be difficult in practice to repair mechanical components or structures by dismantling the machine apart in order to improve the performance of the machine.
Furthermore, in order to tune the parameters of a controller of the machine, one needs to be familiar with the functions of the machine's functions, understand its performance, and have certain level of professional knowledge about the machine's design and manufacturing processes. In other words, the user must be an experienced operator or it would be difficult to tune the machine in real time on a production line of a factory.
Therefore, how to enable an ordinary operator to tune a variety of machine tools on a production line of a factory in real time is a technical problem which urgently requires a solution.
In view of the aforementioned shortcomings of the prior art, the present disclosure provides a tuning method, which may include: providing a tuning system equipped with a virtual machine, wherein the virtual machine is modeled after a target machine; setting a processing condition of the target machine in the tuning system; inputting a simulation command containing a simulation parameter into the virtual machine; and subjecting the virtual machine to simulate a response of the target machine according to the simulation parameter to calculate a required control parameter and use the control parameter as a base parameter for adjusting the target machine.
In an embodiment, the tuning system may be further provided with an identification module, and before setting the processing condition, the tuning method may further comprise: inputting another simulation command containing another simulation parameter into the virtual machine for the target machine to generate response information; transmitting the response information to the identification module; and subjecting the identification module to compare the another simulation command and the response information, and using the another simulation parameter and the response information as a system parameter if an error value of the another simulation parameter is within an acceptable range. Further, the tuning system may be further provided with a simulation unit for transmitting the another simulation command to the target machine and the identification module. In an embodiment, the target machine may include a controller, and the simulation unit may be configured for simulating the controller.
In an embodiment, the tuning system may be further provided with a reference model established by using the virtual machine, and the reference model may include comparison parameters. In another embodiment, the tuning method may further comprise selecting the reference model based on the processing condition of the target machine, and comparing with the control parameter to calculate another control parameter.
The present disclosure provides a tuning system, which may comprise: a server equipped with a virtual machine, wherein the virtual machine is modeled after a target machine; an identification module for identifying the target machine to establish the virtual machine; and a simulation unit for simulating a controller of the target machine for the identification to be performed by the identification module.
In an embodiment, the simulation unit is configured for transmitting a simulation command to the target machine and the identification module for the identification to be performed by the identification module.
The present disclosure provides a simulation method for simulating a controller by a simulation unit. The controller is configured for controlling motions of a target machine. The simulation method may include: setting a parameter for a simulation trajectory; calculating a simulation command based on the parameter; and inputting the simulation command into the target machine for response comparison to determine whether the simulation command corresponds to a target command of the controller for controlling the target machine.
The present disclosure provides a simulation unit, which may comprise: a data collection portion for setting a parameter for a simulation trajectory; a calculation portion for calculating a simulation command based on the parameter; and an analysis portion for inputting the simulation command into the target machine for response comparison to determine whether the simulation command corresponds to a target command of the controller for controlling the target machine.
In an embodiment, the simulation unit is another controller. In an embodiment, the data collection portion sets the parameter for the simulation trajectory by collecting motion parameter information of the controller.
In an embodiment, the analysis portion determines whether the simulation command corresponds to the target command based on the correlation between the simulation trajectory and motions of the target machine.
From the above, the tuning method and the tuning system using the same according to the present disclosure construct the virtual machine to acquire relevant parameters of the target machine in order to simulate the response of the target machine and calculate required control parameters in real time. These control parameters are used by users as initial values for adjusting the parameters of the target machine. Thus, compared to the prior art, the tuning method according to the present disclosure allows an operator to quickly input control parameters into the target machine regardless of the experience of the operator, thereby saving significant amount of time the user has to spend in adjusting the parameters of the target machine.
The technical content of present disclosure is described by the following specific embodiments. One with ordinary skill in the art can readily understand the advantages and effects of the present disclosure upon reading the disclosure of this specification. The present disclosure may also be practiced or applied with other different implementations. Based on different contexts and applications, the various details in this specification can be modified and changed without departing from the spirit of the present disclosure.
It should be noted that the structures, ratios, sizes shown in the drawings appended to this specification are to be construed in conjunction with the disclosure of this specification in order to facilitate understanding of those skilled in the art. They are not meant, in any ways, to limit the implementations of the present disclosure, and therefore have no substantial technical meaning. Without affecting the effects created and objectives achieved by the present disclosure, any modifications, changes or adjustments to the structures, ratio relationships or sizes, are to be construed as fall within the range covered by the technical contents disclosed herein. Meanwhile, terms, such as “one”, “a”, “an”, and the like, are for illustrative purposes only, and are not meant to limit the range implementable by the present disclosure. Any changes or adjustments made to their relative relationships, without modifying the substantial technical contents, are also to be construed as within the range implementable by the present disclosure.
Referring to
As shown in
In an embodiment, the target machine 2 is an automation control machine tool (e.g., a CNC lathe) equipped with a controller 20 for controlling the operations (e.g., processing) of the target machine 2.
The server 90 is used for simulating the operations of the target machine 2 and displaying the simulation results in the form of a virtual machine on the screen 91.
In an embodiment, the virtual machine is used for simulating motion statuses of the target machine 2 before and after adjusting the parameters of the controller 20. In an embodiment, the virtual machine includes a plurality of interfaces for displaying parameters (e.g., interfaces shown in
Therefore, the simulation accuracy of the virtual machine is critical. The establishing of the virtual machine is now described in details.
Referring to
Since the application of the virtual machine involves various parameters of the controller 20, a device capable of simulating the controller 20 is needed, such as the provision of the simulation unit 1. In an embodiment, the simulation unit 1 is used for simulating the controller 20, which can be a customized controller consisting of, for example, a controller chip and relevant electronic components, and can be selectively integrated in the server 90 or provided separately from the server 90.
In an embodiment, as shown in
Further, the steps for simulating of the controller 20 by the simulation unit 1 are as follows.
First, in step S21, the data collection portion 10 captures the motion parameter information of the controller 20 using communication transmission. A user arbitrary selects a trajectory (e.g., a processing route), such as a straight line, a turning line, or an arc; the present disclosure is not limited to as such, and the trajectory is inputted into the data collection portion 10. In step S22, the user sets parameters for a simulation trajectory based on the trajectory, such as a spatial parameter (a simulation parameter), wherein the space can be a two-dimensional space or a three-dimensional space. Next, in step S23, the user sets an acceleration/deceleration parameter (i.e., a simulation parameter) based on the spatial parameter, wherein the acceleration/deceleration parameter may include a pre-interpolation time constant (Tb), a post-interpolation time constant (Ta), a pre-interpolation axial acceleration (Ap), an axial maximum speed difference limit (Vc) or a combination of the above. The settings of the acceleration/deceleration parameters by the user can be represented in the form of graphs.
Next, in step S24, the calculation portion 11 calculates a speed command and an acceleration command based on the acceleration/deceleration parameters. In an embodiment, built-in mathematical integration methods can be used to calculate the speed command and the acceleration command Numerous integration methods can be used, and the present disclosure is not limited to a specific integration method. Then, in step S25, the calculation portion 11 calculates a position command (a simulation command) based on the speed command and the acceleration command Since the target machine 2 cannot work based on inputs of the speed and acceleration commands, a position command (a simulation command) is thus calculated based on the speed and acceleration commands As such, the target machine 2 is able to actuate based on the relative relationship of positions.
Then, in step S26, the simulation command (position command) is automatically input into the target machine 2, so that the analysis portion 12 can perform response comparison. In other words, the analysis portion 12 compares the position command with a historical data (e.g., a target command issued by the controller 20 for controlling the target machine 2) to obtain a simulation error in order to determine whether the simulation command corresponds to the target command. In an embodiment, if a value of the simulation error is less than a predetermined value, the simulation command corresponds to the target command of the controller 20, and the simulation process is ended (e.g., in step S27). Else if a value of the simulation error is greater than the predetermined value, the simulation command cannot correspond to the target command of the controller 20, so the calculation portion 11 needs to re-calculate the speed command and the acceleration command (e.g., in step S26′).
With the simulation method above, the simulation unit 1 is able to effectively simulate the trajectory formation of the controller 20 of the target machine 2 (machine tool) in order to predict the impact of parameter adjustments on the trajectory. And then the simulation unit 1 is able to analyze whether the adjustments meet the actual requirements, in other words, if two trajectories approximate each other. As shown in
It can be appreciated that, in steps S21-S23, if the conditions set by the user do not match those of the controller 20, the comparison of the responses cannot be performed in step S26.
When the tuning system 9 is modeling the target machine 2 for the first time, albeit a virtual machine 9a can be established by simulating the controller 20 using the simulation unit 1, the servo system of the target machine 2 needs to be identified in order for the virtual machine 9a to operate just like the target machine 2. The servo system includes position, speed, current control loop and dynamic electrical characteristics in order to understand the impacts of different motors and servo parameters on the servo system.
As shown in
An algorithm software of the identification module 3 performs comparison using the method of least square (LS) as shown below:
wherein i=positive integer of 1−t;
y(i) is an actual system output;
{dot over (y)}(i) is an estimated system output;
ϕ(t) is a system input matrix;
ϕT(i) is a transpose matrix of a system input matrix;
θ is a system coefficient matrix;
{circumflex over (θ)} is a system estimated coefficient matrix;
Φ is a transpose matrix of ϕ(t);
Y(t) is a system output matrix;
e(i) is an estimated error; and
E(t) is an estimated error matrix.
Next, an error value by matrix multiplication is estimated as follows:
V(θ, t)=½ET(t)t×1E(t)t×t=½∥E(t)∥2=½∥Y(t)−{circumflex over (Y)}(t)∥2=½∥Φ(t)t×1θt×n−Φ(t)t×1{circumflex over (θ)}n×1∥2
The term V(θ, t) is the output, the term on the right of the equal sign ½∥Φ(t)t×nθn×1−Φ(t)t×1∥2 is the input, and E(t)T is the transpose matrix of the estimated error matrix. Since θ is the system coefficient matrix, and {circumflex over (θ)} is the system estimated coefficient matrix, the mass coefficient (M), the damping coefficient (B) and the spring coefficient (K) can be obtained by calculating the value of θ.
In order to minimize the error value, another multiplication matrix can be used as shown below:
Φ(t)t×n{circumflex over (θ)}n×1=Φ(t)t×nθn×1
This equation is multiplied by ΦT(t) on both sides, such that the right term carries out an inverse matrix:
The system estimated coefficient matrix {circumflex over (θ)} is the output, Φ and ΦT are inputs, and Y is a constant. Since the above equation is a mathematical equation, conditions represented by the equation can be arbitrarily defined. In an embodiment, the inputs can be the simulation command containing the simulation parameters of the simulation unit 1, i.e., the inputs can be the mass coefficient (M), the damping coefficient (B), and the spring coefficient (K).
In an embodiment, verification interfaces of the identification module 3 as shown in
Moreover, the calculated system parameters, such as the mass coefficient (M), the damping coefficient (B), and the spring coefficient (K), can be used to formulate a model 30 as shown below:
ms
2
X(s)+bsX(s)+ksX(s)=F(s), wherein s is a constant.
The model formula is built in the server 90, so that an appropriate formula can be selected based on the obtained system parameters. Therefore, the system parameter model 30 is provided to facilitate the understanding of the relationships of the mechanics and the physics between system parameters M, B, and K, which can be optionally displayed.
Moreover, the dynamic simulation diagram 31 of the system parameters shows the status of the calculated system parameters, such as the mass coefficient (M), the damping coefficient (B), and the spring coefficient (K), during system operations of the target machine 2. Therefore, the dynamic simulation diagram 31 of the system parameters is provided to facilitate the understanding of actual status of the system parameter model 30 during system operations of the target machine 2, as shown by different curves in
Therefore, the trajectory of the simulation unit 1 (customized controller) can be inputted to the identification module 3 of the tuning system 9 to simulate the system response of the target machine 2 (actual machine tool) when acceleration/deceleration. More specifically, as shown in
Next, in step S34, similar to steps S24 and S25, the simulation unit 1 converts the acceleration/deceleration parameters into a simulation command (e.g., a speed command, an acceleration command or a position command) Then in step S35, the output (i.e., the response information) of the target machine 2 is obtained based on the simulation command.
Thereafter, in step S36, the identification module 3 performs system identification of the target machine 2 based on the response information of the target machine 2 and the simulation command (as input) by using the LS algorithm described above to obtain an identification error value. Further, relevant system parameters of the target machine 2 are obtained, thereby completing the estimation of the servo system of the target machine 2 (as in step S37). It should be noted that if the identification error value is too large, the simulation unit 1 will reformulate a simulation command, as shown in step S36′.
It can be appreciated that, in steps S31-S33, if the conditions set by the user do not match with the conditions of the controller 20, then comparison of the response in step S35 cannot be performed.
As can be seen, in order to prevent the trajectory selected by the simulation unit 1 not conform with the system operations of the target machine 2, system identification of the target machine 2 is performed by the identification module 3 (for example, the simulation unit 1 requires an arc movement, but the system of target machine 2 can only perform straight line movement, so the identification module 3 performs corrections such that the virtual machine 9a can only perform straight line movements). Thus, when the user uses the tuning system 9 to establish the virtual machine 9a, the identification module 3 first needs to be employed in order to identify the system of the target machine 2 and to obtain the necessary system parameters.
As shown in
In an embodiment, the interfaces of the virtual machine 9a are configured based on the information obtained by the simulation unit 1 and the identification module 3. For example, the interface of
The control parameters depend on the type of controller 20, for example, the parameters of a PID (Proportional-Integral-Derivative) controller may be proportional gain (Kp), integration time (Ti), derivative time (Td), natural frequency (N) or other values a, b. It can be appreciated that the control parameters may also be parameters of a PI controller. Therefore, the parameters obtained by the simulation unit 1 in accordance with steps S21-S27 are displayed on the interface of
The trajectory 1a is a tuning route selected during adjustments of the parameters, which includes the options of several processing routes for user's selection and settings. Therefore, after the user has inputted the control parameters a, b and selected the trajectory 1a, the user may then press the “execute” button 41 (the system parameters 3a have been determined during system identification described with respect to
The type of controller 1b is obtained from simulation of the simulation unit 1. Thus, a single tuning system 9 may store many different types of controller 1b. For example, the controller 20 may be a PID controller or a PI controller, which can be selected and set by the user.
The model formula 1c is a built-in mathematical formula based on the model shown below:
G
PID(S)=Kp[(1/TiS)+1+TdS/(1+TdS/N)], and S is a constant.
An appropriate model formula 1c can be selected based on the control parameters of the controller 20 obtained by the simulation unit 1. Thus, the model formula 1c is provided to facilitate the understanding of mechanics and physics between system parameters M, B, and K, which can be optionally displayed. Once the user has chosen the type of controller 1b, the interface of
The simulation time 1d is the time it takes for the virtual machine 9a to perform parameters calculation in units of seconds. Therefore, after the user presses the “execute” button 41 and the virtual machine 9a has completed its calculation, the simulation time 1d (in seconds) will be displayed on the interface of
The dynamic simulation diagram 40 shows various simulation comparisons according to needs. More specifically, in one interface such as that shown in
As aforementioned, values of the system parameter 3a are determined during system identification described with respect to
The system type 3b is the servo system of the target machine 2 identified by the identification module 3. Thus, a single tuning system 9 may store a plurality of system types 3b according to the types of machines available in the intended factory for user selection.
The system parameter model 3c is determined during system identification as shown in
M
1
+B(-)+K(X1-X2)=F
M
2
−B(-)−K(X1-X2)=0
Thus, the present disclosure is not limited to a particular form of system parameter model 3c. After the user selects the system type 3b, the system parameters 3a and the system parameter model 3c are automatically displayed on the interface shown in
However, there are numerous ways for presenting any interface of the virtual machine 9a. The present disclosure is not limited to those shown above, and can be modified according to needs.
Furthermore, in step S45, during calculation of the control parameters, the virtual machine 9a adjusts the control parameters (e.g., any one or more of proportional gain Kp, integration time Ti, derivative time Td, natural frequency N) in a loop method to obtain control parameters with the minimum error value. For example, a built-in software in the virtual machine 9a for calculating the control parameters in real time may use the classical fourth-order Runge-Kutta method as shown below.
Given that the system initial value y′(x)=f(x,y) and y(x0)=y0, then y can be approximated as y(i+1)=yi+(k1+2k2+2k3+k4)/6. The equations are further shown below.
ki=□f(xi, yi);
k
2
=□f(xi+□/2, yi+k1/2);
k
3
=□f(xi+□/2, yi+k1/2);
k
4
=□f(xi+□, yi+k3);
x
i
=x
0+□;
The term y(i+1) is the output; the term on the right of the equal sign yi+(k1+2k2+2k3+k4)/6 (yi and k1k2k3k4) are inputs; and h is a constant. Since the above formula is a mathematical formula, the conditions it represents can be arbitrarily defined. For example, the input values can be the present parameters of the controller 20 (e.g., proportional gain Kp, integration time Ti derivative time Td, natural frequency N shown in
Further, the validity of the method shown in
When the processing condition concerns speed requirement, as shown in
When the processing condition concerns precision requirement, as shown in
Thus, when the tuning system 9 performs parameter adjustments, the simulation unit 1 and the identification module 3 performs in advance the simulation and the system identification operations, respectively. That is, a virtual machine 9a is established, and information is displayed on at least one interface (e.g., the interfaces shown in
Next, in steps S45 and S46, the user presses the “execute” button 41 to make the virtual machine 9a calculate the required control parameters (or optimized parameters) in real time using its built-in software (e.g., a software constructed based on the classical 4th order Runge-Kutta method as described above). The actual response (e.g., the actual motion routes L and L′) of the target machine 2 and the simulated response (e.g., the simulated motion routes S and S′) generated by the virtual machine 9a in simulating the target machine 2 are displayed in the dynamic simulation diagram 40. That is, the simulation of the response of the target machine 2 is performed by the virtual machine 9a based on the simulation parameters. In actual operations, the virtual machine 9a calculates and adjusts the control parameters a of
Thereafter, in step S47, the control parameters b after calculation by the virtual machine 9a are used as the initial base parameters (e.g., the control parameters of the controller 20) for tuning the target machine 2. Finally, the parameters on the target machine 2 are quickly adjusted manually or through automatic transmission of the tuning system 9, thereby significantly saving time taken for adjusting the parameters of the target machine 2.
In addition, the trajectory la provided by the simulation unit 1 can be inputted into the virtual machine 9a. The virtual machine 9a simulates the response generated by the mechanical structure with respect to acceleration/deceleration. The virtual machine 9a may also be used to simulate the compensation of the servo system on friction and backlash caused by the machine or the suppression of structure vibration.
In this embodiment, the tuning system 9 may use the identification module 3 to store control parameters obtained after each parameter adjustment by the virtual machine 9a or obtained from measuring the target machine 2 (same or different machine tool) in normal circumstances each time. The control parameters are used as comparison parameters for establishing a reference model.
As shown in
Therefore, the present disclosure is able to obtain the reference model of the target machine 2 via the identification module 3 at first. During adjustment of the parameters, as shown in
In conclusion, the tuning system 9 and the tuning method of the present disclosure constructs the virtual machine 9a that effectively simulates the target machine 2 through the use of the simulation unit 1 and the identification module 3. Thus, regardless of the experience of the operator, the operator only needs to set relevant conditions on the interfaces of the tuning system 9. The virtual machine 9a can then quickly calculate and carry out the parameters required for the controller 20 (e.g., in steps S45 and S46). The operator can directly adopt these calculated parameters (e.g., the values of the control parameters b) or fine tune the parameters, thereby allowing the operator to easily adjust the parameters of the controller 20 of the target machine 2 without trials and errors using a lot of parameter values.
Furthermore, the tuning system 9 of the present disclosure enables remote tuning (still needs the present parameters of the controller 20 to input into the columns of the values of the control parameters a in the interface shown in
Moreover, the system identification method of the identification module 3 uses the simulation command of the simulation unit 1 as its input signal.
In addition, the simulation unit 1 can be used alone for simulating the controller 20 without being limited to only work in cooperation with the tuning system 9.
The above embodiments are only used to illustrate the principles of the present disclosure, and should not be construed as to limit the present disclosure in any way. The above embodiments can be modified by those with ordinary skill in the art without departing from the scope of the present disclosure as defined in the following appended claims.