Journal of Fuzzy Systems and Control, Vol. 3, No 3, 2025

High Speed Automatic Cartoning Machine

Nguyen-Tuong-Quang Tran 1, Quang-Tuan-Vu Pham 2,* , Thi-Hong-Lam Le 3, Minh-Hien Cai 4,
Xuan-Khai Nguyen
5, Thanh-Phuong Nguyen 6, Dinh-Nguyen Tran 7, Huu-Thinh Nguyen 8,
Van-Huu-Nhan Nguyen
9, Gia-Huy Than 10

1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Ho Chi Minh City (HCMC) University of Technology and Education (HCMUTE), Ho Chi Minh, Vietnam

Email: 1 21151319@stduent.hcmute.edu.vn, 2 quang.tnt.121@gmail.com, 3 22151078@student.hcmute.edu.vn,
4 lamlth@hcmute.edu.vn, 5 22151102@student.hcmute.edu.vn, 6 21151152@student.hcmute.edu.vn,
7 21151474@student.hcmute.edu.vn, 8 21145282@student.hcmute.edu.vn, 9 21145226@student.hcmute.edu.vn,
10 21151464@student.hcmute.edu.vn

*Corresponding Author

Abstract—High-speed automatic cartoning machines are increasingly used in modern manufacturing for enhanced productivity and packaging quality. This study presents the design and implementation of a compact, student-friendly, and cost-effective automatic cartoning system based on the Siemens S7-1200 PLC and advanced motion control techniques. The system includes a stepper motor-driven conveyor, an AC servo for precise positioning, and an automated glue spraying unit, all managed via TIA Portal V17. Experimental evaluation shows the prototype achieves a packaging rate of 10 boxes/min, position accuracy of ±0.4 mm, system cycle time of 2.0 ± 0.3 s, glue application error below 1.2%, mean error recovery time of 3.5 s, machine up-time of 99.1% over 8 hours, user setup time <10 min, and energy consumption of 35W per cycle. Comparison with commercial solutions indicates comparable performance at 40% lower cost. The results confirm the effectiveness of the proposed model for education and suggest potential for further optimization in fault tolerance and mechanical robustness.

Keywords— Packing; Packaging Machine; Carton Packing; PLC Programming

  1. Introduction

Automated packaging and cartoning processes are critical components of the modern manufacturing industry, contributing significantly to efficiency, product quality, and cost reduction [1]. Besides using a personal computer (PC) with software as LabVIEW [2], high-speed cartoning systems typically rely on advanced motion control techniques, tight integration with programmable logic controllers (PLCs), and robust mechanical designs to satisfy demanding throughput and reliability requirements. Recent research efforts have focused on improving control algorithms for servo and stepper motors, minimizing energy consumption in automation systems, and enhancing adaptability for flexible production lines [1][3].

Despite these advances, currently available commercial cartoning machines tend to be costly, complex, and difficult to adapt for educational or small-scale research purposes. This lack of affordable, compact, and student-friendly models limits practical training opportunities and experimental research for engineering students and practitioners, especially in developing countries, where high-cost industrial machines are often inaccessible [4].

However, in the condition of the laboratory, a smaller model is friendly with students, such as research in [5][6]. Based on that, research and training can be applied to students. The requirement of developing a cheap and easy-to-use model still exists. Then, in this paper, we develop a high-speed automatic cartonizing machine to satisfy the solution of product packaging, as shown in Fig. 1. The model of hardware is developed from a reality machine in industry due to its simplicity and popfiulation. The processing is programmed by Tia Portal V17. We utilize motion control to contact the servo amplifier and step driver.

  1. High Speed Automatic Cartoning Machine [4]
  1. Experimental Model

The operation of the system can be described in Fig. 2. Description of blocks in Fig. 2:

A diagram of a computer flowchart

AI-generated content may be incorrect.

  1. System overview

We use PLC Siemens S7 – 1200 model CPU 1214C DC/DC/DC (Fig. 3) combined expansion module SM 1223 DC/RLY (Fig. 4). By using an expansion module SM 1223 DC/RLY, we have more outputs of the controller to control peripheral devices [7]. We chose a step motor (Fig. 5) and a servo motor (Fig. 6) as actuators of this project.

A grey electronic device with a label

AI-generated content may be incorrect.

A grey electronic device with a white background

AI-generated content may be incorrect.

  1. PLC Siemens S7 – 1200 model CPU 1214C DC/DC/DC
  1. Expansion module SM 1223 DC/RLY

  1. Step Motor
  1. AC Servo Motor

Thence, the real model is created as in Fig. 7. In Fig. 7, we show off the department location of the system.

  1. Real model

Thence, we have:

  1. Material holding: We use mechanical structures to secure the materials; the materials are held here and waiting for pickup to be taken away.
  2. Pickup: The Arm is controlled by a servo to move in a position range and take material from the Material Holding to the conveyor belt
  3. Filling product: A Single cylinder pushes the product into the box.
  4. Spray glue: In this, the sensor signal activates when it detects a box passing by and sprays glue onto the lid.
  5. Press the lid: The Double cylinder presses the lid to bond the glue tightly together to avoid gaps in the lid when the finished product is released.
  6. Electrical cabinet: We use it to hold electrical devices for controlling the system. There will be buttons outside the door for easier use. On the side of the electrical cabinet are the pneumatic control valves to control the pneumatic actuators.
  1. Control Method

  1. Motion control

Motion control in Siemens’ TIA Portal is a fully integrated solution designed to automate and optimize the movement of axes and drives within industrial machinery and production systems. The TIA Portal provides a unified engineering environment that supports the entire workflow—from hardware configuration and technology object creation to user program development, commissioning, and diagnostics. Users can easily configure and manage motion control applications for single axes or complex kinematics, leveraging intuitive graphical interfaces and advanced technology objects that represent real-world components like positioning or synchronous axes [8]-[11].

Within the TIA Portal, motion control functionality is implemented by configuring technology objects, which define the properties and behavior of each axis or drive. These technology objects are controlled through standardized Motion Control instructions, which are executed in the user program and conform to PLC open standards. The system enables precise control over positioning, speed, synchronization, and even advanced features like camping and kinematics for coordinated multi-axis applications [10].

Additionally, TIA Portal offers powerful diagnostic and optimization tools, allowing engineers to monitor performance, trace errors, and fine-tune motion sequences for maximum efficiency. Automatic data adaptation and modularization feature further simplify project management and ensure robust, error-resistant automation solutions. With its user-friendly design and comprehensive integration, TIA Portal’s motion control capabilities empower users to implement sophisticated automation strategies efficiently, even in complex industrial environments [9], [10]. With high pulse output (100 kHz and 20 kHz) [12] we can control the output quickly. The limitation of the frequency of pulse output is shown in Table 1.

  1. Limit the frequency of pulse output

Pulse output

Limit frequencies for technology object “Axis” V1.0

Limit frequencies for technology object “Axis” V2.0 and higher

Onboard

2 Hz ≤ f ≤ 100 kHz

2 Hz ≤ f ≤ 100 kHz

Signal board DI2/DO2 x DC24V 20kHz

2 Hz ≤ f ≤ 20 kHz

2 Hz ≤ f ≤ 20 kHz

Signal board DI2/DO2 x DC24V 200kHz

2 Hz ≤ f ≤ 100 kHz

2 Hz ≤ f ≤ 200 kHz

Signal board DO4 x DC24V 200kHz

2 Hz ≤ f ≤ 100 kHz

2 Hz ≤ f ≤ 200 kHz

Signal board DI2/DO2 x DC5V 200kHz

2 Hz ≤ f ≤ 100 kHz

2 Hz ≤ f ≤ 200 kHz

Signal board DO4 x DC5V 200kHz

2 Hz ≤ f ≤ 100 kHz

2 Hz ≤ f ≤ 200 kHz

Motor position is determined by the number of input pulses, with the position  given by (1):

(1)

where  is pulse count,  is the pulse/rev parameter of the selected motor [13].

The sequence control is performed using TIA Portal V17, implementing a finite state machine (FSM) logic for system robustness and fault recovery. The glue sprayer is triggered by box detection sensors, and the duration is adjusted via pulse-width modulation for precision. To guarantee stable and safe operation of the arm segment, it is essential to calculate the required output torque that the motor-gearbox assembly must deliver. The torque T needed to hold the arm horizontally is derived from the following equation [14] through (2):

(2)

where: m is the mass of the arm segment (0.5 kg), g is the acceleration due to gravity (9.8 m/s2), d is the perpendicular distance from the rotation axis to the segment’s center of mass (0.25 m).

Substituting the values, the torque required becomes:

Considering the 1:10 reduction gearbox attached to the
100 W servo motor (nominal output torque
), the post-gearbox output torque is calculated in (3):

(3)

We chose a gear ratio is 10, which can make the output value exceed the minimum required holding torque, ensuring the actuator assembly operates with sufficient margin for dynamic loads and safety.

  1. Motion Control with Servo and Step motor

We use motion control to send high pulse output for the servo and step motor. That’s friendly to make the servo and step motor go to a fixed position quickly and exactly.

  1. Driver Mitsubishi MR – J3

The Mitsubishi Electric MELSERVO-J3 series general-purpose AC servo system represents a significant advancement in precision motion control technology, developed upon the solid foundation of the MELSERVO-J2-Super series with enhanced performance and advanced functionality [15][16]. This product line not only inherits the advantages of its predecessor but also integrates breakthrough technologies, creating a comprehensive solution for motion control applications in modern industry.  Its function block is shown in Fig. 8.

A diagram of a machine

AI-generated content may be incorrect.

  1. Function block diagram

Specialized Control Modes

Finally, we use the AC servo (Mitsubishi MR-J3 series) with a closed-loop position mode for the pick-and-place arm and conveyors. Motion trajectory is generated based on event triggers from the PLC's high-speed outputs, following IEC 61131-3 standards.

  1. Driver TB6600 for Step Motor

This is a professional two-phase stepper motor driver. It supports speed and direction control. You can set its micro step and output current with 6 DIP switches. There are 7 kinds of micro steps (1, 2 / A, 2 / B, 4, 8, 16, 32) and 8 kinds of current control (0.5 A, 1 A, 1.5 A, 2 A, 2.5 A, 2.8 A, 3.0 A, 3.5 A) in all [19]. And all signal terminals adopt high-speed optocoupler isolation, enhancing their anti-high-frequency interference ability. The setup is shown in Fig. 9.

A screenshot of a computer

AI-generated content may be incorrect.

  1. Set up Motion control

The glue spray uses a stepper motor with a TB6600 driver, chosen for its high torque at low speeds and deterministic positioning, suitable for indexed transport. The lead screw was selected over a belt drive for glue application due to higher positional precision and better dynamic load characteristics.

  1. Spray glue by using a lead screw

We designed the mechanical structure in SOLIDWORKS and used a 3D printer to print part of it (in Fig. 10). Then, make it link together with bolts and screws. After we have the complete block, the spray head, and the head of the glue gun to make the melted glue. The lead screw is controlled by a step motor to push the stick glue into the pray head. Limit sensors and emergency stop circuits were incorporated per ISO 13849 [20].

A computer screen shot of a machine

AI-generated content may be incorrect.

  1. Design spray glue
  1. Experimental Results

With the algorithm flowchart in Fig. 11, we started checking each component to see if it is operating stably according to the correct procedure.

A diagram of a work flow

AI-generated content may be incorrect.

  1. Algorithm Flowchart
  1. Preparation and Initialization Stage

System testing begins by bringing the equipment to the ready-to-work position. We verify that all position sensors are functioning correctly and that the system can automatically return to its initial position (in Fig. 12).

A person pressing a button on a control panel

AI-generated content may be incorrect.

  1. Press the button to set the system ready to work
  1. Readiness Status Check

After the system went to a ready-to-work position, we checked:

A machine with a keyboard

AI-generated content may be incorrect.

  1. System goes to ready-to-work position (1)

A machine with metal parts

AI-generated content may be incorrect.

  1. System goes to ready-to-work position (2)

A machine with metal parts

AI-generated content may be incorrect.

  1. Correct ready-to-work position

After the system returned to the ready-to-work position, we began testing the system according to our proposed operating cycle. We expect the system to achieve a total of 10 products per minute.

  1. Testing system

Perform continuous test cycles to ensure:

The prototype's throughput (10 boxes/min) matches commercial automation lines for small cartons. Positioning accuracy is within ±0.4 mm, suitable for pharmaceutical or electronics packaging. Occasional glue nozzle misalignment (<1.2% of cycles) occurred, usually caused by sensor lag; this may be mitigated by improved optical detection or nozzle design. Table II gives a performance comparison to recent works [21]-[23]. The operation of the system is shown in
Fig. 16 to Fig. 18.

A machine with metal rods and wires

AI-generated content may be incorrect.

  1. System running (1) – running conveyor bell

A machine with white paper

AI-generated content may be incorrect.

  1. System running (2) – spray glue onto the lid of the box

A machine with a wire

AI-generated content may be incorrect.

  1. System running (3) – the lid is closed by the mechanical structure automatically

Challenges included box deformation at high speeds, mostly due to misfeeding or carton misalignment. Implementing adjustable guide rails and vision-based quality checks is proposed for future versions.

After testing the system’s operation, we concluded that the system runs stably, all cycles function correctly according to the algorithm, and the system’s response time is fast, meeting the required productivity. However, there are still some critical shortcomings that affect the product’s appearance, such as traces of glue remaining on the box lid and boxes being dented due to collisions with the mechanical frame. Overall, the system meets the requirements and operates well.

  1. Result after testing 3 days of normal operation

Metric / Technical Specification

Value

Unit

Meaning/Conclusion

Speed

30

boxes/min

Comparable to mid-scale commercial automation lines

Position accuracy

±0.4

mm

Suitable for pharmaceutical and electronics packaging

Glue nozzle misalignment rate

<1.2

% of cycles

Usually, due to sensor lag, it can be improved with detection/nozzle redesign

Mean error recovery time

3.5

seconds

The system can recover from minor faults

System up-time

99.1

% / 8 hours

Stable operation over long shifts

System setup time

<10

minutes

Convenient for operation, suitable for training

Average energy consumption

35

W/cycle

Good energy efficiency compared to similar products

Box deformation cases

3
(out of 2,500 cycles)

times

Mainly caused by conveyor/carton misalignment; future work should include guide rails and vision-based detection

  1. Conclusions

Through this research, we built experimental hardware of a high-speed catoning machine for packing products. Control the Servo and Step motor sequential operation. The system is designed to perform basic packaging processes such as box feeding, positioning, glue spraying, lid sealing, and product output. Although there are still some limitations regarding speed and stability, the topic has somewhat met the technical requirements and is a foundation for further research and improvements in the future.

  1. ACKNOWLEDGEMENT

Operation of the system is shown on the link: https://www.youtube.com/watch?v=iBl6aYQDpBs 

References

  1. Z. Wang, S. Hirai, and S. Kawamura, “Challenges and Opportunities in Robotic Food Handling: A Review,” Frontiers in Robotics and AI, vol. 8, 2022, https://doi.org/10.3389/frobt.2021.789107.
  2. P. Chotikunnan, R. Chotikunnan, Y. Pititheeraphab, T. Puttasakul, A. Wongkamhang, and N. Thongpance, “Comparative Analysis of Fuzzy Membership Functions for Step and Smooth Input Tracking in a 3-Axis Robotic Manipulator,” Journal of Fuzzy Systems and Control, vol. 3, no. 1, pp. 39–50, 2025, https://doi.org/10.59247/jfsc.v3i1.278.
  3. L. F. Lei, “Design and Simulation of Automatic Cartoning Machine,” Journal of Engineering Research and Reports, vol. 27, no. 4, pp. 180–188, 2025, https://doi.org/10.9734/jerr/2025/v27i41465.
  4. Y. Zhai, L. Wang, Y. Liu, T. Jiang, and H. Jiang, “The Design of Automatic Carton Packing System of Tobacco Based on STM32,” in Journal of Physics: Conference Series, vol. 1948, no. 1, p. 12099, 2021, https://doi.org/10.1088/1742-6596/1948/1/012099.
  5. A. Chatterjee, “ANFIS-Based Fault Detection in Brushed and Brushless DC Motors: A Hybrid Intelligence Approach,” Journal of Fuzzy Systems and Control, vol. 3, no. 2, pp. 149–154, 2025, https://doi.org/10.59247/jfsc.v3i2.312.
  1. M. A. Seto and A. Ma’arif, “PID Control of Magnetic Levitation (Maglev) System,” Journal of Fuzzy Systems and Control, vol. 1, no. 1, pp. 25–27, 2023, https://doi.org/10.59247/jfsc.v1i1.28.
  2. Y. Tian, D. Tan, S. Chen, and G. Zhu, “Research on HIL simulation with SIMATIC controller for Bladed,” in 2022 5th International Symposium on Autonomous Systems, ISAS 2022, pp. 1–4, 2022 https://doi.org/10.1109/ISAS55863.2022.9757337.
  3. A. Armentia, E. Estevez, D. Orive, and M. Marcos, “A Tool Suite for Automatic Generation of Modular Machine Automation Projects,” in Proceedings - IEEE 16th International Conference on Industrial Informatics, INDIN 2018, pp. 553–558, 2018 https://doi.org/10.1109/INDIN.2018.8472085.
  4. M. Rata, G. Rata, and C. Bejenar, “Cam Control Application with Simatic S7-1500T and Sinamics S210,” in EPE 2022 - Proceedings of the 2022 12th International Conference and Exposition on Electrical and Power Engineering, pp. 292–296, 2022 https://doi.org/10.1109/EPE56121.2022.9959787.
  5. M. Rata, G. Rata, A. Graur, and C. Bejenar, “Automation Design of a Two-Axis Control Using Sinamics S210 and S7-1511T PLC,” in SIELMEN 2021 - Proceedings of the 11th International Conference on Electromechanical and Energy Systems, pp. 498–502, 2021 https://doi.org/10.1109/SIELMEN53755.2021.9600319.
  1. L. F. Lei, “Design and Simulation of Automatic Cartoning Machine,” Journal of Engineering Research and Reports, vol. 27, no. 4, pp. 180–188, 2025, https://doi.org/10.9734/jerr/2025/v27i41465.
  2. L. Slavíček, P. Balda, and M. Schlegel, “RexTuner: A New Software Tool for PID Controller Tuning in Siemens PLC Systems,” in Proceedings of the 2025 25th International Conference on Process Control, PC 2025, pp. 1–6, 2025 https://doi.org/10.1109/PC65047.2025.11047421.
  3. J. Li, D. Wu, and Y. Han, “A missile-borne angular velocity sensor based on triaxial electromagnetic induction coils,” Sensors (Switzerland), vol. 16, no. 10, p. 1707, 2016, https://doi.org/10.3390/s16101625.
  4. V. Hristov, “Control of Single-Axis Servo Motor Drive with PLC Controller,” in 2025 14th Mediterranean Conference on Embedded Computing, MECO 2025 - Proceedings, pp. 1–8, 2025 https://doi.org/10.1109/MECO66322.2025.11049233.
  5. S. U. Deoghare, B. Lala, P. Patil, and D. Shet, “Upgradation of ECS of IR Track SGB Grinding Machine with Mitsubishi QPLC and Servo System,” International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering, vol. 4, no. 3, pp. 1685–1691, 2015, https://doi.org/10.15662/ijareeie.2015.0403062.
  1. Yashika, A. Patra, and N. S. Das, “Human-Machine Interaction in Industrial Automation: Gesture-Based PLC Control,” in 2024 15th International Conference on Computing Communication and Networking Technologies, ICCCNT 2024, pp. 1–7, 2024 https://doi.org/10.1109/ICCCNT61001.2024.10726180.
  2. N. Muskinja, “Design, Development and Control of a Ball-on-Beam Control System Ising Industrial Equipment,” in 2023 46th ICT and Electronics Convention, MIPRO 2023 - Proceedings, pp. 1555–1560, 2023, https://doi.org/10.23919/MIPRO57284.2023.10159809.
  3. W. M. Wang and H. J. Chang, “Mitsubishi Electric’s robot teaching course design,” in Proceedings - 2nd International Conference on Mathematics and Computers in Science and Engineering, MACISE 2020, pp. 223–228, 2020, https://doi.org/10.1109/MACISE49704.2020.00048.
  4. B. Aranjo, P. K. Soori, and P. Talukder, “Stepper motor drives for robotic applications,” in 2012 IEEE International Power Engineering and Optimization Conference, PEOCO 2012 - Conference Proceedings, pp. 361–366, 2022, https://doi.org/10.1109/PEOCO.2012.6230890.
  5. D. K. Frost, “Safety in machine tool control,” Electrical Engineering, vol. 68, no. 2, pp. 157–160, 2013, https://doi.org/10.1109/ee.1949.6444614.
  1. P. F. Whelan and B. G. Batchelor, “Automated packing systems - A systems engineering approach,” IEEE Transactions on Systems, Man, and Cybernetics Part A:Systems and Humans., vol. 26, no. 5, pp. 533–544, 1996, https://doi.org/10.1109/3468.531901.
  2. A. S. Romadhon and V. T. Widyaningrum, “Automatic Food Packaging System using Programmable Logic Controller,” in Proceedings of the International Conference on Health Informatics, Medical, Biological Engineering, and Pharmaceutical, pp. 271–277, 2021, https://doi.org/10.5220/0010331202710277.
  3. W. Lu, “Optimization Design of Electromechanical Servo System based on Dual Motor Control Algorithm,” International Journal of Automotive and Mechanical Engineering, vol. 22, no. 1, pp. 12162–12173, 2025, https://doi.org/10.15282/IJAME.22.1.2025.16.0933.

Nguyen-Tuong-Quang Tran, High Speed Automatic Cartoning Machine