-
Notifications
You must be signed in to change notification settings - Fork 124
Description
As we can see in the excerpt below, the API (American Petroleum Institute) STANDARD 617 requires that the bearing transfer functions relating force and displacement be provided. The main objective of the changes proposed in this issue is to enable ROSS to provide the user with such transfer functions.
As can be seen in the diagram below, the PID controller produces a current signal that is injected into the electromagnetic actuator which, in turn, produces a force that is applied to the shaft and generates a displacement in the bearing plane. To determine the transfer function that relates such displacement to the magnetic force produced by the actuator, the least squares method was used. Since the relationship between force and displacement is usually represented by a second-order transfer function, given that most mechanical systems can be modeled using Newton's second law, it was considered that the relationship between
The transfer function
in which
The difference equation in question can be rewritten based on the definition of
The least squares method is based on minimizing the difference between the actual output
Assuming that
it is possible to analytically determine the values of
In order for the equation above to be used to determine the parameters rotor.run_time_response()
method.
The graph below shows the temporal evolution of the magnitude of the force applied to the rotor disk, responsible for producing disturbances in the output to be measured.
The current signal
The application of the least squares method resulted in the following model,
The graph below allows a visual comparison between the output produced by ROSS
It is noted that the curves practically overlap, which indicates an excellent fit of the model to the data produced by ROSS. In fact, the fit of the model can be computed as follows.
The method used to obtain the above result can be seen below:
def estimate_second_order_model(U, Y):
"""
Method for estimating a model based on applied inputs and collected outputs.
The model used was: (b_0 z + b_1) / (z^2 + a_0 z + a_1)
:param U: One-dimensional array containing the inputs applied over time.
:param Y: One-dimensional array containing the outputs measured over time.
:return: A tuple containing the coefficients of the estimated model (a_0, a_1, b_0, b_1)
"""
y_1 = 0
y_2 = 0
u_1 = 0
u_2 = 0
Phi = []
for k in range(0, U.shape[0]):
phi_T = [-y_1, -y_2, u_1, u_2]
Phi.append(phi_T)
y_2 = y_1
y_1 = Y[k]
u_2 = u_1
u_1 = U[k]
Y = np.matrix(Y).T
Phi = np.matrix(Phi)
theta = (Phi.T * Phi).I * Phi.T * Y
a_0 = theta[0, 0]
a_1 = theta[1, 0]
b_0 = theta[2, 0]
b_1 = theta[3, 0]
Y_est = []
y_1 = 0
y_2 = 0
u_1 = 0
u_2 = 0
for k in range(0, U.shape[0]):
phi_T = [-y_1, -y_2, u_1, u_2]
y_est = (phi_T * theta)[0, 0]
Y_est.append(y_est)
y_2 = y_1
y_1 = y_est
u_2 = u_1
u_1 = U[k]
return a_0, a_1, b_0, b_1, Y_est
The estimation of the transfer functions that relate force and displacement is still a work in progress. Some of the activities yet to be carried out are listed below.
- Evaluate the result of the estimate for other input types
- Evaluate the quality of the estimate in the frequency domain
- Propose a way to include the computation of the
$F/x$ transfer function in ROSS - Allow the user to adjust the model (through the number of poles and zeros)
- Compute the
$i/x$ transfer function (actually used in the control system design)