Fuel elements for Canadian deuterium uranium reactors are assembled from stacks of cylindrical UO2 pellets, with close tolerances on lengths and diameters. Present stacking techniques involve extensive manual operations and they can be speeded up and reduced in cost by an automated device. If gamma-active fuel is handled, such a device is essential. An automatic fuel pellet assembly process was modeled mathematically. The model indicated a suitable sequence of pellet manipulations to arrive at a stack length that was always within tolerance. This sequence was used as the initial input for the design of mechanical hardware. The mechanical design and the refinement of the mathematical model proceeded simultaneously. Allowances were made for mechanical constraints in the model, and its optimized sequence of operations was incorporated in a microcomputer program to control the mechanical hardware.