The automatic feeding device is crucial in grassland livestock farming, enhancing feeding efficiency, ensuring regular and accurate feed delivery, minimizing waste, and reducing costs. The shape and size of pellet feed render it particularly suitable for the delivery mechanism of automated feeding troughs. The uniformity of pellet flow is a critical factor in the study of automatic feeding troughs, and optimizing the movement characteristics of the pellets contributes to enhanced operational efficiency of the equipment. However, existing research often lacks a systematic analysis of the pellet size characteristics (such as diameter and length) and flow behavior differences in pellet feed, which limits the practical application of feed troughs. This study optimized the angle of repose and structural parameters of the feeding trough using Matlab simulations and discrete element modeling. It explored how the stock bin slope and baffle opening height influence pellet feed flow characteristics. A programmable logic controller (PLC) and human–machine interface (HMI) were used for precise timing and quantitative feeding, validating the design’s practicality. The results indicated that the Matlab method could calibrate the Johnson–Kendall–Roberts (JKR) model’s surface energy. The optimal slope was found to be 63°, with optimal baffle heights of 28 mm for fine and medium pellets and 30 mm for coarse pellets. The experimental metrics showed relative errors of 3.5%, 2.8%, and 4.2% (for average feed rate) and 8.2%, 7.3%, and 1.2% (for flow time). The automatic feeding trough showed a feeding error of 0.3% with PLC-HMI. This study’s optimization of the automatic feeding trough offers a strong foundation and guidance for efficient, accurate pellet feed distribution.