From 1797dac60b3aa7645fd906c28c326a42d1391ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 18 Mar 2021 22:53:11 +0100 Subject: [PATCH 1/6] Systick: Correct comments --- stm-firmware/include/reflow-controller/systick.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stm-firmware/include/reflow-controller/systick.h b/stm-firmware/include/reflow-controller/systick.h index c2adcd0..eaa1f84 100644 --- a/stm-firmware/include/reflow-controller/systick.h +++ b/stm-firmware/include/reflow-controller/systick.h @@ -31,7 +31,7 @@ /** * @brief Reload value for the systick timer. * - * This value has to be configured to set the systick to a one milliscond tick interval + * This value has to be configured to set the systick to a 100 us tick interval * The default value is 16800, which results in a 100us tick for 168 MHz CPU speed */ #define SYSTICK_RELOAD (16800UL) @@ -55,7 +55,7 @@ extern volatile uint64_t global_tick_ms; extern volatile uint32_t lcd_tick_100us; /** - * @brief Setup the Systick timer to generate a 1 ms tick + * @brief Setup the Systick timer to generate a 100 us tick */ void systick_setup(void); From 001f2be176fc2d33bde7a5b34b04705cc62f3c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 18 Mar 2021 23:12:44 +0100 Subject: [PATCH 2/6] Add a few flags to the documentation --- doc/source/firmware/safety/flags.rst | 38 +++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/doc/source/firmware/safety/flags.rst b/doc/source/firmware/safety/flags.rst index 10941c5..2857763 100644 --- a/doc/source/firmware/safety/flags.rst +++ b/doc/source/firmware/safety/flags.rst @@ -68,7 +68,8 @@ no no yes no ERR_FLAG_MEAS_ADC_UNSTABLE -------------------------- -``ERR_FLAG_MEAS_ADC_UNSTABLE`` is set after startup of the PT1000 measuremnt or after reconfiguring the filter settings. +``ERR_FLAG_MEAS_ADC_UNSTABLE`` is set if the Moving Average Filter of the PT1000 ADC detects a bigger deviation between input and filtered output value. +The flag is automatically cleared by the controller as soon as the unstable condition is not met anymore. For this, the filter input to filter output difference has to stay below a certain threshold for a defined amount of samples. .. seealso:: :ref:`firmware_meas_adc_filter` @@ -86,7 +87,7 @@ ERR_FLAG_SAFETY_MEM_CORRUPT ``ERR_FLAG_SAFETY_MEM_CORRUPT`` is set during the initialization of the controller, in case a corrupted safety memory is encountered. In this case the error memory is reinitialized and the flag is set in the error memory. Afer a reboot it will stay asserted until the -safety backup memory is cleared +safety backup memory is cleared. .. seealso:: :ref:`backup_ram` @@ -102,7 +103,7 @@ yes no yes no ERR_FLAG_STACK --------------------------- -``ERR_FLAG_STACK`` ialization of the controller, in case a corrupted safety memory is encountered. +``ERR_FLAG_STACK`` Shutdown of the controller, in case a corrupted safety memory is encountered. This error is not recoverable and will trigger the panic mode. .. seealso:: :ref:`safety_stack_checking` @@ -112,3 +113,34 @@ persistent self-clearing Stops PID Panic Mode ========== ============= ============= =========== yes no yes yes ========== ============= ============= =========== + +.. _safety_flags_timing_pid: + +ERR_FLAG_TIMING_PID +--------------------------- + +``ERR_FLAG_TIMING_PID`` is set if the timing monitor of the PID controller detects a violation in the sample frequency. +The flag is recoverable and only shuts down the PID and therefore the oven control output. + +.. seealso:: Timing Monitor + +========== ============= ============= =========== +persistent self-clearing Stops PID Panic Mode +========== ============= ============= =========== +no no yes no +========== ============= ============= =========== + +.. _safety_flags_overtemp: + +ERR_FLAG_OVERTEMP +--------------------------- + +``ERR_FLAG_OVERTEMP`` is set if the :ref:`pt1000_processing` detects an overtemperature. +The default limit is ``260 degrees Celsius``. However, it is possible to configure the limit and permanenty store it in the EEPROM since hardware version v1.3. + + +========== ============= ============= =========== +persistent self-clearing Stops PID Panic Mode +========== ============= ============= =========== +no no yes no +========== ============= ============= =========== From ae97a69d267e4b3660ca8ae16dd25e233823c5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 18 Mar 2021 23:15:13 +0100 Subject: [PATCH 3/6] documentation --- stm-firmware/include/reflow-controller/safety/stack-check.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm-firmware/include/reflow-controller/safety/stack-check.h b/stm-firmware/include/reflow-controller/safety/stack-check.h index 24dfa61..62b8091 100644 --- a/stm-firmware/include/reflow-controller/safety/stack-check.h +++ b/stm-firmware/include/reflow-controller/safety/stack-check.h @@ -87,7 +87,7 @@ int stack_check_init_corruption_detect_area(void); * @ref stack_check_init_corruption_detect_area beforehand. * * The CRC unit must be enabled for this function to work properly. - * After calling @stack_check_init_corruption_detect_area, this is the case. + * After calling @ref stack_check_init_corruption_detect_area, this is the case. * * @return 0 if no error is detected, all other values are an error. * @note Make sure CRC unit is enabled. From 857838f293c3355f008861cfab5c46ea1d0ee2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 18 Mar 2021 23:18:18 +0100 Subject: [PATCH 4/6] Docu: Improvements --- doc/source/firmware/safety/stack-checking.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/firmware/safety/stack-checking.rst b/doc/source/firmware/safety/stack-checking.rst index f975d31..7b16a72 100644 --- a/doc/source/firmware/safety/stack-checking.rst +++ b/doc/source/firmware/safety/stack-checking.rst @@ -34,6 +34,6 @@ On each run of the safety controller's handling function (:c:func:`safety_contro .. doxygenfunction:: stack_check_corruption_detect_area -This function constantly checks the memory area for write modifications, and therefore detects, if the stack or heap have grown outside their boundaries. +This function checks the memory area for write modifications, and therefore detects, if the stack or heap have grown outside their boundaries. This canary approach does, however, not guarantee a full protection against heap or stack overflows. From 13e7cbfd81af76168527f887b831ca1d3ef3854f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 18 Mar 2021 23:21:17 +0100 Subject: [PATCH 5/6] Documentation: Fix docu of overtemp flag --- doc/source/firmware/safety/flags.rst | 6 +++++- .../include/reflow-controller/safety/safety-config.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/source/firmware/safety/flags.rst b/doc/source/firmware/safety/flags.rst index 2857763..eb47857 100644 --- a/doc/source/firmware/safety/flags.rst +++ b/doc/source/firmware/safety/flags.rst @@ -136,7 +136,11 @@ ERR_FLAG_OVERTEMP --------------------------- ``ERR_FLAG_OVERTEMP`` is set if the :ref:`pt1000_processing` detects an overtemperature. -The default limit is ``260 degrees Celsius``. However, it is possible to configure the limit and permanenty store it in the EEPROM since hardware version v1.3. +The default limit is set to: + +.. doxygendefine:: SAFETY_DEFAULT_OVERTEMP_LIMIT_DEGC + +However, it is possible to configure the limit and permanenty store it in the EEPROM since hardware version v1.3. ========== ============= ============= =========== diff --git a/stm-firmware/include/reflow-controller/safety/safety-config.h b/stm-firmware/include/reflow-controller/safety/safety-config.h index 381723c..67259dd 100644 --- a/stm-firmware/include/reflow-controller/safety/safety-config.h +++ b/stm-firmware/include/reflow-controller/safety/safety-config.h @@ -130,7 +130,7 @@ enum analog_value_monitor { #define SAFETY_EXT_WATCHDOG_PIN (12) /** - * @brief Default Limit of the overtemperature detection + * @brief Default Limit of the overtemperature detection in degrees celsius */ #define SAFETY_DEFAULT_OVERTEMP_LIMIT_DEGC (260.0f) From ec2c23c9f7b8a51a448d5f3611f6ca10eca600b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Fri, 19 Mar 2021 20:51:54 +0100 Subject: [PATCH 6/6] Change unstbale detection range from 10 Ohm to 20 Ohm --- stm-firmware/include/reflow-controller/adc-meas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm-firmware/include/reflow-controller/adc-meas.h b/stm-firmware/include/reflow-controller/adc-meas.h index 6f16df4..f0e764e 100644 --- a/stm-firmware/include/reflow-controller/adc-meas.h +++ b/stm-firmware/include/reflow-controller/adc-meas.h @@ -47,7 +47,7 @@ /** * @brief Difference in Ohm between filter input and output that determines if the filter is stable or unstable. */ -#define ADC_PT1000_FILTER_UNSTABLE_DIFF 10 +#define ADC_PT1000_FILTER_UNSTABLE_DIFF 20 /** * @brief Sample count, the moving average filter has to be within @ref ADC_PT1000_FILTER_UNSTABLE_DIFF for the filter