Share this

Single-axis control system based on PLC and AC servo

2026-04-06 04:19:52 · · #1

introduction

After decades of development, AC servo technology has matured and its performance has continuously improved, becoming one of the supporting technologies in the field of industrial automation . It is widely used in CNC machine tools, textile machinery, automated production lines, and other fields. In these fields, applications that use servo motors to rotate and move a worktable are common. This paper introduces a single-axis control system that meets industrial application requirements. The system mainly consists of a touch screen, a programmable logic controller (PLC), servo motors, and matching servo drivers. The touch screen serves as the human-machine interface, enabling real-time monitoring of the system and providing convenient operation. To ensure data communication between the master and slave PLCs, the system incorporates the Profibus-DP protocol. The paper provides a detailed description of the system's hardware selection, interfaces, and program design. Experiments demonstrate that the system meets the design requirements and has good engineering application value.

1 System Design Requirements and Hardware Selection

In this system, a ball screw, guide rails, and a servo motor constitute the transmission device. The worktable is supported by the guide rails and mounted on the ball screw. The screw is connected to the servo motor rotor via a coupling, converting the motor's rotational motion into the worktable's linear motion. The system has the following requirements during operation: the worktable should have both automatic and jog operating modes. In automatic mode, the worktable movement value should be set via a parameter input window on the touchscreen, with each unit of input corresponding to a 1mm movement. In jog mode, the worktable movement should be manually controlled via the touchscreen or on-site left and right jog control buttons. During operation in both modes, the corresponding indicator light on the touchscreen should illuminate. The system should also have an emergency stop function to ensure safe operation.

The system hardware selection is as follows: Standard PC: Siemens S7-300 (CPU315-2DP) and S7-200 (CPU224 transistors); PLC: Siemens TP177BcolorPN/DP 5.7-inch color LCD touchscreen; Zhuhai Yunkong 60BL3A20-30H AC servo motor, rated output power 200W, rated line current 1.3A, rated line voltage 119.8V, rated torque 0.637Nm, rated speed 3000r/m, rated voltage 220V, equipped with a 2500-line optical encoder, which is directly mounted on the motor rotor; Driver: Zhuhai Yunkong PSDA0233A8 all-digital AC servo driver matched with the servo motor. This driver has eight operating modes including position, speed, and analog speed control. The driver has a built-in dedicated digital processor for the motor, implementing closed-loop servo control of the current loop, speed loop, and position loop in software. It has good robustness and adaptability, suitable for various applications requiring rapid response precision speed control and positioning control. Meanwhile, the driver has a comprehensive protection mechanism for motor overcurrent, overvoltage, undervoltage, overload, and encoder failure.

2. Servo Control Hardware Design

In this system, the S7-200 PLC, servo drivers, and servo motors constitute the servo control section. This section focuses on the wiring between the S7-200 PLC and the drivers, as well as the driver parameter settings.

2.1 PLC driver wiring

In the PLC and driver interface wiring, the driver side uses two ports, JP1 and JP2. JP1 is used to connect the encoder, through which the encoder sends pulse feedback to the driver via twisted-pair shielded wire. JP2 is the position command input/output port, a 50-pin high-density interface used for data exchange with the 57-200 PLC. The 57-200 PLC acts as a motion control slave, and its input/output port definitions and connection pins to the driver are shown in Table 1. Pins 10.0-10.5 are connected to external control buttons to receive corresponding external action commands. Since the PLC output is a 24V signal, the pulse and direction terminal outputs use a common cathode connection. The system uses Q0.2 as the direction control signal terminal; when set to 0, the worktable moves forward (away from the servo motor), and when set to 1, it moves backward.

Table 1. Interface Definitions and Pin Connections for Part 57-200

2.2 Driver Parameter Settings

After wiring is completed, the driver parameters need to be set. According to design requirements, the driver should be configured differently for the two operating modes and reset function required by the system. In automatic mode, the driver operates in position mode, and the motor runs according to the input pulse command, driving the lead screw. In jog mode and homing operation, the driver operates in speed mode, and the motor runs at the internal speed selected by external I10. Therefore, the servo driver is set to a hybrid control mode. The switching between the two modes is determined by the PLC output port Q0.4 (0 for position mode, 1 for speed mode). Corresponding parameter settings are also required for both driver modes. Taking the position control parameter settings in hybrid mode as an example, the driver input pulse command type is selected as pulse + direction mode; the motor direction command inversion control uses the factory default setting; the speed and position gain are used to adjust the servo motor's operating effect when the load power changes. With reasonable power selection, the gain parameter has already been adjusted to a reasonable value before leaving the factory, and will not be changed here. The parameter settings for this example are shown in Table 2.

Table 2 Driver Auto-Run Mode Parameter Settings

3 Human-computer interface design

The system uses a Siemens TP177B touchscreen as the human-machine interface. This touchscreen is based on the Windows CE operating system, has 2MB of user memory, and integrates RS422/1485, USB, and Profinetl Ethernet interfaces. After configuration, control parameters can be easily and flexibly set, enabling real-time monitoring of the operating status.

To achieve data communication between the touchscreen and the master PLC, the touchscreen needs to be configured. This paper uses WinCC Flexible 2005 to configure the touchscreen, which accesses the corresponding memory units of the master PLC through variables. MPI networking is suitable for small-scale applications with low data volume, and the 57-300 CPU has an MPI interface; therefore, this system uses this communication method for communication between the HMI and the master 57-300.

Open the configuration software, create a new project, select TP177 as the HMI device, IFB port as the interface, and 5730014000 as the controller. Design the screen according to the requirements of the touchscreen in the system. The screen mainly includes work indicator lights, work mode selection, and displacement input modules. After editing the screen, configure the connection parameters. In the HMI device configuration section, select Sirnatic for the type, 187500 for the baud rate, and set the address to 1. Check the "Unique Master Station" option on the bus. In the network configuration section, select MPI for the configuration file and set the number of master stations to 1. Set the address in the PLC device to 2, corresponding to the master PLC address. After configuring the connection parameters, create variables according to the address allocation in Table 1. In the start screen, connect each operation module to the corresponding function variable. After configuration, connect the PC and touchscreen using a standard crossover network cable, configure the PGIPC port as PCAdapter (MPI), and set the CPC and touchscreen to download projects via MPI. The designed HMI is shown in Figure 1.

Figure 1 Touchscreen control screen

4. Master-Slave DP Communication Design

PROFIBUS-DP, as an open fieldbus protocol, is widely used in industrial control systems. This protocol uses only Layer 1.2 of the RSIOSI reference model and the user interface; its streamlined structure ensures high-speed data transmission, making it ideal for data communication between FLCs. In this system, the S7-300 master station is primarily used for communication services. At the start of data communication, the master station first receives control commands from the HMI via the MPI communication network, then sends the commands to the slave station via the PROFIBUS-DP bus, while simultaneously receiving feedback information such as the operating status from the slave station. In terms of hardware connection, the S7-200 CPU is connected to the bus network via the EM277. As a DP slave module, the EM277 accepts IIO configuration from the master station and sends and receives different amounts of data. During master-slave DP communication, the master station sends information from its output buffer to the slave station's output buffer, exchanging data with the slave station; the slave station returns data from its input buffer to the master station's input buffer in response to information from the master station.

4.1 Configuration Design

Create a new project in SIMATICManager and insert a SIMATIC300 station. Open the HWconfig editor and insert the rack, power supply, and CPU in sequence according to the order number. In the Profibus configuration screen, create a new DP network, set the communication address to 2, the transmission rate to 187.5Kb/s, and select DP as the configuration file. The master PLC can automatically recognize the HMI and does not require configuration. The S7-Z00 is connected to the Profibus-DP via the EM277 module. The slave configuration is actually configuring the EM277. Before configuration, add the EM277 description file siem089d.gsd to STEP7 and set the slave address to 3 (consistent with the EM277 DIP switch). The communication interface is configured with 4-byte input and 14-byte output, and the V-zone offset is set to 80. Therefore, the master station's transmitting area PQB20-PQB23 corresponds to the slave station's receiving area VB80-VB83, and the master station's receiving area PIB24-PIB27 corresponds to the slave station's transmitting area VB84-VB87. After the system hardware configuration is completed, the hardware information is downloaded to the 57-300. The hardware configuration is shown in Figure 2.

Figure 2 Hardware configuration

4.2 User Program

In the CPU315-2DP symbol table, data block DB1 is defined to store received and transmitted data; function call FC1 is used for data communication exchange between CPU300 and CPU200. OB100 is used to initialize the data mapping input and output storage areas. The main program executes in organization block OB1. After the organization block OB100 is initialized, OB1 is processed cyclically. At the end of the loop, the process image output table is sent to the axis output module. During communication, the communication effect can be viewed through the variable table. The main station program inserts I/O access fault diagnosis module OB82 and rack fault diagnosis module OB86 for operation instructions of corresponding actions.

5. Motion Control Design

During system operation, switching between different control modes should be performed with the motor stopped. To ensure system safety, interlocking functions should be added between automatic and jogging operations, as well as motor forward and reverse rotation. The motion control program is written in a 57-200 PLC. During programming, corresponding subroutines are written for different actions, such as automatic mode, jogging mode, and return to reference point (reset), which are called by the main program OB1. The subroutines are selected by the 57-200 PLC input point or the touchscreen auxiliary relay signal.

5.1 Automatic Mode

In the system hardware connection, the encoder feedback pulse is connected to the driver, forming a semi-closed-loop positioning control system. When the deviation lingering pulse (the difference between the PLC output pulse and the encoder feedback pulse) is less than the parameter setting value, the driver sends a positioning completion pulse signal to the PLC, and the positioning completion flag V18.2 in the PLC is set to 1. In the automatic programming, the running parameters on the touch screen are first converted into the corresponding number of pulses, and then the PLC outputs that number of pulses to the servo driver. The S7-200 PLC integrates two 20kHz high-speed axis outputs. In automatic mode, the system uses the PLS instruction to output PTO pulses from port Q0.0. The corresponding control byte unit in PTO output mode is SMB67. The program writes 16#85 to this register, and the corresponding functions are: select PTO mode; enable pulse output; single-segment operation; microsecond timing; asynchronous update of pulse period and number. To avoid the scan cycle affecting the pulse transmission process, the system generates an interrupt after each pulse transmission. When the system needs to stop urgently, pulse input can be stopped by writing control word 16#CB to SMB67. Considering the pulse transmission frequency limitation of S7-200, the motor is designed to run at a speed of 800 r/m. In the driver's electronic gear ratio setting, the input pulse multiplier is set to 10, and the division factor is set to 1, corresponding to parameter numbers Pr34 and Pr35 respectively. After the servo motor's built-in encoder is multiplied by 4, the resolution can reach 10000 P/R. After the electronic gear ratio setting, the PLC pulse transmission frequency is lower than the maximum value when the driver receives 1000 pulses for one revolution of the motor.

5.2 Jog Mode

In jog mode, the system selects the driver to operate in speed mode, and the motor runs at the speed set internally by the driver. To avoid signal interference between automatic and jog modes when running jog mode, the driver's mixed mode must first be switched via the driver's X3 input point. The system uses only one internal speed; that is, in jog mode, the motor is controlled to run at a single speed. The motor is designed to run at 2000 r/m, with an acceleration/deceleration time set to 500 ms, obtained from parameter number Pr24.

5.3 Return to Reference Point

In servo control systems, the reset function can reduce motion control deviations caused by factors such as system inertia, pulse loss, and connection gaps between the lead screw and mechanical components. In this system, the reference point is set at the middle position of the lead screw, and the reset function is implemented by system programming. A proximity switch is installed at the reference point, with mechanical sensors installed at both ends. The position feedback signal is connected to the S7-200 terminal. The system reset process is described as follows: When the mechanical sensors on both sides of the reference point detect the worktable passing by, the feedback signal changes from high level to low level, and the PLC is internally set. After the reset command is issued, the motor direction is determined at the PLC terminal based on the mechanical sensor signal. The motor runs at the first speed to return to the origin; when it encounters the falling edge of the mechanical sensor, the motor changes to the second speed and slowly approaches the reference point. When it encounters the reference point proximity switch, the motor stops, and the system reset ends.

6. Conclusion

This paper introduces an AC servo system designed to meet industrial control needs. It integrates a PLC, touchscreen, and bus communication, demonstrating significant engineering value. The system uses a touchscreen for adjustment and control, simplifying operation; the PLC directly controls the position and speed of the servo motor, eliminating the need for a positioning module and saving costs. The constructed system meets design requirements, operates reliably, and achieves satisfactory results.

Read next

CATDOLL 128CM Kelsie Silicone Doll (Soft Silicone Head)

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22