Desarrollo del sistema MPPT basado en FPGA

1. Descripción del problema:

 

2. Parte del programa:

 

`timecale 1ns / 1ps
//
// Empresa: 
// Ingeniero: 
// 
// Fecha de creación: 02:59:07 05/06/2019 
// Nombre del diseño: 
// Nombre del módulo: MPPT_module 
// Nombre del proyecto: 
// Dispositivos de destino: 
// Versiones de la herramienta: 
// Descripción: 
//
// Dependencias: 
//
// Revisión: 
// Revisión 0.01 - Archivo creado
// Comentarios adicionales: 
//
//
módulo MPPT_module (
                    i_clk,
                          i_rst,
                          i_PV_current,
                          i_PV_voltage ,
                          o_PV_power,
                          o_PV_max,
                          o_PV_current,
                          o_PV_voltage,
                          o_state
                   );

input i_clk;
input i_rst;
entrada con signo [15: 0] i_PV_current;
entrada con signo [15: 0] i_PV_voltage;
salida con signo [31: 0] o_PV_power;
salida con signo [31: 0] o_PV_max;
salida con signo [15: 0] o_PV_current;
salida con signo [15: 0] o_PV_voltage;
salida [1: 0] o_state;

// potencia
multi_core multi_core_u (
  .a (i_PV_current), // entrada [15: 0] a
  .b (i_PV_voltage), // entrada [15: 0] b
  .p (o_PV_power) // salida [31: 0] p
);


reg firmado [31: 0] r_PV_k1;
reg firmado [31: 0] o_PV_max;
siempre @ (posedge i_clk o posedge i_rst)
comienzan
     si (i_rst)
      comienzan
     o_PV_max <= 32'd0;
      r_PV_k1 <= 32'd0;
      end
else begin
     r_PV_k1 <= o_PV_power;
     if (o_PV_power> o_PV_max)
     o_PV_max <= o_PV_power; 
     si no
      o_PV_max <= o_PV_max; 
     fin
fin

cable firmado [31: 0] Reino Unido;
cable firmado [31: 0] Pk;

asignar Uk = i_PV_voltage;
asignar Pk = o_PV_power;

reg con signo [15: 0] dU = 16'd1;
reg con signo [15: 0] dU0 = 16'd1;

reg con signo [31: 0] Pk1;
reg firmado [15: 0] Uk1;
reg firmado [15: 0] Uref;


// 自适应 步 长 的 产生
reg [19: 0] cnt;
always @ (posedge i_clk o posedge i_rst)
begin
     if (i_rst)
      begin
      cnt <= 20'd0;
      end
else begin
     if (cnt> = 20'd35000)
     cnt <= 20'd35000;     
      si no
      cnt <= cnt + 20'd1;
     fin
fin


reg [1: 0] o_state;
siempre @ (posedge i_clk o posedge i_rst)
comienzan
     si (i_rst)
      comienzan
      Pk1 <= 32'd0;    
      Uk1 <= 16'd0;      
      
      Uref <= 16'd0;

     o_state <= 2'd0;        
      terminar,
si no, comenzar

      Pk1 <= Pk;
      Uk1 <= Reino Unido;
      
      
 
              si (Pk> = Pk1 & Uk> Uk1)  
              comienzan
              Uref <= Uref + {dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [ 15: 6]};
              o_state <= 2'd0;    
              end
              if (Pk> = Pk1 & Uk <= Uk1)
              begin Uref <= Uref  
              - {dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15: 6]};
              o_state <= 2'd1;    
              end
              
              
              if (Pk <Pk1 & Uk> Uk1)  
              begin
              Uref <= Uref - {dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [ 15: 6]};
              o_state <    
              finaliza  
              
              si (Pk <Pk1 & Uk <= Uk1)
              empieza Uref <= Uref  
              + {dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15], dU0 [15: 6]};
              o_state <= 2'd3;    
              end
      
     end
end
asignar o_PV_voltage = Uref;
asignar o_PV_current = dU0;

reg firmado [31: 0] Power_diffe;
reg firmado [7: 0] Current_diff;
always @ (posedge i_clk o posedge i_rst)
begin
     if (i_rst)
      begin
      dU <= 16'd1;
      dU0 <= 16'd1;      
     Power_diffe <= 32'd0;
      Current_diff <= 8'd0;
     
      terminar,
si no, comenzar


     Power_diffe <= o_PV_max-r_PV_k1;
      Current_diff <= i_PV_current [15: 8];

     
     if (cnt <20'd4000)
      begin
              if ({Power_diffe [31-4: 16-4], 4'd0}> 16'd10)
              dU0 <= {16'd16};
          si no
              dU0 <= {Power_diffe [31-4: 16-4], 4'd0};
      end
     else begin
           dU0 <= {Power_diffe [31-4: 16-4], 4'd0};
           fin
 
 
 
     fin
fin

 

endmodule
 

3. Conclusión de la simulación:

A-002-0067

Supongo que te gusta

Origin blog.csdn.net/ccsss22/article/details/114743042
Recomendado
Clasificación