TI微型光伏逆变器源代码

  • J6_730871
    了解作者
  • 26.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 2
    下载次数
  • 2022-04-10 01:54
    上传日期
此设计是一种具有最大功率点跟踪 (MPPT) 功能的数字控制并网太阳能微型逆变器。太阳能微型逆变器是太阳能行业的新兴领域。与将某个安装中的每个太阳能电池板连接到中央逆变器不同,基于太阳能微型逆变器的安装将各个更小的(或“微型”)逆变器分别链接到每个太阳能电池板。该配置本身具有很多优势,包括消除了部分遮光条件、提高了系统效率、提高了可靠性以及增强了模块化。对于此设计,C2000™ Piccolo™ TMS320F28035 微控制器 (MCU) 是整个逆变器的数字控制器,包括控制功率级、MPPT 和并网同步。功率转换级包括 1) 具有次级倍压器的有源钳位反激式直流/直流转换器,以及 2) 并网直流/交流逆变器。此设计可实现 93% 的峰值效率和低于 4% 的总谐波失真 (THD),从而可提高单位太阳能电池板的功率输出,减少不利散热并延长系统寿命。
microinvertor.zip
  • cc
  • SolarMicroInv-Main.c
    60KB
  • SolarMicroInv-Settings.h
    5KB
  • PWM_1ch_UpDwnCnt_Cnf.c
    2.8KB
  • PWM_MicroInvLineClamp_Cnf.c
    4.8KB
  • SolarMicroInv-DevInit_F2803x.c
    33.1KB
  • SolarMicroInv-Includes.h
    1KB
内容介绍
//---------------------------------------------------------------------------------- // FILE: SolarMicroInv_F2803x-Main.C // // Description: Solar MicroInverter Project // // Version: 1.0 // // Target: TMS320F2803x(PiccoloB), // //---------------------------------------------------------------------------------- // Copyright Texas Instruments � 2004-2013 //---------------------------------------------------------------------------------- // Revision History: //---------------------------------------------------------------------------------- // Date | Description / Status //---------------------------------------------------------------------------------- // June 26 2013 : (Manish Bhardwaj, Shamim Choudhury) //---------------------------------------------------------------------------------- // // PLEASE READ - Useful notes about this Project // Although this project is made up of several files, the most important ones are: // "{ProjectName}-Main.C" - this file // - Application Initialization, Peripheral config, // - Application management // - Slower background code loops and Task scheduling // "{ProjectName}-DevInit_F28xxx.C // - Device Initialization, e.g. Clock, PLL, WD, GPIO mapping // - Peripheral clock enables // - DevInit file will differ per each F28xxx device series, e.g. F280x, F2833x, // "{ProjectName}-Settings.h" // - Global defines (settings) project selections are found here // - This file is referenced by both C and ASM files. // "{ProjectName}-Includes.h" // - Include file used by project are defined in this file // // Code is made up of sections, e.g. "FUNCTION PROTOTYPES", "VARIABLE DECLARATIONS" ,..etc // each section has FRAMEWORK and USER areas. // FRAMEWORK areas provide useful ready made "infrastructure" code which for the most part // does not need modification, e.g. Task scheduling, ISR call, GUI interface support,...etc // USER areas have functional example code which can be modified by USER to fit their appl. // // Code can be compiled with various build options (Incremental Builds IBx), these // options are selected in file "{ProjectName}-Settings.h". Note: "Rebuild All" compile // tool bar button must be used if this file is modified. //---------------------------------------------------------------------------------- #include "SolarMicroInv-Includes.h" //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // FUNCTION PROTOTYPES //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Add prototypes of functions being used in the project here void DeviceInit(void); #ifdef FLASH void InitFlash(); #endif void MemCopy(); #ifdef FLASH #pragma CODE_SECTION(Inv_ISR,"ramfuncs"); #pragma CODE_SECTION(OneKhzISR,"ramfuncs"); #endif //This is the control loop ISR run at 50Khz interrupt void Inv_ISR(void); //This is 1 Khz ISR slaved off CPU timer 2, interrupt void OneKhzISR(); void InitECapture(); void ADC_SOC_CNF(int ChSel[], int Trigsel[], int ACQPS[], int IntChSel, int mode); void PWM_1ch_UpDwnCnt_CNF(int16 n, Uint16 period, int16 mode, int16 phase); void PWM_MicroInvLineClamp_CNF(int n,int period,int deadband_rising,int deadband_falling); // -------------------------------- FRAMEWORK -------------------------------------- // State Machine function prototypes //---------------------------------------------------------------------------------- // Alpha states void A0(void); //state A0 void B0(void); //state B0 // A branch states void A1(void); //state A1 void A2(void); //state A2 void A3(void); //state A3 void A4(void); //state A4 // B branch states void B1(void); //state B1 void B2(void); //state B2 void B3(void); //state B3 // Variable declarations void (*Alpha_State_Ptr)(void); // Base States pointer void (*A_Task_Ptr)(void); // State pointer A branch void (*B_Task_Ptr)(void); // State pointer B branch //---------------------------------------------------------------------------------- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // VARIABLE DECLARATIONS - GENERAL //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // -------------------------------- FRAMEWORK -------------------------------------- int16 VTimer0[4]; // Virtual Timers slaved off CPU Timer 0 int16 VTimer1[4]; // Virtual Timers slaved off CPU Timer 1 // Used for running BackGround in flash, and ISR in RAM extern Uint32 *RamfuncsLoadStart, *RamfuncsLoadEnd, *RamfuncsRunStart; extern Uint32 *IQfuncsLoadStart, *IQfuncsLoadEnd, *IQfuncsRunStart; // Used for ADC Configuration int ChSel[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int TrigSel[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int ACQPS[16] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }; //--------------------------------------------------------------------------- // Used to indirectly access all EPWM modules volatile struct EPWM_REGS *ePWM[] = { &EPwm1Regs, //intentional: (ePWM[0] not used) &EPwm1Regs, &EPwm2Regs, &EPwm3Regs, &EPwm4Regs, &EPwm5Regs, &EPwm6Regs, &EPwm7Regs, }; // Used to indirectly access all Comparator modules volatile struct COMP_REGS *Comp[] = { &Comp1Regs,//intentional: (Comp[0] not used) &Comp1Regs, &Comp2Regs, &Comp3Regs }; // ---------------------------------- USER ----------------------------------------- //-----------------------------Inverter & DC-DC Control Loop Variables ------------- // String to describe the state of the PV Inverter char cPV_State[40]; // Solar Library Objects // RAMP to generate forced angle when grid is not present RAMPGEN_IQ rgen1; // CNTL 3p3z for inverter current control #pragma DATA_SECTION(cntl3p3z_InvI_vars,"cntl_var_RAM") #pragma DATA_SECTION(cntl3p3z_InvI_coeff,"cntl_coeff_RAM") CNTL_3P3Z_IQ_VARS cntl3p3z_InvI_vars; CNTL_3P3Z_IQ_COEFFS cntl3p3z_InvI_coeff; // CNTL 2p2z for flyback current control #pragma DATA_SECTION(cntl2p2z_DCDCI_vars,"cntl_var_RAM") #pragma DATA_SECTION(cntl2p2z_DCDCI_coeff,"cntl_coeff_RAM") CNTL_2P2Z_IQ_VARS cntl2p2z_DCDCI_vars; CNTL_2P2Z_IQ_COEFFS cntl2p2z_DCDCI_coeff; // CNTL PI for bus control CNTL_PI_IQ cntlPI_BusInv; int16 UpdateCoef; long Pgain_BusInv, Dgain_BusInv, Igain_BusInv, Dmax_BusInv; // SPLL Objects of two types for grid angle lock SPLL_1ph_IQ spll1; SPLL_1ph_SOGI_IQ spll2; float c2, c1; long Phase_Jump, Phase_Jump_Trig; // Sine analyzer block for RMS Volt, Curr and Power measurements SINEANALYZER_DIFF_wPWR_IQ sine_mains; // notch filter objects for filtering bus voltage, pv current and voltage sense signals #pragma DATA_SECTION(Bus_Volt_notch,"cntl_var_RAM") #pragma DATA_SECTION(PV_volt_notch,"cntl_var_RAM") #pragma DATA_SECTION(PV_cur_notch,"cntl_var_RAM") #pragma DATA_SECTION( notch_TwiceGridFreq,"cntl_coeff_RAM") NOTCH_COEFF_IQ notch_TwiceGridFreq; NOTCH_VARS_IQ Bus_Volt_notch,PV_volt_notch,PV_cur_notch; // MPPT object for flyback current reference selection MPPT_INCC_I_IQ mppt_incc_I1; int16 MPPT_slew; int16 Run_MPPT; int16 MPPT_ENABLE; // Datalogger to plot variables #if INCR_BUILD==1 || INCR_BUILD==2 DLOG_4CH_IQ dlog1; int16 DBUFF1[100], DBUFF2[100], DBUFF3[100], DBUFF4[100]; int16 D_val1, D_val2, D_val3, D_val4; #endif //TODO // Inverter and Flyback Variables _iq24 inv_meas_cur_inst, inv_meas_vol_inst, vbus_meas_inst, vbus_meas_avg ; // reference variable Inverter _iq24 InvModIndex, inv_Iset, inv_ref_cur_inst, inv_bus_ref; // Measure Values DC-DC Stage long pv_meas_cur_inst,pv_meas_vol_inst,pv_meas_cur_avg, pv_meas_vol_avg; // Reference Values DC-DC Stage long pv_ref_cur_inst, pv_ref_cur_mppt, pv_ref_cur_fixed; // Measurement Offsets _iq24 offset_165, offset_GridCurrent, PV_SenseVolt_Offset, PV_SenseCurr_Offset,DC_Bus_Offset; //Offset filter coefficient K1: 0.05/(T+0.05)
评论
  • p@Star 2022-06-23 13:34:30
    光伏逆变器的可以参考一下,需要有DSP基础。
相关推荐
  • MCU内核设计
    这是用逻辑电路设计软件DSCH设计的微控制器内核电路图,让大家参考一下
  • 三星全系列MCU
    三星全系列MCU程序,510N,711N,710V_White17寸,19寸。
  • mcu超级助手
    LED计算 汉字取模 搜索 翻译 彩图转换 TNC计算 电阻电感
  • 三星MCU程序
    三星MCU程序
  • 串口通信_mcu
    刚学MCU的可以用来学习串口操作,简单实用。非常easy掌握串口的简单应用
  • mcu开发文档
    非常好的 开发文档 关于mcu的开发 电子工程创新设计必备宝典系列之32位mcu开发文档 欢迎下载
  • foosball-mcu
    桌上足球-mcu 请参看 Wiki
  • mcu设计
    非常好的32位MCU设计资料
  • lcd mcu isp tools
    支持mstar isp、mtv512、rtd2120、rtd2660等mcu,支持端口用ftdi和并口下载
  • ECEN404_MCU:高级设计项目的MCU代码
    ECEN404_MCU 高级设计项目的MCU代码 自述文件过期添加了一些导航代码。 即将更新 该项目使用的PIC32MZ-2048-EFH-144微控制器上使用的代码。 待办事项:从josh获取区域规范并配置警报引脚。 从josh(逗号,空格等)...