Changeset 784 in ETALON
- Timestamp:
- Jul 18, 2018, 4:52:30 PM (6 years ago)
- Location:
- BPM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BPM/motor_error.txt
r778 r784 72 72 73 73 74 Error No.: 1812 75 Designation : TMS_OVERCURRENT_HW 76 Description : Overcurrent output stage(750-673) 77 Possible cause/Solution : Overcurrent output stage (750-673): Short circuit or ground leak on the motor circuit 78 What we have done : change motor (because the frist one had died) 79 74 80 75 81 -
BPM/print_datas.py
r783 r784 18 18 return(Lx) 19 19 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 20 def 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 61 def 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 22 62 fichier = open(fichier, "r") 23 63 Data = fichier.read() … … 58 98 59 99 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 102 def 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 63 104 fig1 = plt.figure(global_index_figure) 64 105 global_index_figure += 1 65 106 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) 67 120 plt.plot(L[0],L[1], "r", label = "BMP_ref") 68 121 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))) … … 85 138 plt.gca().yaxis.set_tick_params(labelsize = 8) 86 139 # 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 """ 141 def 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]] 89 142 global global_index_figure 90 143 fig1 = plt.figure(global_index_figure) … … 153 206 154 207 155 def print_data (fichier, min = None, max = None):156 L = min_max(read_data (fichier), mini = min, maxi = max)208 def 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) 157 210 print_graph(L) 158 211 #print(L) 159 212 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")213 def 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 217 print_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) 218 print_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") 171 224 plt.show() 172 225
Note: See TracChangeset
for help on using the changeset viewer.