Service and assistant robots operating in "real world" become more and more important for everyday life. Requirements like social intelligence, social interaction, and social behavior are of enormous importance. Researchers agree that the realization of emotions for a robot is one of the most important steps on the way towards social robots. Still, an open question in robotics is how to model emotion in a way that all its functions are realized. In this paper an emotion-based architecture is presented. The architecture supports the implementation of the five functions of emotion, namely: regulative function, selective function, expressive function, motivational function, and rating function. Scalability, perceptibility, and parameterability are also considered as design features. As basis for the proposed architecture, psychological emotion and motivation theories are used. The derived control architecture is implemented using a behavior-based approach, in order to realize a modular extensible system design. The developed architecture is tested on the humanoid robot ROMAN.