Abstract: This paper introduces the Profibus-DP bus technology and its features, and designs a servo control system based on the Profibus-DP bus, consisting of a servo controller, an S7-300 PLC, and ProTool. The system features simple structure, convenient control, and easy maintenance. The communication process between the servo controller and the PLC, as well as the software design, are also described.
Keywords: Fieldbus; Profibus-DP; PLC; Servo controller
| 1. Introduction Profibus is an international, open, and manufacturer-independent fieldbus standard widely used in industrial automation. Based on application characteristics, Profibus is divided into three compatible versions: Profibus-DP, Profibus-FMS, and Profibus-PA. Profibus-DP is a high-speed (data transmission rate 9.6 kbit/s-12 Mbit/s) and economical device-level network, primarily used for communication between field controllers and distributed I/O, meeting the fast response time requirements of AC/DC speed control systems. Due to its high reliability, high performance, good real-time performance, and unique design, it has been accepted by almost all manufacturers and users. BWS servo motors, with their compact structure, easy control, smooth operation, and fast response, have become an increasingly important force in motion control for modern industrial automation. They are particularly prevalent in applications requiring high levels of automation and precise control of speed, position, and torque, such as textile machinery, printing machinery, papermaking machinery, CNC machine tools, and industrial robots. Although PROFIBUS-DP was not specifically developed for motion control like SERCOS, MACRO, or FireWire, its widespread availability makes the use of the PROFIBUS bus for servo control highly significant in practical applications. 2. PROFIBUS-DP Bus Technology 2.1 Introduction to PROFIBUS-DP PROFIBUS is based on ISO 7498 and uses the Open Systems Interconnection (OSI) model as a reference, defining physical transmission characteristics, bus access protocols, and application functions. Its transmission rate is 9.6kbps-12Mbps, with a maximum transmission distance of 100m at 12Mbps and 400m at 1.5Mbps, which can be extended to 10km using repeaters. Up to 127 stations can be connected. PROFIBUS-DP is a high-speed and inexpensive communication connection, using Layer 1, Layer 2 (i.e., physical layer and data link layer), and a user interface layer. Layers 3 through 7 are not described. This fluid architecture ensures fast and efficient data transmission. It is specifically designed for communication between distributed I/O of automatic control systems and equipment. Using PROFIBUS-DP modules can replace 24V or 4-20mA serial signal transmission, reducing investment costs. The Direct Data Link Image (DDLM) provides a user interface that makes access to the data link layer simple and convenient, and transmission can use RS-485 transmission technology or fiber optic media. The hardware of the standard PROFIBUS-DP fieldbus consists of three parts: master devices, slave devices, and network. The master device controls data transmission on the bus and sends information and is authorized to access the bus when no external request is made. Slave devices are simpler external devices compared to the master devices and are not authorized to access the bus. The network includes transmission media and network connectors. The former uses shielded twisted-pair cables to form an electrical network, fiber optic networks made of plastic or glass fiber cables, or hybrid networks based on conversion between the two media by an OLM (Optical Link Module). The latter includes RS-485 bus connectors, RS-485 bus terminals, RS-485 repeaters, and OLMs (Optical Link Modules). 2.2 PROFIBUS-DP Communication Protocol and Features The PROFIBUS-DP physical layer is the same as the first layer of the ISO/OSI reference model, and adopts the EIA-RS485 protocol. Depending on the data transmission rate, twisted pair and optical fiber can be selected as the transmission media. Figure 1 shows the RS485 bus segment structure. The two data lines in Figure 1 are usually referred to as lines A and B, which correspond to the RXD/TXD-N and RXD/TXD-P signals, respectively. The PROFIBUS-DP data link layer Media Access Control (MAL) section employs a controlled access token bus and master-slave architecture. The token bus conforms to the IEEE 8024 local area network protocol. Tokens are passed between masters on the bus, and the master holding the token gains control of the bus. This master communicates with slaves or other masters according to a relational table. The master-slave data link protocol differs from the LAN standard; it conforms to the Unbalanced Normal Response (NRM) mode in HDLC. The characteristics of this mode are: one master controls multiple slaves on the bus, and the master establishes a logical link with each slave; the master issues commands, and the slaves respond; slaves can continuously send multiple frames until no more information is sent, the required number of frames is reached, or the master stops the transmission. The frame transmission process in the data link consists of three stages: data link establishment, frame transmission, and data link release. In Figure 2, F is the frame flag field (8 bits). A is the slave address field. The control field C represents the frame type, number, command, and control information, dividing HDLC frames into three types: information frames (1), monitoring frames (S), and unnumbered frames (U). Information frames are used for the transmission of application data and piggybacking responses; monitoring frames are used to monitor normal operation on the link and respond to the link status in various ways (such as acknowledgment frames, requests for retransmission, or pauses); unnumbered frames (without information fields) are used to transmit various meta-numbered commands and responses, such as establishing link working modes, releasing links, and reporting special situations. The information field consists of application data from PKW and PZD. PKW is used to read and write parameter values, such as writing control words or reading status words, and is generally 4 bytes long. PZD is used to store the specific control values of the controller and set the parameters of the station or status word, and is generally 2 to 10 bytes long. For example, PKW=P554.1 represents writing a 16-bit control word to the main drive module of the frequency converter, where each bit of the control word represents a different control meaning; the second byte of PZD is the start/stop control bit for motors #0 to #7. FCS is the frame check field, which performs cyclic redundancy check (CRC) on the entire frame content, and the HDLC frame can be up to 24 bytes long. Figure 2. Format of frames transmitted between the master and slave stations in normal response mode. 3. Servo Motor Connection to PROFIBUS-DP Network The BWS-NBBR/BBF servo control system from Guangzhou Bowei Servo Technology Co., Ltd. provides a dedicated PROFIBUS-DP bus interface module in its controller. Like other PROFIBUS-DP systems, it can be easily connected to PROFIBUS-DP bus-based industrial control systems using ordinary twisted-pair cables as the communication medium, as shown in Figure 3. The host computer consists of a Siemens S7-300 PLC, model 6ES7315-2AG10-0AB0. It has a dedicated PROFIBUS-DP interface and an MPI communication interface, supporting up to 64 slave stations. The PROFIBUS-DP bus manages all servo controllers in the system, including command transmission and setting of parameters such as speed, torque, and position. As a user interface (HMI) woven from the configuration software ProTool, the entire control system can be easily monitored and its parameters modified. The BWS-BBR/BBF servo controller and servo motor establish feedback through a rotary encoder or photoelectric encoder, forming a high-precision servo control system. The servo motor uploads its operating status and information to the servo controller in real time. As a node on the PROFIBUS-DP bus, the servo controller can communicate with the PLC host, receiving various operation, control, and parameter setting commands from the host computer via the bus. Figure 3. Schematic diagram of the servo motor connected to the PROFIBUS-DP network system. 4. Software Structure Design This servo system communicates and is controlled via the PROFIBUS-DP bus. The main focus is on the software design of the host computer. The following is the main design block diagram of the PLC program. Figure 4 shows the PLC program design flowchart. The PLC program is programmed using STEP 7. The program mainly consists of several parts: OB100, OB1, and FB40. OB100 is the warm-start organization block, which is called when the system starts. It includes function FC35, namely INIT_FIELDBUS, whose main function is to initialize the already opened background data block and set the input/output bus address for the servo controller. OB1 is the main program organization block, including function FC32, function block FB40, function FC37, and background data block DB40. FC32, or CYCL_Update, periodically reads and updates data from the background data block on the bus. Function block FB40 is the main program block controlling the servo controller; it completes the servo controller initialization and position control, mainly including functions FC40 and FC41. FC40, or INIT_SERVO, primarily initializes multiple axes, i.e., multiple servo controllers. FC41, or POS_SEQ_SERVO, is the core of the entire servo control system; it executes control commands such as speed, position, torque, origin return, and reads feedback values from the servo controller on the bus. FC37, or FAULT_RESET, is the reset module; it clears bus error messages and generates a reset command to reset the servo controller. DB40 is the background data block of function block FB40. FC30 is a sub-block of FC40, responsible for transmitting commands from the PLC to the servo controller, checking if commands are executed correctly, and handling errors. FC31 is a sub-block of FC41, diagnosing the completion status of FC41 and reporting to the bus. FC33 and FC34 are also subordinate to function block FB40. FC33 checks the current status of the servo controller; if idle, it sends commands to the bus indicating that the next command can be sent. FC34 handles synchronous and asynchronous error information from multiple servo controllers and generates error reports. 5 Conclusion The introduction of the PROFIBUS-DP interface of the BWS-BBR/BBF servo controller has improved the level of motion control in industrial automation, making the communication and control of servo motors in industrial control networks more convenient, flexible and reliable. Practical experience has proven that this control method is effective. PROFIBUS-DP bus and BWS servo control systems are widely used in industrial control, which provides a broad application prospect for servo controllers with PROFIBUS-DP bus interfaces. References [1] Yang Xianhui. Fieldbus Technology and Its Applications. Beijing: Tsinghua University Press, 1999.6 [2] Siemens S7-300 Reference Manual. Provided by Siemens (China) Co., Ltd. [3] SIEMENS STEP 7 V5.1 Programming Manual. Issued by Siemens (China) Co., Ltd. [4] Brief Explanation of PROFIBUS Standard (JB/T10308.3—2001). Provided by Siemens (China) Co., Ltd. [5] BWS-BBR/BBF Servo Controller Technical Manual. Provided by Guangzhou Bowei Servo Technology Co., Ltd. |