From a52e0e1b4f0b981af32427cb7b2044f5cedd9829 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 6 Jul 2020 16:52:05 +0300 Subject: Version 1.4.6.35 - Pack Mid alpha ============================ Arc head - activate arc heaters gradually stop FPGA Reinit after 20 trials Head cleaning - move actuators (with stub - 0xAD7) fix RML PID support head open prevent job - (with stub - 0xAD6) add stub to overrule cone missing - 0xAD8 --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 0f9848ba1..26fba0194 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -170,6 +170,7 @@ void ControlStop(void) ControlRestart = false; ADCAcquireStop(); } +int FPGA_ReInit_Count = 0; ///avoid too many reinitializations of motors as happens when FPGA is corrupted uint32_t ControlActivityLed( uint32_t Parameter1) { static bool flag = false; @@ -192,11 +193,14 @@ uint32_t ControlActivityLed( uint32_t Parameter1) SendJobProgress(0.0,0,false, "Hardware Failure Error"); AbortJob("FPGA Watchdog Error"); } - ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0); + if (FPGA_ReInit_Count++<20) + { + ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0); - ACTIVITY_GREEN_LED_ON; - FPGA_SetMotorsInit(); - Motor_ReconfigAllMotors(); + ACTIVITY_GREEN_LED_ON; + FPGA_SetMotorsInit(); + Motor_ReconfigAllMotors(); + } } } else -- cgit v1.3.1 From cf49f9b7af8cb4ad0376157d27ef208eca6d1304 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 23 Jul 2020 18:54:20 +0300 Subject: some small changes, mostly in drier loading --- .../Communication/PMR/Diagnostics/EventType.pb-c.c | 402 +++++++++++---------- .../Communication/PMR/Diagnostics/EventType.pb-c.h | 9 +- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 2 +- .../Dispenser_Card/EEPROM/Dispenser_EEPROM.c | 2 +- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 3 + .../Embedded_SW/Embedded/Drivers/Motors/Motor.h | 2 +- .../Embedded/Drivers/Motors/MotorActions.c | 5 +- .../Embedded_SW/Embedded/Modules/Control/control.c | 3 + .../Modules/Diagnostics/DiagnosticActions.c | 6 + .../Modules/Diagnostics/DiagnosticsHoming.c | 11 +- .../Embedded/Modules/Heaters/Heaters_print.c | 16 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 11 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 4 +- .../Embedded/Modules/Thread/ThreadLoad.c | 49 ++- .../Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 1 + .../Embedded/Modules/Waste/Waste_maint.c | 21 ++ .../Embedded/StateMachines/Printing/JobSTM.c | 8 +- .../Embedded/StateMachines/Printing/PrintingSTM.c | 3 + .../Procedures/Dancers calibration.pproj | 1 + .../Procedures/EmbeddedParametersBuild.pproj | 1 + .../Procedures/WHS Loop Disable.pproj | 1 + 21 files changed, 332 insertions(+), 229 deletions(-) create mode 100644 Software/Stubs Collection/Procedures/Dancers calibration.pproj create mode 100644 Software/Stubs Collection/Procedures/EmbeddedParametersBuild.pproj create mode 100644 Software/Stubs Collection/Procedures/WHS Loop Disable.pproj (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c index 153e5bd8d..7f667ae6d 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "EventType.pb-c.h" -static const ProtobufCEnumValue event_type__enum_values_by_number[358] = +static const ProtobufCEnumValue event_type__enum_values_by_number[365] = { { "", "", 0 }, { "", "", 1000 }, @@ -45,6 +45,7 @@ static const ProtobufCEnumValue event_type__enum_values_by_number[358] = { "", "", 2018 }, { "", "", 2019 }, { "", "", 2020 }, + { "", "", 2021 }, { "", "", 3000 }, { "", "", 3001 }, { "", "", 3002 }, @@ -212,6 +213,12 @@ static const ProtobufCEnumValue event_type__enum_values_by_number[358] = { "", "", 5090 }, { "", "", 5091 }, { "", "", 5092 }, + { "", "", 5093 }, + { "", "", 5094 }, + { "", "", 5095 }, + { "", "", 5096 }, + { "", "", 5097 }, + { "", "", 5098 }, { "", "", 6000 }, { "", "", 6001 }, { "", "", 6002 }, @@ -369,177 +376,179 @@ static const ProtobufCEnumValue event_type__enum_values_by_number[358] = { "", "", 10005 }, }; static const ProtobufCIntRange event_type__value_ranges[] = { -{0, 0},{1000, 1},{2000, 15},{3000, 36},{4000, 88},{5000, 110},{6000, 203},{7000, 209},{8000, 297},{9000, 329},{10000, 352},{0, 358} +{0, 0},{1000, 1},{2000, 15},{3000, 37},{4000, 89},{5000, 111},{6000, 210},{7000, 216},{8000, 304},{9000, 336},{10000, 359},{0, 365} }; -static const ProtobufCEnumValueIndex event_type__enum_values_by_name[358] = +static const ProtobufCEnumValueIndex event_type__enum_values_by_name[365] = { - { "", 330 }, - { "", 329 }, - { "", 355 }, + { "", 337 }, + { "", 336 }, + { "", 362 }, { "", 4 }, { "", 5 }, { "", 6 }, { "", 7 }, + { "", 22 }, { "", 21 }, - { "", 335 }, - { "", 346 }, - { "", 340 }, + { "", 342 }, + { "", 353 }, { "", 347 }, - { "", 341 }, + { "", 354 }, { "", 348 }, - { "", 342 }, + { "", 355 }, { "", 349 }, - { "", 343 }, + { "", 356 }, { "", 350 }, - { "", 351 }, - { "", 225 }, + { "", 357 }, + { "", 358 }, + { "", 232 }, + { "", 296 }, + { "", 288 }, + { "", 248 }, + { "", 256 }, + { "", 264 }, + { "", 272 }, + { "", 216 }, + { "", 240 }, + { "", 224 }, + { "", 280 }, + { "", 233 }, + { "", 297 }, { "", 289 }, - { "", 281 }, - { "", 241 }, { "", 249 }, { "", 257 }, { "", 265 }, - { "", 209 }, - { "", 233 }, - { "", 217 }, { "", 273 }, - { "", 226 }, + { "", 217 }, + { "", 241 }, + { "", 225 }, + { "", 281 }, + { "", 234 }, + { "", 298 }, { "", 290 }, - { "", 282 }, - { "", 242 }, { "", 250 }, { "", 258 }, { "", 266 }, - { "", 210 }, - { "", 234 }, - { "", 218 }, { "", 274 }, - { "", 227 }, + { "", 218 }, + { "", 242 }, + { "", 226 }, + { "", 282 }, + { "", 235 }, + { "", 299 }, { "", 291 }, - { "", 283 }, - { "", 243 }, { "", 251 }, { "", 259 }, { "", 267 }, - { "", 211 }, - { "", 235 }, - { "", 219 }, { "", 275 }, - { "", 228 }, + { "", 219 }, + { "", 243 }, + { "", 227 }, + { "", 283 }, + { "", 236 }, + { "", 300 }, { "", 292 }, - { "", 284 }, - { "", 244 }, { "", 252 }, { "", 260 }, { "", 268 }, - { "", 212 }, - { "", 236 }, - { "", 220 }, { "", 276 }, - { "", 229 }, + { "", 220 }, + { "", 244 }, + { "", 228 }, + { "", 284 }, + { "", 237 }, + { "", 301 }, { "", 293 }, - { "", 285 }, - { "", 245 }, { "", 253 }, { "", 261 }, { "", 269 }, - { "", 213 }, - { "", 237 }, - { "", 221 }, { "", 277 }, - { "", 230 }, + { "", 221 }, + { "", 245 }, + { "", 229 }, + { "", 285 }, + { "", 238 }, + { "", 302 }, { "", 294 }, - { "", 286 }, - { "", 246 }, { "", 254 }, { "", 262 }, { "", 270 }, - { "", 214 }, - { "", 238 }, - { "", 222 }, { "", 278 }, - { "", 231 }, + { "", 222 }, + { "", 246 }, + { "", 230 }, + { "", 286 }, + { "", 239 }, + { "", 303 }, { "", 295 }, - { "", 287 }, - { "", 247 }, { "", 255 }, { "", 263 }, { "", 271 }, - { "", 215 }, - { "", 239 }, - { "", 223 }, { "", 279 }, - { "", 232 }, - { "", 296 }, - { "", 288 }, - { "", 248 }, - { "", 256 }, - { "", 264 }, - { "", 272 }, - { "", 216 }, - { "", 240 }, - { "", 224 }, - { "", 280 }, - { "", 92 }, - { "", 103 }, + { "", 223 }, + { "", 247 }, + { "", 231 }, + { "", 287 }, + { "", 93 }, { "", 104 }, - { "", 101 }, - { "", 99 }, + { "", 105 }, { "", 102 }, { "", 100 }, - { "", 105 }, + { "", 103 }, + { "", 101 }, { "", 106 }, { "", 107 }, { "", 108 }, - { "", 88 }, + { "", 109 }, { "", 89 }, { "", 90 }, { "", 91 }, - { "", 98 }, - { "", 93 }, - { "", 95 }, - { "", 96 }, + { "", 92 }, + { "", 99 }, { "", 94 }, - { "", 109 }, + { "", 96 }, { "", 97 }, - { "", 193 }, - { "", 191 }, - { "", 197 }, - { "", 195 }, - { "", 185 }, - { "", 187 }, - { "", 189 }, + { "", 95 }, + { "", 110 }, + { "", 98 }, + { "", 208 }, { "", 194 }, { "", 192 }, { "", 198 }, { "", 196 }, + { "", 204 }, + { "", 206 }, { "", 186 }, { "", 188 }, { "", 190 }, - { "", 149 }, + { "", 195 }, + { "", 193 }, + { "", 199 }, + { "", 197 }, + { "", 205 }, + { "", 207 }, + { "", 187 }, + { "", 189 }, + { "", 191 }, { "", 150 }, { "", 151 }, { "", 152 }, - { "", 145 }, + { "", 153 }, { "", 146 }, { "", 147 }, { "", 148 }, - { "", 140 }, + { "", 149 }, { "", 141 }, { "", 142 }, { "", 143 }, { "", 144 }, - { "", 139 }, + { "", 145 }, + { "", 140 }, + { "", 203 }, + { "", 201 }, { "", 202 }, { "", 200 }, - { "", 201 }, - { "", 199 }, - { "", 138 }, - { "", 182 }, - { "", 175 }, - { "", 156 }, - { "", 162 }, - { "", 168 }, + { "", 139 }, + { "", 209 }, { "", 183 }, { "", 176 }, { "", 157 }, @@ -550,11 +559,11 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[358] = { "", 158 }, { "", 164 }, { "", 170 }, - { "", 133 }, - { "", 128 }, - { "", 110 }, - { "", 116 }, - { "", 122 }, + { "", 185 }, + { "", 178 }, + { "", 159 }, + { "", 165 }, + { "", 171 }, { "", 134 }, { "", 129 }, { "", 111 }, @@ -575,16 +584,16 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[358] = { "", 114 }, { "", 120 }, { "", 126 }, - { "", 178 }, - { "", 171 }, + { "", 138 }, + { "", 133 }, { "", 115 }, { "", 121 }, { "", 127 }, { "", 179 }, { "", 172 }, - { "", 153 }, - { "", 159 }, - { "", 165 }, + { "", 116 }, + { "", 122 }, + { "", 128 }, { "", 180 }, { "", 173 }, { "", 154 }, @@ -595,41 +604,46 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[358] = { "", 155 }, { "", 161 }, { "", 167 }, + { "", 182 }, + { "", 175 }, + { "", 156 }, + { "", 162 }, + { "", 168 }, { "", 26 }, { "", 27 }, { "", 33 }, { "", 16 }, - { "", 74 }, - { "", 77 }, - { "", 80 }, - { "", 83 }, - { "", 39 }, - { "", 46 }, - { "", 53 }, - { "", 60 }, + { "", 75 }, + { "", 78 }, + { "", 81 }, + { "", 84 }, + { "", 40 }, + { "", 47 }, + { "", 54 }, + { "", 61 }, { "", 34 }, { "", 17 }, { "", 18 }, { "", 19 }, { "", 20 }, - { "", 352 }, - { "", 353 }, - { "", 336 }, + { "", 359 }, + { "", 360 }, + { "", 343 }, { "", 12 }, { "", 14 }, { "", 13 }, { "", 11 }, { "", 10 }, - { "", 42 }, - { "", 49 }, - { "", 56 }, - { "", 63 }, - { "", 45 }, - { "", 52 }, - { "", 59 }, - { "", 66 }, - { "", 68 }, + { "", 43 }, + { "", 50 }, + { "", 57 }, + { "", 64 }, + { "", 46 }, + { "", 53 }, + { "", 60 }, { "", 67 }, + { "", 69 }, + { "", 68 }, { "", 24 }, { "", 25 }, { "", 23 }, @@ -637,100 +651,100 @@ static const ProtobufCEnumValueIndex event_type__enum_values_by_name[358] = { "", 29 }, { "", 30 }, { "", 28 }, - { "", 86 }, + { "", 87 }, + { "", 312 }, + { "", 328 }, + { "", 304 }, + { "", 320 }, + { "", 313 }, + { "", 329 }, { "", 305 }, { "", 321 }, - { "", 297 }, - { "", 313 }, + { "", 314 }, + { "", 330 }, { "", 306 }, { "", 322 }, - { "", 298 }, - { "", 314 }, + { "", 315 }, + { "", 331 }, { "", 307 }, { "", 323 }, - { "", 299 }, - { "", 315 }, + { "", 316 }, + { "", 332 }, { "", 308 }, { "", 324 }, - { "", 300 }, - { "", 316 }, + { "", 317 }, + { "", 333 }, { "", 309 }, { "", 325 }, - { "", 301 }, - { "", 317 }, + { "", 318 }, + { "", 334 }, { "", 310 }, { "", 326 }, - { "", 302 }, - { "", 318 }, + { "", 319 }, + { "", 335 }, { "", 311 }, { "", 327 }, - { "", 303 }, - { "", 319 }, - { "", 312 }, - { "", 328 }, - { "", 304 }, - { "", 320 }, - { "", 208 }, - { "", 207 }, - { "", 203 }, - { "", 206 }, - { "", 204 }, - { "", 205 }, - { "", 332 }, - { "", 354 }, + { "", 215 }, + { "", 214 }, + { "", 210 }, + { "", 213 }, + { "", 211 }, + { "", 212 }, + { "", 339 }, + { "", 361 }, { "", 0 }, { "", 15 }, - { "", 344 }, - { "", 338 }, + { "", 351 }, { "", 345 }, - { "", 339 }, - { "", 73 }, - { "", 76 }, - { "", 79 }, - { "", 82 }, - { "", 41 }, - { "", 48 }, - { "", 55 }, - { "", 62 }, - { "", 22 }, + { "", 352 }, + { "", 346 }, + { "", 74 }, + { "", 77 }, + { "", 80 }, + { "", 83 }, + { "", 42 }, + { "", 49 }, + { "", 56 }, + { "", 63 }, { "", 8 }, { "", 9 }, { "", 3 }, { "", 1 }, { "", 2 }, - { "", 40 }, - { "", 47 }, - { "", 54 }, - { "", 61 }, - { "", 70 }, - { "", 69 }, + { "", 41 }, + { "", 48 }, + { "", 55 }, + { "", 62 }, { "", 71 }, - { "", 44 }, - { "", 51 }, - { "", 58 }, - { "", 65 }, + { "", 70 }, + { "", 72 }, + { "", 45 }, + { "", 52 }, + { "", 59 }, + { "", 66 }, { "", 36 }, - { "", 87 }, { "", 37 }, - { "", 84 }, + { "", 88 }, + { "", 38 }, { "", 85 }, + { "", 86 }, { "", 35 }, { "", 31 }, - { "", 337 }, - { "", 334 }, - { "", 356 }, - { "", 357 }, - { "", 331 }, - { "", 333 }, - { "", 38 }, - { "", 72 }, - { "", 75 }, - { "", 78 }, - { "", 81 }, - { "", 43 }, - { "", 50 }, - { "", 57 }, - { "", 64 }, + { "", 344 }, + { "", 341 }, + { "", 363 }, + { "", 364 }, + { "", 338 }, + { "", 340 }, + { "", 39 }, + { "", 73 }, + { "", 76 }, + { "", 79 }, + { "", 82 }, + { "", 44 }, + { "", 51 }, + { "", 58 }, + { "", 65 }, }; const ProtobufCEnumDescriptor event_type__descriptor = { @@ -739,9 +753,9 @@ const ProtobufCEnumDescriptor event_type__descriptor = "", "", "", - 358, + 365, event_type__enum_values_by_number, - 358, + 365, event_type__enum_values_by_name, 11, event_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h index fe8060fb7..cfb700260 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/EventType.pb-c.h @@ -42,7 +42,7 @@ typedef enum _EventType { EVENT_TYPE__FRONT_COVER_3_OPEN = 2004, EVENT_TYPE__FRONT_COVER_4_OPEN = 2005, EVENT_TYPE__CARTRIDGES_COVER_OPEN = 2006, - EVENT_TYPE__REAR_COVER_OPEN = 2007, + EVENT_TYPE__ARCH_COVER_OPEN = 2007, EVENT_TYPE__MACHINE_INTERNAL_OVERTEMPERATURE = 2008, EVENT_TYPE__MACHINE_FANS_RPM_TOO_LOW = 2009, EVENT_TYPE__MACHINE_FANS_STOPPED = 2010, @@ -56,6 +56,7 @@ typedef enum _EventType { EVENT_TYPE__ELECTRICAL_CABINET_OVERTEMPERATURE = 2018, EVENT_TYPE__FPGA_WATCHDOG_ACTIVATED = 2019, EVENT_TYPE__UNINTENDED_RESET = 2020, + EVENT_TYPE__TEMPERATURE_MEASUREMENT_ERROR = 2021, EVENT_TYPE__THREAD_BREAK = 3000, EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_FEEDER_DANCER = 3001, EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST = 3002, @@ -223,6 +224,12 @@ typedef enum _EventType { EVENT_TYPE__DYEING_HEAD_LEFT_ACTUATOR_UP_TIMEOUT = 5090, EVENT_TYPE__DYEING_HEAD_RIGHT_ACTUATOR_DOWN_TIMEOUT = 5091, EVENT_TYPE__DYEING_HEAD_LEFT_ACTUATOR_DOWN_TIMEOUT = 5092, + EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH = 5093, + EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH = 5094, + EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_LOW = 5095, + EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_LOW = 5096, + EVENT_TYPE__DYEING_HEAD_ARC_LID_IS_OPEN = 5097, + EVENT_TYPE__DYEING_HEAD_TUNNEL_LID_IS_OPEN = 5098, EVENT_TYPE__MIXER_OVERTEMPERATURE = 6000, EVENT_TYPE__MIXER_UNDERTEMPERATURE_A = 6001, EVENT_TYPE__MIXER_UNDERTEMPERATURE_B = 6002, 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 24b0fce27..6069c78ff 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 @@ -1157,7 +1157,7 @@ bool Safety_Incident_Report()//TODO move to GPIO folder { bool IsSafetyIncidentOccurred = No_Safety_Event; - if(ROM_GPIOPinRead(GPIO_PORTR_BASE, GPIO_PIN_2)) //EPB_S1 (GPI_PS1_DC_OK) + if(ROM_GPIOPinRead(GPIO_PORTR_BASE, GPIO_PIN_2)==0) //EPB_S1 (GPI_PS1_DC_OK) IsSafetyIncidentOccurred = Safety_Event_Occurred; return IsSafetyIncidentOccurred; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c index 9ae12d0b4..d9f5385f6 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/EEPROM/Dispenser_EEPROM.c @@ -272,7 +272,7 @@ uint32_t Get_EEPROM_DATA_From_Dispenser(int Dispenser_ID,StubDispenserEEpromData if (dispensereeprom->dispensers_n) memcpy(dispensereeprom->dispensers_n,Dispenser_struct[Dispenser_ID].Read_Disp_EEPROM.bytes.Dispenser_SN,sizeof(Dispenser_struct[Dispenser_ID].Read_Disp_EEPROM.bytes.Dispenser_SN)); dispensereeprom->has_minimalpressure = true; - dispensereeprom->minimalpressure = Dispenser_struct[Dispenser_ID].Read_Disp_EEPROM.bytes.Maximal_Pressure; + dispensereeprom->minimalpressure = Dispenser_struct[Dispenser_ID].Read_Disp_EEPROM.bytes.Minimal_Pressure; dispensereeprom->has_maximalpressure = true; dispensereeprom->maximalpressure = Dispenser_struct[Dispenser_ID].Read_Disp_EEPROM.bytes.Maximal_Pressure; dispensereeprom->has_minimalmv = true; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 32d82f8af..ad34e4224 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -651,6 +651,9 @@ uint32_t WHS_Pid_Testing_Func(double setParam,double measuredParam) //WHS_ControlData.m_params.dt = 2; close_loop_time = WHS_ControlData.m_params.dt; SendLimitedBlowerControl(calculated_speed); + if (calculated_speed < MIN_ALLOWED_BLOWER_VOLTAGE) + WHS_ControlData.m_integral = 0; + return OK; } diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h index aa5ffbb12..fdfb99561 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h @@ -350,7 +350,7 @@ uint32_t MotorMovetoBreakSensor (TimerMotors_t _motorId,bool direction, uint32_t uint32_t MotorMovetoDancerPosition (TimerMotors_t _motorId,bool direction, uint32_t Freq,uint32_t DancerId,bool dancervaluedirection, callback_fptr callback,uint32_t timeout); uint32_t MotorAbortMovetoLimitSwitch (TimerMotors_t _motorId); uint32_t MotorMoveToStopper (TimerMotors_t _motorId,bool direction, uint32_t Speed, callback_fptr callback,uint32_t backlash,uint32_t timeout); -uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callback,uint32_t timeout); +uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callback,uint32_t timeout, bool direction); uint32_t MotorStopAction (TimerMotors_t MotorId); //Stop the controlled action of a motor diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 12c9193e3..e505ac017 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -283,7 +283,7 @@ uint32_t MotorVerifiedCallBackFunction(uint32_t IfIndex, uint32_t ArmPosition) / if (MotorCallback[MotorId]) MotorCallback[MotorId](MotorId,ArmPosition); MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize); - MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,NULL,1000); + MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,NULL,1000,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize); DrierZeroPosition = Read_Dryer_ENC_Position(); //trigger the next call } @@ -383,7 +383,7 @@ uint32_t MotorMoveToDrierPositionCallBackFunction(uint32_t IfIndex, uint32_t Rea } return OK; } -uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callback,uint32_t timeout) +uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callback,uint32_t timeout, bool direction) { //assert (callback); uint32_t currentposition = 0; @@ -412,6 +412,7 @@ uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callb //Report("MotorMovetoEncoderPosition direction",__FILE__,__LINE__,direction,RpWarning,15,0); //MotorSetDirection( MotorId, direction); + MotorSetDirection(MotorId,direction); MotorSetSpeed (MotorId, 30); MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToDrierPositionCallBackFunction, 2,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 ); MotorControlCallback[MotorId] = MotorMoveToDrierPositionCallBackFunction; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 26fba0194..14275533e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -597,6 +597,9 @@ uint32_t ControlLowLoop(uint32_t tick) continue; if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond) continue; + if (ControlArray[ControlLowDevice_i].StartTick == tick) + continue; + if (((tick - ControlArray[ControlLowDevice_i].StartTick)%ControlArray[ControlLowDevice_i].ControlTiming)<=skipped_ticks) // run the control on exact intervals { ControlBacklog[backlogindex]=ControlLowDevice_i; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c index 4d3344ce7..7bda97734 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c @@ -24,6 +24,7 @@ #include #include +#include #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/I2C_Communication/DAC/blower.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" @@ -214,6 +215,11 @@ uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) Trigger_SetWHSValveWatseCartridge(request->value); break; case INTERFACE_IOS__GPO_WHS_WTANKPUMP2: + if ((IFS_Availability[1] == IFS_RECOGNIZED)&&(IFS_Availability[2] == IFS_RECOGNIZED)) //ifs installed -check cartridges + { + if (NoCartAvailable()) + return ERROR; + } SetWastePump( request->value); break; case INTERFACE_IOS__GPO_SPARE_SSR12_CTRL: diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index a439a8715..93bf916b2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -480,18 +480,20 @@ uint32_t Diagnostics_Dryer_UnLoading_Callback(uint32_t MotorId, uint32_t ReadVal uint32_t temp = Read_Dryer_ENC_Position(); Report("Diagnostics_Dryer_UnLoading_Callback",__FILE__,ReadValue,temp,RpMessage,D_DrierPrevLocation,0); //Report("Diagnostics_Dryer_UnLoading_Callback details",__FILE__,(int)(TotalLoadedLen),D_numberOfCycles,RpMessage,CallbackCounter,0); - if (ReadValue == NOTBUSY) // OK - take another round + if ((abs (temp -D_DrierPrevLocation)>1000 )&&(ReadValue == NOTBUSY)) // OK - take another round +// if (ReadValue == NOTBUSY) // OK - take another round { D_DrierPrevLocation = temp; Report("Diagnostics_Dryer_UnLoading cycles",__FILE__,D_numberOfCycles,LoadArmRounds,RpMessage,0,0); if (D_numberOfCycles50 )&&(ReadValue == NOTBUSY)) { @@ -618,7 +631,7 @@ } else { - MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Dryer_MovetoEncoderPosition_Callback,30000); + MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Dryer_MovetoEncoderPosition_Callback,30000,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); } @@ -803,6 +816,7 @@ } uint32_t Thread_Load_Dryer_UnLoading_Callback(uint32_t MotorId, uint32_t ReadValue) { + bool direction; numberOfCycles++; uint32_t temp = Read_Dryer_ENC_Position(); Report("Thread_Load_Dryer_UnLoading_Callback",__FILE__,ReadValue,temp,RpMessage,DrierPrevLocation,0); @@ -823,7 +837,7 @@ } else //done enough cycles, go to the center point { - MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000); + MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); } @@ -831,7 +845,23 @@ else //timeout or no movement { Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); + if (SecondTry == true) + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); + else + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); + if (abs(temp -DrierPrevLocation)<200) + { + if (temp MotorControlConfig[index].m_ingnoreValue) + //if (fabs(calculated_speed-CurrentControlledSpeed[index])> MotorControlConfig[index].m_ingnoreValue) { CurrentControlledSpeed[index] = calculated_speed; MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index 308de0bd0..af4bd5e08 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -33,6 +33,7 @@ void cartFILLING_END(void); //{set state of ACTIVE to FULL} CartridgeStateEnum cartGetState (WasteCartridgeEnum); bool cartGetPresence (WasteCartridgeEnum CartId); bool cartCart_door();//Polled by polling function. Notify waste. Poll each 1 second. During active filling poll each 100msec +bool NoCartAvailable(); void Waste_Init(); void Waste_StateMachine(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 7d358cfc2..40e23e0b3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -499,3 +499,24 @@ void Waste_StateMachine(void) break; } } +void Waste_Prepare(void) +{ + //check if the waste is ready to run - waste level not above overflow level and no cartridge in the slots + if (wasteLevel > wasteLevelOverflow) + { + Report("cannot start a job with waste tank overflow", __FILE__, __LINE__, wasteLevel, RpMessage, wasteLevelOverflow, 0); + PrepareReady(Module_Waste,ModuleFail); + return; + } + if ((WHS_IsEmptying())||(NoCartAvailable())) + { + PrepareReady(Module_Waste,ModuleDone); + } + else + { + Report("cannot start a job with cartridges in the IFS", __FILE__, __LINE__, wasteLevel, RpMessage, wasteLevelOverflow, 0); + PrepareReady(Module_Waste,ModuleFail); + } + return; + +} diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 48ade0798..106d515ad 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -207,6 +207,10 @@ static ReturnCode PrepareState(void *JobDetails) { PrepareWaiting[Module_Thread] = ModuleWaiting; } + if (Configured[Module_Waste]) + { + PrepareWaiting[Module_Waste] = ModuleWaiting; + } if (Configured[Module_Winder]) { PrepareWaiting[Module_Winder] = ModuleWaiting; @@ -239,6 +243,8 @@ static ReturnCode PrepareState(void *JobDetails) SendJobProgress(0.0, 0, false, "Winder prepare failed !!!!"); } } + if (Configured[Module_Waste]) + Waste_Prepare(); return retcode; } @@ -548,7 +554,7 @@ uint32_t ThreadCleaningJob(int speed) Configured[Module_Winder] = true; Configured[Module_IDS] = true; Configured[Module_Heaters] = true; - Configured[Module_Waste] = false; + Configured[Module_Waste] = true; //set the requested speed without changing other process parameters memcpy (&ProcessParametersCopy,&ProcessParametersKeep,sizeof(ProcessParameters)); if(speed) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index a0828322e..6f2b9c534 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -20,6 +20,7 @@ #include "./printingSTM.h" #include "Drivers/Heater/Heater.h" +#include #include "Modules/General/MachineStatus.h" #include "modules/General/process.h" @@ -306,6 +307,8 @@ uint32_t PrintingHWConfiguration(void *Configuration) HardwareConfiguration *request = Configuration; if (request->n_winders == 1) Configured[Module_Winder] = true; + if ((IFS_Availability[1] == IFS_RECOGNIZED)&&(IFS_Availability[2] == IFS_RECOGNIZED)) //ifs installed -check cartridges + Configured[Module_Waste] = true; if (request->n_motors < HARDWARE_MOTOR_TYPE__MOTO_SPARE1_1) { diff --git a/Software/Stubs Collection/Procedures/Dancers calibration.pproj b/Software/Stubs Collection/Procedures/Dancers calibration.pproj new file mode 100644 index 000000000..e906c6329 --- /dev/null +++ b/Software/Stubs Collection/Procedures/Dancers calibration.pproj @@ -0,0 +1 @@ +{"$id":"1","Name":"Dancers calibration","Description":null,"Scripts":{"$id":"2","$values":[{"$id":"3","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Program\r\n{\r\n public void OnExecute(IProcedureContext context)\r\n {\r\n\r\n\t\tvar response1 = context.ShowQuestion(\"Please Enter Password:\");\r\n\t\tif (response1. \"Aa123456\")\r\n\t\t{\r\n\t\t\tcontext.WriteLine(response1);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tcontext.RequestTimeout = 2000;\r\n\t\t\t//for (int i = 0; i < 100; i++)\r\n\t\t\t{\r\n\t\t\t\tvar response = context.Send(\"StubDancerPositionRequest\" ,0);\r\n\t\t\t\tThread.Sleep(1000);\r\n\t\t\t\t response = context.Send(\"StubDancerPositionRequest\" ,1);\r\n\t\t\t\tThread.Sleep(1000);\r\n\t\t\t\t response = context.Send(\"StubDancerPositionRequest\" ,2);\r\n\t\t\t\tThread.Sleep(1000);\r\n\t\t\t}\r\n\t }\r\n\r\n }\r\n}","Name":"Program.csx","IsEntryPoint":true},{"$id":"4","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Service\r\n{\r\n public double Calc(double a, double b)\r\n {\r\n return a + b;\r\n }\r\n}","Name":"Service.csx","IsEntryPoint":false}]},"Inputs":{"$id":"5","$values":[]},"ReferenceAssemblies":{"$id":"6","$values":[{"$id":"7","File":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","HintType":"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"8","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","HintType":"System.Linq.Enumerable, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"9","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","HintType":"System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"10","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Procedures.dll","HintType":"Tango.FSE.Procedures.ProcedureProject, Tango.FSE.Procedures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"11","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Common.dll","HintType":"Tango.FSE.Common.Diagnostics.IDiagnosticsProvider, Tango.FSE.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"12","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.BL.dll","HintType":"Tango.BL.Enumerations.TechMonitors, Tango.BL, Version=2.0.36.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"13","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.PMR.dll","HintType":"Tango.PMR.Common.MessageType, Tango.PMR, Version=2.0.40.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"14","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Transport.dll","HintType":"Tango.Transport.ITransporter, Tango.Transport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"15","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Integration.dll","HintType":"Tango.Integration.Operation.IMachineOperator, Tango.Integration, Version=2.0.31.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"16","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Google.Protobuf.dll","HintType":"Google.Protobuf.IMessage, Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604"},{"$id":"17","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","HintType":"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}]},"ApartmentState":"MTA"} \ No newline at end of file diff --git a/Software/Stubs Collection/Procedures/EmbeddedParametersBuild.pproj b/Software/Stubs Collection/Procedures/EmbeddedParametersBuild.pproj new file mode 100644 index 000000000..0b1371bbb --- /dev/null +++ b/Software/Stubs Collection/Procedures/EmbeddedParametersBuild.pproj @@ -0,0 +1 @@ +{"$id":"1","Name":"EmbeddedParametersBuild","Description":null,"Scripts":{"$id":"2","$values":[{"$id":"3","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing System.IO;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.PMR.EmbeddedParameters;\r\nusing Tango.PMR.IO;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Program\r\n{\r\n public void OnExecute(IProcedureContext context)\r\n {\r\n\r\n context.AddResult(ResultType.Passed, \"My Value Name\", \"Test for this value has passed.\");\r\n\t\tConfigurationParameters configurationParameters = new ConfigurationParameters();\r\n\r\n\t\tconfigurationParameters.BreakSensorLimit = 10;\r\n\r\n\t\t//how many samples to collect in diagnostics before sending\r\n\t\tconfigurationParameters.DiagnosticCollectionLimit = 3;\r\n\r\n\t\t//how many consecutive readout before declaring DC over/underheat alarm\r\n\t\tconfigurationParameters.OverHeatCountLimit = 3;\r\n\t\tconfigurationParameters.UnderHeatCountLimit = 3;\r\n\r\n\t\t// time of motor activity before opening the valve or after closing the valve, in milliseconds\r\n\t\tconfigurationParameters.CloseValveTimeout = 20;\r\n\t\tconfigurationParameters.OpenValveTimeout = 20;\r\n\r\n\t\t//backlash after filling - target pressure, timoeout, time staps (speed will be added in general parameters)\r\n\t\tconfigurationParameters.InitialDispenserPressure = 0.25; \r\n\t\tconfigurationParameters.InitialDispenserTimeout = 60000; //20 seconds\r\n\t\tconfigurationParameters.InitialDispenserTimeLag = 100;\r\n\r\n\t\t//job prepare - build pressure in dispensers - target pressure, timoeout, time staps, speed\r\n\t\tconfigurationParameters.DispenserBuildPressureSpeed = 950; //no more than 1000\r\n\t\tconfigurationParameters.DispenserBuildPressureLimit = 0.85; \r\n\t\tconfigurationParameters.DispenserBuildPressureTimeout = 180000;\r\n\t\tconfigurationParameters.DispenserBuildPressureLag = 100;\r\n\r\n\t\t//temperature band 1000 = 100% - thresholds for job start around target temprature - AC\r\n\t\tconfigurationParameters.ACHeatersLowerOperationLimit = 995;\r\n\t\tconfigurationParameters.ACHeatersUpperOperationLimit = 1005;\r\n\r\n\t\t//temperature band 1000 = 100% - thresholds for job start around target temprature - DC\r\n\t\tconfigurationParameters.DCHeatersLowerOperationLimit = 978;\r\n\t\tconfigurationParameters.DCHeatersUpperOperationLimit = 1005;\r\n\r\n\t\t// mid tank reading offset to add to the readout (OBSOLETE!)\r\n\t\tconfigurationParameters.MidTankPressureCorrection = 0.0;\r\n\r\n\t\t//waste factor for intersegment pressure building\r\n\t\tconfigurationParameters.DispenserPresegmentWFCF = 40;\r\n\t\t//how much time to start the WFCF process (pressure buildup) before segment start\r\n\t\tconfigurationParameters.IDSPreSegmentWFCFTimeBeforeSegment = 12000;\r\n\r\n\t\t//flag: start heaters according to saved process parameters upon init?\r\n\t\tconfigurationParameters.StartHeatingOnInitSequence = true;\r\n\r\n\t\t// current test for the heaters - alarm thresholds\r\n\t\tconfigurationParameters.CurrentAlarmLowLimit = 0.78;\r\n\t\tconfigurationParameters.CurrentAlarmHighLimit = 1.07;\r\n\r\n\t\t//currently not in use\r\n\t\tconfigurationParameters.IDSSegmentRefillTimeout = 5000;\r\n\t\tconfigurationParameters.IDSPreSegmentBuildupTime = 5000;\r\n\t\t//cleaning!!!!!!!!!!\r\n\t\tconfigurationParameters.IDSCleaningSpeed = 800;\r\n\t\tconfigurationParameters.IDSCleaningStopBeforeSegmentTime = 10000; //end of presegemnt\r\n\t\tconfigurationParameters.IDSCleaningStartSprayPreSegmentTime =2000; //beginning of presegment\r\n\r\n\t\tint Tup = 6,Tdelay1 = 26,Tdelay2 = 65;//300 milli up, stay 1 sec, stay down 2 sec\r\n\t\t// Tup = LeftRockerSpeed/100;\r\n\t\t// Tdelay1 = LeftRockerSpeed%100;\r\n\t\t// Tdelay2 = RightRockerSpeed;\r\n\t\tint LeftRockerSpeed = Tup*100+Tdelay1;\r\n\t\tint RightRockerSpeed = Tdelay2;\r\n\r\n\t\tconfigurationParameters.IDSLeftCleaningMotorSpeed = LeftRockerSpeed;\r\n\t\tconfigurationParameters.IDSRightCleaningMotorSpeed = RightRockerSpeed;\r\n\r\n\t\tconfigurationParameters.SwitchToIdleTimeinSeconds = 3600;\r\n\t\tconfigurationParameters.IdleDrierTemperature = 80;\r\n\t\tconfigurationParameters.IdleHeadTemperature = 80;\r\n\t\tconfigurationParameters.IdleMixerTemperature = 0;\r\n\t\tconfigurationParameters.PowerOffTemperatureLimit = 60;\r\n\r\n\t\t//general parameters, ORDER MUST BE PRESERVED!!!!\r\n\t\t//check the dispensers hard limit alarms\r\n\t\t/*1*/\r\n\t\tDouble checkHardLimitAlarms = new Double();\r\n\r\n\t\tcheckHardLimitAlarms = 1.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(checkHardLimitAlarms);\r\n\r\n\t\t/*2*/\r\n\t\tDouble checkCurrentAlarms = new Double();\r\n\t\tcheckCurrentAlarms = 0.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(checkCurrentAlarms);\r\n\t\t//check the tamper alarms\r\n\r\n\t\t/*3*/\r\n\t\tDouble checkTamperAlarms = new Double();\r\n\t\tcheckTamperAlarms = 1.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(checkTamperAlarms);\r\n\r\n\t\t/*4*/\r\n\t\tDouble checkMotorAlarms = new Double();\r\n\t\tcheckMotorAlarms = 1.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(checkMotorAlarms);\r\n\r\n\t\t/*5*/\r\n\t\tDouble WinderBackToBaseTime = new Double();\r\n\t\tWinderBackToBaseTime = 820.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(WinderBackToBaseTime);\r\n\r\n\t\t/*6*/\r\n\t\tDouble DispenserInitialPressureSpeed = new Double();\r\n\t\tDispenserInitialPressureSpeed = 1050.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(DispenserInitialPressureSpeed);\r\n\r\n\t\t/*7*/\r\n\t\tDouble SetDiagnosticMode = new Double();\r\n\t\tSetDiagnosticMode = 3.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(SetDiagnosticMode);\r\n\r\n\t\t/*8*/\r\n\t\tDouble SetAutoFill = new Double();\r\n\t\tSetAutoFill = 3.0;\r\n\t\tconfigurationParameters.GeneralParameters.Add(SetAutoFill);\r\n\r\n\t\tFile.WriteAllBytes(\"C:/temp/EmbParam.cfg\",configurationParameters.ToBytes());\r\n\r\n\t\tbyte[] fileBytes = File.ReadAllBytes(\"C:/temp/EmbParam.cfg\");\r\n\r\n\r\n\t\tvar config = ConfigurationParameters.Parser.ParseFrom(fileBytes);\r\n\r\n\t\tcontext.Write( config);\r\n\t\tThread.Sleep(1000);\r\n\r\n\r\n\t\tcontext.Write(\"\\n\\n Deleting old file\");\r\n\r\n\t\tDeleteRequest deleteRequest = new DeleteRequest();\r\n\t\tdeleteRequest.Path = \"SYSINFO//EmbParam.cfg\";\r\n\t\tdeleteRequest.Attribute = Tango.PMR.IO.FileAttribute.Unspecified;\r\n\t\tDeleteResponse response5 = context.Send(deleteRequest);\r\n\r\n\r\n\t\tThread.Sleep(1000);\r\n\t\tcontext.Write(\"\\n\\n Loading new file file\");\r\n\r\n\t\tFileUploadRequest fileUploadRequest = new FileUploadRequest();\r\n\t\tfileUploadRequest.Path = \"SYSINFO//EmbParam.cfg\";\r\n\t\tfileUploadRequest.Length = (int)fileBytes.Length;\r\n\t\tFileUploadResponse response2 = context.Send(fileUploadRequest);\r\n\t\tThread.Sleep(1000);\r\n\t\tlong chunk_size = response2.MaxChunkLength;\r\n\r\n\t\tFileStream fs = new FileStream(\"C:/temp/EmbParam.cfg\",FileMode.Open);\r\n\r\n\t\twhile (fs.Position < fs.Length)\r\n\t\t{\r\n\t\t\t\tcontext.Write(\"Position \"+ fs.Position+ \" Length \"+ fs.Length +\"\\n\\n\");\r\n\t\t\t\tFileChunkUploadRequest fileChunkUploadRequest = new FileChunkUploadRequest();\r\n\t\t\t\tfileChunkUploadRequest.UploadID = response2.UploadID;\r\n\t\t\t\tbyte[] chunk = new byte[Math.Min(chunk_size,fs.Length - fs.Position)];\r\n\t\t\t\tfs.Read(chunk,0,chunk.Length);\r\n\t\t\t\tfileChunkUploadRequest.Buffer = ByteString.CopyFrom(chunk);\t\r\n\t\t\t\tvar response3 = context.Send(fileChunkUploadRequest);\r\n\t\t\t\tThread.Sleep(2000);\r\n\r\n\t\t}\r\n\r\n\t\t// activating the new file\r\n\t\tProgressRequest progressRequest = new ProgressRequest();\r\n\t\tprogressRequest.Amount = 0xCD;\r\n\t\tprogressRequest.Delay = 0xCD;\r\n\t\tvar response1 = context.Send(progressRequest);\r\n\r\n }\r\n}","Name":"Program.csx","IsEntryPoint":true},{"$id":"4","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Service\r\n{\r\n public double Calc(double a, double b)\r\n {\r\n return a + b;\r\n }\r\n}","Name":"Service.csx","IsEntryPoint":false}]},"Inputs":{"$id":"5","$values":[]},"ReferenceAssemblies":{"$id":"6","$values":[{"$id":"7","File":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","HintType":"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"8","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","HintType":"System.Linq.Enumerable, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"9","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","HintType":"System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"10","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Procedures.dll","HintType":"Tango.FSE.Procedures.ProcedureProject, Tango.FSE.Procedures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"11","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Common.dll","HintType":"Tango.FSE.Common.Diagnostics.IDiagnosticsProvider, Tango.FSE.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"12","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.BL.dll","HintType":"Tango.BL.Enumerations.TechMonitors, Tango.BL, Version=2.0.36.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"13","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.PMR.dll","HintType":"Tango.PMR.Common.MessageType, Tango.PMR, Version=2.0.40.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"14","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Transport.dll","HintType":"Tango.Transport.ITransporter, Tango.Transport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"15","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Integration.dll","HintType":"Tango.Integration.Operation.IMachineOperator, Tango.Integration, Version=2.0.31.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"16","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Google.Protobuf.dll","HintType":"Google.Protobuf.IMessage, Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604"},{"$id":"17","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","HintType":"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}]},"ApartmentState":"MTA"} \ No newline at end of file diff --git a/Software/Stubs Collection/Procedures/WHS Loop Disable.pproj b/Software/Stubs Collection/Procedures/WHS Loop Disable.pproj new file mode 100644 index 000000000..046c188a1 --- /dev/null +++ b/Software/Stubs Collection/Procedures/WHS Loop Disable.pproj @@ -0,0 +1 @@ +{"$id":"1","Name":"WHS Loop Disable","Description":null,"Scripts":{"$id":"2","$values":[{"$id":"3","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Program\r\n{\r\n public void OnExecute(IProcedureContext context)\r\n {\r\n\r\n\t\tint ControlLoopEnable = 0x1000;\r\n\t\tint ControlLoopDisable = 0x0000;\r\n\t\t\r\n\t\tProgressRequest progressRequest = new ProgressRequest();\r\n\t\tprogressRequest.Amount = 0x3e8;\r\n\t\tprogressRequest.Delay = ControlLoopDisable+2700;\r\n\r\n\tvar response = context.Send(progressRequest);\r\n\r\n }\r\n}","Name":"Program.csx","IsEntryPoint":true},{"$id":"4","Code":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.ObjectModel;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Google.Protobuf;\r\nusing Tango.BL.Enumerations;\r\nusing Tango.PMR.Stubs;\r\nusing Tango.PMR.Diagnostics;\r\nusing Tango.FSE.Common.Diagnostics;\r\nusing Tango.FSE.Procedures;\r\n\r\npublic class Service\r\n{\r\n public double Calc(double a, double b)\r\n {\r\n return a + b;\r\n }\r\n}","Name":"Service.csx","IsEntryPoint":false}]},"Inputs":{"$id":"5","$values":[]},"ReferenceAssemblies":{"$id":"6","$values":[{"$id":"7","File":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","HintType":"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"8","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","HintType":"System.Linq.Enumerable, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"9","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","HintType":"System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"},{"$id":"10","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Procedures.dll","HintType":"Tango.FSE.Procedures.ProcedureProject, Tango.FSE.Procedures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"11","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.FSE.Common.dll","HintType":"Tango.FSE.Common.Diagnostics.IDiagnosticsProvider, Tango.FSE.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"12","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.BL.dll","HintType":"Tango.BL.Enumerations.TechMonitors, Tango.BL, Version=2.0.36.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"13","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.PMR.dll","HintType":"Tango.PMR.Common.MessageType, Tango.PMR, Version=2.0.40.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"14","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Transport.dll","HintType":"Tango.Transport.ITransporter, Tango.Transport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"},{"$id":"15","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Tango.Integration.dll","HintType":"Tango.Integration.Operation.IMachineOperator, Tango.Integration, Version=2.0.31.1608, Culture=neutral, PublicKeyToken=null"},{"$id":"16","File":"C:\\Program Files (x86)\\Twine Solutions LTD\\Tango FSE\\Google.Protobuf.dll","HintType":"Google.Protobuf.IMessage, Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604"},{"$id":"17","File":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","HintType":"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}]},"ApartmentState":"MTA"} \ No newline at end of file -- cgit v1.3.1 From 2d36ca07a6b43cf997aea3a987ed97cd3afcb655 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 12:04:23 +0200 Subject: fix flash writing (parameters. now causes reset!), improve logs saving on errfile.txt, prevent motor alarms after hw configuration --- .../Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 17 ----------------- .../Embedded/Common/SWUpdate/FirmwareUpgrade.c | 6 +++++- .../Embedded_SW/Embedded/Common/report/reportInit.c | 5 +++++ .../Embedded_SW/Embedded/Communication/Connection.c | 4 ++-- .../Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 9 ++++----- .../Embedded/Drivers/flash_ram/FlashProgram.h | 2 ++ .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 10 +++++++--- .../Embedded/Modules/AlarmHandling/AlarmHandling.h | 2 ++ .../Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 16 ++++++++-------- Software/Embedded_SW/Embedded/Modules/Control/control.c | 2 ++ .../Embedded/Modules/General/GeneralHardware.c | 1 + Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 9 +++++---- .../Embedded/Modules/Stubs_Handler/Progress.c | 4 ++++ .../Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 2 +- 14 files changed, 48 insertions(+), 41 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 56888b742..10f33c62b 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -662,15 +662,6 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) FRESULT Fresult = FR_OK; FileInfo **FilesInfo = (FileInfo**)my_malloc(sizeof(FileInfo *)*(MAX_NUM_OF_FILES)); FileInfo Data[MAX_NUM_OF_FILES]; - /* - time_t t; - struct tm *ltm; - char *curTime; - t = time(NULL); - ltm = localtime(&t); - curTime = asctime(ltm); - Report(curTime, __FILE__, ltm->tm_hour,ltm->tm_min , RpWarning, ltm->tm_sec, 0); - */ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT)) { @@ -727,14 +718,6 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) Data[i].lastmodifieddate = fno[i]->fdate; Data[i].has_lastmodifiedtime = true; Data[i].lastmodifiedtime = fno[i]->ftime; - /* - t = (fno[i]->fdate<<16)+fno[i]->ftime; - ltm = localtime(&t); - curTime = asctime(ltm); - usnprintf(&Datestr, 100, "File info %s %s",fno[i]->fname, curTime); - Report(Datestr, __FILE__, __LINE__, t, RpWarning, (int)Data[i].lastmodifiedtime, 0); - Task_sleep(50); - */ if (i==0) usnprintf(&FullPath[i], 50, "%s", request->path); diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index dbbe47ddb..2d39d25ec 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -165,6 +165,8 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); FFresult = f_unlink("//SYSINFO//EMBPARAM.CFG"); FFresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG"); + FlashInit(); + Reboot = true; LoadConfigurationParamsFromFile(true); Report("ConfigParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; @@ -173,7 +175,9 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); FFresult = f_unlink("//SYSINFO//PROCESSP.CFG"); FFresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG"); - LoadProcessParamsFromFile(); + //LoadProcessParamsFromFile(); + FlashInit(); + Reboot = true; Report("ProcessParams",__FILE__,FFresult,(int)NumberOfFiles,RpWarning,CurrentRunningFile,0); CurrentRunningFile++; break; diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index 8890fa8b9..2778943f3 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -109,6 +109,10 @@ uint32_t OpenLogFile(void) uint32_t CloseLogFile(void) { /* perform default error output */ + int len; + uint32_t Bytes = 0; + len = usnprintf(RepMessage, 80, "Closing Log File %s %s",__DATE__, __TIME__); + LogFresult = f_write(LogFileHandle,RepMessage,len,&Bytes ); LogFresult = f_close(LogFileHandle); LogFileHandle = NULL; return LogFresult; @@ -329,6 +333,7 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer) // ReportInitParams InitParams; StartDebugLogRequest* request = start_debug_log_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + Report("==============Saving file=================", __FILE__, __LINE__, _gTangoVersion.m_patch, RpWarning, _gTangoVersion.m_build, 0); ustrncpy (protobufToken, requestContainer->token,36); if (LogFileHandle != NULL) f_sync(LogFileHandle); diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index 0e90e5dbf..b566aa0e0 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -186,8 +186,8 @@ void KeepAliveRequest1Second(void) KARequestId++; //Report("keepalive request sent",__FILE__,__LINE__,KARequestId,RpWarning,msec_millisecondCounter, 0); - if (keepalivetest == false) - KeepAliveOneSecondCounter = 0; + //if (keepalivetest == false) + // KeepAliveOneSecondCounter = 0; //KeepAliveActive = true; responseContainer = createContainer(MESSAGE_TYPE__KeepAliveRequest, KARequestToken, true, &request, &keep_alive_request__pack, &keep_alive_request__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index 9d20d37a4..2ebaa4732 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -166,8 +166,7 @@ void Read_Motors_Driver_ADC(void) } else { - ReportWithPackageFilter(GeneralFilter,"the motor's combined driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0); - + //ReportWithPackageFilter(GeneralFilter,"the motor's combined driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0); } } @@ -192,9 +191,7 @@ void Read_Motors_Driver_ADC(void) { FPGA_Get_Res(i); MotorDriverResponse[i].ADC = Fpga_Spi[i].RX_MISO; - LOG_ERROR (i, "the motor's driver type"); - ReportWithPackageFilter(GeneralFilter,"the motor's driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0); - + //ReportWithPackageFilter(GeneralFilter,"the motor's driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0); } } } @@ -491,6 +488,8 @@ void FPGA_SetMotorsInit() { uint8_t i=0; + MotorConfiguredTimeout = 100; + //since powerstep in stby on powerup) F1_Moto_Driver_NSTBYRST1 = 0xFFFF; F1_Moto_Driver_NSTBYRST2 = 0xFFFF; diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h index 655a980db..7da9f92a7 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h @@ -26,6 +26,8 @@ #define FLASH_SIZE 0X8000 +extern int base_flashErased; + //***************************************************************************** // // Read application data from a buffer and program it into flash. diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 42f60a151..6df2c27c6 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -73,6 +73,7 @@ bool AlarmHandlingActive = false; uint32_t AlarmHandlingControlId = 0xFF; uint32_t AlarmHandlingTick = 0; +int MotorConfiguredTimeout = 100; double CurrentAlarmHighLimit ,CurrentAlarmLowLimit; bool CheckHardLimitAlarms = false,CheckCurrentAlarms = false,CheckTamperAlarms = false,CheckMotorAlarms = false; uint8_t alarm_response_buffer[500]; @@ -504,7 +505,7 @@ uint32_t AlarmHandlingLoadFile(void) if (F_count == 4) { - ReportWithPackageFilter(AlarmFilter,"Writing four alarms", __FILE__,AlarmPtr,F_count, RpMessage, p_size, 0); + //ReportWithPackageFilter(AlarmFilter,"Writing four alarms", __FILE__,AlarmPtr,F_count, RpMessage, p_size, 0); F_count = 0; ReadAppAndProgram(AlarmPtr, p_size,FileAlarmItem); AlarmPtr+=p_size; @@ -976,7 +977,7 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) if ((IFS_Availability[1] == IFS_RECOGNIZED_INIT_PASSED)&&(IFS_Availability[2] == IFS_RECOGNIZED_INIT_PASSED)) //ifs installed -check cartridges { - tempFoundReason = Waste_Prepare(); + tempFoundReason = Waste_CheckState(); if (tempFoundReason!=JOB_OK) { FoundReason = tempFoundReason; @@ -1192,6 +1193,9 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (AlarmItem == NULL) return ERROR; int AlarmCounter=0; + if (MotorConfiguredTimeout) + MotorConfiguredTimeout--; + for (Alarm_i = 0;Alarm_i < NumOfSystemAlarms;Alarm_i++) { Status = false; @@ -1368,7 +1372,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case ALARM_SOURCE_TYPE__MotorAlarm: if (CheckMotorAlarms) { - if ((FPGA_WD_Occurred == true)||(MachineReadyForHeating == false)) + if ((FPGA_WD_Occurred == true)||(MotorConfiguredTimeout > 0)) { Status = false; } diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h index 3b39370bf..0ce6d4816 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h @@ -10,6 +10,8 @@ #include "StateMachines/Printing/PrintingSTM.h" #include +extern int MotorConfiguredTimeout; + uint32_t AlarmHandlingFlashLoad(void); uint32_t AlarmHandlingLoadFile(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 8a14a1d67..689219583 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -822,14 +822,6 @@ uint32_t MillisecLowLoop(uint32_t tick) } if (Tensecond_Tick) { - #ifndef RUN_AS_MAIN_JIG - //Trigger_MidTank_Pressure_Read(); - for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) - { - Read_MidTank_Pressure_Sensor(Disp_i); - } - #endif - } if (OneMinute_Tick) { @@ -864,6 +856,14 @@ uint32_t MillisecLowLoop(uint32_t tick) { Shinko_Cycle_Comm(); } +#ifndef RUN_AS_MAIN_JIG + //Trigger_MidTank_Pressure_Read(); + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + Read_MidTank_Pressure_Sensor(Disp_i); + } +#endif + } if (OneHourTick) { diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 14275533e..2047e9910 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -198,6 +198,8 @@ uint32_t ControlActivityLed( uint32_t Parameter1) ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0); ACTIVITY_GREEN_LED_ON; + MotorConfiguredTimeout = 100; + FPGA_SetMotorsInit(); Motor_ReconfigAllMotors(); } diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2f9088cf1..90c18caa0 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -467,6 +467,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) //if (request->n_winders == 1) // status += InternalWinderConfigMessage(request->winders); + MotorConfiguredTimeout = 100; status += MotorsInit(); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 4fe32e7cd..2c2ebfd07 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -84,7 +84,7 @@ uint32_t InitialDispenserSpeed = INITIAL_DISPENSER_SPEED; uint32_t ControlIdtoInactiveDispenserId [MAX_SYSTEM_DISPENSERS] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; -uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t deviceID); +//uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t deviceID); AutoHoming_Config_enum AutoHoming_Config = AutoHoming_off; void IDS_Dispenser_SetAutoHoming_Config(AutoHoming_Config_enum Config) @@ -350,6 +350,7 @@ uint32_t IDS_StopHomeDispenser (uint32_t DispenserId) CurrentDispenserSpeed[DispenserId] = 0; return OK; } +/* uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) { assert(DispenserId < MAX_SYSTEM_DISPENSERS); @@ -380,7 +381,7 @@ uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) } // HomingActive[DispenserId]= false; ReportWithPackageFilter(IDSFilter,"End homing for job start",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0); - /* else + /`* else { ReportWithPackageFilter(IDSFilter,"homing aborted,start backlash",__FILE__,millisecondCounter,(int)DispenserId,RpWarning,(int)DispenserHomingTime[DispenserId],0); DispenserHomingControlId[DispenserId] = AddControlCallback( IDS_HomeDispenserBackMoveCallback, InitialDispenserTimeLag, GetDispenserPressure,motorId, motorId, 0 ); @@ -389,12 +390,12 @@ uint32_t IDS_StopHomeDispenserBuildPressure (uint32_t DispenserId) Task_sleep(10); MotorSetSpeed(motorId, 1000); CurrentDispenserSpeed[DispenserId] = 1000; - }*/ + }*`/ //IDS_Dispenser_RefillEnded ( DispenserId, MotorsCfg[motorId].microstep); return OK; } - +*/ uint32_t IDS_CheckDispenserLimitSwitch (LimitSwitchAlarms LS_Id) { int DispenserId; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index fb8e97898..0d5d60af0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -948,7 +948,11 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) if((request->amount == 0x0CD) && (request->delay == 0x0CD)) //Get Gas Sensor { LOG_ERROR(request->delay,"Load embedded parameters from file and restart"); + base_flashErased = false; LoadConfigurationParamsFromFile(true); + LOG_ERROR(255,"Update successful, Rebooting in 5 seconds"); + Task_sleep (eOneSecond*5); + Power_Reset(); response.progress = (double)OK; response.has_progress = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1de7f1319..8043f76a9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -36,7 +36,7 @@ bool DoorState = OPEN; uint32_t timeout_counter = 0; int wasteLevel = 0; WasteCartridgeEnum SelectedCard = MaxWasteCartridges; -CartridgeStateEnum CartState[MaxWasteCartridges]; +CartridgeStateEnum CartState[MaxWasteCartridges];// = {CartridgeStateOUT,CartridgeStateOUT,CartridgeStateOUT}; uint32_t Cartridge_Cover_Control; button *CartLed[MaxWasteCartridges] = {0, &cart2, &cart3}; WasteTankStateEnum WasteTankState = WasteTankStateIdle; -- cgit v1.3.1 From 9cb2c024526e3690ac4b423beb876622a8106af1 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 27 Oct 2020 23:56:07 +0200 Subject: job error messages --- .../I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 2 ++ Software/Embedded_SW/Embedded/Modules/Control/control.c | 1 + Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 3 +++ Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 2 ++ Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 4 ++++ Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 1 + Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 7 +++++++ .../Embedded/StateMachines/Initialization/PowerOffSequence.c | 1 + Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 7 +++++-- Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c | 4 ++++ 10 files changed, 30 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index ce6b34dd9..57ccd0747 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -439,9 +439,11 @@ void SendLimitedBlowerControl(int mV) if (JobIsActive()) { JobEndReason = JOB_SAFETY_CRITICAL_ALARM; + usnprintf(AlarmReasonStr, 100, "Waste airflow Error %d",mV); SendJobProgress(0.0,0,false, "Waste airflow Error"); AbortJob("Waste airflow Error"); //SegmentReady(Module_Heaters,ModuleFail); + ReportWithPackageFilter(HeatersFilter, "Waste airflow Error",__FILE__,__LINE__,mV,RpError, 0,0); HeatersEnd(); return; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 2047e9910..ce4a91465 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -190,6 +190,7 @@ uint32_t ControlActivityLed( uint32_t Parameter1) if (JobIsActive()) { JobEndReason = JOB_MOTOR_ALARM; + usnprintf(AlarmReasonStr, 100, "Hardware Failure Error"); SendJobProgress(0.0,0,false, "Hardware Failure Error"); AbortJob("FPGA Watchdog Error"); } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index d977fe3f3..56b46c98c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -399,6 +399,7 @@ uint32_t HeatersTestInternalAlarmsCBFunction(uint32_t IfIndex, uint32_t readValu if (JobIsActive()) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Internal Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Internal Temperature Error"); AbortJob("Internal Over Temperature Error"); //SegmentReady(Module_Heaters,ModuleFail); @@ -1188,6 +1189,7 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) if (JobIsActive()&&(HeaterReady[index]==true)) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Temperature Error"); AbortJob("Over Temperature Error"); //SegmentReady(Module_Heaters,ModuleFail); @@ -1239,6 +1241,7 @@ uint32_t DcHeaterMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) if (JobIsActive()&&(HeaterReady[index]==true)) { JobEndReason = JOB_TEMPERATURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Temperature %d Error %d",index,readValue); SendJobProgress(0.0,0,false, "Temperature Error"); AbortJob("Under Temperature Error"); ReportWithPackageFilter(HeatersFilter, "Temperature Error",__FILE__,__LINE__,index,RpError, 0,0); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 2c2ebfd07..ab2062293 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -20,6 +20,7 @@ #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" +#include "Modules/AlarmHandling/AlarmHandling.h" FPGA_GPI_ENUM Dispenser_Id_to_LS_Id[MAX_SYSTEM_DISPENSERS] = { @@ -502,6 +503,7 @@ uint32_t IDS_Dispenser_Alarm_On (uint8_t DispenserId) status |= MotorStop(MotorId, Hard_Hiz); IDS_Dispenser_Init(DispenserId); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS_Dispenser_Alarm_On %d ",DispenserId); return status; } uint32_t IDS_Dispenser_Alarm_Off (uint8_t DispenserId) diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 462165ee7..9f8491aa1 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -643,6 +643,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl endOfPrepareWCF = true; result = ModuleFail; JobEndReason = JOB_PRESSURE_ALARM; + usnprintf(AlarmReasonStr, 100, "IDS pressure timeout %d ",DispenserPrepareTimeout); pressureReady = true; ReportWithPackageFilter(IDSFilter,"pressure timeout!",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0); for (i = 0; i < MAX_DYE_DISPENSERS; i++) @@ -1357,6 +1358,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { ReportWithPackageFilter(IDSFilter,"Error JobBrushStopId",__FILE__,__LINE__,(int)Segment->n_brushstops,RpError,(int)0,0); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS brushstop error %d above %d ",JobBrushStopId,Segment->n_brushstops); PreSegmentReady(Module_IDS,ModuleFail); return ERROR; } @@ -1449,6 +1451,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { ReportWithPackageFilter(IDSFilter,"End run - BrushStopReadError",__FILE__,__LINE__,(int)FileBrushStop,RpError,(int)0,0); JobEndReason = JOB_OUT_OF_DYE; + usnprintf(AlarmReasonStr, 100, "IDS brushstop read error"); PreSegmentReady(Module_IDS,ModuleFail); } } @@ -1663,6 +1666,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) { Task_stat(Task_self(),&statbuf); ReportWithPackageFilter(IDSFilter,"BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0); + usnprintf(AlarmReasonStr, 100, "IDS brushstop error"); JobEndReason = JOB_OUT_OF_DYE; SegmentReady(Module_IDS,ModuleFail); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 0440d2241..a6cb25c45 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -167,6 +167,7 @@ uint32_t Winder_Prepare(void *JobDetails) if (IgnoreConeMissing == false) { JobEndReason = JOB_THREAD_BREAK; + usnprintf(AlarmReasonStr, 100, "No cone in winder"); PrepareReady(Module_Winder,ModuleFail); AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); return ERROR; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 94350f752..bc4e6cb8f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -459,6 +459,7 @@ uint32_t checkBreakSensor(uint32_t index) JobEndReason = JOB_THREAD_BREAK; ThreadControlActive = false; SendJobProgress(0.0,0,false, TMessage); + strcpy(AlarmReasonStr,TMessage); SendSegmentFail(); //AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,true); //EndState(CurrentJob,"ReadBreakSensor Error" ); @@ -482,6 +483,7 @@ uint32_t checkBreakSensor(uint32_t index) { //consider applying the debouce parameters later usnprintf(TMessage, 60, "thread speed too low"); + strcpy(AlarmReasonStr,TMessage); JobEndReason = JOB_THREAD_BREAK; ThreadControlActive = false; SendJobProgress(0.0,0,false, TMessage); @@ -685,6 +687,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) JobEndReason = JOB_WINDER_DANCER_FAIL+HARDWARE_DANCER_0; #endif SendJobProgress(0.0,0,false, TMessage); + strcpy(AlarmReasonStr,TMessage); //EndState(CurrentJob,TMessage ); SendSegmentFail(); /*switch (index) @@ -1115,6 +1118,7 @@ uint32_t ThreadPrepareState(void *JobDetails) { ReportWithPackageFilter(ThreadFilter,"Dyeing head is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpWarning,LIMIT,0); //JobEndReason = JOB_LIDS_OPEN; + // usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); //PrepareReady(Module_Thread,ModuleFail); //return ERROR; } @@ -1122,6 +1126,7 @@ uint32_t ThreadPrepareState(void *JobDetails) { ReportWithPackageFilter(ThreadFilter,"Dryer lid is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpWarning,LIMIT,0); //JobEndReason = JOB_LIDS_OPEN; + // usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); //PrepareReady(Module_Thread,ModuleFail); //return ERROR; }*/ @@ -1135,6 +1140,7 @@ uint32_t ThreadPrepareState(void *JobDetails) if (SkipOpenLids == false) { JobEndReason = JOB_LIDS_OPEN; + usnprintf(AlarmReasonStr, 100, "Dyeing head is open!!!"); PrepareReady(Module_Thread,ModuleFail); return ERROR; } @@ -1155,6 +1161,7 @@ uint32_t ThreadPrepareState(void *JobDetails) if (SkipOpenLids == false) { JobEndReason = JOB_LIDS_OPEN; + usnprintf(AlarmReasonStr, 100, "Dryer lid is open!!!"); PrepareReady(Module_Thread,ModuleFail); return ERROR; } diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index dc7c09499..3a0c94e27 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -363,6 +363,7 @@ uint32_t PowerOffStopRunningJob(void) { REPORT_MSG (PowerOffMachineState, "Stop running job"); JobEndReason = JOB_ABORTED_BY_USER; + usnprintf(AlarmReasonStr, 100, "Power off pressed"); AbortJob("Power off pressed"); } PowerOffMachineState++; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 39afcb954..0a176c2cb 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -1155,14 +1155,14 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes { responseContainer.has_error = true; responseContainer.error = JobError_to_ErrorCode[JobEndReason]; + if (strlen(ErrorMsg)) + responseContainer.errormessage = ErrorMsg; } if (JobAbortedByUser == true) { JobAbortedByUser = false; responseContainer.has_error = true; responseContainer.error = ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED; - if (strlen(ErrorMsg)) - responseContainer.errormessage = ErrorMsg; } } container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -1206,6 +1206,9 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes default: break; } + if (strlen(AlarmReasonStr)) + strncpy(ErrorMsg,AlarmReasonStr,100); + } JobMessageStruc JobMessage; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index 3b0844934..9e43bfb07 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -28,6 +28,7 @@ #include "modules/Heaters/Heaters_ex.h" #include "modules/Diagnostics/Diagnostics.h" #include "modules/ids/ids_ex.h" +#include "Modules/AlarmHandling/AlarmHandling.h" #include "PMR/Hardware/UploadHardWareConfigurationRequest.pb-c.h" #include "PMR/Hardware/HardwareMotorType.pb-c.h" @@ -756,6 +757,7 @@ void PrintSTMMsgHandler(void * msg) if (RewindJobFile() != FR_OK) { JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else @@ -795,6 +797,7 @@ void PrintSTMMsgHandler(void * msg) else { JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else @@ -814,6 +817,7 @@ void PrintSTMMsgHandler(void * msg) { Report("SegmentLoading failed",__FILE__,__LINE__, Segment,RpMessage,(int)(Segment->length*100),0); JobEndReason = JOB_FILE_PROBLEM; + usnprintf(AlarmReasonStr, 100, "Job file processing error"); if (dryerbufferlength <= 0.1) EndState(CurrentJob, "Job Ended"); else -- cgit v1.3.1 From 8efe188632bc4ac542b34fa9cfb18996179410b8 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 28 Oct 2020 13:22:16 +0200 Subject: fix leds handling --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index ce4a91465..0a092821e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -209,6 +209,20 @@ uint32_t ControlActivityLed( uint32_t Parameter1) else ACTIVITY_GREEN_LED_OFF; + if(power.color == colorOFF) Pannel_Leds(POWER_ON_OFF,MODE_OFF); + if(jog.color == colorOFF) Pannel_Leds(THREAD_JOGGING,MODE_OFF); + if(load.color == colorOFF) Pannel_Leds(THREAD_JOGGING,MODE_OFF); + if(cart1.color == colorOFF) Pannel_Leds(CART_1,MODE_OFF); + if(cart2.color == colorOFF) Pannel_Leds(CART_2,MODE_OFF); + if(cart3.color == colorOFF) Pannel_Leds(CART_3,MODE_OFF); + + if(power.color == colorON) Pannel_Leds(POWER_ON_OFF,MODE_ON); + if(jog.color == colorON) Pannel_Leds(THREAD_JOGGING,MODE_ON); + if(load.color == colorON) Pannel_Leds(THREAD_JOGGING,MODE_ON); + if(cart1.color == colorON) Pannel_Leds(CART_1,MODE_ON); + if(cart2.color == colorON) Pannel_Leds(CART_2,MODE_ON); + if(cart3.color == colorON) Pannel_Leds(CART_3,MODE_ON); + if(power.color == fastBILNK) Pannel_Leds(POWER_ON_OFF,MODE_OFF); else -- cgit v1.3.1