In the past we achieved to use a rat-like robot and a single rat to develop Animal Models of Mental Disorder (AMMDs) through stress exposure. However, to simulate the real social environment, we use a rat-like robot composed of multiple links to chase a specific rat (target) in a group of rats (outside observers). In this paper, we aim to develop a real-time control system for a multi-link robot surrounded by multiple rats. A virtual impedance model was adopted to generate posture and trajectory for a multi-link robot named WR-5. With the analysis of virtual forces/moments acting on WR-5 based on the model, corresponding dynamic equations can be obtained to control the motion of WR-5. Simulation results show that the head of WR-5 can accurately direct a target object in the following test. After conducting experiments with three rat subjects (a target rat, two outside observers), the output results suggest that the head and body gesture of WR-5 achieves to follow the target in real-time. Meanwhile, the control system allows real-time avoidance of the moving outside observers during interaction.