A dynamic programming model that optimizes farmer profits and minimizes gin processing and energy consumption provides the basic for computer selection of gin machinery sequences. The model utilizes the cotton market price and the performance characteristics of gin machinery to determine the optimum machinery sequence. Cotton moisture, color, and foreign matter measurements are made with electronic devices at three stations in the gin system and are used to feed forward and feed backward to control the gin process. Special routing valves are used to bypass or select any combination of four seed cotton cleaners, two multi-path driers, and three lint cleaners as directed by a computer based on process control software. A PC-compatible microcomputer and C-language form the basis for the control system. The gin process control system operates successfully and minimizes fiber damage and machinery usage while optimizing profits.