Changeset 784 in ETALON


Ignore:
Timestamp:
Jul 18, 2018, 4:52:30 PM (6 years ago)
Author:
moutardier
Message:

new error of wago

Location:
BPM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BPM/motor_error.txt

    r778 r784  
    7272
    7373
     74Error No.: 1812
     75Designation : TMS_OVERCURRENT_HW
     76Description : Overcurrent output stage(750-673)
     77Possible cause/Solution : Overcurrent output stage (750-673): Short circuit or ground leak on the motor circuit
     78What we have done : change motor (because the frist one had died)
     79
    7480
    7581
  • BPM/print_datas.py

    r783 r784  
    1818    return(Lx)
    1919
    20 
    21 def read_data(fichier): # program to read data from a file of data with position of motor and them Va, Vb, Vc and Vd
     20def read_data_xmotor_ymotor_Va_Vb_Vc_Vd_sum_x_y(fichier): # program to read data from a file of data with position of motor and them Va, Vb, Vc and Vd
     21    fichier = open(fichier, "r")
     22    Data = fichier.read()
     23    Data_list = [[[] for i in range(9)] for j in range(3)]
     24    value = ""
     25    index = 0
     26    for i in Data:
     27        if (i == " ") :
     28            if index == -1:
     29                bpm_index = int(value)
     30                Data_list[0].append(value)
     31                index +=1
     32            elif index == 1:
     33                Data_list[1].append(value)
     34                #print(value)
     35                index += 1
     36            elif index == 2:
     37                Data_list[2].append(value)
     38                index += 1
     39            elif index == 3:
     40                Data_list[3].append(value)
     41                index += 1
     42            else:
     43                Data_list[4].append(value)
     44                index = 0
     45            value = ""
     46        elif (i == "\n") :
     47            value = ""
     48            index = -1
     49        else:
     50            value += i
     51    fichier.close()
     52    for i in range(5):
     53        Data_list[i] = float_list(Data_list[i])
     54    Data_list[0] = product_list(Data_list[0],10**-6)
     55    for i in range(1,5):
     56        Data_list[i] = product_list(Data_list[i],1000)
     57    return(Data_list)
     58
     59
     60
     61def read_data_position_Va_Vb_Vc_Vd(fichier): # program to read data from a file of data with position of motor and them Va, Vb, Vc and Vd
    2262    fichier = open(fichier, "r")
    2363    Data = fichier.read()
     
    5898
    5999
    60 def print_graph(L): # program to print graph of data set in a list with [[position][Va][Vb][Vc][Vd]], also do a linear regretion and print the equation
    61 #    a = np.array([L[0][i],L[1][i]] for i in range(len(L[0])))
    62     global global_index_figure
     100
     101
     102def print_graph(L): # program to print graph of X_libera vs X_motor with a list L = [[[x_motor_position][y_motor_position][Va][Vb][Vc][Vd][sum][x_libera_position][y_libera_position]][same for BPM1][same for BPM2]], also do a linear regretion and print the equation
     103    global global_index_figure # to creat different figure
    63104    fig1 = plt.figure(global_index_figure)
    64105    global_index_figure += 1
    65106    plt.clf()
    66     lr1 = stats.linregress(L[0],L[1]) # return tuple (pente,ordonnee a l'origine, coef de correlation, p-value, erreur standard de l'estimation)
     107    for bpm_data in range(L):
     108        lr1 = stats.linregress(bpm_data[0],bpm_data[7]) # return tuple (pente,ordonnee a l'origine, coef de correlation, p-value, erreur standard de l'estimation)
     109        plt.plot(bpm_data[0],bpm_data[7], "r", label = "BMP_ref")
     110        plt.plot(bpm_data[0],[lr1.slope*i + lr1.intercept for i in bpm_data[0]], "r--", label = "BMP_ref regression line, \nerror = "+str(round(lr1.stderr,3))+",\ncorrelation coefficient = "+str(round(lr1.rvalue,3)))
     111
     112
     113
     114
     115
     116
     117
     118    """
     119    lr1 = stats.linregress(L[1],L[1]) # return tuple (pente,ordonnee a l'origine, coef de correlation, p-value, erreur standard de l'estimation)
    67120    plt.plot(L[0],L[1], "r", label = "BMP_ref")
    68121    plt.plot(L[0],[lr1.slope*i + lr1.intercept for i in L[0]], "r--", label = "BMP_ref regression line, \nerror = "+str(round(lr1.stderr,3))+",\ncorrelation coefficient = "+str(round(lr1.rvalue,3)))
     
    85138    plt.gca().yaxis.set_tick_params(labelsize = 8)
    86139#    plt.show()
    87 
    88 def residu(L): # program to do graph of residu of data give in a list with [[position][Va][Vb][Vc][Vd]]
     140"""
     141def residu_position_Va_Vb_Vc_Vd(L): # program to do graph of residu of data give in a list with [[position][Va][Vb][Vc][Vd]]
    89142    global global_index_figure
    90143    fig1 = plt.figure(global_index_figure)
     
    153206
    154207   
    155 def print_data(fichier, min = None, max = None):
    156     L = min_max(read_data(fichier), mini = min, maxi = max)
     208def print_data_position_Va_Vb_Vc_Vd(fichier, min = None, max = None):
     209    L = min_max(read_data_position_Va_Vb_Vc_Vd(fichier), mini = min, maxi = max)
    157210    print_graph(L)
    158211    #print(L)
    159212
    160 def print_residu(fichier, min = None, max = None):
    161     L = min_max(read_data(fichier), mini = min, maxi = max)
    162     residu(L)
    163 
    164 print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt",0.1,0.3)
    165 print_residu("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt",0.1,0.3)
    166 
    167 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_163036_0.txt")
    168 
    169 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")
    170 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")
     213def print_residu_position_Va_Vb_Vc_Vd(fichier, min = None, max = None):
     214    L = min_max(read_data_position_Va_Vb_Vc_Vd(fichier), mini = min, maxi = max)
     215    residu_position_Va_Vb_Vc_Vd(L)
     216
     217print_data_position_Va_Vb_Vc_Vd("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt",0.1,0.3)
     218print_residu_position_Va_Vb_Vc_Vd("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt",0.1,0.3)
     219
     220#print_data_position_Va_Vb_Vc_Vd("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_163036_0.txt")
     221
     222#print_data_position_Va_Vb_Vc_Vd("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")
     223#print_data_position_Va_Vb_Vc_Vd("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")
    171224plt.show()
    172225
Note: See TracChangeset for help on using the changeset viewer.