aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-08-09 09:31:28 +0300
committerAvi Levkovich <avi@twine-s.com>2018-08-09 09:31:28 +0300
commit85f396d49c44fedae0a3af776143978d1a497154 (patch)
tree85d600af9078e0df78b54f4ce75bc9d74ba6f311 /Software/Embedded_SW/Embedded/Modules
parentd2d199db0af38c2d61a9dd58bea1154b099f9852 (diff)
parent535b90dc450d521e9567dbed050e411f91efdc50 (diff)
downloadTango-85f396d49c44fedae0a3af776143978d1a497154.tar.gz
Tango-85f396d49c44fedae0a3af776143978d1a497154.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c
index 6312c701e..1efce00e3 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c
@@ -35,9 +35,9 @@ void Calculateinit (void)
Bits_0Pascal = Vlow * 4096 / 3; // Vlow * 4096bit / 3Vref = 709.973328 bits
Bits_1MPascal = VHigh * 4096 / 3; // VHigh * 4096bit / 3Vref = 3549.86646 bits
- a = (Bits_1MPascal - Bits_0Pascal) / (1 - 0) ;// Mpascal/Bits = 2839.89307
+ a = (1 - 0) / (Bits_1MPascal - Bits_0Pascal);// Mpascal/Bits = 0.000352125
- b = Bits_0Pascal - (a * 0 ); //709.973328
+ b = 0 - (a * Bits_0Pascal ); // y = ax + b (x= Bits_0Pascal, y = 0)
}
float CalculateDispenserPressure (int DispenserId)
@@ -58,7 +58,7 @@ float CalculateDispenserPressure (int DispenserId)
if(data<Bits_0Pascal)
data = Bits_0Pascal;//40mA 0Bar
- temp = (data - b) / a;
+ temp = a * data + b;
DispenserPressure[DispenserId] = temp; // [Mpascal] ( 1 Mpascal = 10 Bar )