aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-12 18:23:05 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-12 18:23:05 +0300
commit819b2bc2094baac1ddf4e6e84cd308e96eb17d8e (patch)
tree8b77801f6ccc5aea874583c334f3bf71ff6083d0 /Software/Embedded_SW/Embedded/Modules
parentda8c561c85c9ee296cb18796e5db95ca759d1063 (diff)
parenta4a2a94fe295f57c462eb3cd2c24c9ba512de5a6 (diff)
downloadTango-819b2bc2094baac1ddf4e6e84cd308e96eb17d8e.tar.gz
Tango-819b2bc2094baac1ddf4e6e84cd308e96eb17d8e.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_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 )