Summary
This document describes a power line communication (PLC) data concentrator scheme based on the PRIME standard implemented with C2000 series dual-core (CM3+C28x) microcontrollers. This solution implements a complete PRIME protocol stack through a Concerto MCU and SDRAM, provides a UART asynchronous serial port with a baud rate of 115200bps for network management and data communication for the client host, and provides a low-cost implementation of the data concentrator function. an effective solution.
Introduction
PRIME – PoweRline Intelligent Metering Evolution standard is a technical standard for remote meter reading developed by Spain Iberdrola Electric Power Company in conjunction with relevant PLC chip, system, meter and other manufacturers for narrowband PLC power line communication, including data transmission standards at the physical layer and MAC layer. The protocol of this technology is open, the implementation is free of copyright fees, and the products of different manufacturers can be interconnected. TI uses a low-cost DSP controller to implement the PRIME protocol in software, which improves the flexibility of applications compared to other manufacturers’ implementation of dedicated chip ASICs.
In fact, TI has implemented the full functionality of the PRIME data concentrator earlier with the OMAP1808. The solution introduced in this paper is mainly to transplant the DC solution of the OMAP platform to the single-chip Concerto, and realize the upper and lower MAC protocols and physical layer protocols of PRIME in one chip, which is suitable for low-cost embedded data concentrator applications. Therefore, , we also refer to the data concentrator scheme as EDC, that is, Embedded Data Concentrate.
The DC solution of the OMAP1808 platform is based on the Linux operating system, while this EDC solution is based on the TIRTOS operating system. The upper-layer and lower-layer MAC communication adopts internal data sharing, which not only reduces the system and occupies less resources, but also the data is more reliable. In addition, the number of nodes that can be managed and connected is no different from the DC solution of the OMAP platform.
1 EDC system architecture
This solution uses the Concerto series chip F28M35H52C1 as the main chip to handle the UPPER MAC and LOW MAC, PHY layer protocols of the PRIME protocol. F28M35H52C1 is a dual-core MCU. It contains two MCU systems: Cortex m3 main system and TI C28x control subsystem. Each system has 512KB of Flash space. Cortex m3 uses 32KB RAM independently, and TI C28x uses 36KB RAM independently. , In addition, there are 64KB of shared RAM (all allocated to C28x in EDC system) and 2KB of IPC Message RAM with configurable usage rights. In the EDC system application, the main frequency of the Cortex m3 core is 75MHz, which is responsible for processing the Upper MAC protocol, and the main frequency of the C28x core is 150MHz, which is responsible for processing the Low MAC and PHY layer protocols. The two cores share data through IPC. zone mechanism for communication. The main chip MCU plus an 8M Bytes SDRAM, accessed by the CM3 core, is used to store data such as the node information database. The current size of the system is about 3M Bytes; in addition, there is a 128KBytes EEPROM, accessed by C28x, used to store the system Power-down parameters; the analog front end adopts TI AFE031, which supports three-phase and single-phase connections, and is controlled by the C28x core through the SPI interface. The system block diagram is shown in Figure 1. Among them, CM3 controls one LED through 1 GPIO port, and displays at 1Hz frequency when the system is working normally; C28x controls the other three LEDs through 3 GPIOs, indicating the working status of C28x and the communication status of PLC respectively.
Figure 1 Schematic diagram of PRIME EDC system architecture
2 EDC solution features
A single chip realizes the complete functions of PLC PRIME DC.
Provide UART interface to communicate with PC or user Host Processor, communication rate is 115200bps, 8 data bits, 1 stop bit, no parity check.
Provide PC (Ubuntu Linux OS) client software for simulation testing. The client software communicates with the server running on the EDC through mgmt and IEC-432 API interfaces. Users can refer to these client software sample codes to implement Host code design. Terminal software includes:
Management tool application
Base node conference tool application
IEC 61334-4-32 data transfer application
The hardware design retains the SCIA UART communication interface of C28x, which is convenient for customers to use the PC-side ZCG tool software provided by TI to test the parameters of the PLC PHY layer by connecting the COM port of the PC or the USB-UART adapter board to this interface.
3 Hardware Design
3.1 Reference Schematic
Please refer to Figure 2, Figure 3, and Figure 4 for the schematic design of the hardware-related parts.
Figure 2 Schematic diagram of the main chip MCU reference design
Figure 3 SDRAM and UART interface reference design schematic
Figure 4 AFE031 peripheral circuit reference design schematic
3.2 Circuit Board
The actual EDC circuit board is shown in Figure 5 and Figure 6. On the front of the circuit board are placed MCU, AFE031 and most components such as transformers, power supply ICs, and a piece of SDRAM on the back. The colored line connection part on the upper left of the MCU chip is the UART communication interface and the UART print information output interface, and the left side is the 15V power supply input interface and the meter connection interface. In section 6.3.1, the interface definition of the concentrator carrier module is designed, and the UART interface is connected to the UART0 of the MCU CM3 core; the black tape covered part on the right side is the external three-phase power line interface, which is also in accordance with the State Grid “Q /GDW 375.2-2009” standard section 6.3.2 defines the carrier coupling interface definition of the concentrator carrier module, and the service node can perform single-phase or three-phase signal connection with the EDC through the three-phase power line interface. When the EDC is powered on and works normally, the LED (LED-4) on the lower right as shown in Figure 5 will flash at a frequency of 1Hz.
Figure 5 Front View of EDC Board
Figure 6 Rear View of EDC Board
3.3 Network connection between EDC and PLC nodes
In this example, TI’s TMDSPLCKIT-V3 is used as the PLC node. The connection between EDC and two PLC nodes is shown in Figure 7. The UART0 interface of EDC and the Linux PC client are connected through a UART-USB adapter board, as shown in Figure 8. shown.
Figure 7 Schematic diagram of the connection between EDC and PLC nodes
Figure 8 Schematic diagram of the connection between EDC and PC
4 Functions that EDC can achieve
Supports registration/deregistration of up to 1200 nodes
· Supports up to 3600 Unicast MAC connections/releases
· Keep Alive function and automatic adjustment of Keep Alive check interval
· IEC-61334-4-32 Logical Link Layer
· Appemu data transfer test
· Support node relay
· Node promotion and demotion
· Multicast MAC connect/release
· Single-point and multi-point firmware upgrade
· Support for external applications using IEC 61334-4-32 services
· Support external management GUI
· Supports Linux client commands for DC conformance testing
5 Object code and Linux client software required for EDC to run
Concerto target code: prime_dc_concerto_cm3.out prime_dc_concerto_c28x.out
Linux client software: uart_intf, mgmt_cli, ext432App, bn_conf_tool
6 PRIME EDC Basic Function Demonstration
The function demonstration of PRIME EDC is based on a PRIME network, which consists of a base node and several service nodes, and EDC is one of the base nodes. The functional demo includes the following parts:
1. Node registration, node logout
2. Keep Alive Monitoring
3. Node connection, disconnection
4. Node upgrade (to relay node), node downgrade (to terminal node)
5. Data transmission according to IEC-61334-4-32 protocol
6. Firmware online update (unicast and multicast)
Refer to the network connection diagram in Figure 7 to build a demonstration network, and refer to Figure 8 to connect the UART1 of the EDC to the Linux PC. After powering on the EDC and the service node, the system will automatically complete the network connection. The above function demonstration can be realized by the corresponding command line operation on the Linux PC side. For command line operations on Linux PC, refer to the following chapters.
7 Command Line Operation Instructions on Linux PC
Prepare a PC with ubuntu Linux OS installed, and copy the provided Linux client software: uart_intf, mgmt_cli, ext432App, bn_conf_tool to the Home path.
7.1 Open UART relay
Open a Terminal on the Linux PC, enter the uart_intf path, execute the “make clean” command to remove the old executable files, and then execute the “make PREFIX=” command to generate the executable file uart_intf suitable for this system. In the current path, type the following command to enable the UART relay:
sudo ./uart_info –c /dev/ttyUSB0
After the command is executed normally, the following prompt is displayed:
Figure 9 Linux UART connection prompt
Among them, TCP port <57777>, TCP port <56666>, TCP port <58888> are the port parameters used by client processes such as subsequent data transmission, network management and DC consistency check.
7.2 mgmt network management tool client and its common command reference
Open a new Terminal on the Linux PC, enter the mgmt_cli path, execute the “make clean” command to remove the old executable files, and then execute the “make PREFIX=” command to generate the executable file pdc_mgmt_cli suitable for this system.
Under the current path, type the following command to run the Network Administration Tools client:
./pdc_mgmt_cli –p 56666
After the command is executed normally, the following prompt is displayed:
connecting to 127.0.0.1:56666
connected
>>
At the >> prompt type ? Then press Enter to list all the commands supported by the client; when using a command, if you do not know how to use parameters, you can also add spaces and ? after the command. , the parameters and parameter ranges required by the command will be displayed.
Description of some common commands:
7.2.1?
Function: List all commands list as follows:
get-dc-std
get-node-info
get-switch-info
get-terminal-info
get-mac-uc-conn-info
unreg-node
close-mac-uc-conn
pro-term
dem-switch
set-ka-tmo
get-ka-tmo
ena-ka-auto-adj
dis-ka-auto-adj
start-uc-fu
start-mc-fu
show-uc-fu
show-mc-fu
cancel-fu
add-to-black-list
rm-from-black-list
show-black-list
ena-event
dis-event
get-pib
set-pib
reboot-sn
send-new-image
del-curr-image
show-curr-image
add-node-to-fu-mc-gp
rm-node-from-fu-mc-gp
del-fu-mc-gp
show-fu-mc-gp
get-phy-tx-paras
set-phy-tx-paras
set-alv-params
get-alv-params
7.2.2 CTRL + c
Function: Exit the mgmt client and return to the Linux command line
7.2.3 get-dc-std
Function: Get the standard executed by DC
Example:
>>get-dc-std
PRIME
7.2.4 get-node-info
Function: Get the node information currently connected to the PRIME network.
Example:
7.2.5 get-ka-tmo
Function: Get the current Keep Alive check timeout
Example:
>>get-ka-tmo
128 seconds
7.2.6 set-ka-tmo
Function: Set the current Keep Alive check timeout time
Example:
>>set-ka-tmo –t 32
Keep alive timeout is now 32 seconds.
7.2.7 pro-term
Function: Upgrade an endpoint to a relay node
Example:
>>pro-term -l 2 –s 0
Request sent…
7.2.8 send-new-image
Function: Download firmware to DC
Example:
>>send-new-image –f /filefolder/prime_7.6.1.sbin –p 128
7.2.9 show-curr-image
Function: View the firmware information stored in the current DC
Example:
>>show-curr-image
Image file name: /filefolder/prime_7.6.1.sbin
Image CRC: 0xa57439b1
Image size: 187958 bytes
7.2.10 del-curr-image
Function: Delete the firmware stored in the current DC. Before downloading new firmware, you must execute this command to delete the current firmware.
Example:
>>del-curr-image
7.2.11 start-uc-fu
Function: start unicast firmware update
Example:
>>start-uc-fu –f drunk.sbin –e 55:55:55:55:55:55 –p 128
7.2.12 cancel-fu
Function: Cancel the current firmware update
Example:
>>cancel-fu
7.2.13 show-uc-fu
Function: Display the current firmware update status and information
Example:
>>show-uc-fu
Image File Name: /filefolder/prime_7.6.1.sbin
Node: 55:55:55:55:55:55
Image CRC: 0xa57439b1
Page Size: 128 bytes
Image Size: 187958 bytes
Page Count: 1469
Pgae Sent: 980
Communication State: CONNECTED
Upgrade FSM State: PAGE TRANSFER
7.3 IEC61334-4-32 upper layer application example of data communication
PRIME EDC allows external applications to communicate with nodes in the network following the IEC61334-4-32 protocol. This scenario provides application reference code for the Linux platform.
Open a new Terminal on the Linux PC, enter the ext432app path, execute the “make clean” command to remove the old executable files, and then execute the “make PREFIX=” command to generate the executable file pdc_app432 suitable for this system.
Under the current path, type the following command to start the data communication process:
/pdc_app432 –p 57777 –l 64 –ds 1 –da 2
Parameter Description:
-l is used to specify the number of data bytes to be sent, the parameter value range is 1~200;
-ds is used to specify the SAP address of the target node, the parameter range is 0~191;
-da is used to specify the node 432 address of the communication connection, which is obtained from the node information obtained by the get-node-info command.
Before executing the pdc_app432 command, you need to refer to Figure 10 and use the ZGUI tool to configure the TI PLC V3-KIT to AppEmu-LLC mode. In this mode, when the Linux client executes the pdc_app432 command, the PLC Module will send the received data back to the DC, and the DC will upload it to the PC through UART, and Display it on the Terminal where pdc_app432 is located. When transmitting a 190-byte packet, the operation result is shown in Figure 11.
Figure 10 Using the ZGUI tool to configure the node for AppEMU-LLC mode
Figure 11 Data Transfer Test Run Results
Reference documentation
1. TI PRIME DC Software User Guide
2. TI PRIME DC IEC-61334-4-32 API SPEC
3. Concerto F28M35x Technical Reference Manual (SPRUH22B)
4. Concerto Microcontrollers (SPRS742C)
5. Q/GDW 375.2-2009 “Type Specification for Electricity Consumer Information Collection System: Concentrator Type Specification”
The Links: G104V1-T01 FZ400R12KS4