Share this

Design of a motion controller based on an embedded PLC chipset

2026-04-06 06:20:08 · · #1

1 Introduction

Rotary screen printing machines are electromechanical equipment used in the post-printing and dyeing process of fabrics. They are used to color, print, and dry fabrics. The key component is the printing unit, which mainly performs automatic overprinting of various patterns. Traditional printing units use mechanical transmission control. When the process changes or the fabric changes, the mechanical adjustments are labor-intensive and the operation is complex. After a period of use, due to mechanical wear, the printing accuracy and speed are greatly reduced, and pattern slippage occurs during speed increases and decreases. In the late 1990s, domestically produced rotary screen printing machines began to adopt an independent motor transmission control mode. Although the printing accuracy and speed were significantly improved, pattern slippage still occurred during speed increases and decreases, and the corresponding control system configuration was also relatively complex. These included single-chip microcomputer bus expansion methods, computer distributed control, and PLC control. Due to their complexity or high cost, these control methods have not been widely adopted.

After a thorough analysis of the advantages and disadvantages of various control schemes, the authors designed the KP3-05M06R motion controller using the embedded PLC chipset from Huangshi Kewei Automation Co., Ltd. This controller integrates PLC, CAN bus, and RS485/232 functions, and is used in conjunction with stepper drivers or servo drivers. It features functions such as jogging, positioning, pulse forward and reverse interpolation, and pulse frequency division for stepper motors or servo motors. Multiple motion controllers are interconnected via a CAN communication interface, with one motion controller acting as the master and the others as slaves. The system can be connected to a human-machine interface for centralized display, control, and management of the process. With a web server, remote monitoring and diagnostics of the control system can also be achieved.

2. Functions of the motion controller

Since 2005, thousands of KP3-05M06R motion controllers have been used in the textile and dyeing industries. Practical experience has proven that this controller not only boasts superior performance but is also extremely easy to use and maintain. Its main parameters are as follows:

Input: 5 optical couplers + 1 pulse signal up to 100kHz.

Outputs: 6 relays + 5 transistors + 1 0-10VDC + 1 cascaded pulse + 1 frequency divider pulse.

Communication functions:

CAN interface, 160kbit/s baud rate, enabling interconnection of multiple motion controllers;

Serial port 0 can be used for ladder diagram downloading, monitoring, and connecting to a character screen or human-machine interface.

Serial port 1 supports a portion of the master-slave protocol in Mitsubishi FX2N computer connection mode format 1. This protocol can be used to implement motion control.

The controller can interconnect with FX2N series PLCs, operator terminals, or other devices to complete functions such as information exchange, parameter setting, and remote operation.

Control functions:

Pulse frequency division, frequency = input pulse frequency / k, where 4.000 ≤ k < ∞, and the number of significant digits after the decimal point is 3;

Pulse jogging, automatic positioning, linear interpolation;

programming language:

Ladder diagram language, compatible with Mitsubishi fx2n instructions.

3 Hardware Design Scheme

3.1 Block diagram of main controller and peripheral circuits

The block diagram of the main controller and peripheral circuits is shown in Figure 1.

Figure 1 Block diagram of main controller and peripheral circuits

3.2 Block Diagram of Controller and Peripheral Circuits

The block diagram of the controller and its peripheral circuits is shown in Figure 2.

Figure 2 shows the block diagram of the controller and peripheral circuitry.

4 Software Design Scheme

4.1 Main Controller Software Design

The main controller uses an embedded PLC chipset to perform digital input/output, UART0, UART1, CAN, and RS485/232 interconnection and communication functions. The basic software framework consists of the following seven subroutines.

init-config: Port initialization program, completes input/output port configuration, intermediate variable initialization, and SPI startup.

init-start: Power-on initialization program, resets all output ports.

init-set: Sets the initialization program and resets all output ports.

init-run: Runs the initialization program.

Step: Instruction Cycle Scanning Program

tms: A 2.5ms periodic scanning program that samples the input port status, refreshes the output port status, and sends and receives SPI communication messages.

scan: Calculation cycle scanning program, input port status filtering, and interpretation of SPI communication messages.

4.2 From the perspective of controller software design

The slave controller uses a C8051F330 microcontroller with an instruction processing speed of up to 25 MIPS. It samples the input pulses, receives commands from the master controller, processes them accordingly, divides the input pulses, outputs pulses of the corresponding frequency, and sends relevant information to the master controller. The slave controller acts as an actuator, receiving commands from the master controller to perform different actions and feeding back the execution status to the master controller. It mainly consists of the following five functional programs.

start: Power-on reset initialization program, input/output port configuration, reset intermediate variable units, and start SPI and int0 interrupts.

int-int0: External interrupt 0 service routine, which performs frequency division and pulse interpolation on the input pulse.

int-spi: SPI interrupt service routine, used for receiving and sending SPI communication messages.

int-t3: Timer t3 interrupt service routine, which monitors the SPI communication status and the main program execution status.

main: The main program interprets SPI communication messages and performs pulse jogging and positioning.

4.3 Master-Slave Controller Combination Design

The master and slave controllers are connected via an SPI interface with a communication rate of 500 kbit/s, which helps improve the speed and real-time performance of the system.

The main station uses a timed send/receive mode. During embedded program initialization, SPI sending is started. When the timer expires, one byte of data is received first, and then the next byte of data is sent. After all messages have been sent, sending is paused to wait for the main program to process the messages. Only after the messages are processed will the next round of sending begin.

The slave station uses an interrupt-driven receive/transmit mode. After entering the interrupt service routine, it first receives one byte of data, then sends one byte of data. Once all messages have been received, the corresponding message with the same number of bytes is sent. At this point, the slave station stops receiving messages and waits for the main program to process the received messages. After the messages are processed, the next round of message receiving begins.

Message structure: stx + message content + etx + crc.

stx: Message start code, fixed at 02h.

Message content: The first two bytes are the ASCII codes corresponding to the command word to distinguish different messages, followed by the actual data of the message, all in ASCII code.

etx: Message end code, fixed at 03h.

CRC: Checksum. The sum of all bytes in the message content is added together, then the value of ETX is added, and then the result is converted into ASCII code.

5 Application Examples

5.1 Name of Control Equipment

Control equipment name: 4-color rotary screen printing machine control system.

5.2 Technical Requirements

Synchronous drive consists of two parts: main drive synchronization mainly involves the synchronous transmission between the fabric feeding motor and the overfeed motor, printing motor, drying oven motor, and column baking motor (including the synchronization between the column baking motor and the fabric dropping motor, etc.); secondary synchronous transmission is to realize the synchronous transmission between the printing motor and the screen head motor, which requires high synchronization accuracy.

The electrical control system consists of a spindle motion control unit (i.e., master station), a slave axis control unit (4-in-1), and a human-machine interface , which facilitates users in editing process programs (the programs can be kept confidential).

5.3 Control System Block Diagram

The control system block diagram is shown in Figure 3.

Figure 3 Control System Block Diagram

5.4 Control Scheme

5.4.1 Synchronization Control

The KP3-05M06R motion controller receives and processes the main motor speed data detected by the encoder, and then outputs pulses with adjustable frequency to control the mesh head motor, thereby synchronizing the guide belt with the mesh head.

The main drive is synchronized by an embedded PLC and a synchronous controller.

5.4.2 Automatic flower alignment control

Automatic pattern matching does not require the installation of proximity switches with high failure rates. Automatic pattern matching can be achieved simply by writing a ladder diagram program and transmitting the step number input via the touch screen to the D5904 and D5905 registers, and setting the automatic zero-return control word D5907 to 1.

5.4.3 Interpolation Control

Because printing requires high precision, the interpolation data must be frequently modified on the production floor, which is both time-consuming and fails to meet the requirements. With this motion controller, interpolation control can be achieved simply by assigning values ​​to the D5902 and D5903 registers.

Due to space limitations, the control scheme cannot be described in detail.

6 Conclusions

Although this motion controller is designed specifically for rotary screen printing machine control systems, it can also be used in other motion control systems because users can program it using standard ladder diagrams to achieve different functions. Utilizing embedded PLC chipsets for combined design is a novel product design approach . Designers can focus solely on the hardware and software design of interface components, reducing the product design process by two-thirds and ensuring high reliability. Embedded PLC chipsets provide product designers with a fast, efficient, and reliable design solution.

Practice has proven that motion control devices based on embedded PLC chipsets offer high printing precision, fast transmission speed, high production efficiency, and excellent product quality, resulting in significant social and economic benefits and widespread customer acclaim. This design scheme has promotional value.

Read next

CATDOLL 128CM Dolly Silicone Doll

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
CATDOLL 108CM Coco

CATDOLL 108CM Coco

Articles
2026-02-22
CATDOLL Oliva Soft Silicone Head

CATDOLL Oliva Soft Silicone Head

Articles
2026-02-22