This paper presents an intelligent method of tuning a flat controller for trajectory tracking of a single link flexible manipulator. The tip position of the manipulator was determined as the flat output. Using the flat output, a feedback control law is designed to stabilize the tip of the end effector and track the reference trajectories. The gains obtained for the flat controller is optimized using particle swarm optimization. Results show fast response to system trajectories, good tracking performance with no overshoots.