diff --git a/SI_LOG_MESSAGES.txt b/SI_LOG_MESSAGES.txt index 248a8b2..a965bdb 100644 --- a/SI_LOG_MESSAGES.txt +++ b/SI_LOG_MESSAGES.txt @@ -1,27 +1,29 @@ - EMPTY_LOG = 0, - LOGGING_DATA, - FLASH_ERROR, - FLASH_START_ERROR, - FLASH_FULL, - FLASH_LOG_FULL, - ENTER_STATIC_FIRE, - EXIT_STATIC_FIRE, - ENTER_ARM, - UPDATE_ARM, - EXIT_ARM, - LOX_OPEN, - LOX_OPEN_FULL, - ETHANOL_OPEN, - ETHANOL_OPEN_FULL, - NITROGEN_OPEN, - NITROGEN_OPEN_FULL, - LOX_CLOSING, - LOX_FULL_CLOSED, - ETHANOL_CLOSING, - ETHANOL_FULL_CLOSED, - NITROGEN_CLOSING, - NITROGEN_FULL_CLOSED, - ETHANOL_DRAIN_OPEN, - LOX_DRAIN_OPEN, - ETHANOL_DRAIN_CLOSED, - LOX_DRAIN_CLOSED \ No newline at end of file +EMPTY_LOG = 0, +LOGGING_DATA, +FLASH_ERROR, +FLASH_START_ERROR, +FLASH_FULL, +FLASH_LOG_FULL, +ENTER_STATIC_FIRE, +EXIT_STATIC_FIRE, +ENTER_ARM, +UPDATE_ARM, +EXIT_ARM, +LOX_OPEN, +LOX_OPEN_FULL, +ETHANOL_OPEN, +ETHANOL_OPEN_FULL, +NITROGEN_OPEN, +NITROGEN_OPEN_FULL, +LOX_CLOSING, +LOX_FULL_CLOSED, +ETHANOL_CLOSING, +ETHANOL_FULL_CLOSED, +NITROGEN_CLOSING, +NITROGEN_FULL_CLOSED, +ETHANOL_DRAIN_OPEN, +LOX_DRAIN_OPEN, +ETHANOL_DRAIN_CLOSED, +LOX_DRAIN_CLOSED, +ENTER_ABORT, +EXIT_ABORT \ No newline at end of file diff --git a/Serial_decoder.py b/Serial_decoder.py index f92794f..e825228 100644 --- a/Serial_decoder.py +++ b/Serial_decoder.py @@ -7,7 +7,7 @@ from datetime import datetime import queue import re -PORT = "COM7" +PORT = "COM9" SerialPort = serial.Serial(port=PORT,baudrate=250000) input_queue = queue.SimpleQueue() diff --git a/mainv2.py b/mainv2.py index 98c6e65..fa11055 100644 --- a/mainv2.py +++ b/mainv2.py @@ -72,7 +72,7 @@ lbl.grid(row=4, column=0, columnspan=2) labels.append(lbl) # index 16 lbl = tk.Label(root, text="Delta Tick:0", width=20, height=3, borderwidth=2, relief="groove", font=("Arial", 14)) -lbl.grid(row=4, column=2, columnspan=2) +lbl.grid(row=4, column=1, columnspan=2) labels.append(lbl) # index 17 # Checkboxes to select plotted (derived) channels @@ -232,7 +232,7 @@ def update_SI(value: SD.ReturnDecoder): # NOTE: mode should be "a" or "a+", not "+a" with open(f"{FILENAME}_SI.csv", "a") as file: file.write(f"{value.timestamp},{value.log_message}\n") - print(f"\033[F\033[2Ktime:{value.timestamp}, SI:{value.log_message}", end="\n") + print(f"Time:{value.timestamp}, SI:{value.log_message}", end="\n") Last_history_call: int = 0 @@ -262,8 +262,12 @@ def append_history(adc_values: list, timestamp: int): # 7-14: Pressures from channels 8..15 for i in range(8, 16): # eight pressure sensors - pres = 0.0000153522 * adc_values[i] - 6.5652036917 - history_y[i - 1].append(pres) # 8→7, 15→14 + if i == 12: + pres = 0.0000153522 * (adc_values[i] / 2) - 6.5652036917 + history_y[i - 1].append(pres) # 8→7, 15→14 + else: + pres = 0.0000153522 * adc_values[i] - 6.5652036917 + history_y[i - 1].append(pres) # 8→7, 15→14 def update_plot(): diff --git a/run1.m b/run1.m index 00729b3..54fedf7 100644 --- a/run1.m +++ b/run1.m @@ -1,7 +1,8 @@ close all -result = readmatrix("3NitrogenTest2_ADC_data.csv"); - +result = readmatrix("SaveData/2025_12_03_16_23_RUN1_ADC.csv"); +%result = result(14430:end, : ); +result(:,14) = result(:,14)./2; time = result(:,1); temp = 0.000111 .* result(:,4:9) + 2.31991; @@ -12,23 +13,26 @@ load_cell = result(:,2:3); weight = -1.166759307845543e-04 .* 0.5.*(load_cell(:,1) + load_cell(:,2)) + 4.971416323340051e+02; figure() -plot(time,weight) +scatter(time,weight,10) title("load cell in Kg") xlabel("Time in ms") ylabel("KG") +xlim([1101179 1134450+5000]) for x = 1:7 figure() - plot(time,pressure(:,x)) + scatter(time,pressure(:,x),10) title(sprintf("Pressure channel %d",x)) xlabel("Time in ms") ylabel("Pressure") + xlim([1101179 1134450+5000]) end for x = 1:6 figure() - plot(time,temp(:,x)) + scatter(time,temp(:,x),10) title(sprintf("temperature channel %d",x)) xlabel("Time in ms") ylabel("Temprature in C") + xlim([1101179 1134450+5000]) end diff --git a/run2.m b/run2.m new file mode 100644 index 0000000..d7fe9f9 --- /dev/null +++ b/run2.m @@ -0,0 +1,38 @@ +close all + +result = readmatrix("SaveData/2025_12_03_13_26_COLD_FIRE_ADC.csv"); +%result = result(14430:end, : ); +result(:,14) = result(:,14)./2; +time = result(:,1); + +temp = 0.000111 .* result(:,4:9) + 2.31991; + +pressure = result(:,10:17).*(0.000015)-6.565; + +load_cell = result(:,2:3); +weight = -1.166759307845543e-04 .* 0.5.*(load_cell(:,1) + load_cell(:,2)) + 4.971416323340051e+02; + +figure() +scatter(time,weight,10) +title("load cell in Kg") +xlabel("Time in ms") +ylabel("KG") +xlim([1038760 1082100+5000]) + +for x = 1:7 + figure() + scatter(time,pressure(:,x),10) + title(sprintf("Pressure channel %d",x)) + xlabel("Time in ms") + ylabel("Pressure") + xlim([1038760 1082100+5000]) +end + +for x = 1:6 + figure() + scatter(time,temp(:,x),10) + title(sprintf("temperature channel %d",x)) + xlabel("Time in ms") + ylabel("Temprature in C") + xlim([1038760 1082100+5000]) +end