UPP/UPP/Core/Configs/upp_config.h

98 lines
3.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
******************************************************************************
* @file upp_config.h
* @brief Конфигурационные параметры УПП
******************************************************************************
@addtogroup UPP_CONFIG UPP configs
@ingroup UPP_MAIN
@brief Конфигурация УПП
@{
******************************************************************************
* @details
******************************************************************************/
#ifndef _UPP_CONFIG_H_
#define _UPP_CONFIG_H_
#include "stm32f4xx_hal.h"
// Проверка корректности структуры
#define assert_upp(_struct_) check_null_ptr_2(_struct_, (_struct_)->f.Initialized)
/* Дефайны для индексов */
#define U_BA 0
#define U_AC 1
#define U_BC 2
#define I_C 0
#define I_A 1
#define I_B 2
#define TEMP_1 0
#define TEMP_2 1
/**
* @addtogroup UPP_DEFAULT_PARAMS Default params for external flash
* @ingroup UPP_CONFIG
* @brief Дефолтные параметры для внешней памяти. Они применятся по команде или по ошибке
* @{
*/
/* Параметри мониторинга сети */
#define PM_EXP_ALPHA_COEF_DEFAULT 0.01
/* Номинальные параметры */
#define NOM_PHASE_NUMB 3
#define NOM_U_V_DEFAULT 690
#define NOM_U_DEVIATION_PLUS_PERCENT_DEFAULT 6
#define NOM_U_DEVIATION_MINUS_PERCENT_DEFAULT 10
#define NOM_F_HZ_DEFAULT 50
#define NOM_F_DEVIATION_PLUS_PERCENT_DEFAULT 5
#define NOM_F_DEVIATION_MINUS_PERCENT_DEFAULT 5
#define NOM_I_A_DEFAULT 5
/* Параметры ПУИ */
#define PUI_Iref_PERCENT_DEFAULT 150
#define PUI_Tnt_MS_DEFAULT 300
#define PUI_Umin_PERCENT_DEFAULT 80
#define PUI_Umax_PERCENT_DEFAULT 120
#define PUI_Imax_PERCENT_DEFAULT 99
#define PUI_Imin_PERCENT_DEFAULT 7
#define PUI_TiMax_US_DEFAULT 5000
#define PUI_Tdelay_SECONDS_DEFAULT 30
#define PUI_Interlace_EN_DEFAULT 5000
/* Параметры АЦП */
#define ADC_U_MAX_V_DEFAULT 1216.0
#define ADC_I_MAX_A_DEFAULT 53.0
#define ADC_U_ZERO_DEFAULT 2048
#define ADC_I_ZERO_DEFAULT 2048
/* Параметры определения перехода через ноль */
#define ZERO_CROSS_HYSTERESIS_PERCENT_DEFAULT 2.0
#define ZERO_CROSS_DEBOUNCE_10US_DEFAULT 2*100 // (2.5 * 100 = 2.5 мс)
/* Параметры ШИМ для тиристоров */
#define PWM_THYR_FREQUENCY_HZ_DEFAULT 20000
#define PWM_THYR_PULSE_NUMBER_DEFAULT 20
/** //UPP_DEFAULT_PARAMS
* @}
*/
/**
* @addtogroup UPP_COMPILED_PARAMS Fixed params
* @ingroup UPP_CONFIG
* @brief Параметры устанавливаемые на этапе компиляции. Без перепрошивки их не поменять
* @{
*/
/* Периоды вызова всякого */
#define PM_ADC_PERIOD_US 10 ///< Период опроса АЦП в мкс
#define PM_SLOW_PERIOD_10US 50 ///< Период обновление медленных расчетов в 10мкс
#define PM_TEMP_PERIOD_10US 5000 ///< Период обновление датчиков температуры в 10мкс
/* Частоты таймеров в МГц*/
#define ADC_TIM8_FREQ_MZH 180 ///< Частота тиков таймера АЦП
#define PWM_TIM1_FREQ_MHZ 180 ///< Частота тиков таймера ШИМ (1-4 каналы)
#define PWM_TIM3_FREQ_MHZ 90 ///< Частота тиков таймера ШИМ (5-6 каналы)
#define ANGLE_TIM2_FREQ_MHZ 90 ///< Частота тиков таймера отсчета угла открытия тиристоров
#endif //_UPP_CONFIG_H_