更改启动方式,完善转换

This commit is contained in:
起床就犯困 2024-08-29 10:50:22 +08:00
parent de2f325604
commit e12fc66caa
32 changed files with 13557 additions and 12097 deletions

View File

@ -27,36 +27,43 @@ typedef struct _uint8_config_info{
}uint8_config_info;
//typedef struct _config_info{
// uint8_t start_Flag[2]; /* 起始标志 */
// uint8_t address[7]; /* 地址 */
// uint8_t end_Flag; /* 结束标志 */
// uint16_t Access_Node_Type; /* 接入节点类型 */
// uint16_t Communication_Methods; /* 通信方式 */
// uint32_t bat485_Baud; /* 串口波特率 */
// uint32_t gw485_Baud; /* 串口波特率 */
// uint16_t ConstantCurrentV; /* 高于该(电压 / 100),小于ConstantVoltageV / 100电压进行恒流充电 */
// uint16_t ConstantVoltageV; /* 高于该(电压 / 100)且电流大于FloatI / 100进行恒压充电 */
// uint16_t FloatI; /* 高于该(电压 / 100)且电流低于FloatI / 100进行浮充充电 */
// uint16_t startSolarOpenCircuitV;/* 高于该(电压 / 100)开始充电 */
//}config_info;
typedef struct _config_info{
uint8_t start_Flag[2]; /* お宎梓祩 */
uint8_t address[7]; /* 華硊 */
uint32_t baud_485; /* 串口波特率 */
uint16_t constantCurrentV; /* 电压高于(ConstantCurrentV / 100 + 0.4),小于ConstantVoltageV / 100 - 0.4进入mppt模式 */
uint16_t constantVoltageV; /* 电压高于该(ConstantVoltageV / 100)且电流大于FloatI / 100 + 0.1)进行恒压充电 */
uint16_t floatI; /* 电压高于该(ConstantVoltageV / 100)且电流低于FloatI / 100进行浮充充电 */
uint16_t startSolarOpenCircuitV; /* 太阳能板开路电压高于该(电压 / 100)开始充电 */
uint16_t stopSolarOpenCircuitV; /* 太阳能板开路电压高于该(电压 / 100)停止充电 */
uint16_t noBatteryChargeV; /* 没有电池时的输出电压 */
uint16_t FloatTime; /* 浮充时间(秒) */
uint16_t checkSolarOpenCircuitVTime; /* 启动任务中太阳能板开路电压检测时间 */
uint16_t registerRefreshTime; /* 寄存器数据刷新时间 */
uint16_t resRefreshTime; /* 线阻计算间隔时长 */
uint16_t sensorEnableBroadcastTime; /* 传感器运行再次注册的间隔 */
uint16_t HighSideMosTemperature_stop; /* 当上桥温度达到该值时,停止输出 */
uint16_t HighSideMosTemperature_end; /* 当上桥温度上升到该值时输出稳定在12V降低功率运行 */
uint16_t HighSideMosTemperature_start; /* 当上桥温度降低到该值时,按照正常情况输出 */
uint8_t end_Flag; /* 賦旰梓祩 */
uint16_t Access_Node_Type; /* 接入节点类型 */
uint16_t Communication_Methods; /* 通信方式 */
uint32_t bat485_Baud; /* 串口波特率 */
uint32_t gw485_Baud; /* 串口波特率 */
uint16_t ConstantCurrentV; /* 高于该(电压 / 100),小于ConstantVoltageV / 100电压进行恒流充电 */
uint16_t ConstantVoltageV; /* 高于该(电压 / 100)且电流大于FloatI / 100进行恒压充电 */
uint16_t FloatI; /* 高于该(电压 / 100)且电流低于FloatI / 100进行浮充充电 */
uint16_t startSolarOpenCircuitV;/* 高于该(电压 / 100)开始充电 */
}config_info;
#define CONFIG_INFO_SIZE (sizeof(config_info))
#pragma pack(pop)
/* 接入节点类型 */
typedef enum
{
POWERBOX = 1, /* 电源箱子 */
MICROMETEOROLOGY = 2, /* 微气象 */
}SL_ACCESSNODETYPE;
/* 通信方式 */
typedef enum
{
RS485 = 1,
RJ45 = 2,
}SL_COMMUNICATIONMETHODS;
extern config_info g_slConfigInfo;
#define FLASH_SAVE_ADDR_BEGIN (0x00)

View File

@ -9,37 +9,7 @@
#define APP_INC_MPPT_CONTROL_H_
#include "debug.h"
#pragma pack(push,1)
typedef struct _SL_Mppt_para{
uint16_t Registration_Status; /* 注册状态 */
uint8_t address[7]; /* 地址 */
uint16_t Access_Node_Type; /* 接入节点类型 */
uint16_t Communication_Methods; /* 通信方式 */
uint16_t Battery_Voltage; /* 电池电压 */
uint16_t Battery_temperature; /* 电池温度 */
uint16_t Remaining_Battery_Bower; /* 电池剩余电量 */
uint16_t Solar_Open_Circuit_Voltage; /* 太阳能开路电压 */
}SL_Mppt_para;
extern SL_Mppt_para g_Mppt_Para;
#pragma pack(pop)
/* mppt工作模式 */
typedef enum
{
TRICKLE = 1, /* 涓流模式 */
CONSTANTCURRENT = 2, /* 恒流模式 */
CONSTANTVOLTAGE = 3, /* 恒压模式 */
FLOAT = 4, /* 浮充模式 */
}SL_MPPT_MODE;
///* 恒定电流或者电压时PI调节器参数 */
//typedef struct PIconstV {
// float_t kp;
// float_t ki;
// float_t allError;
//};
#include <math.h>
extern float g_duty_ratio;
@ -48,5 +18,7 @@ void MpptMode(void);
void mppt_constantVoltage(float InVoltage);
void test(void);
void printf_data(void);
float_t get_capturedata(float_t (*fun)(void));
uint16_t get_mpptMode(void);
#endif /* APP_INC_MPPT_CONTROL_H_ */

View File

@ -10,7 +10,7 @@
#include "debug.h"
#include "uart_dev.h"
#include "math.h"
/* 功能码 */
typedef enum
@ -31,10 +31,12 @@ typedef enum
SL_Register_Access_Node_Type = 0x0002, /* 接入节点类型 */
SL_Register_Communication_Methods = 0x0003, /* 通信方式 */
SL_Register_Battery_Voltage = 0x0100, /* 电池电压 */
SL_Register_Battery_temperature = 0x0101, /* 电池温度 */
SL_Register_Remaining_Battery_Bower = 0x0102, /* 电池剩余电量 */
SL_Register_Solar_Open_Circuit_Voltage1 = 0x0103, /* 太阳能开路电压1 */
SL_Register_Solar_Open_Circuit_Voltage2 = 0x0104, /* 太阳能开路电压2 */
SL_Register_Charg_Current = 0x0101, /* 充电电流(流向电池+负载) */
SL_Register_Discharg_Current = 0x0102, /* 放电电流(流向负载) */
SL_Register_Solar_Open_Circuit_Voltage = 0x0103, /* 太阳能开路电压 */
SL_Register_HighSideMos_Temperature = 0x0104, /* 高端mos的温度 */
SL_Register_DischargMos_State = 0x0105, /* 放电mos的状态 */
SL_Register_MPPT_Mode = 0x0106, /* 工作模式 */
}SL_Mppt_MsgRegister;
/* 注册状态 */
@ -45,6 +47,39 @@ typedef enum
REGISTER_SUCCESS = 2, /* 注册成功 */
}SL_REGISTERSTATUS;
/* 接入节点类型 */
typedef enum
{
POWERBOX = 1, /* 电源箱子 */
MICROMETEOROLOGY = 2, /* 微气象 */
}SL_ACCESSNODETYPE;
/* 通信方式 */
typedef enum
{
RS485 = 1,
RJ45 = 2,
Lora = 3,
}SL_COMMUNICATIONMETHODS;
/* 放电mos管状态 */
typedef enum
{
close = 0,
open = 1,
}SL_DischargMos_State;
/* mppt工作模式 */
typedef enum
{
NoWork = 0, /* 没有工作 */
TRICKLE = 1, /* 涓流模式 */
CONSTANTCURRENT = 2, /* 恒流模式 */
CONSTANTVOLTAGE = 3, /* 恒压模式 */
FLOAT = 4, /* 浮充模式 */
NoBattery = 5, /* 没有电池 */
}SL_MPPT_MODE;
#define chang_8_to_16(L,H) (L | (H<<8))
/* 指定对齐方式为1字节 */
@ -171,6 +206,33 @@ typedef struct _SL_RegProcTable{
RegProcFunc pRegProc;
}SL_RegProcTable;
/* 默认参数 */
typedef struct _default_Value{
uint8_t start_Flag[2]; /* 起始标志 */
uint8_t address[7]; /* 地址 */
uint16_t access_Node_Type; /* 接入节点类型 */
uint16_t communication_Methods; /* 通信方式 */
uint8_t end_Flag; /* 结束标志 */
}default_Value;
extern default_Value defaultValue;
typedef struct _SL_Mppt_para{
uint16_t Registration_Status; /* 注册状态 */
uint8_t address[7]; /* 地址 */
uint16_t Access_Node_Type; /* 接入节点类型 */
uint16_t Communication_Methods; /* 通信方式 */
float_t Battery_Voltage; /* 电池电压 */
float_t Charg_Current; /* 充电电流(流向电池+负载) */
float_t Discharg_Current; /* 放电电流(流向负载) */
float_t Solar_Open_Circuit_Voltage; /* 太阳能开路电压 */
float_t HighSideMos_Temperature; /* 高端mos的温度 */
uint16_t DischargMos_State; /* 放电mos的状态 */
uint16_t MPPT_Mode; /* 工作模式 */
}SL_Mppt_para;
extern SL_Mppt_para g_Mppt_Para;
/* 恢复默认的对齐设置 */
#pragma pack(pop)

View File

@ -12,15 +12,24 @@
#include "timeSliceOffset.h"
#include "uart_dev.h"
void stop_mpptWork(void);
void start_mpptWork(void);
#define runled_reloadVal 1000 /* 任务执行间隔 */
#define runled_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_runled;
void Task_RunLED(void);
#define mpptControl_reloadVal 10 /* 任务执行间隔 */
#define mpptControl_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_mpptControl;
void Task_mpptControl(void);
#define startMpptControl_reloadVal 1000 /* 任务执行间隔 */
#define startMpptControl_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_startMpptControl;;
void Task_startMpptControl(void);
#define softStart_reloadVal 30 /* 任务执行间隔 */
#define softStart_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_softStart;
extern void Task_softStart(void);
#define usart_reloadVal 100 /* 任务执行间隔 */
#define usart_offset 0 /* 任务执行偏移量 */
@ -37,6 +46,7 @@ void Task_wdi(void);
#define refreshRegister_reloadVal 1000 /* 任务执行间隔 */
#define refreshRegister_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_refreshRegister;
extern uint8_t overTemperature;
void Task_refreshRegister(void);
#define recvbroadcast_reloadVal 3000 /* 任务执行间隔 */
@ -47,10 +57,18 @@ extern uint8_t g_recvBroadcastRegisterNumber; /*
extern STR_TimeSliceOffset m_recvbroadcast;
void Task_recvbroadcast(void);
#define EnPowerSupply_reloadVal 1000 /* 任务执行间隔 */
#define EnPowerSupply_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_EnPowerSupply;
extern void Task_EnPowerSupply(void);
#define outputAgain_reloadVal 1000 /* 任务执行间隔 */
#define outputAgain_offset 30 /* 任务执行偏移量 */
extern uint8_t outputAgainFlag;
extern STR_TimeSliceOffset m_outputAgain;
void Task_outputAgain(void);
#define sensorEnableBroadcast_reloadVal 1000 /* 任务执行间隔 */
#define sensorEnableBroadcast_offset 0 /* 任务执行偏移量 */
extern STR_TimeSliceOffset m_sensorEnableBroadcast;
/* 是否接收广播帧标志位 */
extern uint8_t run_Broadcast;
void Task_sensorEnableBroadcast(void);
void task_Init(void);
void hardware_Init(void);

View File

@ -7,19 +7,23 @@
#include "inflash.h"
#include "flash.h"
#include "sl_protocol.h"
config_info g_slConfigInfo = {
.start_Flag = {'S', 'L'},
.address = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},
.end_Flag = 0x16,
.Access_Node_Type = POWERBOX,
.Communication_Methods = RS485,
.bat485_Baud = 9600,
.gw485_Baud = 9600,
.ConstantCurrentV = 1100,
.ConstantVoltageV = 1400,
.FloatI = 50,
.startSolarOpenCircuitV = 1600,
.constantCurrentV = 1000,
.constantVoltageV = 1400,
.floatI = 10,
.startSolarOpenCircuitV = 1700,
.stopSolarOpenCircuitV = 1500,
.noBatteryChargeV = 1200,
.FloatTime = 10,
.checkSolarOpenCircuitVTime = 10,
.registerRefreshTime = 1,
.resRefreshTime = 1,
.sensorEnableBroadcastTime = 20,
.HighSideMosTemperature_stop = 90,
.HighSideMosTemperature_end = 70,
.HighSideMosTemperature_start = 50,
};
@ -44,10 +48,27 @@ uint8_t read_config_info(void)
{
config_info temp_config_info;
SPI_Flash_Read((uint8_t *)&temp_config_info, FLASH_SAVE_ADDR_BEGIN, CONFIG_INFO_SIZE);
if (temp_config_info.start_Flag[0] == 'S') {
if (temp_config_info.start_Flag[0] == 'S'
&& temp_config_info.start_Flag[1] == 'L'
&& temp_config_info.end_Flag == 0x16) {
g_slConfigInfo = temp_config_info;
return 1;
}
else {
g_slConfigInfo.start_Flag[0] = defaultValue.start_Flag[0];
g_slConfigInfo.start_Flag[1] = defaultValue.start_Flag[1];
g_slConfigInfo.address[0] = defaultValue.address[0];
g_slConfigInfo.address[1] = defaultValue.address[1];
g_slConfigInfo.address[2] = defaultValue.address[2];
g_slConfigInfo.address[3] = defaultValue.address[3];
g_slConfigInfo.address[4] = defaultValue.address[4];
g_slConfigInfo.address[5] = defaultValue.address[5];
g_slConfigInfo.address[6] = defaultValue.address[6];
g_slConfigInfo.end_Flag = defaultValue.end_Flag;
}
return 0;
}

View File

@ -4,27 +4,28 @@
* Created on: 2024629
* Author: psx
*/
#include <math.h>
#include "mppt_control.h"
#include "collect_Conversion.h"
#include "pwm.h"
#include "inflash.h"
#include "gpio.h"
#include "sl_protocol.h"
#include "task.h"
#include "uart_dev.h"
SL_Mppt_para g_Mppt_Para = {0};
static void TrickleCharge(void);
static void ConstantCurrentCharge(void);
static void ConstantVoltageCharge(void);
static void FloatingCharge(void);
static void NoBatteryCharge(void);
/* 占空比 */
float g_duty_ratio = 0.7;
/* 用于确定工作模式 */
static uint8_t modeFlag = 2;
//static uint8_t modeFlag = 2;
/**
* @brief
@ -145,11 +146,44 @@ void printf_data(void)
// get_MOSFET_Temper();
// get_PV2_VOLT_IN();
printf("1. 涓流模式; 2. 恒流模式; 3, 恒压模式; 4, 浮充模式modeFlag : %d \n", modeFlag);
printf("\n");
}
float_t get_capturedata(float_t (*fun)(void))
{
float_t temp1;
float_t temp[3];
for (int i = 0; i < 3; ++i) {
temp[i] = fun();
// Delay_Us(1);
}
if (temp[0] > temp[1]) {
temp1 = temp[0];
temp[0] = temp[1];
temp[1] = temp1;
}
if (temp[0] > temp[2]) {
temp1 = temp[0];
temp[0] = temp[2];
temp[2] = temp1;
if (temp[1] > temp[2]) {
temp1 = temp[1];
temp[1] = temp[2];
temp[2] = temp1;
}
}
return temp[1];
}
//uint16_t get_mpptMode(void)
//{
// return (uint16_t)modeFlag;
//}
/**
* @brief
* @param
@ -194,8 +228,10 @@ void mppt_constantVoltage(float InVoltage)
// float_t error = (get_PV1_VOLT_IN()) - InVoltage;
// float_t error = InVoltage - (get_PV2_VOLT_IN());
// allError += error;
// printf("111\n");
float_t pv1Volt = get_PV1_VOLT_IN();
float_t pv1Volt = get_capturedata(get_PV1_VOLT_IN);
// printf("volt in : %d \n", pv1Volt);
float_t error = pv1Volt - InVoltage;
// float_t error = InVoltage - pv1Volt;
float_t stepPwm = kp * error + ki * pv1Volt;
@ -250,7 +286,8 @@ void mppt_constantVoltageO(float OutVoltage)
// static float_t kp = 0.1;
// static float_t ki = 0.001;
float_t outVolt = get_PV_VOLT_OUT();
// float_t outVolt = get_PV_VOLT_OUT();
float_t outVolt = g_Mppt_Para.Battery_Voltage;
// float_t error = outVolt - OutVoltage;
float_t error = OutVoltage - outVolt;
float_t stepPwm = kp * error + ki * outVolt;
@ -308,7 +345,9 @@ void mppt_constantCurrentO(float outCurrent)
// static float_t flag = 1;
// static float_t last_OutputPower = 0;
float_t outCurr = get_CHG_CURR();
// float_t outCurr = get_CHG_CURR();
float_t outCurr = g_Mppt_Para.Charg_Current;
// float_t OutputPower = outCurr * get_PV_VOLT_OUT();
float_t error = outCurrent - outCurr;
// float_t error = outCurr - outCurrent;
@ -357,7 +396,7 @@ void mppt_constantCurrentO(float outCurrent)
*/
void TrickleCharge(void)
{
mppt_constantCurrentO(1);
mppt_constantCurrentO(2);
}
/**
@ -381,12 +420,7 @@ void ConstantCurrentCharge(void)
*/
void ConstantVoltageCharge(void)
{
// mppt_constantVoltage(17.5);
// mppt_constantVoltageO((float_t)g_Mppt_Para.Battery_Voltage);
mppt_constantVoltageO(14.5);
// g_duty_ratio = 0.9;
// Set_duty_ratio(&g_duty_ratio);
}
/**
@ -397,79 +431,76 @@ void ConstantVoltageCharge(void)
*/
void FloatingCharge(void)
{
// static uint32_t run_num;
// if (get_CHG_CURR() > 0.01) {
// mppt_constantVoltageO(12);
// if (run_num++ > 100) {
// if ((get_PV_VOLT_OUT()) < 14) {
// run_num = 0;
// modeFlag = CONSTANTVOLTAGE;
// return;
// }
// }
// }
//
// else {
// TIM_SetCompare4(TIM4, 0);
// if (run_num++) {
// if ((get_PV_VOLT_OUT()) < 14) {
// run_num = 0;
// modeFlag = CONSTANTVOLTAGE;
// return;
// }
// }
//
// if (run_num > 100) {
// run_num = 0;
// modeFlag = CONSTANTVOLTAGE;
// return;
// }
// }
//
// if (run_num > 200) {
// run_num = 100;
// }
static uint32_t num = 0;
static uint32_t numLenFlag;
static uint8_t onlyOnce = 1;
if (onlyOnce) {
numLenFlag = g_slConfigInfo.FloatTime * 1000 / 5;
onlyOnce = 0;
}
TIM_SetCompare4(TIM4, 0);
// mppt_constantVoltageO(12);
if (500 == num++) {
// if ((get_PV_VOLT_OUT()) > 13.5) {
if (numLenFlag == ++num) {
num = 0;
modeFlag = CONSTANTVOLTAGE;
// return;
// }
ConstantVoltageCharge();
g_Mppt_Para.MPPT_Mode = CONSTANTVOLTAGE;
}
// if ((get_PV_VOLT_OUT()) > 13.5) {
// modeFlag = CONSTANTVOLTAGE;
// return;
// }
}
/**
* @brief
* @param
* @retval
*
*/
void NoBatteryCharge(void)
{
static float_t NoBatteryChargeV;
static uint8_t onlyOnce = 1;
if (onlyOnce) {
NoBatteryChargeV = (float_t)g_slConfigInfo.noBatteryChargeV / 100;
onlyOnce = 0;
}
mppt_constantVoltageO(NoBatteryChargeV);
if ((g_Mppt_Para.Battery_Voltage - NoBatteryChargeV > 0.1 && g_Mppt_Para.Charg_Current < 0.1)
|| (NoBatteryChargeV - g_Mppt_Para.Battery_Voltage > 0.1 && g_Mppt_Para.Charg_Current > 0.5)) {
ConstantCurrentCharge();
g_Mppt_Para.MPPT_Mode = CONSTANTCURRENT;
}
}
void MpptContorl(void)
{
switch(modeFlag) {
switch(g_Mppt_Para.MPPT_Mode) {
case TRICKLE:
// printf("111\n");
TrickleCharge();
break;
case CONSTANTCURRENT:
// printf("222222\n");
ConstantCurrentCharge();
break;
case CONSTANTVOLTAGE:
// printf("333333333\n");
ConstantVoltageCharge();
break;
case FLOAT:
// printf("444444444444\n");
FloatingCharge();
break;
case NoBattery:
// printf("555555555555555\n");
NoBatteryCharge();
break;
default:
break;
}
@ -477,68 +508,140 @@ void MpptContorl(void)
void MpptMode(void)
{
// static uint8_t temp_flag = 1;
// static float ConstantCurrentV;
// static float ConstantVoltageV;
// static float FloatI;
// /* 赋值仅执行一次 */
// if (temp_flag) {
// ConstantCurrentV = (float)g_slConfigInfo.ConstantCurrentV / 100;
// ConstantVoltageV = (float)g_slConfigInfo.ConstantVoltageV / 100;
// FloatI = (float)g_slConfigInfo.FloatI / 100;
// temp_flag = 0;
//// printf("g_slConfigInfo.ConstantCurrentV : %d g_slConfigInfo.ConstantVoltageV : %d /100 \n", g_slConfigInfo.ConstantCurrentV, g_slConfigInfo.ConstantVoltageV);
//// printf("ConstantCurrentV : %d /100 ConstantVoltageV : %d /100 \n", (int)ConstantCurrentV, (int)ConstantVoltageV);
// }
// printf("vout : %d /100 \n", (int)(g_Mppt_Para.Battery_Voltage * 100));
// printf("iout : %d /1000 \n", (int)(g_Mppt_Para.Charg_Current * 1000));
// printf("in checkSolarOpenCircuitVoltage v: %d/100 \n", (int)(g_Mppt_Para.Solar_Open_Circuit_Voltage * 100));
printf("vout : %d /100 \n", g_Mppt_Para.Battery_Voltage);
printf("iout : %d /1000 \n", (int)(get_CHG_CURR() * 1000));
printf("in checkSolarOpenCircuitVoltage v: %d/100 \n", g_Mppt_Para.Solar_Open_Circuit_Voltage);
// printf("ConstantCurrentV : %d ConstantVoltageV : %d \n", (int)ConstantCurrentV, (int)ConstantVoltageV);
static float ConstantCurrentV;
static float ConstantVoltageV;
static float FloatI;
static float StopSolarOpenCircuitV;
// if (((ConstantVoltageV < (float)g_Mppt_Para.Battery_Voltage / 100) &&
// (FloatI > get_CHG_CURR())) || modeFlag == FLOAT) {
// modeFlag = FLOAT;
/* 赋值仅执行一次 */
static uint8_t only_once = 1;
if (only_once) {
ConstantCurrentV = (float)g_slConfigInfo.constantCurrentV / 100;
ConstantVoltageV = (float)g_slConfigInfo.constantVoltageV / 100;
FloatI = (float)g_slConfigInfo.floatI / 100;
StopSolarOpenCircuitV = (float)g_slConfigInfo.stopSolarOpenCircuitV / 100;
only_once = 0;
}
//// if (g_Mppt_Para.Battery_Voltage > 16 || g_Mppt_Para.Battery_Voltage < 8
//// || modeFlag == NoBattery) {
//// modeFlag = NoBattery;
// if (g_Mppt_Para.Battery_Voltage > 16 || g_Mppt_Para.Battery_Voltage < 8
// || g_Mppt_Para.MPPT_Mode == NoBattery) {
// g_Mppt_Para.MPPT_Mode = NoBattery;
// return;
// }
//
// if ((ConstantCurrentV < (float)g_Mppt_Para.Battery_Voltage / 100) &&
// (ConstantVoltageV >= (float)g_Mppt_Para.Battery_Voltage / 100)) {
// modeFlag = CONSTANTCURRENT;
//// if (((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
//// (FloatI > g_Mppt_Para.Charg_Current)) || modeFlag == FLOAT) {
//// modeFlag = FLOAT;
// if (((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
// (FloatI > g_Mppt_Para.Charg_Current)) || g_Mppt_Para.MPPT_Mode == FLOAT) {
// g_Mppt_Para.MPPT_Mode = FLOAT;
// return;
// }
//
// if ((ConstantVoltageV < (float)g_Mppt_Para.Battery_Voltage / 100) &&
// (FloatI <= get_CHG_CURR())) {
// modeFlag = CONSTANTVOLTAGE;
// if (((ConstantCurrentV + 0.4) < g_Mppt_Para.Battery_Voltage) &&
// ((ConstantVoltageV - 0.4) >= g_Mppt_Para.Battery_Voltage)) {
//// modeFlag = CONSTANTCURRENT;
// g_Mppt_Para.MPPT_Mode = CONSTANTCURRENT;
// return;
// }
//
// if ((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
// (FloatI + 0.1 <= g_Mppt_Para.Charg_Current)) {
//// modeFlag = CONSTANTVOLTAGE;
// g_Mppt_Para.MPPT_Mode = CONSTANTVOLTAGE;
// return;
// }
//
// if (ConstantCurrentV > g_Mppt_Para.Battery_Voltage) {
//// modeFlag = TRICKLE;
// g_Mppt_Para.MPPT_Mode = TRICKLE;
// return;
// }
if (((14.3 < (float)g_Mppt_Para.Battery_Voltage / 100) &&
(0.08 > get_CHG_CURR())) || modeFlag == FLOAT) {
modeFlag = FLOAT;
return;
}
if ((13 < (float)g_Mppt_Para.Battery_Voltage / 100) &&
(13.8 >= (float)g_Mppt_Para.Battery_Voltage / 100)) {
modeFlag = CONSTANTCURRENT;
return;
}
if ((14.3 < (float)g_Mppt_Para.Battery_Voltage / 100) &&
(0.2 <= get_CHG_CURR())) {
modeFlag = CONSTANTVOLTAGE;
return;
}
if (12.5 > (float)g_Mppt_Para.Battery_Voltage / 100) {
modeFlag = TRICKLE;
return;
}
// modeFlag = CONSTANTCURRENT;
// if (g_Mppt_Para.Battery_Voltage > 16 || g_Mppt_Para.Battery_Voltage < 8
// || g_Mppt_Para.MPPT_Mode == NoBattery) {
// g_Mppt_Para.MPPT_Mode = NoBattery;
// return;
// }
// if (g_Mppt_Para.Charg_Current - g_Mppt_Para.Discharg_Current < 0.05
// || g_Mppt_Para.Discharg_Current - g_Mppt_Para.Charg_Current < 0.05) {
// g_Mppt_Para.MPPT_Mode = NoBattery;
// return;
// }
//
// if (((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
// (FloatI > g_Mppt_Para.Charg_Current)) || g_Mppt_Para.MPPT_Mode == FLOAT) {
// g_Mppt_Para.MPPT_Mode = FLOAT;
// return;
// }
//
// if (((ConstantCurrentV + 0.4) < g_Mppt_Para.Battery_Voltage) &&
// ((ConstantVoltageV - 0.4) >= g_Mppt_Para.Battery_Voltage)) {
// g_Mppt_Para.MPPT_Mode = CONSTANTCURRENT;
// return;
// }
//
// if ((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
// (FloatI + 0.1 <= g_Mppt_Para.Charg_Current)) {
// g_Mppt_Para.MPPT_Mode = CONSTANTVOLTAGE;
// return;
// }
//
// if (ConstantCurrentV > g_Mppt_Para.Battery_Voltage) {
// g_Mppt_Para.MPPT_Mode = TRICKLE;
// return;
// }
if (g_Mppt_Para.Solar_Open_Circuit_Voltage < StopSolarOpenCircuitV
&& (g_Mppt_Para.Discharg_Current >= g_Mppt_Para.Charg_Current
|| g_Mppt_Para.Charg_Current - g_Mppt_Para.Discharg_Current < 0.05)) {
g_Mppt_Para.MPPT_Mode = NoWork;
stop_mpptWork();
TimeSliceOffset_Register(&m_startMpptControl, Task_startMpptControl
, startMpptControl_reloadVal, startMpptControl_offset);
return;
}
if (((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
(FloatI > g_Mppt_Para.Charg_Current)) || g_Mppt_Para.MPPT_Mode == FLOAT) {
g_Mppt_Para.MPPT_Mode = FLOAT;
return;
}
if (((ConstantCurrentV + 0.4) < g_Mppt_Para.Battery_Voltage) &&
((ConstantVoltageV - 0.4) >= g_Mppt_Para.Battery_Voltage)) {
g_Mppt_Para.MPPT_Mode = CONSTANTCURRENT;
return;
}
if ((ConstantVoltageV < g_Mppt_Para.Battery_Voltage) &&
(FloatI + 0.1 <= g_Mppt_Para.Charg_Current)) {
g_Mppt_Para.MPPT_Mode = CONSTANTVOLTAGE;
return;
}
if (ConstantCurrentV > g_Mppt_Para.Battery_Voltage) {
g_Mppt_Para.MPPT_Mode = TRICKLE;
return;
}
if (g_Mppt_Para.Charg_Current - g_Mppt_Para.Discharg_Current < 0.03
&& g_Mppt_Para.Discharg_Current - g_Mppt_Para.Charg_Current < 0.03) {
g_Mppt_Para.MPPT_Mode = NoBattery;
return;
}
}
void findMiNDutyRatio(void)
@ -559,7 +662,7 @@ void test(void)
// mppt_readjust();
// Get_OutputPower();
// mppt_constantVoltage(17);
// mppt_constantVoltage(18);
// findMiNDutyRatio();
// MpptContorl();
@ -573,8 +676,20 @@ void test(void)
// mppt_readJust();
// mppt_constantCurrentO(1);
g_Mppt_Para.Battery_Voltage = get_capturedata(get_PV_VOLT_OUT);
g_Mppt_Para.Charg_Current = get_capturedata(get_CHG_CURR);
g_Mppt_Para.Discharg_Current = get_capturedata(get_DSG_CURR);
if (!overTemperature) {
MpptMode();
}
MpptContorl();
// mppt_constantVoltageO(12);
// static uint32_t run_num = 0;
// if (1000 < run_num++) {
// FloatingCharge();

View File

@ -14,6 +14,13 @@
#include "task.h"
#include "tim.h"
default_Value defaultValue = {'S', 'L'\
, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11\
, POWERBOX\
, RS485
, 0x16};
SL_Mppt_para g_Mppt_Para = {0};
/* 静态函数申明 */
static void SL_MsgProcFunc_Read_Register(device_handle device, void *pMsg, uint32_t MsgLen);
@ -23,15 +30,17 @@ static void SL_MsgProcFunc_Registration_request(device_handle device, void *pMsg
static void SL_MsgProcFunc_Update_Profile(device_handle device, void *pMsg, uint32_t MsgLen);
static void SL_MsgProcFunc_Remote_Upgrade(device_handle device, void *pMsg, uint32_t MsgLen);
static uint16_t SL_ReadRegisterRegistrationStatus(void *pMsg);
static uint16_t SL_ReadRegisteraddress(void *pMsg);
static uint16_t SL_ReadRegisterAccessNodeType(void *pMsg);
static uint16_t SL_ReadRegisterCommunicationMethods(void *pMsg);
//static uint16_t SL_ReadRegisterRegistrationStatus(void *pMsg);
//static uint16_t SL_ReadRegisteraddress(void *pMsg);
//static uint16_t SL_ReadRegisterAccessNodeType(void *pMsg);
//static uint16_t SL_ReadRegisterCommunicationMethods(void *pMsg);
static uint16_t SL_ReadRegisterBatteryVoltage(void *pMsg);
static uint16_t SL_ReadRegisterBatterytemperature(void *pMsg);
static uint16_t SL_ReadRegisterRemainingBatteryBower(void *pMsg);
static uint16_t SL_ReadRegisterChargCurrent(void *pMsg);
static uint16_t SL_ReadRegisterDischargCurrent(void *pMsg);
static uint16_t SL_ReadRegisterSolarOpenCircuitVoltage(void *pMsg);
//static uint16_t SL_ReadRegisterSolarOpenCircuitVoltage2(void *pMsg);
static uint16_t SL_ReadRegisterHighSideMosTemperature(void *pMsg);
static uint16_t SL_ReadRegisterDischargMosState(void *pMsg);
static uint16_t SL_ReadRegisterMPPTMode(void *pMsg);
//static uint16_t SL_WriteRegisterRegistrationStatus(void *pMsg);
//static uint16_t SL_WriteRegisteraddress(void *pMsg);
@ -71,19 +80,20 @@ SL_FuncionMsgProcTable g_MsgTbl[] =
{SL_Function_Code_Remote_Upgrade, SL_MsgProcFunc_Remote_Upgrade},
};
/* 寄存器处理表 */
SL_RegProcTable g_RegTblR[] =
{
{SL_Register_Registration_Status, SL_ReadRegisterRegistrationStatus},
{SL_Register_address, SL_ReadRegisteraddress},
{SL_Register_Access_Node_Type, SL_ReadRegisterAccessNodeType},
{SL_Register_Communication_Methods, SL_ReadRegisterCommunicationMethods},
// {SL_Register_Registration_Status, SL_ReadRegisterRegistrationStatus},
// {SL_Register_address, SL_ReadRegisteraddress},
// {SL_Register_Access_Node_Type, SL_ReadRegisterAccessNodeType},
// {SL_Register_Communication_Methods, SL_ReadRegisterCommunicationMethods},
{SL_Register_Battery_Voltage, SL_ReadRegisterBatteryVoltage},
{SL_Register_Battery_temperature, SL_ReadRegisterBatterytemperature},
{SL_Register_Remaining_Battery_Bower, SL_ReadRegisterRemainingBatteryBower},
{SL_Register_Solar_Open_Circuit_Voltage1, SL_ReadRegisterSolarOpenCircuitVoltage},
// {SL_Register_Solar_Open_Circuit_Voltage2, SL_ReadRegisterSolarOpenCircuitVoltage2},
{SL_Register_Charg_Current, SL_ReadRegisterChargCurrent},
{SL_Register_Discharg_Current, SL_ReadRegisterDischargCurrent},
{SL_Register_Solar_Open_Circuit_Voltage, SL_ReadRegisterSolarOpenCircuitVoltage},
{SL_Register_HighSideMos_Temperature, SL_ReadRegisterHighSideMosTemperature},
{SL_Register_DischargMos_State, SL_ReadRegisterDischargMosState},
{SL_Register_MPPT_Mode, SL_ReadRegisterMPPTMode},
};
/* 寄存器处理表 */
@ -330,9 +340,8 @@ void SL_MsgProcFunc_Registration_request(device_handle device, void *pMsg, uint3
g_Mppt_Para.Registration_Status = chang_8_to_16(rpack->registration_Status_L, rpack->registration_Status_H);
/* 20s内不再接收广播帧 */
run_Broadcast = 0;
TIM2->CNT = 0;
TIM_Cmd(TIM2, ENABLE); //TIM2使能
TimeSliceOffset_Register(&m_sensorEnableBroadcast, Task_sensorEnableBroadcast
, sensorEnableBroadcast_reloadVal, sensorEnableBroadcast_offset);
}
@ -419,53 +428,53 @@ void SL_MsgProcFunc_Remote_Upgrade(device_handle device, void *pMsg, uint32_t Ms
}
/**
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterRegistrationStatus(void *pMsg)
{
log_info(" SL_ReadRegisterRegistrationStatus ");
uint16_t value = g_Mppt_Para.Registration_Status;
return value;
}
/**
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisteraddress(void *pMsg)
{
log_info(" SL_ReadRegisteraddress ");
return 0;
}
/**
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterAccessNodeType(void *pMsg)
{
log_info(" SL_ReadRegisterAccessNodeType ");
uint16_t value = g_Mppt_Para.Access_Node_Type;
return value;
}
/**
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterCommunicationMethods(void *pMsg)
{
log_info(" SL_ReadRegisterCommunicationMethods ");
uint16_t value = g_Mppt_Para.Communication_Methods;
return value;
}
///**
// * @brief 读取注册状态寄存器
// * @param
// * @retval
// */
//uint16_t SL_ReadRegisterRegistrationStatus(void *pMsg)
//{
// log_info(" SL_ReadRegisterRegistrationStatus ");
// uint16_t value = g_Mppt_Para.Registration_Status;
// return value;
//}
//
///**
// * @brief 读取地址寄存器
// * @param
// * @retval
// */
//uint16_t SL_ReadRegisteraddress(void *pMsg)
//{
// log_info(" SL_ReadRegisteraddress ");
//
// return 0;
//}
//
///**
// * @brief 读取接入节点类型寄存器
// * @param
// * @retval
// */
//uint16_t SL_ReadRegisterAccessNodeType(void *pMsg)
//{
// log_info(" SL_ReadRegisterAccessNodeType ");
// uint16_t value = g_Mppt_Para.Access_Node_Type;
// return value;
//}
//
///**
// * @brief 读取通信方式寄存器
// * @param
// * @retval
// */
//uint16_t SL_ReadRegisterCommunicationMethods(void *pMsg)
//{
// log_info(" SL_ReadRegisterCommunicationMethods ");
// uint16_t value = g_Mppt_Para.Communication_Methods;
// return value;
//}
/**
* @brief
@ -475,57 +484,81 @@ uint16_t SL_ReadRegisterCommunicationMethods(void *pMsg)
uint16_t SL_ReadRegisterBatteryVoltage(void *pMsg)
{
log_info(" SL_ReadRegisterBatteryVoltage ");
uint16_t value = (uint16_t)g_Mppt_Para.Battery_Voltage * 10;
uint16_t value = (uint16_t)(g_Mppt_Para.Battery_Voltage * 10);
return value;
}
/**
* @brief
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterBatterytemperature(void *pMsg)
uint16_t SL_ReadRegisterChargCurrent(void *pMsg)
{
log_info(" SL_ReadRegisterBatterytemperature ");
uint16_t value = (uint16_t)g_Mppt_Para.Battery_temperature * 10;
log_info(" SL_ReadRegisterChargCurrent ");
uint16_t value = (uint16_t)(g_Mppt_Para.Charg_Current * 10);
return value;
}
/**
* @brief
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterRemainingBatteryBower(void *pMsg)
uint16_t SL_ReadRegisterDischargCurrent(void *pMsg)
{
log_info(" SL_ReadRegisterRemainingBatteryBower ");
uint16_t value = (uint16_t)g_Mppt_Para.Remaining_Battery_Bower * 10;
log_info(" SL_ReadRegisterDischargCurrent ");
uint16_t value = (uint16_t)(g_Mppt_Para.Discharg_Current * 10);
return value;
}
/**
* @brief 1
* @brief
* @param
* @retval
*/
uint16_t SL_ReadRegisterSolarOpenCircuitVoltage(void *pMsg)
{
log_info(" SL_ReadRegisterSolarOpenCircuitVoltage1 ");
uint16_t value = (uint16_t)g_Mppt_Para.Solar_Open_Circuit_Voltage * 10;
log_info(" SL_ReadRegisterSolarOpenCircuitVoltage ");
uint16_t value = (uint16_t)(g_Mppt_Para.Solar_Open_Circuit_Voltage * 10);
return value;
}
/**
* @brief mos管的温度寄存器
* @param
* @retval
*/
uint16_t SL_ReadRegisterHighSideMosTemperature(void *pMsg)
{
log_info(" SL_ReadRegisterHighSideMosTemperature ");
uint16_t value = (uint16_t)(g_Mppt_Para.HighSideMos_Temperature * 10);
return value;
}
/**
* @brief mos管状态寄存器
* @param
* @retval
*/
uint16_t SL_ReadRegisterDischargMosState(void *pMsg)
{
log_info(" SL_ReadRegisterDischargMosState ");
uint16_t value = (uint16_t)g_Mppt_Para.DischargMos_State;
return value;
}
/**
* @brief mppt工作模式寄存器
* @param
* @retval
*/
uint16_t SL_ReadRegisterMPPTMode(void *pMsg)
{
log_info(" SL_ReadRegisterMPPTMode ");
uint16_t value = (uint16_t)g_Mppt_Para.MPPT_Mode;
return value;
}
//
///**
// * @brief 读取太阳能开路电压2寄存器
// * @param
// * @retval
// */
//uint16_t SL_ReadRegisterSolarOpenCircuitVoltage2(void *pMsg)
//{
// log_info(" SL_ReadRegisterSolarOpenCircuitVoltage2 ");
// uint16_t value = (uint16_t)g_Mppt_Para.Solar_Open_Circuit_Voltage2 * 10;
// return value;
//}
///**
// * @brief 写入注册状态寄存器

View File

@ -22,6 +22,29 @@
#include <stdlib.h>
#include "collect_Conversion.h"
void stop_mpptWork(void)
{
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, SET);
g_duty_ratio = 0.7;
TIM_SetCompare4(TIM4, 0);
TIM_Cmd(TIM3, DISABLE);
// TimeSliceOffset_Register(&m_startMpptControl, Task_startMpptControl
// , startMpptControl_reloadVal, startMpptControl_offset);
// GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, RESET);
}
void start_mpptWork(void)
{
// GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, RESET);
g_Mppt_Para.MPPT_Mode = CONSTANTCURRENT;
TIM_Cmd(TIM3, ENABLE);
// TimeSliceOffset_Unregister(&m_startMpptControl);
// Delay_Ms(500);
GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, SET);
}
/**
* @brief
* @param
@ -32,41 +55,104 @@ void Task_RunLED(void)
{
// uart_sendstr(g_gw485_uart4_handle, "\n\n\n\n\n");
// uart_sendstr(g_gw485_uart4_handle, "is gw485\n");
// uart_sendstr(g_bat485_uart3_handle, "is bat485\n");
// uart_sendstr(g_bat485_uart3_handle, "is bat485\n");get_PV1_VOLT_IN();
printf(" duty_ratio : %d/1000 \n", (int)(g_duty_ratio * 1000));
printf_data();
printf(" vout : %d/100 \n", (int)(g_Mppt_Para.Battery_Voltage * 100));
printf(" Iout : %d/100 \n", (int)(g_Mppt_Para.Charg_Current * 100));
printf(" Idisout : %d/100 \n", (int)(g_Mppt_Para.Discharg_Current * 100));
printf(" mosT : %d/10 \n", (int)(g_Mppt_Para.HighSideMos_Temperature * 10));
printf(" mosState : %d \n", (int)(g_Mppt_Para.DischargMos_State));
// printf(" mosState : %d \n", GPIO_ReadOutputDataBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN));
// printf(" mosState : %d \n", GPIO_ReadInputDataBit(DSG_PROT_GPIO, DSG_PROT_PIN));
printf(" 0.没有工作; 1.涓流模式; 2.恒流模式; 3.恒压模式; 4.浮充模式; 5.没有电池 : %d \n", g_Mppt_Para.MPPT_Mode);
// printf("vout : %d/100 \n", (int)(get_capturedata(get_PV_VOLT_OUT) * 100));
// get_CHG_CURR();
static uint8_t flag = RESET;
flag = !flag;
GPIO_WriteBit(RUN_LED_GPIO, RUN_LED_PIN, flag);
// static uint8_t num = 0;
// if (10 == ++num) {
// GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, SET);
// }
return;
}
/**
* @brief mppt控制
* @brief mppt控制
* @param
* @retval
*/
STR_TimeSliceOffset m_mpptControl;
void Task_mpptControl(void)
STR_TimeSliceOffset m_startMpptControl;
void Task_startMpptControl(void)
{
test();
static uint16_t checkSolarOpenCircuitVTimeFlag;
static uint8_t only_once = 1;
if (only_once) {
only_once = 0;
checkSolarOpenCircuitVTimeFlag = g_slConfigInfo.checkSolarOpenCircuitVTime - 3;
}
// static uint8_t test_flag = 0;
// if (5 == ++test_flag) {
// test_flag = 0;
// printf("in time init \n");
// TIM2->CNT = 0;
// TIM_Cmd(TIM2, ENABLE); //TIM2使能
// printf("out time init \n");
// }
if (g_slConfigInfo.checkSolarOpenCircuitVTime == ++checkSolarOpenCircuitVTimeFlag) {
checkSolarOpenCircuitVTimeFlag = 0;
g_Mppt_Para.Solar_Open_Circuit_Voltage = get_capturedata(get_PV1_VOLT_IN);
printf("volt in : %d/100 \n", (int)(g_Mppt_Para.Solar_Open_Circuit_Voltage * 100));
if (g_Mppt_Para.Solar_Open_Circuit_Voltage
> ((float_t)g_slConfigInfo.startSolarOpenCircuitV / 100)) {
// start_mpptWork();
TimeSliceOffset_Register(&m_softStart, Task_softStart, softStart_reloadVal, softStart_offset);
}
}
return;
}
/**
* @brief
* @param
* @retval
*/
STR_TimeSliceOffset m_softStart;
void Task_softStart(void)
{
static uint16_t num = 0;
static float_t dutyRatio = 0;
num++;
if (num == 1) {
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, RESET);
TimeSliceOffset_Unregister(&m_startMpptControl);
}
if (num < 5) {
TIM_SetCompare4(TIM4, 100);
}
else if (num > 70 || dutyRatio > g_duty_ratio) {
dutyRatio = 0;
num = 0;
Set_duty_ratio(&g_duty_ratio);
TimeSliceOffset_Unregister(&m_softStart);
start_mpptWork();
return;
}
else {
dutyRatio += 0.01;
Set_duty_ratio(&dutyRatio);
}
}
/**
* @brief
* @param
@ -99,104 +185,56 @@ void Task_wdi(void)
return;
}
/**
* @brief ,mppt工作模式
* @brief ,mos管温度
* @param
* @retval
*/
#define checkRemainingBatteryBower 30 //电池剩余电量30s刷新一次
//#define checkSolarOpenCircuitVoltage 1800 //太阳能板开路电压30min刷新一次
#define checkSolarOpenCircuitVoltage 100 //太阳能板开路电压刷新一次
#define mpptmodedelay 1 //mppt工作模式60s刷新一次小于1000S
//#define checkSolarOpenCircuitDelay 500 //检测太阳能板开路电压时,关闭太阳能板的延时时间
STR_TimeSliceOffset m_refreshRegister;
uint8_t overTemperature = 0;
void Task_refreshRegister(void)
{
static uint32_t checkFlagTemp1 = checkRemainingBatteryBower - 1;
static uint32_t checkFlagTemp2 = checkSolarOpenCircuitVoltage - 1;
/* */
static uint32_t opencheckFlag = 0;
static uint32_t mpptModeFlag = mpptmodedelay -1;
static uint16_t checkRegisterRefreshTimeFlag;
// g_Mppt_Para.Battery_Voltage = 0;
g_Mppt_Para.Battery_temperature = 0;
g_Mppt_Para.Battery_Voltage = (uint16_t)(get_PV_VOLT_OUT() * 100);
if (g_slConfigInfo.registerRefreshTime == ++checkRegisterRefreshTimeFlag) {
checkRegisterRefreshTimeFlag = 0;
g_Mppt_Para.Battery_Voltage = get_capturedata(get_PV_VOLT_OUT);
g_Mppt_Para.Charg_Current = get_capturedata(get_CHG_CURR);
g_Mppt_Para.Discharg_Current = get_capturedata(get_DSG_CURR);
g_Mppt_Para.HighSideMos_Temperature = get_capturedata(get_MOSFET_Temper);
g_Mppt_Para.DischargMos_State = GPIO_ReadOutputDataBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN)
&& GPIO_ReadInputDataBit(DSG_PROT_GPIO, DSG_PROT_PIN);
g_Mppt_Para.Solar_Open_Circuit_Voltage = get_capturedata(get_PV1_VOLT_IN);
if (checkRemainingBatteryBower == ++checkFlagTemp1) {
g_Mppt_Para.Remaining_Battery_Bower = 0;
checkFlagTemp1 = 0;
if (g_Mppt_Para.HighSideMos_Temperature < g_slConfigInfo.HighSideMosTemperature_start) {
if (overTemperature == 2) {
// start_mpptWork();
TimeSliceOffset_Register(&m_softStart, Task_softStart, softStart_reloadVal, softStart_offset);
}
if (checkSolarOpenCircuitVoltage == ++checkFlagTemp2 || (opencheckFlag && ++checkFlagTemp2)) {
// printf("in checkSolarOpenCircuitVoltage \n");
if (!opencheckFlag) {
TIM_SetCompare4(TIM4, 0);
opencheckFlag = 1;
checkFlagTemp2 = 0;
}
else {
// GPIO_WriteBit(G_FFMOS_CON1_GPIO, G_FFMOS_CON1_PIN, SET);
// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, SET);
// g_Mppt_Para.Solar_Open_Circuit_Voltage1 = get_PV1_VOLT_IN();
// g_Mppt_Para.Solar_Open_Circuit_Voltage2 = get_PV2_VOLT_IN();
// GPIO_WriteBit(G_FFMOS_CON1_GPIO, G_FFMOS_CON1_PIN, RESET);
// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, RESET);
// opencheckFlag = 0;
//
// if ((g_Mppt_Para.Solar_Open_Circuit_Voltage1
// > g_slConfigInfo.startSolarOpenCircuitV)
// || (g_Mppt_Para.Solar_Open_Circuit_Voltage2
// > g_slConfigInfo.startSolarOpenCircuitV)) {
// TimeSliceOffset_Register(&m_mpptControl, Task_mpptControl
// , mpptControl_reloadVal, mpptControl_offset);
// mpptModeFlag = 0;
// Set_duty_ratio(&g_duty_ratio);
// } else {
// TimeSliceOffset_Unregister(&m_mpptControl);
// mpptModeFlag = 100;
// }
g_Mppt_Para.Solar_Open_Circuit_Voltage = (uint16_t)(get_PV1_VOLT_IN() * 100);
opencheckFlag = 0;
// printf("in checkSolarOpenCircuitVoltage v: %d/100 \n", g_Mppt_Para.Solar_Open_Circuit_Voltage1);
if (g_Mppt_Para.Solar_Open_Circuit_Voltage
> g_slConfigInfo.startSolarOpenCircuitV) {
// TimeSliceOffset_Register(&m_mpptControl, Task_mpptControl
// , mpptControl_reloadVal, mpptControl_offset);
mpptModeFlag = 0;
TIM_Cmd(TIM3, ENABLE);
Set_duty_ratio(&g_duty_ratio);
} else {
// TimeSliceOffset_Unregister(&m_mpptControl);
TIM_Cmd(TIM3, DISABLE);
TIM_SetCompare4(TIM4, 0);
mpptModeFlag = 100;
}
}
}
// if (mpptModeFlag != 100) {
// if (mpptmodedelay == ++mpptModeFlag) {
//// printf("vout : %d /100", g_Mppt_Para.Battery_Voltage);
// MpptMode();
// mpptModeFlag = 0;
// }
// }
if (mpptModeFlag != 100) {
// printf("vout : %d /100", g_Mppt_Para.Battery_Voltage);
MpptMode();
}
// MpptMode();
overTemperature = 0;
return;
}
if (g_Mppt_Para.HighSideMos_Temperature > g_slConfigInfo.HighSideMosTemperature_end) {
g_Mppt_Para.MPPT_Mode = NoBattery;
overTemperature = 1;
}
if (g_Mppt_Para.HighSideMos_Temperature > g_slConfigInfo.HighSideMosTemperature_stop) {
overTemperature = 2;
stop_mpptWork();
}
}
}
/**
* @brief 广,3s
* @param
@ -290,20 +328,45 @@ void Task_recvbroadcast(void)
}
/**
* @brief 使dcdc电源
* @brief
* @param
* @retval
*/
STR_TimeSliceOffset m_EnPowerSupply;
void Task_EnPowerSupply(void)
STR_TimeSliceOffset m_outputAgain;
uint8_t outputAgainFlag = 0;
void Task_outputAgain(void)
{
if (get_PV_VOLT_IN1() > 16.0) {
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, RESET);
return;
} else if (get_PV_VOLT_IN1() < 14.5) {
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, SET);
if (outputAgainFlag == 1) {
outputAgainFlag = 0;
TimeSliceOffset_Unregister(&m_outputAgain);
}
if (outputAgainFlag == 2) {
TimeSliceOffset_Unregister(&m_outputAgain);
}
return;
}
/**
* @brief
* @param
* @retval
*/
STR_TimeSliceOffset m_sensorEnableBroadcast;
/* 是否接收广播帧标志位 */
uint8_t run_Broadcast = 1;
void Task_sensorEnableBroadcast(void)
{
static uint32_t enabBroadcastTimeFlag = 0;
enabBroadcastTimeFlag++;
run_Broadcast = 0;
if (enabBroadcastTimeFlag == g_slConfigInfo.sensorEnableBroadcastTime) {
enabBroadcastTimeFlag = 0;
run_Broadcast = 1;
TimeSliceOffset_Unregister(&m_sensorEnableBroadcast);
}
return;
}
@ -322,78 +385,72 @@ void g_Mppt_Para_Init(void)
g_Mppt_Para.address[4] = g_slConfigInfo.address[4];
g_Mppt_Para.address[5] = g_slConfigInfo.address[5];
g_Mppt_Para.address[6] = g_slConfigInfo.address[6];
g_Mppt_Para.Access_Node_Type = g_slConfigInfo.Access_Node_Type;
g_Mppt_Para.Communication_Methods = g_slConfigInfo.Communication_Methods;
g_Mppt_Para.Battery_Voltage = 0;
g_Mppt_Para.Battery_temperature = 0;
g_Mppt_Para.Remaining_Battery_Bower = 0;
g_Mppt_Para.Solar_Open_Circuit_Voltage = 0;
// g_Mppt_Para.Solar_Open_Circuit_Voltage2 = 0;
g_Mppt_Para.Access_Node_Type = defaultValue.access_Node_Type;
g_Mppt_Para.Communication_Methods = defaultValue.communication_Methods;
g_Mppt_Para.Battery_Voltage = get_capturedata(get_PV_VOLT_OUT);
g_Mppt_Para.Charg_Current = get_capturedata(get_CHG_CURR);
g_Mppt_Para.Discharg_Current = get_capturedata(get_DSG_CURR);
g_Mppt_Para.Solar_Open_Circuit_Voltage = get_capturedata(get_PV1_VOLT_IN);
g_Mppt_Para.HighSideMos_Temperature = get_capturedata(get_MOSFET_Temper);
g_Mppt_Para.DischargMos_State = GPIO_ReadOutputDataBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN)
&& GPIO_ReadInputDataBit(DSG_PROT_GPIO, DSG_PROT_PIN);
g_Mppt_Para.MPPT_Mode = NoWork;
// printf("start_flag : %s \n", g_slConfigInfo.start_Flag);
// for (int var = 0; var < 7; ++var) {
// printf("address[%d] : %x\n", var, g_slConfigInfo.address[var]);
// }
// printf("end_flag : %x\n", g_slConfigInfo.end_Flag);
// printf("access_Node_Type : %x\n", defaultValue.access_Node_Type);
// printf("communication_Methods : %x\n", defaultValue.communication_Methods);
}
/**
* @brief
* @brief
* @param
* @retval
*/
void task_Init(void)
{
// read_config_info();
read_config_info();
g_Mppt_Para_Init();
TimeSliceOffset_Register(&m_runled, Task_RunLED, runled_reloadVal, runled_offset);
// m_refreshRegister.runFlag = 1; /* 该启动后立即执行一次 */
TimeSliceOffset_Register(&m_refreshRegister, Task_refreshRegister
, refreshRegister_reloadVal, refreshRegister_offset);
// TimeSliceOffset_Register(&m_mpptControl, Task_mpptControl
// , mpptControl_reloadVal, mpptControl_offset);
TimeSliceOffset_Register(&m_usart, Task_usart, usart_reloadVal, usart_offset);
//
TimeSliceOffset_Register(&m_wdi, Task_wdi, wdi_reloadVal, wdi_offset);
TimeSliceOffset_Register(&m_EnPowerSupply, Task_EnPowerSupply
, EnPowerSupply_reloadVal, EnPowerSupply_offset);
TimeSliceOffset_Register(&m_refreshRegister, Task_refreshRegister
, refreshRegister_reloadVal, refreshRegister_reloadVal);
TimeSliceOffset_Register(&m_startMpptControl, Task_startMpptControl
, startMpptControl_reloadVal, startMpptControl_offset);
TimeSliceOffset_Start(); /* 启动时间片轮询 */
}
/**
* @brief
* @brief
* @param
* @retval
*/
void hardware_Init(void)
{
Systick_Init();
TIM2_Init();
TIM2_Init(1);
uart_dev_init();
PWM_TIM_Configuration();
ADC_all_Init();
RUN_LED_Init();
G_FFMOS_CON_Init();
WDI_INPUT_Init();
BEEP_Init();
SPI_Flash_Init();
POW_OUT_CON_Init();
DSG_PROT_Init();
SPI_Flash_Init();
EnPowerSupply_Init();
// GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, SET);
// TIM_SetCompare4(TIM4, 5000);
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, RESET);
Set_duty_ratio(&g_duty_ratio);
// Set_duty_ratio(0);
// Delay_Ms(100);
// TIM_SetCompare2(TIM4, 50);
// TIM1_Init(20);
TIM3_Init(5);
TIM3_Init(1);
}

View File

@ -80,12 +80,12 @@ device_handle uart_dev_init(void)
// }
// }
InitRingQueue(&uart_devices[0].uart_ring_queue, bat485_in_buff, sizeof(bat485_in_buff));
uart_init(BAT485_UART_INDEX, g_slConfigInfo.bat485_Baud);
uart_init(BAT485_UART_INDEX, g_slConfigInfo.baud_485);
uart_devices[0].init = 1;
g_bat485_uart3_handle = (device_handle)(&uart_devices[0]);
InitRingQueue(&uart_devices[1].uart_ring_queue, gw485_in_buff, sizeof(gw485_in_buff));
uart_init(GW485_UART_INDEX, g_slConfigInfo.gw485_Baud);
uart_init(GW485_UART_INDEX, g_slConfigInfo.baud_485);
uart_devices[1].init = 1;
g_gw485_uart4_handle = (device_handle)(&uart_devices[1]);

View File

@ -10,14 +10,10 @@
#include "debug.h"
extern uint8_t run_Broadcast;
void TIM3_Init(uint16_t delay_ms);
void TIM3_Int_Init(uint16_t arr,uint16_t psc);
void TIM2_Init(void);
void TIM2_Init(uint16_t delay_ms);
void TIM2_Int_Init(uint16_t arr,uint16_t psc);
void Systick_Init(void);

View File

@ -12,7 +12,7 @@ void ADC_all_Init(void)
RCC_PB2PeriphClockCmd(RCC_PB2Periph_GPIOA, ENABLE);
RCC_PB2PeriphClockCmd(RCC_PB2Periph_ADC1, ENABLE);
RCC_ADCCLKConfig(RCC_PCLK2_Div6);
RCC_ADCCLKConfig(RCC_PCLK2_Div2);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7; //PA1~7对应ADC通道1~7
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;

View File

@ -6,6 +6,8 @@
*/
#include "gpio.h"
#include "task.h"
void G_FFMOS_CON_Init(void)
{
@ -65,6 +67,7 @@ void POW_OUT_CON_Init(void)
GPIO_Init(POW_OUT_CON_GPIO, &GPIO_InitStructure);
GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, SET);
// GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, RESET);
}
void EXTI2_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
@ -97,8 +100,18 @@ void DSG_PROT_Init(void)
void EXTI2_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line2)==SET) { //EXTI_GetITStatus用来获取中断标志位状态如果EXTI线产生中断则返回SET否则返回RESET
printf("Run at EXTI\r\n");
// printf("Run at EXTI\r\n");
GPIO_WriteBit(DSG_PROT_GPIO, DSG_PROT_PIN, RESET);
if (outputAgainFlag == 0) {
GPIO_WriteBit(DSG_PROT_GPIO, DSG_PROT_PIN, SET);
outputAgainFlag = 1;
}
if (outputAgainFlag == 1) {
GPIO_WriteBit(POW_OUT_CON_GPIO, POW_OUT_CON_PIN, RESET);
outputAgainFlag = 2;
}
EXTI_ClearITPendingBit(EXTI_Line2); //清除中断标志位
}
}
@ -112,7 +125,8 @@ void EnPowerSupply_Init(void)
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(EnPowerSupply_GPIO, &GPIO_InitStructure);
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, SET);
// GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, SET);
GPIO_WriteBit(EnPowerSupply_GPIO, EnPowerSupply_PIN, RESET);
}

View File

@ -46,12 +46,7 @@ void PWM_TIM_Configuration(void)
TIM_OC4Init(TIM4, &TIM_OCInitStructure);
TIM_OC4PreloadConfig(TIM4, TIM_OCPreload_Enable);
TIM_OC2Init(TIM4, &TIM_OCInitStructure);
TIM_OC2PreloadConfig(TIM4, TIM_OCPreload_Disable);
// TIM_OC2PreloadConfig(TIM4, TIM_OCPreload_Enable);
TIM_Cmd(TIM4, ENABLE);
TIM_CtrlPWMOutputs(TIM4, ENABLE);
}

View File

@ -9,12 +9,7 @@
#include "timeSliceOffset.h"
#include "pwm.h"
#include "mppt_control.h"
/* 延时时间 */
#define delays 20
/* 是否接收广播帧标志位 */
uint8_t run_Broadcast = 1;
#include "task.h"
void TIM3_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void TIM2_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
@ -23,12 +18,11 @@ void SysTick_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void TIM1_UP_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void TIM3_Init(uint16_t delay_ms)
{
/* 分频系数 */
uint16_t psc = (SystemCoreClock / 10000) - 1;
/* 分频系数 */
/* 周期数 */
uint16_t arr = delay_ms * 10 - 1;
TIM3_Int_Init(arr, psc);
@ -61,38 +55,18 @@ void TIM3_Int_Init(uint16_t arr, uint16_t psc)
void TIM3_IRQHandler(void)
{
// static float duty_ratio = 0;
// static int flag = 1;
// static int flag1 = 0;
if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) { //检查TIM3中断是否发生。
TIM_ClearITPendingBit(TIM3, TIM_IT_Update); //清除TIM3的中断挂起位。
test();
// flag1++;
// if (flag1 == 20) {
// if (flag) {
// duty_ratio += 0.005;
// if (duty_ratio > 1) {
// flag = !flag;
// }
// } else {
// duty_ratio -= 0.005;
// if (duty_ratio < 0) {
// flag = !flag;
// }
// }
// flag1 = 0;
// Set_duty_ratio(duty_ratio);
// printf(" TIM3_IRQHandler \n");
// }
}
}
void TIM2_Init(void)
void TIM2_Init(uint16_t delay_ms)
{
/* 分频系数 */
uint16_t psc = (SystemCoreClock / 1000) - 1;
uint16_t psc = (SystemCoreClock / 10000) - 1;
/* 周期值 */
uint16_t arr = delays * 1000 - 1;
uint16_t arr = delay_ms * 10 - 1;
TIM2_Int_Init(arr, psc);
}
@ -114,22 +88,22 @@ void TIM2_Int_Init(uint16_t arr, uint16_t psc)
//初始化TIM NVIC设置中断优先级分组
NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn; //TIM2中断
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; //设置抢占优先级0
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; //设置抢占优先级0
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //设置响应优先级3
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能通道1中断
NVIC_Init(&NVIC_InitStructure); //初始化NVIC
// TIM_Cmd(TIM2, ENABLE); //TIM2使能
TIM_Cmd(TIM2, ENABLE); //TIM2使能
}
void TIM2_IRQHandler(void)
{
if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET) { //检查TIM2中断是否发生。
TIM_ClearITPendingBit(TIM2, TIM_IT_Update); //清除TIM2的中断挂起位。
TIM_Cmd(TIM2, DISABLE); //TIM2禁止
// TIM_ITConfig(TIM2, TIM_IT_Update, DISABLE); //禁止TIM2更新中断
// printf("in time2 it \n");
run_Broadcast = 1;
TIM_ClearITPendingBit(TIM2, TIM_IT_Update); //清除TIM1的中断挂起位。
TimeSliceOffset_Produce();
if (outputAgainFlag == 1) {
outputAgainFlag = 0;
}
}
}

View File

@ -25,7 +25,10 @@ App/src/inflash.o: ../App/src/inflash.c D:\psx\MPPT\git\App\inc/inflash.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h \
D:\psx\MPPT\git\Hardware\inc/flash.h
D:\psx\MPPT\git\Hardware\inc/flash.h \
D:\psx\MPPT\git\App\inc/sl_protocol.h D:\psx\MPPT\git\App\inc/uart_dev.h \
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
D:\psx\MPPT\git\Hardware\inc/rs485.h
D:\psx\MPPT\git\App\inc/inflash.h:
@ -86,3 +89,11 @@ D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h:
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h:
D:\psx\MPPT\git\Hardware\inc/flash.h:
D:\psx\MPPT\git\App\inc/sl_protocol.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h:
D:\psx\MPPT\git\Hardware\inc/rs485.h:

Binary file not shown.

View File

@ -29,9 +29,11 @@ App/src/mppt_control.o: ../App/src/mppt_control.c \
D:\psx\MPPT\git\App\inc/collect_Conversion.h \
D:\psx\MPPT\git\Hardware\inc/adc.h D:\psx\MPPT\git\Hardware\inc/pwm.h \
D:\psx\MPPT\git\App\inc/inflash.h D:\psx\MPPT\git\Hardware\inc/gpio.h \
D:\psx\MPPT\git\App\inc/uart_dev.h \
D:\psx\MPPT\git\App\inc/sl_protocol.h D:\psx\MPPT\git\App\inc/uart_dev.h \
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
D:\psx\MPPT\git\Hardware\inc/rs485.h
D:\psx\MPPT\git\Hardware\inc/rs485.h D:\psx\MPPT\git\App\inc/task.h \
D:\psx\MPPT\git\Drivers\TimeSliceOffset/timeSliceOffset.h \
D:\psx\MPPT\git\App\inc/uart_dev.h
D:\psx\MPPT\git\App\inc/mppt_control.h:
@ -101,8 +103,16 @@ D:\psx\MPPT\git\App\inc/inflash.h:
D:\psx\MPPT\git\Hardware\inc/gpio.h:
D:\psx\MPPT\git\App\inc/sl_protocol.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h:
D:\psx\MPPT\git\Hardware\inc/rs485.h:
D:\psx\MPPT\git\App\inc/task.h:
D:\psx\MPPT\git\Drivers\TimeSliceOffset/timeSliceOffset.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,7 +25,12 @@ Hardware/src/gpio.o: ../Hardware/src/gpio.c \
D:\psx\MPPT\git\User/ch32l103_it.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h \
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h \
D:\psx\MPPT\git\App\inc/task.h \
D:\psx\MPPT\git\Drivers\TimeSliceOffset/timeSliceOffset.h \
D:\psx\MPPT\git\App\inc/uart_dev.h \
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
D:\psx\MPPT\git\Hardware\inc/rs485.h D:\psx\MPPT\git\App\inc/uart_dev.h
D:\psx\MPPT\git\Hardware\inc/gpio.h:
@ -84,3 +89,15 @@ D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h:
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h:
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h:
D:\psx\MPPT\git\App\inc/task.h:
D:\psx\MPPT\git\Drivers\TimeSliceOffset/timeSliceOffset.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h:
D:\psx\MPPT\git\Hardware\inc/rs485.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:

Binary file not shown.

Binary file not shown.

View File

@ -30,7 +30,8 @@ Hardware/src/tim.o: ../Hardware/src/tim.c \
D:\psx\MPPT\git\App\inc/uart_dev.h \
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
D:\psx\MPPT\git\Hardware\inc/rs485.h D:\psx\MPPT\git\Hardware\inc/pwm.h \
D:\psx\MPPT\git\App\inc/mppt_control.h
D:\psx\MPPT\git\App\inc/mppt_control.h D:\psx\MPPT\git\App\inc/task.h \
D:\psx\MPPT\git\App\inc/uart_dev.h
D:\psx\MPPT\git\Hardware\inc/tim.h:
@ -101,3 +102,7 @@ D:\psx\MPPT\git\Hardware\inc/rs485.h:
D:\psx\MPPT\git\Hardware\inc/pwm.h:
D:\psx\MPPT\git\App\inc/mppt_control.h:
D:\psx\MPPT\git\App\inc/task.h:
D:\psx\MPPT\git\App\inc/uart_dev.h:

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff