Formation control of multiple groups of agents finds application in large area navigation by generating different geometric patterns and shapes, and also in carrying large objects. In this paper, Centroid Based Transformation (CBT) \cite{c39}, has been applied to decompose the combined dynamics of wheeled mobile robots (WMRs) into three subsystems: intra and inter group shape dynamics, and the dynamics of the centroid. Separate controllers have been designed for each subsystem. The gains of the controllers are such chosen that the overall system becomes singularly perturbed system. Then sliding mode controllers are designed on the singularly perturbed system to drive the subsystems on sliding surfaces in finite time. Negative gradient of a potential based function has been added to the sliding surface to ensure collision avoidance among the robots in finite time. The efficacy of the proposed controller is established through simulation results.