{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "

# Analysis of PLI3.d2 HWC Test in an RB Circuit

\n", " \n", "\n", "The circuit is powered up to I_INTERM_2. After a short plateau a powering failure is simulated by the power converter. After a minute the EE system is activated by a quench simulation in a current lead.\n", "The aim of this test is to verify the correct functionality of the PC when a powering failure is generated.\n", "\n", " \n", "\n", "The required analysis and signatures are listed below.\n", "\n", "|Responsible|Type of analysis|Criterion|\n", "|-----------|----------------|---------|\n", "|PC|PC voltage check|PC voltage ~ -1.5 V ± 0.5 V, 1 s after the EE activation. The current decay time constant should be within 20% of Decay_Time_const. Smooth exponential waveform on the PC voltage and current during the whole decay|\n", "|PC|Earth Current Analysis|The maximum earth current <50 mA during EE activation disregarding the peak at the opening of the EE system.|\n", "|EE|Energy discharge|Maximum voltage on EE resistance ($R*I$±10%) and maximum temperature of the EE resistance (±10% from theoretical value)|\n", "|EE|Energy discharge|Time delay on switch opening (300±50ms at odd point and 600±50ms at even point)|\n", "\n", "source: Powering Procedure and Acceptance Criteria for the 13 kA Dipole Circuits, MP3 Procedure, https://edms.cern.ch/document/874713" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# Analysis Assumptions\n", "- We consider standard analysis scenarios, i.e., all signals can be queried. If a signal is missing, an analysis can raise a warning and continue or an error and abort the analysis.\n", "- It is recommended to execute each cell one after another. However, since the signals are queried prior to analysis, any order of execution is allowed. In case an analysis cell is aborted, the following ones may not be executed (e.g. I\\_MEAS not present). \n", "\n", "# Plot Convention\n", "- Scales are labeled with signal name followed by a comma and a unit in square brackets, e.g., I_MEAS, [A].\n", "- If a reference signal is present, it is represented with a dashed line.\n", "- If the main current is present, its axis is on the left. Remaining signals are attached to the axis on the right. The legend of these signals is located on the lower left and upper right, respectively.\n", "- The grid comes from the left axis.\n", "- The title contains timestamp, circuit name, and signal name allowing to re-access the signal.\n", "- The plots assigned to the left scale have colors: blue (C0) and orange (C1). Plots presented on the right have colors red (C2) and green (C3).\n", "- Each plot has an individual time-synchronization mentioned explicitly in the description.\n", "- If an axis has a single signal, then the color of the label matches the signal's color. Otherwise, the label color is black." ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 0. Initialise Working Environment" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "scrolled": true }, "outputs": [], "source": [ "# External libraries\n", "print('Loading (1/11)'); import sys; import pandas as pd\n", "print('Loading (2/11)'); from IPython.display import display, Javascript, clear_output\n", "\n", "# Internal libraries\n", "print('Loading (3/11)'); import lhcsmapi\n", "print('Loading (4/11)'); from lhcsmapi.Time import Time\n", "print('Loading (5/11)'); from lhcsmapi.Timer import Timer\n", "print('Loading (6/11)'); from lhcsmapi.analysis.RbCircuitQuery import RbCircuitQuery\n", "print('Loading (7/11)'); from lhcsmapi.analysis.RbCircuitAnalysis import RbCircuitAnalysis\n", "print('Loading (8/11)'); from lhcsmapi.analysis.report_template import apply_report_template\n", "print('Loading (9/11)'); from lhcsmapi.gui.hwc.HwcSearchModuleMediator import HwcSearchModuleMediator\n", "print('Loading (10/11)'); from lhcsmapi.pyedsl.PlotBuilder import create_hwc_plot_title_with_circuit_name\n", "print('Loading (11/11)'); from lhcsmapi.analysis.expert_input import get_expert_decision\n", "\n", "clear_output()\n", "lhcsmapi.get_lhcsmapi_version()\n", "lhcsmapi.get_lhcsmhwc_version('../__init__.py')\n", "print('Analysis performed by %s' % HwcSearchModuleMediator.get_user())" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 1. User Input\n", "1. Copy code from AccTesting and paste into an empty cell below\n", " \n", "\n", " - If you only want to test the notebook only for the copy&paste feature (without opening the AccTesting), please copy and execute the code below\n", " \n", " hwc_test = 'PLI3.d2'\n", " circuit_name = 'RB.A12'\n", " campaign = 'HWC_2017'\n", " t_start = '2017-04-22 13:22:37.202'\n", " t_end = '2017-04-22 14:01:44.575'\n", " \n", "\n", "2. To analyze a historical test with a browser GUI, copy and execute the following code in the cell below\n", "\n", "circuit_type = 'RB'\n", "hwc_test = 'PLI3.d2'\n", "hwcb = HwcSearchModuleMediator(circuit_type=circuit_type, hwc_test=hwc_test, hwc_summary_path='/eos/project/l/lhcsm/hwc/HWC_Summary.csv')\n", "\n", "\n", " - After opening the browser GUI, choose a circuit name in order to display HWC test with, campaign name as well as start and end time" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "scrolled": false }, "outputs": [], "source": [ "hwc_test = 'PLI3.d2' \n", "circuit_name = 'RB.A34' \n", "campaign= 'Recommissioning post LS2' \n", "t_start = '2021-03-24 22:19:06.563000000'\n", "t_end = '2021-03-24 22:44:23.159000000'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('hwc_test = \\'%s\\'\\ncircuit_name = \\'%s\\'\\ncampaign = \\'%s\\'\\nt_start = \\'%s\\'\\nt_end = \\'%s\\'' % (hwc_test, circuit_name, campaign, t_start, t_end))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 2. Query All Signals Prior to Analysis" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deleteable": false, "scrolled": false, "tags": [ "skip_output" ] }, "outputs": [], "source": [ "circuit_type = 'RB'\n", "\n", "if 'hwcb' in locals():\n", " circuit_name = hwcb.get_circuit_name()\n", " t_start = Time.to_unix_timestamp(hwcb.get_start_time())\n", " t_end = Time.to_unix_timestamp(hwcb.get_end_time())\n", " t_start_ref = Time.to_unix_timestamp(hwcb.get_ref_start_time())\n", " t_end_ref = Time.to_unix_timestamp(hwcb.get_ref_end_time())\n", " is_automatic = hwcb.is_automatic_mode()\n", "else:\n", " t_start = Time.to_unix_timestamp(t_start)\n", " t_end = Time.to_unix_timestamp(t_end)\n", " t_start_ref, t_end_ref = HwcSearchModuleMediator.get_last_ref_start_end_time('/eos/project/l/lhcsm/hwc/HWC_Summary.csv', circuit_name, hwc_test, Time.to_string_short(t_start))\n", " print(t_start_ref, t_end_ref)\n", " t_start_ref, t_end_ref = Time.to_unix_timestamp(t_start_ref), Time.to_unix_timestamp(t_end_ref)\n", " is_automatic = False\n", "\n", "rb_query = RbCircuitQuery(circuit_type, circuit_name, max_executions=30)\n", "rb_analysis = RbCircuitAnalysis(circuit_type, results_table=None, is_automatic=is_automatic)\n", "\n", "with Timer():\n", " # PC\n", " i_meas_nxcals_df = rb_query.query_signal_nxcals(t_start, t_end, t0=t_start, system='PC', signal_names='I_MEAS', spark=spark) \n", "\n", " source_timestamp_pc = rb_query.find_source_timestamp_pc(t_start, t_end)\n", " timestamp_fgc = source_timestamp_pc.at[0, 'timestamp']\n", " \n", " source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref)\n", " timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp']\n", " \n", " # PIC\n", " timestamp_pic = rb_query.find_timestamp_pic(timestamp_fgc, spark=spark, duration=[(t_end-timestamp_fgc, 'ns')])\n", " timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')])\n", " i_a_df, i_ref_df = rb_query.query_pc_pm(timestamp_fgc, timestamp_fgc, signal_names=['I_A', 'I_REF'])\n", " i_meas_df, i_earth_df, i_earth_pcnt_df, v_meas_df = rb_query.query_pc_pm(timestamp_fgc, min(timestamp_pic), signal_names=['I_MEAS', 'I_EARTH', 'I_EARTH_PCNT', 'V_MEAS'])\n", " \n", " # PC Reference\n", " i_meas_nxcals_pic_sync_df = rb_query.query_signal_nxcals(t_start, t_end, t0=min(timestamp_pic), system='PC', signal_names='I_MEAS', spark=spark)\n", " i_meas_nxcals_pic_sync_ref_df = rb_query.query_signal_nxcals(t_start_ref, t_end_ref, t0=min(timestamp_pic_ref), system='PC', signal_names='I_MEAS', spark=spark) \n", " if isinstance(t_start_ref, int):\n", " source_timestamp_pc_ref = rb_query.find_source_timestamp_pc(t_start_ref, t_end_ref)\n", " timestamp_fgc_ref = source_timestamp_pc_ref.at[0, 'timestamp']\n", " else:\n", " timestamp_fgc_ref = float('nan')\n", " \n", " # PIC Reference\n", " #timestamp_pic_ref = rb_query.find_timestamp_pic(timestamp_fgc_ref, spark=spark, duration=[(t_end_ref-timestamp_fgc_ref, 'ns')])\n", " i_meas_ref_df = rb_query.query_pc_pm(timestamp_fgc_ref, min(timestamp_pic_ref), signal_names=['I_MEAS'])\n", " \n", " # EE Voltage\n", " source_timestamp_ee_odd_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_ODD')\n", " timestamp_ee_odd = source_timestamp_ee_odd_df.loc[0, 'timestamp']\n", " source_ee_odd = source_timestamp_ee_odd_df.loc[0, 'source']\n", " u_dump_res_odd_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_odd, min(timestamp_pic), system='EE_ODD', signal_names=['U_DUMP_RES'])\n", "\n", " source_timestamp_ee_even_df = rb_query.find_source_timestamp_ee(timestamp_fgc, system='EE_EVEN')\n", " timestamp_ee_even = source_timestamp_ee_even_df.loc[0, 'timestamp']\n", " source_ee_even = source_timestamp_ee_even_df.loc[0, 'source']\n", " u_dump_res_even_df = rb_query.query_ee_u_dump_res_pm(timestamp_ee_even, min(timestamp_pic), system='EE_EVEN', signal_names=['U_DUMP_RES'])\n", " \n", " # EE Temperature\n", " t_res_odd_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n", " if len(source_timestamp_ee_odd_df) > 1:\n", " t_res_odd_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n", " else:\n", " t_res_odd_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]\n", " \n", " t_res_even_0_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[0, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')\n", " if len(source_timestamp_ee_even_df) > 1:\n", " t_res_even_1_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_df.loc[1, 'timestamp'], min(timestamp_pic), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')\n", " else:\n", " t_res_even_1_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]\n", "\n", " # EE Voltage Reference\n", " if isinstance(t_start_ref, int):\n", " source_timestamp_ee_odd_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_ODD')\n", " source_timestamp_ee_even_ref_df = rb_query.find_source_timestamp_ee(timestamp_fgc_ref, system='EE_EVEN')\n", " \n", " u_dump_res_odd_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_ODD', signal_names=['U_DUMP_RES'])\n", "\n", " u_dump_res_even_ref_df = rb_query.query_ee_u_dump_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), system='EE_EVEN', signal_names=['U_DUMP_RES'])\n", "\n", " # EE Temperature Reference\n", " t_res_odd_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n", " if len(source_timestamp_ee_odd_ref_df) > 1:\n", " t_res_odd_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_odd_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_ODD')\n", " else:\n", " t_res_odd_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]\n", " t_res_even_0_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[0, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')\n", " if len(source_timestamp_ee_even_ref_df) > 1:\n", " t_res_even_1_ref_df = rb_query.query_ee_t_res_pm(source_timestamp_ee_even_ref_df.loc[1, 'timestamp'], min(timestamp_pic_ref), signal_names=['T_RES_BODY_1', 'T_RES_BODY_2', 'T_RES_BODY_3'], system='EE_EVEN')\n", " else:\n", " t_res_even_1_ref_df = [pd.DataFrame(columns=['T_RES_BODY_1']), pd.DataFrame(columns=['T_RES_BODY_2']), pd.DataFrame(columns=['T_RES_BODY_3'])]\n", " \n", " # DFB\n", " source_timestamp_leads_odd_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_ODD')\n", " t0 = t_start if source_timestamp_leads_odd_df.empty else timestamp_fgc\n", " u_hts_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')])\n", " u_res_odd_dfs = rb_query.query_leads(t0, source_timestamp_leads_odd_df, system='LEADS_ODD', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])\n", "\n", " source_timestamp_leads_even_df = rb_query.find_timestamp_leads(timestamp_fgc, 'LEADS_EVEN')\n", " t0 = t_start if source_timestamp_leads_even_df.empty else timestamp_fgc\n", " u_hts_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_HTS'], spark=spark, duration=[(t_end-t_start, 'ns')])\n", " u_res_even_dfs = rb_query.query_leads(t_start, source_timestamp_leads_even_df, system='LEADS_EVEN', signal_names=['U_RES'], spark=spark, duration=[(t_end-t_start, 'ns')])\n", " \n", " timestamp_dct = {'FGC': timestamp_fgc, 'PIC': min(timestamp_pic), 'EE_EVEN': timestamp_ee_even, 'EE_ODD': timestamp_ee_odd, 'LEADS_ODD': source_timestamp_leads_odd_df, 'LEADS_EVEN': source_timestamp_leads_even_df}" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 3. Timestamps" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.create_timestamp_table(timestamp_dct)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 4. Power Converter\n", "## 4.1. Plot of the Power Converter Main Current\n", "\n", "*GRAPHS*:\n", "\n", "- t = 0 s corresponds to the start of the test" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "import matplotlib as mpl\n", "mpl.rcParams['savefig.dpi'] = 80\n", "mpl.rcParams['figure.dpi'] = 80\n", "%matplotlib notebook\n", "title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS')\n", "rb_analysis.plot_i_meas(i_meas_nxcals_df, title=title)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- t = 0 s corresponds to PIC timestamp\n", "\n", "Delay between powering failure and EE may be different" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "i_meas_nxcals_pic_sync_df.rename(columns={'I_MEAS': '%s:I_MEAS' % circuit_name}, inplace=True)\n", "i_meas_nxcals_pic_sync_ref_df.rename(columns={'I_MEAS': '%s:I_MEAS_REF' % circuit_name}, inplace=True)\n", "ax = i_meas_nxcals_pic_sync_df.plot(figsize=(13.5, 6))\n", "i_meas_nxcals_pic_sync_ref_df.plot(ax=ax, grid=True, title=title)\n", "ax.set_xlabel('Time, [s]', fontsize=15)\n", "ax.set_ylabel('I, [A]', fontsize=15)\n", "ax.title.set_size(20)\n", "ax.tick_params(labelsize=15)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "## 4.2. Analysis of the Power Converter Main Current\n", "This analysis module displays the main current of the power converter (I_MEAS) compared to the one obtained from the reference FPA (HWC PNO.b2 test with opening of EE systems and without magnet quench).\n", "\n", "*ANALYSIS*:\n", "- The evolution of the characteristic time $\\tau$ of an exponential decay $f(t)$ is obtained as\n", "\\begin{equation}\n", "-\\frac{f(t)}{\\partial_t f(t)} = -\\frac{f_0 e^{-t/\\tilde{\\tau}}}{\\partial_t (f_0 e^{-t/\\tilde{\\tau}})} = -\\frac{f_0 e^{-t/\\tilde{\\tau}}}{-f_0/\\tilde{\\tau} e^{-t/\\tilde{\\tau}}}=-\\frac{1}{-1/\\tau}=\\tau\n", "\\end{equation}\n", "Naturally, this formula only applies to exponential decayed characterised by a time constant. Nonetheless, for pseudo-exponential decays, this formula gives a notion of the change of the characteristic time $\\tilde{\\tau}$. For a circuit we compute the time-varying characteristic time as\n", "\\begin{equation}\n", "\\tilde{\\tau} = - \\frac{\\text{I_MEAS}}{\\partial_t \\text{I_MEAS}}\n", "\\end{equation}\n", "\n", "*CRITERIA* \n", "- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 90 s< Tau <110 s\n", "\n", "*PLOT*:\n", "- The main power converter current (analyzed and reference) on the left axis, I_MEAS\n", "- The characteristic time calculated for the main current (reference and actual) on the right axis, -I_MEAS/dI_MEAS_dt \n", "The actual characteristic time contains steps, which indicate a quenching magnet (decrease of circuit inductance); note that for the reference one the steps are not present. Timing of PIC abort, FGC timestamp, and the maximum current are reported next to the graph.\n", "- t = 0 s corresponds to the respective (analyzed and reference) FGC timestamps." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.analyze_i_meas_pc(circuit_name, timestamp_fgc, timestamp_fgc_ref, min(timestamp_pic), i_meas_df, i_meas_ref_df)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "## 4.3. Analysis of the Power Converter Main Current Smoothness\n", "\n", "*ANALYSIS*:\n", "- The current smoothness is evaluated on the basis of its second derivative. The derivative is calculated as a rolling division of current and time differences. The rolling window is fixed and equal to 10 points; with the sampling time equal to 0.1 s the time difference is equal to $dt=1 s$.\n", "\\begin{equation}\n", "\\frac{d i(t)}{dt} = \\frac{i(t+dt)-i(t)}{dt}\n", "\\end{equation}\n", "To obtain the second derivative of the current decay, the formula above is applied twice to the current profile from PM after the second EE opening (for t > 1 s).\n", "\n", "*CRITERIA* \n", "- Check if the second derivative of the current decay of I_MEAS from t = 1 s is -10 A/s^2< dI_MEAS/dt^2 < 10 A/s^2\n", "\n", "*PLOT*:\n", "- The second derivative of the main power converter current on the left axis, dI_MEAS/dt^2\n", "- Green bar denotes the acceptance threshold for the second derivative of the main power converter current\n", "- t = 0 s corresponds to the PM timestamp of the FGC" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "scrolled": true }, "outputs": [], "source": [ "title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='I_MEAS smoothness')\n", "rb_analysis.plot_i_meas_smoothness(i_meas_df, title=title)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "## 4.4. Power Converter Voltage Analysis\n", "*CRITERIA*\n", "- Check if the V_MEAS voltage is within -3.7 +/- 0.5 V range 1 s after the EE timestamp, assuming that I_MEAS = ~9 kA.\n", "\n", "*GRAPHS*\n", "- t = 0 s corresponds to the PM timestamp of the FGC" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "title = create_hwc_plot_title_with_circuit_name(circuit_name=circuit_name, hwc_test=hwc_test, t_start=t_start, t_end=t_end, signal='V_MEAS')\n", "rb_analysis.assert_v_meas(timestamp_ee_even, min(timestamp_pic), t_after_ee=1, v_meas_df=v_meas_df, value_min=-4.2, value_max=-3.2, title=title, xmax=15)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 5. Energy Extraction System\n", "## 5.1. Analysis of the Energy Extraction Voltage\n", "\n", "*ANALYSIS*:\n", "\n", "- Calculate U_dump_res (t=0)\n", "- Calculate the characteristic time of pseudo-exponential current decay with the charge approach\n", "\n", "*CRITERIA*:\n", "\n", "- Check if U_DUMP_RES (t=0) = (±10%) U_DUMP_RES reference.\n", "- Check if the timestamp difference between FGC and EE an odd point is 100±50 ms \n", " The opening delay was 300±50 ms prior to YETS 2017/8\n", "- Check if the time stamp difference between FGC and EE an even point: 600±50 ms\n", "\n", "*WARNING*:\n", "- Check if the characteristic time of pseudo-exponential decay of I_MEAS from t=1 to 120 s is 110 s<-Tau <130 s\n", "\n", "*GRAPHS*:\n", "\n", "- t = 0 s corresponds to the PM timestamp of the FGC\n", "\n", "First plot (global view):\n", "- the power converter converter current on the left axis, I_MEAS\n", "- the two energy extraction voltages on the right, U_DUMP_RES, U_DUMP_RES\n", "\n", "Second plot (triggering view):\n", "- the power converter current on the left axis, I_MEAS\n", "- the power converter reference current on the left axis, STATUS.I_REF (should stop at the moment of the FGC PM timestamp)\n", "- the two energy extraction voltages on the right axis, U_DUMP_RES, U_DUMP_RES\n", "- the green dashed line denotes the PIC timestamp" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.analyze_char_time_u_dump_res_ee(circuit_name, timestamp_fgc, [u_dump_res_odd_df, u_dump_res_even_df], i_meas_df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.analyze_delay_time_u_dump_res_ee(circuit_name, min(timestamp_pic), min(timestamp_pic), [timestamp_ee_odd, timestamp_ee_even],\n", " i_a_df, i_ref_df, [u_dump_res_odd_df, u_dump_res_even_df])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.compare_max_u_res_dump_to_reference(u_dump_res_odd_df, u_dump_res_odd_ref_df, 'U_DUMP_RES_ODD')\n", "rb_analysis.compare_max_u_res_dump_to_reference(u_dump_res_even_df, u_dump_res_even_ref_df, 'U_DUMP_RES_EVEN')" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "## 5.2. Analysis of the Energy Extraction Temperature\n", "\n", "*WARNING*\n", "- Check if temperature profile is +/-25 K w.r.t. the reference temperature profile\n", "\n", "*PLOT*:\n", "\n", "- Temperature signals on the left axis, T\n", "- A reference signal with an acceptable signal range is also provided on the left axis\n", "- t = 0 s corresponds to PM timestamps of each temperature PM entry" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.plot_ee_temp(circuit_name + '_EE_ODD', timestamp_ee_odd, t_res_odd_0_df + t_res_odd_1_df, t_res_odd_0_ref_df + t_res_odd_1_ref_df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "scrolled": false }, "outputs": [], "source": [ "rb_analysis.analyze_ee_temp(circuit_name + '_EE_ODD', timestamp_ee_odd, t_res_odd_0_df + t_res_odd_1_df, t_res_odd_0_ref_df + t_res_odd_1_ref_df, abs_margin=25, scaling=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.plot_ee_temp(circuit_name + '_EE_EVEN', timestamp_ee_even, t_res_even_0_df + t_res_even_1_df, t_res_even_0_ref_df + t_res_even_1_ref_df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "rb_analysis.analyze_ee_temp(circuit_name + '_EE_EVEN', timestamp_ee_even, t_res_even_0_df + t_res_even_1_df, t_res_even_0_ref_df + t_res_even_1_ref_df, abs_margin=25, scaling=1)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 6. Current Leads\n", "## 6.1. Plot of Current Leads\n", "\n", "*CRITERIA*:\n", "\n", "- Check if the quench detection signal for U_HTS is below the threshold (3 mV)\n", "- Check if the quench detection signal for U_RES is below the threshold (100 mV)\n", "\n", "*GRAPHS*:\n", "\n", "- t = 0 s corresponds to the FGC timestamp" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "timestamp = t_start if source_timestamp_leads_odd_df.empty else source_timestamp_leads_odd_df.loc[0, 'timestamp']\n", "rb_analysis.analyze_leads_voltage(u_hts_odd_dfs, circuit_name, timestamp, signal='U_HTS', value_min=-0.003, value_max=0.003)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "timestamp = t_start if source_timestamp_leads_even_df.empty else source_timestamp_leads_even_df.loc[0, 'timestamp']\n", "rb_analysis.analyze_leads_voltage(u_hts_even_dfs, circuit_name, timestamp, signal='U_HTS', value_min=-0.003, value_max=0.003)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "timestamp = t_start if source_timestamp_leads_odd_df.empty else source_timestamp_leads_odd_df.loc[0, 'timestamp']\n", "rb_analysis.analyze_leads_voltage(u_res_odd_dfs, circuit_name, timestamp, signal='U_RES', value_min=-0.1, value_max=0.1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "timestamp = t_start if source_timestamp_leads_even_df.empty else source_timestamp_leads_even_df.loc[0, 'timestamp']\n", "rb_analysis.analyze_leads_voltage(u_res_even_dfs, circuit_name, timestamp, signal='U_RES', value_min=-0.1, value_max=0.1)" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 7. Signature Decision" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "signature = get_expert_decision('Expert Signature Decision: ', ['PASSED', 'FAILED'])" ] }, { "cell_type": "markdown", "metadata": { "deletable": false }, "source": [ "# 8. Final Report" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false }, "outputs": [], "source": [ "analysis_start_time = Time.get_analysis_start_time()\n", "apply_report_template()\n", "file_name_html = '{}_{}-{}-{}_{}.html'.format(circuit_name, hwc_test, Time.to_datetime(t_start).strftime(\"%Y-%m-%d-%Hh%M\"), analysis_start_time, signature)\n", "full_path = '/eos/project/m/mp3/RB/{}/{}/{}'.format(circuit_name, hwc_test, file_name_html)\n", "!mkdir -p /eos/project/m/mp3/RB/$circuit_name/$hwc_test\n", "print('Compact notebook report saved to (Windows): ' + '\\\\\\\\cernbox-smb' + full_path.replace('/', '\\\\'))\n", "display(Javascript('IPython.notebook.save_notebook();'))\n", "Time.sleep(5)\n", "!{sys.executable} -m jupyter nbconvert --to html $'AN_RB_PLI3.d2.ipynb' --output /eos/project/m/mp3/RB/$circuit_name/$hwc_test/$file_name_html --TemplateExporter.exclude_input=True --TagRemovePreprocessor.remove_all_outputs_tags='[\"skip_output\"]'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" }, "sparkconnect": { "bundled_options": [ "NXCALS", "SparkMetrics" ], "list_of_options": [] }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": false, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }