A cast metal is generally produced by using a sand mold. A foamed polystyrene mold is used as the master mold for making the corresponding sand mold. Recently, the development of a flexible machining robot for foamed polystyrene materials is expected to be used in the cast metal industries because of the high cost and inefficiency of conventional large-sized CNC machine tools. To cope with the need, we already presented a machining system based on an industrial robot. Industrial robots have been recognized as a typical biomimetic machine pursuing the capability of human arm. The developed robotic CAM system provides a simple interface without using any robot languages between any CAD/CAM system and the machining robot. In this paper, a trajectory following controller with a capability of generating micro vibrational motion is completed for a ball endmill of the machining robot in order to enhance the machining performance of foamed polystyrene materials with curved surface. The micro vibrational motion is online generated along curved surface by post-processing original CL data. The implementation of the proposed controller and removal machining results along curved surface are illustrated.