sensor3updates

This commit is contained in:
Adit Khandelwal
2025-11-20 15:41:39 -06:00
parent 707c2146da
commit 892e50c619
2 changed files with 7 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
# --- Load CSV --- # --- Load CSV ---
data = pd.read_csv(r'C:\Users\k28ad\OneDrive\Documents\sensor\Sensor3DataNew.csv') data = pd.read_csv(r'C:\Users\k28ad\OneDrive\Documents\GitHub\guadaloop_lev_control\sensor\Sensor3NewAverages.csv')
x = data["x"].values x = data["x"].values
# Stack them into a 2D array (shape: 5 × 100) # Stack them into a 2D array (shape: 5 × 100)
# stacked = np.column_stack((data["y"].values, data["y2"].values, data["y3"].values, data["y4"].values, data["y5"].values)) # stacked = np.column_stack((data["y"].values, data["y2"].values, data["y3"].values, data["y4"].values, data["y5"].values))

View File

@@ -47,14 +47,14 @@ class App:
v = 0.2822807132259202 v = 0.2822807132259202
if (sensor == 3): if (sensor == 3):
A = -13.891292062248292 A = -13.8907146886418
K = 990.6819962477331 K = 990.6824637304771
B = 0.16376045588859353 B = 0.16376005385006073
C = -0.074904004740735 C = -0.07513804021312243
v = 0.17727132893449118 v = 0.1772655198934789
#IMPORTANT: FOR SENSOR 3, INDUCTION SENSOR OUTPUTS VOLTAGE > 6 v #IMPORTANT: FOR SENSOR 3, INDUCTION SENSOR OUTPUTS VOLTAGE > 6 v
#SO WE USED NEW VOLTAGE DIVIDER: 220 OHMS, 550 OHMS #SO WE USED NEW VOLTAGE DIVIDER: 20000 OHMS, 50000 OHMS
y = float(analog) y = float(analog)
#print(y) #print(y)
real = C - (1.0 / B) * np.log((( (K - A) / (y - A) ) ** v) - 1.0) real = C - (1.0 / B) * np.log((( (K - A) / (y - A) ) ** v) - 1.0)