-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensitivity computation when using Magnetic Bearings #1099
Comments
During the sensitivity computing implementation, it was necessary to slightly modify the initially proposed structure. The changes implemented in the ROSS fork (specifically at: https://github.com/ArthurIasbeck/ross/tree/compute-sensitivity) are described below.
In summary, the user executes the |
Below are the latest changes implemented in the fork https://github.com/ArthurIasbeck/ross/tree/compute-sensitivity.
|
The changes that enable ROSS to perform the computation of sensitivities associated with magnetic bearings present in the rotor have been duly implemented in the fork https://github.com/ArthurIasbeck/ross/tree/compute-sensitivity and the pull request https://github.com/petrobras/ross/pull/1108 has been opened, requesting that these changes be incorporated into ROSS. |
Recently, the following changes were made (commit ID 021e8e9 from fork https://github.com/ArthurIasbeck/ross/tree/compute-sensitivity):
|
I recently had access to ISO 14839-3, which defines how the sensitivity of active magnetic bearings should be measured. This ISO standard assumes that the control system associated with the AMB can be represented as follows: where The system above can be simplified so that: Based on these representations, the ISO standard proposes that the open-loop, closed-loop, and sensitivity transfer functions, represented by Also, according to the ISO standard, it is possible to define the open-loop transfer function as Starting from the simplified diagram introduced previously, it is possible to verify that Assuming that the frequency response provided by ROSS is obtained by varying Therefore, it follows that Since the controller transfer function The recent changes in the methods responsible for calculating the sensitivity aimed to comply with ISO 14839-3. There were few significant changes, among them, the addition of |
As mentioned in previous comments, ISO 14839-3 describes the experimental procedure associated with measuring the sensitivity of the Active Magnetic Bearing (AMB) control systems. This procedure is based on the sampling of some signals and the application of noise The time-domain data that enabled the computation of the sensitivity were obtained through the execution of the def generate_time_response():
np.random.seed(0)
rotor = self.rotor_assembly()
speed = 1200 # [rad/s] = [Hz] * 2 * np.pi
time_samples = int(self.t_max / self.dt + 1)
t = np.linspace(0, self.t_max, time_samples)
f = np.zeros((len(t), rotor.ndof))
response = rotor.run_time_response(speed, f, t, method="newmark") The method responsible for implementing the controllers associated with each AMBs ( def magnetic_bearing_controller(self, magnetic_bearings, time_step, disp_resp):
...
for elm in magnetic_bearings:
dofs = [self.number_dof * elm.n, self.number_dof * elm.n + 1]
for idx_dofs, value_dofs in enumerate(dofs):
# CODE ADDED - START
if value_dofs == 49:
# Impulse
if elm.e0[idx_dofs] == 1e-06:
e = 1
else:
e = 0
# White noise (uniform)
# e = np.random.rand() * 1e-6
# White noise (Gaussian)
# e = np.random.normal(scale=1e-6)
v_2 = disp_resp[value_dofs]
v_1 = v_2 + e
data_dict = {
"e": e,
"v_1": v_1,
"v_2": v_2
}
err = setpoint - v_1
else:
err = setpoint - disp_resp[value_dofs]
# CODE ADDED - END
P = elm.kp_pid * err
elm.integral[idx_dofs] += elm.ki_pid * err * dt
D = elm.kd_pid * (err - elm.e0[idx_dofs]) / dt
... The data collected from the terminal after the execution of the def compute_sensitivity(
data_file_name="input/00_temp_data_to_compute_sensitivity.txt",
):
with open(data_file_name, "r") as file:
data = file.readlines()
data = data[2:-1]
e_list = []
v_1_list = []
for line in data:
values = json.loads(line)
e_list.append(values["e"])
v_1_list.append(values["v_1"])
e = np.array(e_list, dtype=np.float64)
v_1 = np.array(v_1_list, dtype=np.float64)
t = np.linspace(0, self.t_max, len(e))
f, abs_G_s, phase_G_s, _ = compute_freq_resp_from_temp(
t, v_1, e, plot_result=plot_result
)
omega = 2 * np.pi * f
return omega, abs_G_s, phase_G_s
def compute_freq_resp_from_temp(t, y, u, plot_result=False, ft_gain=1):
Y, _, _, _ = compute_fft(y, t)
U, f, _, _ = compute_fft(u, t)
Gyy = np.conj(Y) * Y
Guu = np.conj(U) * U
Guy = np.conj(U) * Y
H = ft_gain * (Guy / Guu)
coe = np.absolute(Guy) ** 2 / (Gyy * Guu)
abs_H, phase_H = compute_abs_phase(H)
return f, abs_H, phase_H, H
def compute_abs_phase(X):
X = np.round(X, 10)
abs_X = np.absolute(X)
phase_X = np.array([0 if np.absolute(z) == 0 else np.angle(z) for z in X])
return abs_X, phase_X The rotor used to obtain the evaluated data is represented below. The sensitivity calculation, in this case, was based on the data associated with the In the graphs below, it is possible to verify the sensitivity values obtained considering different types of disturbance |
Theoretical Background
The API STANDARD 617 document (produced by the American Petroleum Institute) requires that rotors supported by active magnetic bearings (AMBs) have their stability assessed based on a series of criteria. One of these criteria involves analyzing the sensitivity of the closed-loop control system that enables the AMB operation. Given the transfer functions of the controller$G_r(s)$ and the plant $G_p(s)$ (which in this case describes the relationship between the force applied by the AMB and the displacement of the shaft at the bearing location), it is possible to calculate the sensitivity $G_s(s)$ as follows:
Since the closed-loop response is given by
it can be concluded that$G_s(s) + G_c(s) = 1$ . Therefore,
The block diagram below graphically represents the control system associated with the AMB. The force that the AMB applies to the shaft and the displacement of the shaft at the bearing location are represented by$F$ and $x$ , respectively.
According to the ROSS documentation, the frequency response obtained from the execution of the$F_w$ , represents an excitation to the control system, as shown in the figure below.
run_freq_response
method is computed based on the application of an excitation force at a given node of the shaft. This force,Therefore, since ROSS produces a frequency response that relates$x$ and $F_d$ , it can be said that this response represents, in the frequency domain, the transfer function $G_d(s)$ , whose definition can be obtained based on the analysis of the block diagram introduced above.
where$F_d(s)$ and $X(s)$ are the Laplace transforms of the disturbance and output, respectively.
Given the definition of$T(s)$ previously presented, it follows that
Since the gains of the controller$G_r(s)$ (in this case, a PID controller) are known, it is possible to obtain the magnitude and phase of the controller's frequency response (using the Python Control Systems). Since the magnitude and phase of $G_d(s)$ are provided by ROSS (from the execution of the $T(s)$ as follows:
run_freq_response
method), it is possible to compute the magnitude and phase ofHaving obtained the magnitude and phase of$T(s)$ , the sensitivity can finally be computed, given that $S(s) = 1 - T(s)$ .
Method employed in the computation of sensitivity
The proposed method for computing the sensitivity is presented below. As previously discussed, the computation of the sensitivity depends on the gains of the controller employed and the frequency response provided by ROSS, which represents the relationship between the output and a disturbance applied at the plant input.
The script below was used to validate the aforementioned method. Both the rotor utilized, and the results obtained can be verified below, having been acquired from an execution that took 25.43 seconds. The computation of the sensitivity, itself, took only 1.09 milliseconds.
Complete code
Implementation of sensitivity computation in ROSS
The results presented thus far indicate that the proposed method does indeed allow the sensitivity to be correctly computed. Therefore, it is proposed that such computation should take place during the execution of the
run_freq_response
method. Once the frequency response (freq_resp
) has been properly computed by this method, it will be necessary to verify if there is any AMB associated with the rotor under analysis. If so, the sensitivity should be calculated based on the frequency response produced during the execution of therun_freq_response
method. TheFrequencyResponseResult
object will then need to be modified to receive information regarding sensitivity in its constructor. In addition, a new method should be added to this class, allowing the user to construct a plot that represents both the magnitude and phase of the sensitivity.The diagrams below illustrate the current structure of the
run_freq_response
method and theFrequencyResponseResult
class, while the blocks highlighted in pink indicate the modifications that will be implemented in both.The text was updated successfully, but these errors were encountered: