TIDUF72 August 2024
The foreground process includes the initial setup of the MSPM0+ MCU hardware and software and the ADS131M02 and AMC131M03 registers immediately after a device RESET. Figure 3-1 shows the flowchart for this process.
The initialization routines involve the setup of the MSPM0G3507:
After the hardware is set up, any received frames from the GUI are processed. Next, the foreground process checks whether the background process has notified the foreground process to calculate new metrology parameters for any voltage-current mappings. This notification is accomplished through the assertion of the PHASE_STATUS_NEW_LOG status flag whenever a frame of data is available for processing. The data frame consists of the processed dot products that were accumulated for CYCLES_PER_COMPUTATION number of cycles of data. The value for CYCLES_PER_COMPUTATION is 10 cycles when the nominal frequency setting in the software is 50Hz and 12 cycles when the nominal frequency setting in the software is set to 60Hz. When the measured line frequency is equal to the nominal frequency of the design, this is equivalent to 200 milliseconds of accumulated data.
The processed dot products include the VRMS, IRMS, active power, reactive power, fundamental voltage, fundamental active power, and fundamental reactive power. These dot products are used by the foreground process to calculate the corresponding metrology readings in real-world units. All the processed dot products are accumulated in separate 64-bit registers to further process and obtain the RMS and mean values. Using the calculated values of active and reactive power of the foreground process, the apparent power is calculated.
Similarly, using the calculated values of the foreground for the fundamental voltage, fundamental reactive power, and fundamental active power, the fundamental current, fundamental apparent power, voltage THD, and current THD are calculated. Additionally, voltage underdeviation and voltage overdeviation are calculated using the value of the calculated RMS voltage and the defined nominal voltage of the design. The frequency (in Hz) and power factor are also calculated using parameters calculated by the background process using the formulas in the Section 3.1.6.
The foreground process is also responsible for calculating the 1-cycle VRMS readings that are used to update the sag, swell, and interruption state logging variables. The 1-cycle VRMS readings are triggered by the background process after every negative-to-positive zero crossing. After the new VRMS reading, the following state variables are updated accordingly:
For the one-phase configuration, there are two voltage-current mappings, where each voltage-to-current mapping has a different voltage and current channel. Specifically, the line-to-neutral voltage measurement for line A and the line A current measurement are associated with each other for one mapping and the line B current measurement is used for neutral current monitoring (no voltage associated).
For the two-phase configuration, there are two voltage-current mappings, where Phase A and Phase B both share the voltage measured with ADS131M02. Specifically, the same line-to-line voltage measurement (180 degrees shift between the voltages on Phase A and Phase B) is associated with the line A and line B current measurements, on ADS131M02 and AMC131M03, respectively.
For simplicity, each voltage-to-current mapping is referred to as a phase in this document as well as in the PC GUI.