Movatterモバイル変換


[0]ホーム

URL:


CN115509975B - A hard-core interface module for APF control system - Google Patents

A hard-core interface module for APF control system
Download PDF

Info

Publication number
CN115509975B
CN115509975BCN202211003535.5ACN202211003535ACN115509975BCN 115509975 BCN115509975 BCN 115509975BCN 202211003535 ACN202211003535 ACN 202211003535ACN 115509975 BCN115509975 BCN 115509975B
Authority
CN
China
Prior art keywords
module
data
ram
writing
dual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211003535.5A
Other languages
Chinese (zh)
Other versions
CN115509975A (en
Inventor
周文罕
张继征
陈子栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tysen Kld Group Co ltd
Original Assignee
Tysen Kld Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tysen Kld Group Co ltdfiledCriticalTysen Kld Group Co ltd
Priority to CN202211003535.5ApriorityCriticalpatent/CN115509975B/en
Publication of CN115509975ApublicationCriticalpatent/CN115509975A/en
Application grantedgrantedCritical
Publication of CN115509975BpublicationCriticalpatent/CN115509975B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了APF控制系统的硬核接口模块,硬核接口模块通过读写双口RAM与MCU通信;硬核接口模块的顶层实体的输入信号包括:时钟信号,波形数据,从板数据,从板状态,双口RAM读写状态,故障信号,通知信号;硬核接口模块的顶层实体的输出信号包括:第一使能信号,数据输出,地址输出,命令输出,通知信号。通过APF控制系统的硬核接口模块将控制硬核采集的电网系统实时运行的各项电气数据、开关状态、运行的线路的稳定性等重要信息及时显示在控制终端上的同时传递终端下发的配置参数,实现对电网系统运行状况的实时掌控。

The present invention discloses a hard-core interface module of an APF control system, which communicates with an MCU by reading and writing a dual-port RAM; the input signals of the top-level entity of the hard-core interface module include: a clock signal, waveform data, slave board data, slave board status, dual-port RAM read-write status, a fault signal, and a notification signal; the output signals of the top-level entity of the hard-core interface module include: a first enable signal, data output, address output, command output, and a notification signal. The hard-core interface module of the APF control system controls the real-time operation of various electrical data, switch status, stability of the running line and other important information of the power grid system collected by the hard-core, and timely displays them on the control terminal while transmitting the configuration parameters issued by the terminal, so as to realize real-time control of the operation status of the power grid system.

Description

Hard core interface module of APF control system
Technical Field
The invention relates to the technical field of APF control systems, in particular to a hard core interface module of an APF control system.
Background
The electrical information data and the operation state data play a key role in the safe and stable operation of the whole power system, so that various operation parameters of the power grid are monitored in real time, the operation quality of the power grid is analyzed according to the collected data, and the power grid is coordinated and optimized. The quality of the power grid and the running condition of the active power filter device are required to be monitored by a terminal monitoring system, and the running efficiency can be improved and the fault risk can be controlled in a controllable range by uniformly monitoring and managing the power grid system.
How to feed back a large amount of data with complex structure generated by an APF control system with a plurality of calculation modules working cooperatively to a control terminal in high efficiency and in time, and simultaneously save and send configuration parameters issued by the control terminal to related modules in the APF control system, so as to realize high-efficiency monitoring and management on a power grid system is a problem that needs to be faced by those skilled in the art.
Disclosure of Invention
Aiming at the technical problems existing in the prior art, in a first aspect, the invention discloses a hard core interface module of an APF control system, wherein the hard core interface module is communicated with an MCU through a read-write dual-port RAM;
The input signals of the top layer entity of the hard core interface module comprise clock signals, waveform data, slave board status, dual-port RAM read-write status, fault signals and notification signals;
the output signals of the top layer entity of the hard core interface module comprise a first enabling signal, data output, address output, command output and notification signals, wherein the command output comprises a command sent by the MCU to the hard core;
The bottom layer module of the hard core interface module comprises:
the state monitoring module is used for monitoring the dual-port RAM and outputting the read-write state of the dual-port RAM;
The waveform data writing module is used for writing the waveform data collected from a network side or an APF control system output side into the dual-port RAM, wherein the waveform data comprises voltage waveform data and/or current waveform data;
A slave board data writing module for writing the slave board data and the slave board data into the dual-port RAM;
The command writing-in and reading module is used for writing the commands sent by the MCU to the hard core into the dual-port RAM;
the parameter transfer module is used for controlling the transfer of configuration parameters between the MCU and the hard core;
The fault signal writing module is used for writing the fault signal into the dual-port RAM and modifying the information of the fault pointer at the same time;
The time-sharing multiplexing module is used for controlling the time-sharing multiplexing of the read-write of the dual-port RAM by all the bottom layer modules;
the multiplexing module is configured to send a second enabling signal to the state detection module when judging that the dual-port RAM is not occupied, and the state detection module is configured to start working after receiving the second enabling signal.
In a second aspect, the present invention proposes an APF, including a motherboard, where the motherboard is electrically connected to at least three devices, each device including three slave boards, where the three slave boards are an a-phase slave board, a B-phase slave board, and a C-phase slave board, respectively.
In a third aspect, the present invention provides an APF control system, where the APF control system includes a hard core implemented based on an FPGA, an MCU, and a dual-port RAM for communication between the hard core and the MCU, and the APF control system further includes the hard core interface module described above.
The hard core interface module of the APF control system timely displays important information such as various electric data, switching states, stability of running lines and the like of the power grid system which are collected by the control hard core in real time on the control terminal, and meanwhile transmits configuration parameters issued by the terminal, so that the real-time control of the running condition of the power grid system is realized.
Drawings
FIG. 1 is a top level physical schematic of a number of hard core interface modules;
FIG. 2, bottom level modules of some hard core interface modules;
FIG. 3 is a schematic diagram of some of the hard core interface modules;
fig. 4, block diagram of some APFs.
Detailed Description
First, the following explanation is made on terms of the present invention:
FPGA, field programmable gate array, preferably Intel corporation AgilexTM, and employing Intel complementDevelopment was performed. MCU (microcontroller unit, microcontrol unit) is based on a soft-core implementation, preferably a Nios II fast-core. Avalon interface, UART, universal asynchronous receiver transmitter, which is used for high-speed data stream transmission, read-write register, memory and control of off-chip equipment. JTAG, test access interface. SDRAM, synchronous dynamic random access memory. "programs" may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. The term "Time Division Multiplexing (TDM)", by employing different time periods of the same physical connection to transmit different signals, can achieve multiplexing purposes. The term in the invention is mainly aimed at dealing with the space domain optimization requirement when more than two modules are needed in the FPGA design, and the space domain optimization is carried out on a plurality of modules which are not used simultaneously and have the same function.
The technical scheme of the invention is described below with reference to the accompanying drawings.
Some hard core interface modules communicate with the MCU through read-write dual-port RAM. The top layer entity of the hard core interface module is shown in figure 1, wherein the input signals comprise clock signals, waveform Data, slave board state, dual-port RAM read-write state, fault signals and notification signals;
Some hard core interface modules include the main underlying modules in fig. 2:
The state monitoring module monitors the dual-port RAM and outputs the read-write state of the dual-port RAM;
The waveform data writing module is used for writing the voltage waveform data and the current waveform data into the dual-port RAM;
A slave board data writing module for writing the slave board data and the slave board data into the dual-port RAM;
The command writing-in and reading module is used for writing the commands sent by the MCU to the hard core into the dual-port RAM;
the parameter transfer module is used for controlling the transfer of configuration parameters between the MCU and the hard core;
The fault signal writing module is used for writing the fault signal into the dual-port RAM and modifying the information of the fault pointer at the same time;
And the time-sharing multiplexing module is used for controlling the time-sharing multiplexing of the read-write of the dual-port RAM by all the bottom layer modules.
The multiplexing module is configured to send a second enabling signal to the state detection module when judging that the dual-port RAM is not occupied, and the state detection module is configured to start working after receiving the second enabling signal.
The principle of some hard core interface modules is as shown in fig. 3, communication between the hard core and the MCU is realized through a dual-port RAM, wherein the dual-port RAM is composed of five RAM blocks with consistent reading and writing, and the dual-port RAM is respectively configured as follows:
The first RAM block is used for storing the read-write state of the dual-port RAM;
A second RAM block for storing a data block including the waveform data, the slave board state;
the third RAM block is used for storing cache data for the MCU to inquire;
a fourth RAM block for storing data exchanged between the hard core and the MCU;
and a fifth RAM block for storing the fault code.
The state detection module of some embodiments is configured to perform state detection on the dual-port RAM at regular intervals;
The state detection module sends the state of the dual-port RAM to any one or more modules of the command writing and reading module, the parameter transfer module, the fault signal writing module and the waveform data writing module;
And after any one or more modules of the command writing and reading module, the parameter transfer module, the fault signal writing module and the waveform data writing module receive the state of the dual-port RAM, sending a RAM request instruction to the time-sharing multiplexing module.
The hard core interface module of some embodiments further performs the step of allowing the time division multiplexing module to write and read the command, the parameter transfer module, the fault signal writing module, the waveform data writing module, and the state detection module in sequence according to the priority from high to low, allowing the request RAM instruction of the corresponding module.
Some of the sub-modules of the parameter delivery module include:
The MCU configuration parameter buffer module is used for reading configuration parameters from an external memory and storing the configuration parameters into an internal memory, wherein the configuration parameters are modified by the MCU;
The updating and initializing module is used for transmitting the index catalog and the numerical value of the configuration parameters to the waveform data writing module for checking whether the numerical value of the transformer is changed after the data of the APF control system is updated, the UART module for informing a slave board of checking whether the numerical value of the configuration parameters is to be modified, the protection module for checking whether the configuration parameters are modified, and the DFT module for checking whether the configuration parameters are required to be modified;
and the issuing configuration data caching module is used for caching configuration parameters issued by the control terminal of the APF control system.
In some more specific embodiments, the waveform data writing module includes a sample writing module and a sample data processing module, wherein:
the detection module detects the read-write state of the dual-port RAM every 400Ms, and if the dual-port RAM is in an idle state, sends out a write signal to the dual-port RAM;
the sampling signal transmitting module is used for transmitting a sampling signal every 7811 clock cycles and controlling the sampling writing module to execute writing;
the sampling writing module is used for collecting the waveform data, generating a writing enabling signal, a writing address and writing data, writing the waveform data into the second RAM block at one time,
The waveform data comprise voltage waveform data and/or current waveform data, and specifically comprise three-phase power grid voltage waveform data, three-phase power grid current waveform data, three-phase load current waveform data and three-phase total compensation current waveform data;
And the sampling data processing module is used for converting the waveform data into actual values.
In some more specific embodiments, the sub-module of the sample writing module comprises:
the second RAM block state monitoring module is used for inquiring the state of the second RAM block at regular intervals and sending a writing instruction to the second RAM block;
The sampling execution module is used for executing the acquisition of the waveform data;
and the auxiliary sampling control module is used for sending sampling commands to the sampling execution module at regular intervals.
The configuration of the MCU of some embodiments is realized by embedding a Nios II architecture on an FPGA, and specifically comprises the following steps:
Loading a soft verification MCU CPU function based on a Nios II architecture on an FPGA;
Based on the Nios II architecture, a plurality of functional modules including an Avalon-MM tri-state bridge, a UART module, a Jtag port debugging module, an SDRAM controller module, a plurality of interval timers, a flash memory interface and a plurality of parallel IO ports are integrated.
Some APFs, constructed as shown in fig. 4, include a motherboard electrically connected to at least three devices, each device including three slave boards, a phase a slave board, a phase B slave board, and a phase C slave board, respectively.
Some APF control systems include a hard core implemented based on an FPGA, an MCU, and a dual port RAM for communication of the hard core with the MCU, the hard core further including a hard core interface module as in any of the embodiments described above.
A dual-port RAM is opened up in the FPGA to realize communication between the MCU and the hard core part. The dual port RAM size in this particular embodiment is 1024 bits by 64 bits. The dual port RAM was divided into 5 blocks, ram#1, rma#2, ram#3, ram#4, ram#5, respectively. Each RAM block holds different data. A 32bit MCU is configured with a 32bit x 32bit multiplier inside. Through practical tests, the MCU works relatively stably at 50M. The interface signals between the hard core and the MCU and the dual-port RAM are fixed, and no signal is directly exchanged between the hard core and the MCU, and the signals are transferred by the dual-port RAM.
The dual-port RAM is a shared multi-port memory which is provided with two sets of completely independent data lines, address lines and read-write control lines on an SRAM memory and allows two independent systems to randomly access the memory at the same time, and can allow an MCU or a hard core to randomly read or write the memory at the same time, but does not allow the MCU to simultaneously read and write one address unit and does not allow the hard core to read and write the same address unit.
The MCU (or FPGA hard core) can send a write command after the address and data to be written are ready on address_a and data_a, the pulse width of the write command is at least 1 global clock length (50M), and the length of a global clock is not allowed to be more than 5, otherwise, the dual-port RAM is written for the second time, and the actual test shows that the command pulse is 10M in width when the main frequency is 50M. The addresses_a and data_a need to be changed after wren_a is low, otherwise erroneous data is written to the erroneous address. The write-once dual-port RAM requires approximately 4 global clocks.
When the MCU reads the address unit which is being written by the hard core, the data read by the MCU is the historical value of the address unit, and when the MCU reads the address unit which is being written by the MCU, the data read by the hard core is also the historical value of the address unit. But when the MCU and the hard core write an address at the same time, the value of the address location is indeterminate. The historical values are saved to a caching module.
The invention is explained below by means of a specific example.
Example 1
1. Design of embedded MCU interface
An MCU interface module was built in the Quartz, and the types and functions of its pins are listed in Table 1.
TABLE 1 MCU interface function List
The MCU interface based on the Nios II soft core processor integrates a plurality of modules, and the description of the main modules is shown in Table 2:
TABLE 2 description of the Main modules of the MCU interface
Name of the nameDescription of the invention
CPUNiosII processor
tri_state_bridge_0Avalon-MM tri-state bridge
ButtonParallel IO port
LEDParallel IO port
RS232Universal asynchronous serial port (UART) module employing 232 level
RS232_485Universal asynchronous serial port (UART) module employing 232 level
RS232_disUniversal asynchronous serial port (UART) module employing 232 level
jtag_uart_0Jtag port debugging module
CFI_FLASHFlash memory interface
SDRAMSDRAM controller
PIO_InParallel IO port
PIO_OutParallel IO port
sysidSystemIDPeripheral
Timer_1Interval timer
Timer_2Interval timer
Sys_StateParallel IO port
RAM_ControlParallel IO port
RAM_AddrParallel IO port
RAM_Data_AParallel IO port
RAM_Data_BParallel IO port
RAM_Byte_EnParallel IO port
2. Design of hard core read-write RAM
In order to realize the operation of the hard core read-write RAM, thereby realizing the information communication between the MCU and the hard core, the definition of the input and output signals of the top layer entity of the hard core interface module is shown in the table 3.
TABLE 3 definition of input/output signals for top level entities
The following table gives the interface signals for the hard core and dual port RAM. Byteena _a is a write byte enable signal, which divides 64bit data written into RAM into 8 bytes, corresponding to byteena _a 8 bits, when corresponding bit is high, the bytes can be written into corresponding address unit, and other byte data in the address unit is kept unchanged from last historical value.
The interface signals between the MCU and the dual-port RAM are similar, but an additional clock matching module is added in the middle, so that the dual-port RAM is prevented from being written or read for many times.
TABLE 4 interface signals for hard core and dual port RAM
Signal signalWidth of (L)Description of the invention
data_a64bitWriting data for dual port RAM
address_a10bitReading or writing addresses of dual port RAM
wren_a1bitRequest signal for writing dual port RAM
rden_a1bitRequest signal for reading dual port RAM
byteena_a8bitWriting byte enable signals for dual port RAM
q_a64bitDual port RAM output data
Each of the underlying modules is explained in detail below:
2.1 State monitoring Module
The module corresponds to a control register area, and outputs all RAM read-write states, and table 5 is a definition description of main input-output signals of the module.
TABLE 5 input/output Signal of State monitoring submodule
When the RAM is in the idle state, the state of the RAM block is detected every 1 ms. The signal En comes from the time division multiplexing sub-module, when the time division multiplexing module judges that the current RAM is not occupied, the signal En is in high level, and the RAM state monitoring module is informed to start working.
2.2 Waveform data writing Module
The module is used for controlling the FPGA hard core to write waveform data into the second RAM block for the MCU to read and display, and the table 6 is a definition description of main input and output signals of the module. The module comprises a sampling writing module and a sampling data processing module.
TABLE 6 definition of the Primary input/output Signal of waveform data write Module
Wherein the sampled data processing module is operative to convert the sampled voltage-current data into actual values. It should be noted that, the relationship between the actual value and the sampling value of the grid voltage is:
Wherein Us is the actual value of the grid voltage, and Us' is the sampling value. 2849 in the program is also hereby obtained.
The relation between the actual value and the sampling value of the grid current is:
Where is is the actual value of the grid voltage and is' is the sampled value. N represents the turn ratio of the external current transformer, and the parameter is issued through a screen and is processed and identified by an FPGA_MCU_APF_grid_Cur_Index_Rd module. The APF output side current sampling is the same as the net side current sampling, so the processing is the same.
The sample write module consists of small modules that support parallel computation of multiple small modules.
2.2.1 Second RAM Block status monitoring Module FPGA_MCU_RAM_sample
The function is to detect the state of RAM#2 once every 400ms, if the display MCU is idle, start to send out the signal written into the RAM block, show RAM is being used;
2.2.2 auxiliary sampling Control Module FPGA u MCU_RAM_Volt_Cur Sample Control
The sampling signal is sent out once every 7811 clock cycles (because the voltage and current waveform data are all 128 points/cycle), and the sampling execution module is controlled to collect data of twelve channels.
2.2.3 Sample execution Module FPGA_MCU_RAM Volt_Cur
Data acquisition of twelve channels is executed, wherein the data are respectively ABC three-phase power grid voltage, ABC three-phase power grid current, ABC three-phase load current and ABC three-phase total compensation current, each data is a point, a written enabling signal is generated, addresses are written, data are written, and the like, and the data are written into corresponding positions in the RAM at one time.
2.3 Slave board data write module
The function of the module is to write the data of voltage, current, temperature, protection, etc. sent from the controller into the RAM. The definition of the main input and output signals from the controller data write RAM control submodule is as follows in table 7:
TABLE 7 slave controller data write RAM control submodule
Signal signalType(s)Meaning of the following description
Index_StNotification signal inputInforming the module that it can start working
Slave_Index_1A[63..0]Data inputSlave plate a phase data
Slave_Index_1B[63..0]Data inputSlave B phase data
Slave_Index_1C[63..0]Data inputSlave plate C phase data
Slave_State_1A[7..0]State inputSlave board a phase protection data
Slave_State_1B[7..0]State inputSlave board B phase protection data
Slave_State_1C[7..0]State inputSlave board C phase protection data
Wr_ReqNotification outputEnable signal for writing RAM
Addr[9..0]Address signal outputWriting addresses to RAM
Byte_En[7..0]Byte enable signal outputByte enabling
Wr_Data[63..0]Write data outputWriting data of RAM
RAM_NextNotification signal outputNotification signal
2.4 Command write read Module
The function of the module is to write the commands of the MCU interface to the FPGA hard core into the RAM, and then read the commands by the FPGA hard core. The main input/output signals are defined in table 8:
TABLE 8 Main input/output Signal of Command write read submodule
Signal signalType(s)Meaning of the following description
Rd_StNotification signal inputInforming the module that it can start working
RAM_3_W_Ord[15..0]Command signal inputWrite command pointer
RAM_3_R_Ord[15..0]Command signal inputRead command pointer
RAM_Data[63..0]Data inputData written into RAM
RAM_CommandCommand signal inputNotification signal after command reading
Wr_ReqNotification signal outputEnable signal for writing RAM
Addr[9..0]Address signal outputWriting addresses to RAM
Byte_En[7..0]Byte enable signal outputByte enabling
Wr_Data[63..0]Write data outputWriting data of RAM
Rd_ReqNotification signal outputEnable signal for reading RAM
Confi_Rd_StNotification signal outputNotification signal
2.5 Parameter transfer Module
The function of the module is to control parameter transfer between MCU and FPGA hard core, the definition of main input and output signals is as shown in Table 9:
TABLE 9 Main input output Signal of parameter transfer submodule
The parameter transmission submodule consists of three small modules, namely:
2.5.1MCU configuration parameter cache module FPGA_MCU_RAM _Config_Rd
The function is that when the MCU modifies the parameters, the module reads the modified parameters from the external RAM, and simultaneously caches the parameters into the internal RAM, thereby facilitating parameter recall. After the MCU requests the parameters of the main controller, the parameters in the internal RAM are read, and then the parameters are written into the external RAM, and finally the parameters are used for screen display.
It should be noted that the external RAM is not located in the main controller of the APF control system.
2.5.2 Update and initialization Module FPGA_RAM_Config RAM Control
When the data update or the power-on signal is detected, the module sends an Index directory (Sys_Index) and a numerical value of system configuration parameters stored in the RAM to a waveform writing module for checking whether the numerical value of a mutual inductor is changed, a UART module for informing a slave board to check whether corresponding data is to be modified, a protection module for checking whether corresponding parameters are to be modified, and a DFT module for checking whether the corresponding parameters are to be modified. The module is mainly used for updating and initializing system data. When the configuration parameters are needed by the main board program, the control terminal judges whether to issue new configuration parameters by detecting three parameters, namely Sys_Config_Ud, sys_Index and cof_RAM_Data, so as to update the parameters. Each time after the configuration data is issued, the module first caches the modified data into the issued configuration data cache module, and then reads all parameters in the RAM all the way around. Every time a parameter is read, sys_Config_Ud is pulled high once, sys_Index outputs the Index corresponding to the currently read configuration parameter, and Cof_RAM_Data outputs the parameter value.
2.5.3 Issue configuration data caching Module FPGA_MCU_Config_RAM
All configuration data issued from the screen of the control terminal is cached.
2.6 Fault Signal writing Module
The function of the module is that when a hard core fails once, fault information is written into the RAM, and meanwhile, the information of a fault pointer in the RAM is modified. The definition of the input/output signals is shown in table 10:
TABLE 10 Primary input output Signal of Fault Signal writing submodule
2.7 Time division multiplexing module
The function of the module is to time-share multiplex the read-write signals of the RAM by each module, so that a plurality of modules can be prevented from simultaneously reading or simultaneously writing the RAM at the same time. The definition of the input/output signals is shown in table 11.
TABLE 11 definition of input/output Signal of time-division multiplexing submodule
3.APF
The APF is structured as in fig. 4, wherein the main controller is implemented based on an FPGA. The method for defining the device ID comprises the step that the main controller automatically distributes the ID through the serial number of the communication interface of the optical fiber.
The three-phase IDs of the device 1 are respectively: 0x010A,0x010B,0x010C;
the three-phase IDs of the device 2 are respectively: 0x020a,0x020b,0x020c;
The three-phase IDs of the device 3 are respectively: 0x030a,0x030b,0x030c;
when the ID is 0x0100,0x0200,0x0300. The description refers to a certain device (including ABC three phases), and 0xAAAA refers to all devices.
4. Hard core and MCU
As shown in fig. 3, the main controller is provided with a hard core part and an MCU.
The hard core mainly comprises a data acquisition sub-module, a power grid voltage phase locking sub-module, a sliding window DFT sub-module, a network side PR regulator sub-module, a reactive DQ extraction sub-module, a harmonic injection reference generation sub-module, an APF working mode selection sub-module, a high-speed optical fiber communication interface sub-module and the like, and also comprises auxiliary sub-modules such as a hardware protection sub-module, a time sequence control sub-module, an MCU data interface sub-module, a contactor control sub-module and the like, wherein the control of direct current side voltage is realized from a controller.
The hard core part is responsible for processing main functions of APF, including harmonic extraction, reference synthesis, high-speed asynchronous serial communication, etc., the part has higher real-time requirements, higher operation speed and more processing by a pipeline, and the MCU is responsible for processing contents with low real-time requirements, mainly comprising user interactive display communication, in the embodiment, a 32-bit MCU is configured, and a 32bit multiplied by 32bit multiplier is arranged inside the MCU. The running clock can work at 100M, but the 100M main frequency has larger pressure on external SDRAM, and through practical test, MCU work at 50M is relatively stable, and 100M is unstable in some cases. And can be properly improved according to actual conditions.
5. Dual port RAM
Preferably, a dual-port RAM is opened up inside the FPGA to realize the communication between the MCU and the hard core.
In a specific embodiment, the dual port RAM is 1024 bits by 64 bits in size, for a total of 64 kbits. The dual port RAM was divided into 5 blocks, ram#1,RMA#2,RAM#3,RAM#4, RAM #5. Each RAM block holds different data, but the read and write to the RAM blocks are consistent.
Some embodiments provide a method for implementing the dual port RAM based on SRAM, comprising the steps of:
Two sets of mutually independent access systems for the MCU and the hard core to access the SRAM are arranged on the SRAM, and each set of access system comprises a data line, an address line and a read-write control line;
the communication between the hard core and the MCU is realized by reading the SRAM, and the method comprises the following steps:
Allowing the hard core and the MCU to randomly read or write the SRAM through respective access systems;
the MCU is not allowed to simultaneously execute reading and writing to an address unit on the SRAM;
the hard check is not allowed to perform both reading and writing to an address location on the SRAM.
In some embodiments, the first RAM block coordinates the hard core and MCU to read or write to the second RAM block based on state information, including RAM2 read-write state, RAM4 read-write state, RAM2 device ID, parameter passing device ID, write failure pointer, read command pointer, write command pointer, MCU passing valid data bits of the parameter.
The communication between the hard core and the MCU is supported through the dual-port RAM, and information such as various electric data, switching states, stability of running lines and the like of the power grid system running in real time are displayed on a display screen, so that the real-time control of the running state of the power grid system is realized, and important data are stored.
When the MCU reads the address unit which is being written by the hard core, the data read by the MCU is the historical value of the address unit, and when the MCU reads the address unit which is being written by the MCU, the data read by the hard core is also the historical value of the address unit. But when the MCU and the hard core write an address at the same time, the value of the address location is indeterminate. The historical values are typically saved to a caching module.
The interface signals between the hard core and the MCU and the dual-port RAM are fixed, as shown in Table 12, and the interface signals between the MCU and the dual-port RAM are similar to the interface signals, but an additional clock matching module is added in the middle, so that the dual-port RAM is prevented from being written or read for many times.
TABLE 12 interface signals for hard core and dual port RAM
Wherein Byteena _a is a writing section enabling signal, 64bit data written into the RAM is divided into 8 bytes, corresponding to the 8 bits of byteena _a, when the corresponding bit is high, the bytes can be written into corresponding address units respectively, and other byte data in the address units are kept unchanged from the last historical value.
The timing of reading and writing to the dual port RAM is further illustrated by the following specific examples, taking the MCU read and write timing as an example (the hard core timing is similar thereto).
5.1 Read Dual port RAM timing
Preferably, the length of the RAM address is 10 bits at the maximum, the upper 6 bits are convenient for expansion, and the upper 0 bit of the 10-bit address is filled into the 16-bit address when the RAM is read. The data read from the dual-port RAM is placed in the array corresponding to the receive_data.
When the address_a of MCU (or hard core) on address line is ready, it can send read command, the pulse width of command is at least 1 global clock length (50M), and it does not allow for more than 5 global clock lengths, otherwise it can twice read dual-port RAM, when the main frequency is 50M, the command pulse is 10M. After a command is issued, data can be read from the q_a signal after an appropriate time. Reading dual port RAM at a time requires approximately 4 global clocks. Address_a is changed after rden_a is low, otherwise erroneous data is read.
5.2 Write Dual port RAM timing
The MCU (or hard core) can send a write command after preparing the address and data to be written on address_a and data_a, the pulse width of the write command is at least 1 global clock length (50M), and the pulse width of the write command is not allowed to exceed 5 global clock lengths, otherwise, the write dual-port RAM is written for the second time, and the actual test shows that the command pulse is 10M width when the main frequency is 50M. The addresses_a and data_a need to be changed after wren_a is low, otherwise erroneous data is written to the erroneous address. The write-once dual-port RAM requires approximately 4 global clocks.
It should be noted that, the speed of reading and writing the dual-port RAM is very fast, and for the MCU with the main frequency of 50M, it takes about 1ns to read or write the dual-port RAM once.
5.3 Data from each RAM Block
1RAM#1 data definition
RAM#1 corresponds to a control register area where all RAM read and write status data is stored, where the hard core and MCU will always query the space to determine the RMA space to operate, the detailed address definitions are as follows:
TABLE 13 Address definition of RAM#1
5.3.2RAM#2 data definition
And storing the related information of the APF system which is required to be displayed on the control terminal. The MCU reads the data and then updates the relevant data of the control terminal. The hard core writes at a rate of 200ms and only after all writes are completed is the MCU allowed to read from it, thus ensuring integrity. The read/write of the hard core and MCU is controlled by the RAM2_state in RAM#1, and other data of the RAM block is refreshed immediately as long as the operation state feedback information from the slave controller is updated. The refresh rate depends on the rate at which the MCU reads the RAM. The hard core only needs to send the compensation current waveform of a certain device required by the MCU, and the hard core judges which device the compensation waveform transmitted by the MCU needs to be transmitted by the hard core by reading the data in the RAM 2_ID. The following table gives detailed data definitions for the RAM block:
Table 14 RAM#2 data definition
The following table gives a detailed definition of the status of the device:
TABLE 15 device State definition
Command codeDescription of the invention
0x0000Stop of
0x0001Operation
0x0002Failure of
0x0003Offline
0x0004Scram
0x0005Standby
0x0006Is not present in
OthersStandby for use
Ram#3 data definition
The hard core receives the commands of the MCU and then sequentially executes the commands, and the hard core does not store the commands of the MCU and does not return a status signal, so that the MCU needs to query other related data of the RAM block to determine whether the execution of the commands is completed.
Table 16 RAM#3 data definition
TABLE 17 Command Format
The main controller automatically distributes ID through the serial number of the communication interface of the optical fiber;
ram#4 data definition
The method is used for transferring parameters between the hard core and the MCU, the transfer of the parameters takes pages as units, 9 pieces of data 0x 340-0 x342 are used for storing data transferred from the hard core to the MCU, 0x 343-0 x345 are used for sending MUC to setting of the parameters of the hard core, and the transfer of the data is controlled through the RAM4_ord, the RAM4_ID, the RAM4_addr and the RAM4_ENOB in the RAM # 1.
Table 18 data format for hard-core write and MCU read
Table 19 data format for MCU write, hard core read
The specific parameters are shown in the following table:
TABLE 20 read-write data parameters
5.3.5RAM#5 data definition
The method mainly comprises the steps of accessing fault codes, ensuring that when a plurality of faults happen simultaneously, old faults which are not read by an MCU can not be covered by new faults, and simultaneously writing 32 buffer areas of the fault codes, and when the faults happen, a hard core puts the ID of the fault equipment and the specific fault codes into the 0x3e 0-0 x3fd buffer area according to the pointed position in a write pointer 0x3ff for the MCU to read and store.
Data definition of RAM#5
TABLE 22 event code coding
Embodiments of the subject matter and the functional operations described in this specification can be implemented in computer programs or instructions, digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware, including the structures disclosed in this specification and structural equivalents thereof, or in combinations of one or more of the above. A computer suitable for carrying out the computer program comprises and can be based on a general purpose microprocessor or a special purpose microprocessor or both, or any other kind of central processing unit, as examples.
Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the activities recited in the claims can be executed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In certain implementations, multi-tasking and parallel processing may be advantageous.

Claims (9)

Translated fromChinese
1.一种APF控制系统的硬核接口模块,通过读写双口RAM与MCU通信;其特征在于,1. A hard-core interface module of an APF control system, which communicates with the MCU by reading and writing dual-port RAM; characterized in that:所述硬核接口模块的顶层实体的输入信号包括:时钟信号,波形数据,从板数据,从板状态,双口RAM读写状态,故障信号,通知信号;The input signals of the top-level entity of the hard-core interface module include: clock signal, waveform data, slave board data, slave board status, dual-port RAM read and write status, fault signal, and notification signal;所述硬核接口模块的顶层实体的输出信号包括:第一使能信号,数据输出,地址输出,命令输出,通知信号;所述命令输出包括所述MCU发给所述硬核的命令;The output signals of the top-level entity of the hard core interface module include: a first enable signal, data output, address output, command output, and notification signal; the command output includes a command sent by the MCU to the hard core;所述硬核接口模块的底层模块包括:The bottom layer modules of the hard core interface module include:状态监测模块:用于对所述双口RAM进行监测并输出所述双口RAM读写状态;Status monitoring module: used for monitoring the dual-port RAM and outputting the read and write status of the dual-port RAM;波形数据写入模块:用于从网侧或从所述APF控制系统输出侧采集的所述波形数据写入所述双口RAM中,所述波形数据包括电压波形数据和/或电流波形数据;Waveform data writing module: used for writing the waveform data collected from the grid side or from the output side of the APF control system into the dual-port RAM, the waveform data including voltage waveform data and/or current waveform data;从板数据写入模块:用于将所述从板数据和所述从板状态写入所述双口RAM中;A slave board data writing module: used for writing the slave board data and the slave board status into the dual-port RAM;命令写入读取模块:用于将所述MCU发给所述硬核的命令写入所述双口RAM中;Command writing and reading module: used for writing the command sent by the MCU to the hard core into the dual-port RAM;参数传递模块:用于控制所述MCU与所述硬核之间的配置参数传递;Parameter transfer module: used to control the transfer of configuration parameters between the MCU and the hard core;故障信号写入模块:用于将所述故障信号写入所述双口RAM中,同时修改故障指针的信息;Fault signal writing module: used for writing the fault signal into the dual-port RAM and modifying the fault pointer information at the same time;分时复用模块:用于控制所有上述底层模块对所述双口RAM的读写的分时复用;Time-sharing multiplexing module: used to control the time-sharing multiplexing of reading and writing of the dual-port RAM by all the above-mentioned bottom modules;其中,所述复用模块被配置为:当判断所述双口RAM没有被占用时,发送第二使能信号给所述状态监测模块;所述状态监测模块被配置为:接收到所述第二使能信号后开始工作。Wherein, the multiplexing module is configured to: send a second enabling signal to the status monitoring module when it is determined that the dual-port RAM is not occupied; and the status monitoring module is configured to: start working after receiving the second enabling signal.2.如权利要求1所述的硬核接口模块,其特征在于,所述硬核接口模块执行以下步骤:2. The hard core interface module according to claim 1, wherein the hard core interface module performs the following steps:所述状态监测模块每隔一定的时间对所述双口RAM进行状态检测;The status monitoring module performs status detection on the dual-port RAM at regular intervals;所述状态监测模块将所述双口RAM的状态下发给所述命令写入读取模块、所述参数传递模块、所述故障信号写入模块、所述波形数据写入模块中的任一个或多个模块;The state monitoring module sends the state of the dual-port RAM to any one or more modules of the command writing and reading module, the parameter transfer module, the fault signal writing module, and the waveform data writing module;所述命令写入读取模块、所述参数传递模块、所述故障信号写入模块、所述波形数据写入模块中的任一个或多个模块接收到所述双口RAM的状态后,向所述分时复用模块发送请求RAM指令。After receiving the status of the dual-port RAM, any one or more of the command writing and reading module, the parameter transfer module, the fault signal writing module, and the waveform data writing module sends a request RAM instruction to the time-sharing multiplexing module.3.如权利要求2所述的硬核接口模块,其特征在于,所述硬核接口模块还执行以下步骤:所述分时复用模块根据优先级从高到低为所述命令写入读取模块、所述参数传递模块、所述故障信号写入模块、所述波形数据写入模块、状态监测模块的顺序,允许相应模块的所述请求RAM指令。3. The hard-core interface module as described in claim 2 is characterized in that the hard-core interface module also performs the following steps: the time-sharing multiplexing module writes the command reading module, the parameter transfer module, the fault signal writing module, the waveform data writing module, and the status monitoring module in order from high to low priority, and allows the request RAM instruction of the corresponding module.4.如权利要求1所述的硬核接口模块,其特征在于,所述双口RAM为五个读写一致的RAM块组成,分别被配置为:4. The hard-core interface module according to claim 1, wherein the dual-port RAM is composed of five read-write consistent RAM blocks, which are respectively configured as:第一RAM块:用于存储所述双口RAM的读写状态;The first RAM block is used to store the read and write status of the dual-port RAM;第二RAM块:用于存储包括所述波形数据、所述从板数据、所述从板状态;The second RAM block is used to store the waveform data, the slave board data, and the slave board status;第三RAM块:用于存储包括供所述MCU查询的缓存数据;The third RAM block is used to store cache data including data for query by the MCU;第四RAM块:用于存储在所述硬核和所述MCU之间交换的数据;Fourth RAM block: used to store data exchanged between the hard core and the MCU;第五RAM块:用于存储故障代码。The fifth RAM block: used to store fault codes.5.如权利要求4所述的硬核接口模块,其特征在于,所述参数传递模块的子模块包括:5. The hard core interface module according to claim 4, wherein the submodules of the parameter transfer module include:MCU配置参数缓存模块:用于从外部存储器中读取配置参数并将其存储至内部存储器,所述配置参数为被所述MCU修改的配置参数;读取所述内部存储器中的配置参数并将其写入所述外部存储器;MCU configuration parameter cache module: used to read configuration parameters from the external memory and store them in the internal memory, wherein the configuration parameters are configuration parameters modified by the MCU; read the configuration parameters in the internal memory and write them into the external memory;更新和初始化模块:当所述APF控制系统的数据更新后,用于将所述配置参数的索引目录和数值发送到:用于校验互感器数值是否发生改变的所述波形数据写入模块;用于通知从板检验是否要修改所述配置参数的数值的UART模块;用于校验所述配置参数是否被修改的保护模块;用于校验所述配置参数是否需要修改的DFT模块;Update and initialization module: when the data of the APF control system is updated, it is used to send the index directory and value of the configuration parameters to: the waveform data writing module used to check whether the mutual inductor value has changed; the UART module used to notify the slave board to check whether the value of the configuration parameter needs to be modified; the protection module used to check whether the configuration parameter has been modified; the DFT module used to check whether the configuration parameter needs to be modified;下发配置数据缓存模块:用于缓存所述APF控制系统的控制终端下发的配置参数。The configuration data caching module is used to cache the configuration parameters sent by the control terminal of the APF control system.6.如权利要求4所述的硬核接口模块,其特征在于,所述波形数据写入模块包括采样写入模块和采样数据处理模块,其中:6. The hard-core interface module according to claim 4, characterized in that the waveform data writing module comprises a sampling writing module and a sampling data processing module, wherein:采样写入模块:用于采集所述波形数据,生成写入使能信号、写入地址和写入数据,并将所述波形数据一次写入所述第二RAM块,A sampling and writing module is used to collect the waveform data, generate a write enable signal, a write address and write data, and write the waveform data into the second RAM block at one time.所述波形数据包括电压波形数据和/或电流波形数据,具体为:三相电网电压波形数据、三相电网电流波形数据、三相负载电流波形数据、三相总补偿电流波形数据;The waveform data includes voltage waveform data and/or current waveform data, specifically: three-phase grid voltage waveform data, three-phase grid current waveform data, three-phase load current waveform data, and three-phase total compensation current waveform data;采样数据处理模块:用于将所述波形数据换算为实际值。Sampling data processing module: used to convert the waveform data into actual values.7.如权利要求6所述的硬核接口模块,其特征在于,所述采样写入模块的子模块包括:7. The hard core interface module according to claim 6, wherein the submodules of the sampling and writing module include:第二RAM块状态监控模块:用于每隔一定时间查询所述第二RAM块状态,对所述第二RAM块发送写入指令;A second RAM block status monitoring module: used to query the status of the second RAM block at regular intervals and send a write instruction to the second RAM block;采样执行模块:用于执行所述波形数据的采集;Sampling execution module: used for executing the acquisition of the waveform data;辅助采样控制模块:用于每隔一定时间向所述采样执行模块发送采样命令。Auxiliary sampling control module: used to send sampling commands to the sampling execution module at regular intervals.8.如权利要求7所述的硬核接口模块,其特征在于,对所述MCU的配置通过基于在FPGA上嵌入NiosII架构实现,具体包括以下步骤:在所述FPGA上加载基于所述NiosII架构的软核实现所述MCU的CPU功能;8. The hard-core interface module according to claim 7, characterized in that the configuration of the MCU is implemented by embedding the NiosII architecture on the FPGA, specifically comprising the following steps: loading a soft core based on the NiosII architecture on the FPGA to implement the CPU function of the MCU;在所述NiosII架构的基础上集成包括Avalon-MM三态桥,UART模块,Jtag口调试模块,SDRAM控制器模块,若干间隔计时器,闪存接口,若干并行IO口的多个功能模块。Based on the NiosII architecture, multiple functional modules including an Avalon-MM tri-state bridge, a UART module, a Jtag port debugging module, an SDRAM controller module, several interval timers, a flash memory interface, and several parallel IO ports are integrated.9.一种APF控制系统,其特征在于,所述APF控制系统包括基于FPGA实现的硬核、MCU和用于所述硬核与所述MCU的通信的双口RAM,所述硬核还包括如权利要求1-8任一项所述的硬核接口模块。9. An APF control system, characterized in that the APF control system includes a hard core implemented based on FPGA, an MCU and a dual-port RAM for communication between the hard core and the MCU, and the hard core also includes a hard core interface module as described in any one of claims 1-8.
CN202211003535.5A2022-08-192022-08-19 A hard-core interface module for APF control systemActiveCN115509975B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211003535.5ACN115509975B (en)2022-08-192022-08-19 A hard-core interface module for APF control system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211003535.5ACN115509975B (en)2022-08-192022-08-19 A hard-core interface module for APF control system

Publications (2)

Publication NumberPublication Date
CN115509975A CN115509975A (en)2022-12-23
CN115509975Btrue CN115509975B (en)2024-12-24

Family

ID=84502344

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211003535.5AActiveCN115509975B (en)2022-08-192022-08-19 A hard-core interface module for APF control system

Country Status (1)

CountryLink
CN (1)CN115509975B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103178619B (en)*2013-04-182015-02-04珠海万力达电气自动化有限公司APF (accurate position finder), SVG (static var generator) control device for realizing 3G (the third generation telecommunication) monitoring
CN103513650B (en)*2013-09-242015-12-02许继电气股份有限公司The record ripple control method of converter valve opertaing device
CN104391818B (en)*2014-11-262018-08-28国家电网公司A kind of bis- network data read-write systems of EtherCAT and its method
CN105653477A (en)*2015-12-212016-06-08南京亚派科技股份有限公司Double-port RAM-based method for communication of hard core and soft core in FPGA
CN111190852A (en)*2019-12-062020-05-22中国航空工业集团公司洛阳电光设备研究所PowerPC and Microblaze interaction system and interaction method based on double ports
CN113946524B (en)*2021-10-152024-05-31卡斯柯信号有限公司 A dual-port RAM system and method based on FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
并联型有源电力滤波器通用实验平台的研究;惠亮亮;中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑;20180215;第2018卷(第02期);正文第15-16页*

Also Published As

Publication numberPublication date
CN115509975A (en)2022-12-23

Similar Documents

PublicationPublication DateTitle
CN103513650B (en)The record ripple control method of converter valve opertaing device
CN101206162B (en) Flat wheel detection data acquisition and signal processing system
CN102567280B (en)Computer hardware platform design method based on DSP (digital signal processor) and FPGA (field programmable gate array)
CN201583945U (en)Serial communication system for multiple singlechips based on FPGA
CN103023739A (en)EtherCAT communication management device for dual-core based power electronic equipment
CN106293797A (en)A kind of method and system of online updating Single Chip Microcomputer (SCM) program
CN203405756U (en)Embedded mainboard
CN105529829A (en)Distribution transformer intelligent detection system based on wireless transmission technology
CN115509975B (en) A hard-core interface module for APF control system
CN109542481B (en)Automatic configuration device and method for multi-mode multifunctional test instrument
CN201726201U (en)Phase checking device for intellectualized digital transformer substation
CN202632518U (en)Pollutant source monitoring data acquisition and transmission instrument
CN201136230Y (en) Concrete mixing station intelligent control device
CN201549934U (en)Remote terminal device
CN201667071U (en) A signal switching system
CN115357531A (en)Double-port RAM module of APF control system
CN201689133U (en)Electric energy quality monitoring device
CN209281188U (en)High-performance cogeneration units operation data acquisition terminal based on ARM9 framework
CN203070047U (en)EtherCAT communication management device for dual-core based power electronic equipment
CN222580423U (en)FPGA-based embedded control system
CN218350747U (en)Multi-unit distributed parallel operation control system of data center
CN201345541Y (en)Low current grounding intelligent line-selection device
CN102346465A (en)Energy-saving energy online monitoring system
CN102095916A (en)Wireless communication measuring system for current of build-in arrester
LiuThe building of data acquisition system based on embedded technology

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Address after:No. 666 Kongzi Road, Zhoushi Town, Kunshan City, Suzhou City, Jiangsu Province, 215300

Applicant after:TYSEN-KLD GROUP CO.,LTD.

Address before:Room 4, No. 577, Xinxing South Road, Kunshan Development Zone, Suzhou, Jiangsu 215333

Applicant before:TYSEN-KLD GROUP CO.,LTD.

CB02Change of applicant information
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp