In this paper, we construct a simulation model of an automatic target detection and tracking machine gun application for military aircraft using 3D printing technology. Simultaneously, we propose an algorithm for automatic target detection and tracking using a convolutional neural network model, specifically based on the YOLOv8 model, to enhance the speed and accuracy of target identification. We utilize an STM32 microcontroller to control the target tracking motion system. Experimental results demonstrate that the target recognition system achieves a high accuracy rate of 97.86% and effectively tracks moving targets with speeds below 0.5m/s.Trong bài báo này, mô hình mô phỏng súng máy phát hiện và bám sát mục tiêu tự động ứng dụng cho máy bay quân sự sử dụng công nghệ in 3D được phát triển. Đồng thời đề xuất thuật toán tự động phát hiện và bám mục tiêu sử dụng mạng nơ-ron tích chập, cụ thể là sử dụng mô hình YOLOv8 đểtăng tốc độ và độ chính xác nhận dạng, vi điều khiển STM32 để điều khiển hệthổng chuyển động bám mục tiêu. Sau khi thực nghiệm cho thấy hệ thống nhận dạng mục tiêu với độ chính xác khá cao 97,86% và bám mục tiêu một cách nhanh chóng khi mục tiêu chuyển động với tốc độ nhỏ hơn 0,5m/s.