From 98848a96f592588748e37624ba09b5fae19921a4 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 4 Mar 2020 12:16:51 +0200 Subject: set head type to sylko until fixed. set the WHS blower setpoint in SW --- Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index eeb0051f5..6116818b2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -201,7 +201,7 @@ } else { - //WHS_Start_Blower_Control_Closed_Loop(2.5); + WHS_Set_SetPoint_Q_value(headairflow/2); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); -- cgit v1.3.1 From 12aa8a9ea3347b0c8365c14e172311d6b8ee6f38 Mon Sep 17 00:00:00 2001 From: Shai Frieder Date: Wed, 4 Mar 2020 17:16:25 +0200 Subject: --- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 1 + .../WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c | 5 -- .../WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c | 59 +++++++++++++++------- .../WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h | 13 +++++ .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded_SW/Embedded/Modules/General/process.c | 2 +- .../Embedded/Modules/Heaters/Heaters_print.c | 1 + .../Embedded/Modules/Thread/ThreadLoad.c | 3 ++ .../Embedded/Modules/Thread/Thread_print.c | 2 +- .../StateMachines/Initialization/InitSequence.c | 2 + .../StateMachines/Initialization/PowerIdle.c | 2 +- .../Initialization/PowerOffSequence.c | 2 +- 12 files changed, 65 insertions(+), 28 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 2d3763ede..d9a25aa61 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -18,6 +18,7 @@ #include #include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h" +#include FPGA_GPI FPGA_Gpi; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c index c25a0397c..d589b35ec 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_AD5272_Rheostat/WHS_Rheostat.c @@ -148,8 +148,3 @@ bool Gas_Voc() return status; } -bool Set_Next_Gas_Value() -{ - - -} diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c index c712dbd32..f813e9b91 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c @@ -18,7 +18,7 @@ #include #include #include - +#include #include "drivers/Flash_ram/MCU_E2Prom.h" uint16_t Orf_zero_value[DRIER_FLOW_METER+1] = {1112,0,1040}; @@ -253,7 +253,7 @@ double get_Q(WHS_Flow_Meter num) bool get_cur_vlv1(uint16_t *value) { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[14]) << 8) | U20_MAX11614.MAX11614_Read_Buf[15] ) & 0x0FFF); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[14]) << 8) | U20_MAX11614.MAX11614_Read_Buf[15] ) & 0x0FFF);//AIN7 ReportWithPackageFilter(WasteFilter,"------------ get_cur_vlv1 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -262,7 +262,7 @@ bool get_cur_fan(uint16_t *value) { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[12]) << 8) | U20_MAX11614.MAX11614_Read_Buf[13] ) & 0x0FFF); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[12]) << 8) | U20_MAX11614.MAX11614_Read_Buf[13] ) & 0x0FFF);//AIN6 ReportWithPackageFilter(WasteFilter,"------------ get_cur_fan (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -271,7 +271,7 @@ bool get_gas_out(uint16_t *value) { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[10]) << 8) | U20_MAX11614.MAX11614_Read_Buf[11] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[10]) << 8) | U20_MAX11614.MAX11614_Read_Buf[11] ) & 0x0FFF );//AIN5 ReportWithPackageFilter(WasteFilter,"------------ get_gas_out (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -280,16 +280,16 @@ bool get_vlev2(uint16_t *value) { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[8]) << 8) | U20_MAX11614.MAX11614_Read_Buf[9] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[8]) << 8) | U20_MAX11614.MAX11614_Read_Buf[9] ) & 0x0FFF );//AIN4 ReportWithPackageFilter(WasteFilter,"------------ get_vlev2 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } -bool get_vlev1(uint16_t *value) // U36 connected to AIN3 +bool get_vlev1(uint16_t *value) // U36 connected to AIN1 { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[2]) << 8) | U20_MAX11614.MAX11614_Read_Buf[3] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[2]) << 8) | U20_MAX11614.MAX11614_Read_Buf[3] ) & 0x0FFF );//AIN1 ReportWithPackageFilter(WasteFilter,"------------ get_vlev1 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -298,7 +298,7 @@ bool get_orf_3(uint16_t *value) // U33 connected to AIN0 { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[0]) << 8) | U20_MAX11614.MAX11614_Read_Buf[1] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[0]) << 8) | U20_MAX11614.MAX11614_Read_Buf[1] ) & 0x0FFF );//AIN0 ReportWithPackageFilter(WasteFilter,"------------ get_orf_3 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -307,7 +307,7 @@ bool get_orf_2(uint16_t *value) // U36 connected to AIN3 { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[6]) << 8) | U20_MAX11614.MAX11614_Read_Buf[7] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[6]) << 8) | U20_MAX11614.MAX11614_Read_Buf[7] ) & 0x0FFF );// AIN3 ReportWithPackageFilter(WasteFilter,"------------ get_orf_2 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -315,7 +315,7 @@ bool get_orf_2(uint16_t *value) // U36 connected to AIN3 bool get_orf_1(uint16_t *value) // U34 connected to AIN2 { bool status = OK; - *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[4]) << 8) | U20_MAX11614.MAX11614_Read_Buf[5] ) & 0x0FFF ); + *value = (((((uint16_t)U20_MAX11614.MAX11614_Read_Buf[4]) << 8) | U20_MAX11614.MAX11614_Read_Buf[5] ) & 0x0FFF ); // AIN2 ReportWithPackageFilter(WasteFilter,"------------ get_orf_1 (value)-----------------", __FILE__,__LINE__, value, RpMessage, 0, 0); return status; } @@ -378,18 +378,39 @@ double GetWHSAirFlow(uint8_t OR_Id) return Q_value ; } - -uint16_t GetWHSGasSensor() +#define coefficient 9.72 +double GetWHSWasteTankLevelMiliLiter() { - uint16_t value = 0; - get_gas_out(&value); - return value; + uint16_t Vm = 0; + uint16_t V0 = 0; + double waste_volume_ml = 0.0; + + get_vlev1(&Vm); + MCU_E2PromRead(EEPROM_WASTE_TANK_ZERO_VALUE,&V0); + waste_volume_ml = (coefficient * (Vm -V0)); + ReportWithPackageFilter(WasteFilter,"------------ waste_volume_ml -----------------", __FILE__, __LINE__, 0, RpMessage, (waste_volume_ml * 1000), 0); + return waste_volume_ml; } -uint16_t GetWHSWasteTankLevel() +#define OPEN_WASTE_VALVE 0 +#define CLOSE_WASTE_VALVE 1 +bool waste_seq() { - uint16_t value = 0; - get_cur_fan(&value); - return value; + bool status = OK; + double waste_level = 0.0; + + ReportWithPackageFilter(WasteFilter,"------------ open waste level Air valve -----------------", __FILE__, __LINE__, 0, RpMessage, 0, 0); + Trigger_SetWHS_VOC_Valve(OPEN_WASTE_VALVE); + ReportWithPackageFilter(WasteFilter,"------------ wait 1 second -----------------", __FILE__, __LINE__, 0, RpMessage, 0, 0); + + ReportWithPackageFilter(WasteFilter,"------------ close waste level Air valve -----------------", __FILE__, __LINE__, 0, RpMessage, 0, 0); + Trigger_SetWHS_VOC_Valve(CLOSE_WASTE_VALVE); + + waste_level = GetWHSWasteTankLevelMiliLiter(); + ReportWithPackageFilter(WasteFilter,"------------ get waste level in ml -----------------", __FILE__, __LINE__, 0, RpMessage, (waste_level*1000), 0); + + + + return status; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h index 0a4f73508..223135e37 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.h @@ -4,6 +4,18 @@ #ifndef WHS_MAX11614_H_ #define WHS_MAX11614_H_ + +/* + * DRIER -> ORF3 -> U33 -> ORF_1 -> U20.5 (AIN0) + * WAST_TANK -> LEV1 -> U35 -> ORF_2 -> U20.6 (AIN1) + * HEAD -> ORF1 -> U34 -> ORF_3 -> U20.7 (AIN2) + * N.U. -> ORF2 -> U36 -> VLEV1 -> U20.8 (AIN3) + * N.U -> U39 -> U45 -> VLEV2 -> U20.9 (AIN4) + * REHOSTAT -> U40 -> U45 -> GAS_OUT -> U20.10 (AIN5) + * CURRENT FAN -> U13 -> CUR_FAN -> U20.11 (AIN6) + * VALV1 -> U25 -> CUR_VLV1 -> U20.12 (AIN7) + * VALV2 -> U29 -> CUR_VLV2 -> U20.4 (AIN8) + */ #include typedef enum @@ -58,6 +70,7 @@ uint16_t GetWHSWasteTankLevel(void); bool SetDisplayView(WHS_Display_View view ); bool SetLeftDisplayView(WHS_Left_Display_View view ); bool SetWriteDisplayView(WHS_Left_Display_View view ); +uint32_t WHS_MAX11614_Load_OrificeZeroValue (uint16_t O1, uint16_t O3); uint16_t Get_orf1_V0(void); uint16_t Get_orf3_V0(void); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 5a920bc25..6297299de 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -53,6 +53,7 @@ #include "Modules/Waste/Waste.h" #include "Drivers/I2C_Communication/Main_Board_EEPROM/Main_EEPROM.h" #include +#include uint32_t EmbeddedParametersInit(void); uint32_t EmbeddedParametersWrite(void * buffer, uint16_t size); diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index da9070201..4cb35d488 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -25,7 +25,7 @@ #include "StateMachines/Initialization/InitSequence.h" #include "drivers/Flash_ram/FlashProgram.h" - +#include double dyeingspeed = 0; double dryerbufferlength = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 66f965d15..9b628a160 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -38,6 +38,7 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/I2C_Communication/Head_Card/ADC/Head_ADC.h" #include "Drivers/I2C_Communication/I2C.h" +#include #include "StateMachines/Printing/PrintingSTM.h" #include "StateMachines/Initialization/PowerIdle.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 6116818b2..946eae0ec 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -32,6 +32,9 @@ #include "drivers/motors/motor.h" #include "drivers/Flash_ram/MCU_E2Prom.h" #include "Drivers/I2C_Communication/I2C.h" +#include +#include + #include "PMR/Stubs/StubHeatingTestRequest.pb-c.h" #include "PMR/Stubs/StubHeatingTestResponse.pb-c.h" #include "PMR/Stubs/StubHeatingTestPollRequest.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 229b86cac..91f655171 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -458,7 +458,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //extern int MotorSamplePointer[MAX_THREAD_MOTORS_NUM]; //read value is the dancer angle - int i,index=MAX_THREAD_MOTORS_NUM; + int i,index=MAX_THREAD_MOTORS_NUM,len; //int len; int DancerId; int32_t TranslatedReadValue, avreageSampleValue = 0;//,avreageMotorSampleValue = 0; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 08136c846..6d9b8c411 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -34,6 +34,8 @@ #include "drivers/Flash_ram/MCU_E2Prom.h" #include #include +#include +#include #include "heaters/heaters_ex.h" diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 91a089321..11fb18110 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -23,7 +23,7 @@ #include "drivers/I2C_Communication/DAC/Blower.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Valves/Valve.h" - +#include #include "Modules/General/buttons.h" #include "heaters/heaters_ex.h" diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index a0cd8d118..10dde5bbe 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -34,7 +34,7 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Heater/TemperatureSensor.h" #include "drivers/Valves/Valve.h" - +#include #include "StateMachines/Printing/PrintingSTM.h" #include "PowerIdle.h" -- cgit v1.3.1