aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-09-16 10:29:07 +0300
committerAvi Levkovich <avi@twine-s.com>2019-09-16 10:29:07 +0300
commit7cd6b7395a58546d112f9d9fefe50813b1bb198d (patch)
tree4e058de2f510214f73e6b2be613abfba1bada15d /Software/Embedded_SW
parentc37b3746168eea774c813c796656905dca0fc412 (diff)
downloadTango-7cd6b7395a58546d112f9d9fefe50813b1bb198d.tar.gz
Tango-7cd6b7395a58546d112f9d9fefe50813b1bb198d.zip
Update the midtank calibration function + add stub to display the buffers of Initial_Offset_A and Slope_B
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c38
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h4
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c13
-rw-r--r--Software/Embedded_SW/Embedded/src/makefile.libs4
-rw-r--r--Software/Embedded_SW/Embedded/src/sysbios/makefile24
-rw-r--r--Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4fbin1817078 -> 1817446 bytes
6 files changed, 50 insertions, 33 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
index ed7421981..59d62863e 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
@@ -126,13 +126,13 @@ double Calculate_Pressure(uint32_t VsampleInBits )
Pressure = PBar;
return Pressure;
}
-*/
+*/
void MidTankPressureCorrection(double Offset)
{
//MidThankReadingOffset = Offset;
}
-
+/*
double Calculate_Pressure(uint32_t VsampleInBits )//MidTank
{
double temp, VADC = 0.0 ,PKpa,VSensor,HighMeter,LiquidLitter;
@@ -169,18 +169,18 @@ double Calculate_Pressure(uint32_t VsampleInBits )//MidTank
double Calculate_correction_MidTank_Pressure(uint32_t VsampleInBits )
{
-/*
- Assumptions:
- B=(8.2±0.2)mV/mm for all sensors.
- A is changed within ±50mV during full life cycle.
- Aair - should be measured (@ Vpow=5V) and stored as calibrated value
- Azero – estimated VOUT when level cartridge is equal to bottom surface of the midtank.
- Azero= Aair + B*(10+20)=Aair+246
- VOLUME=Stank*(VOUT-Azero)/B= 0.1*73.9*( VOUT - Aair-246)/8.2 (mL) {VOUT – mV}
- For not calibrated sensors (assembled at machines) Aair:=2554mV, so
- VOLUME= 0.1*73.9*( VOUT - 2800)/8.2 (mL)
- */
+// Assumptions:
+// B=(8.2±0.2)mV/mm for all sensors.
+// A is changed within ±50mV during full life cycle.
+// Aair - should be measured (@ Vpow=5V) and stored as calibrated value
+// Azero – estimated VOUT when level cartridge is equal to bottom surface of the midtank.
+// Azero= Aair + B*(10+20)=Aair+246
+// VOLUME=Stank*(VOUT-Azero)/B= 0.1*73.9*( VOUT - Aair-246)/8.2 (mL) {VOUT – mV}
+// For not calibrated sensors (assembled at machines) Aair:=2554mV, so
+// VOLUME= 0.1*73.9*( VOUT - 2800)/8.2 (mL)
+
+
double temp, VADC = 0.0 ,VSensor,LiquidLitter;
//---- VBits -> VADC ----
@@ -243,7 +243,7 @@ double Calculate_MidTank_Liquid(uint32_t VsampleInBits, double Factor )//MidTan
return LiquidLitter;
}
-
+*/
//Initial_Offset_A 2.5-3 [V] +-10%
double Deafault_Initial_Offset_A = 2.8;//TBD
double Max_Initial_Offset_A = 3.25;//TBD
@@ -257,7 +257,7 @@ double Min_Slope_B = 0.6;//TBD
double Calc_Calibration_MidTank_Liquid(uint32_t VsampleInBits, MidTank_t MidTank_ID )
{
double temp, VADC = 0.0 ,VSensor,LiquidLitter;
- double Factor = 0.93;//Only for dispenser 8 (due to the material density)
+ //double Factor = 0.93;//Only for dispenser 8 (due to the material density)
//---- VBits -> VADC ----
@@ -287,8 +287,8 @@ double Calc_Calibration_MidTank_Liquid(uint32_t VsampleInBits, MidTank_t MidTan
LiquidLitter = temp * Slope_B[MidTank_ID]; //Litter
}
- if(MidTank_ID == MIDTANK_8)
- temp *= Factor;//Only for dispenser 8 (due to the material density)
+ //if(MidTank_ID == MIDTANK_8)
+ // temp *= Factor;//Only for dispenser 8 (due to the material density)
if(LiquidLitter < 0)
LiquidLitter = 0;
@@ -375,9 +375,9 @@ double Read_MidTank_Pressure_Sensor(MidTank_t MidTank_ID) //0-7
//MidTank_Pressure[MidTank_ID] = Calculate_correction_MidTank_Pressure(VsampleInBits);//use the Calibration correction equation
- MidTank_Pressure[MidTank_ID] = Calculate_MidTank_Liquid(VsampleInBits , Factor);//According to Gal (email 28-Aug-19)
+ //MidTank_Pressure[MidTank_ID] = Calculate_MidTank_Liquid(VsampleInBits , Factor);//According to Gal (email 28-Aug-19)
- //Calc_Calibration_MidTank_Liquid(VsampleInBits, MidTank_ID );
+ MidTank_Pressure[MidTank_ID] = Calc_Calibration_MidTank_Liquid(VsampleInBits, MidTank_ID );
return MidTank_Pressure[MidTank_ID];
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
index e0aa9396f..8f7ed8a64 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
@@ -61,4 +61,8 @@ uint32_t Read_Heaters_Current(HEATERS_CURRENT Heater_ID);
void ADC_MUX_Init();
double Calc_Calibration_MidTank_Liquid(uint32_t VsampleInBits, MidTank_t MidTank_ID );
+
+extern double Initial_Offset_A[NUM_OF_MIDTANKS];
+extern double Slope_B[NUM_OF_MIDTANKS];
+
#endif /* DRIVERS_I2C_COMMUNICATION_ADC_MUX_ADC_MUX_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index c91b2edee..79e4b202a 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -73,6 +73,19 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
}
else
+ if((request->amount == 0x0A) && ((request->delay >= 0) && (request->delay < 8))) //read the midtank calibration
+ {
+ response.progress = Initial_Offset_A[request->delay];
+ response.has_progress = true;
+ }
+
+ else
+ if((request->amount == 0xB) && ((request->delay >= 0) && (request->delay < 8))) //read the midtank calibration
+ {
+ response.progress = Slope_B[request->delay];
+ response.has_progress = true;
+ }
+ else
if((request->amount == 0x5C4E) && (request->delay == 0x5C4E)) //Screw Home Pos dir
{
test_Home_Pos();
diff --git a/Software/Embedded_SW/Embedded/src/makefile.libs b/Software/Embedded_SW/Embedded/src/makefile.libs
index 6d9bf810f..f262762ef 100644
--- a/Software/Embedded_SW/Embedded/src/makefile.libs
+++ b/Software/Embedded_SW/Embedded/src/makefile.libs
@@ -1,6 +1,6 @@
#
# This file was generated based on the configuration script:
-# C:\TFS\Software\Embedded_SW\Embedded\Embedded.cfg
+# C:\Tango\Software\Embedded_SW\Embedded\Embedded.cfg
#
# This makefile may be included in other makefiles that need to build
# the libraries containing the compiled source files generated as
@@ -14,7 +14,7 @@
#
# The absolute path to the generated source directory (at the time the
# sources were generated) is:
-# C:\TFS\Software\Embedded_SW\Embedded\src
+# C:\Tango\Software\Embedded_SW\Embedded\src
#
GEN_SRC_DIR ?= ../src
diff --git a/Software/Embedded_SW/Embedded/src/sysbios/makefile b/Software/Embedded_SW/Embedded/src/sysbios/makefile
index 527c48702..1dec70826 100644
--- a/Software/Embedded_SW/Embedded/src/sysbios/makefile
+++ b/Software/Embedded_SW/Embedded/src/sysbios/makefile
@@ -1,29 +1,29 @@
-XOPTS = -I"C:/ti/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M4F
+XOPTS = -I"C:/TI/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M4F
-vpath % C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
-vpath %.c C:/ti/xdctools_3_32_00_06_core/packages/
+vpath % C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
+vpath %.c C:/TI/xdctools_3_32_00_06_core/packages/
CCOPTS = --endian=little -mv7M4 --abi=eabi --float_support=fpv4spd16 -q -ms --opt_for_speed=2 --program_level_compile -o3 -g --optimize_with_debug -Dxdc_FILE=__FILE__ -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_knl_Clock_stopCheckNext__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U
-XDC_ROOT = C:/ti/xdctools_3_32_00_06_core/packages/
+XDC_ROOT = C:/TI/xdctools_3_32_00_06_core/packages/
-BIOS_ROOT = C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
+BIOS_ROOT = C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/
BIOS_DEFS = -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=TRUE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE
-BIOS_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
+BIOS_INC = -I"C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
-TARGET_INC = -I"C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
+TARGET_INC = -I"C:/TI/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/"
INCS = $(BIOS_INC) $(TARGET_INC)
-CC = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include
-ASM = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include
-AR = C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/bin/armar rq
+CC = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
+ASM = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
+AR = C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armar rq
-DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
-CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
+DEL = C:/TI/xdctools_3_32_00_06_core/packages/../bin/rm -f
+CP = C:/TI/xdctools_3_32_00_06_core/packages/../bin/cp -f
define RM
$(if $(wildcard $1),$(DEL) $1,:)
diff --git a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
index f4cc14aed..90650539e 100644
--- a/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
+++ b/Software/Embedded_SW/Embedded/src/sysbios/sysbios.aem4f
Binary files differ