ems/ems_c/logic/logic_protected.h

54 lines
2.0 KiB
C
Raw Permalink 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.

/*****************************************************************************
* @copyright 2024-202, . POWER SUPPLY CO., LTD.
* @file logic_protected.h
* @brief xxxx
* @author Gary
* @date 2024/09/21
* @remark 初修订
*****************************************************************************/
#ifndef __LOGIC_PROTECTED_H__
#define __LOGIC_PROTECTED_H__
typedef struct
{
// 中间参数
float_t power; // 目标功率 INOUT
float_t rePower; // 目标无功功率 INOUT
float_t nowActiveDemand; // 实时需量
int runPeriod; // 运行周期 ms
uint8_t protectSign; // 保护配置更新标志
// 读实时库
float_t totalActivePower; // 变压器下总电表总有功功率 IN
float_t emsActivePower; // 储能测总有功功率 IN
// 可配置参数
float_t maxActivePower; // 变压器总容量 IN
float_t overFlowLowLimt; // 过载预警限流值 IN
float_t overFlowCloseLimt; // 过载关机值 IN
float_t maxPower; // 充放电功率上限(一律为正值)
bool demandCtl; // 防需量开关 IN
float_t aimActiveDemand; // 目标需量 IN
float_t demandCtrlLowLimt; // 防需预警限流值 IN
float_t demandCtrlCloseLimt; // 防需关机值 IN
bool backFlow; // 防逆流开关 IN
float_t backFlowLowLimt; // 逆流预警限流值 IN
float_t backFlowCloseLimt; // 逆流关机值 IN
uint16_t socForbidCharge; // 禁充SOC [55%-100%]
uint16_t socForbidDischarge; // 禁放SOC [0%-45%]
// DIDO接口
uint16_t scramButton; // 急停开关1打开
} protect_params_t; // 保护函数传参结构体
/*****************************************************************************
* @brief 获取削峰平谷实时运行参数接口
* @param[in] bool sign 时间表是否更新标志
* @return 0 成功 -1 失败
*****************************************************************************/
int logicFun_peakValley();
// 策略数据计算及保护接口
int logicFun_protect();
#endif