The problem of velocity tracking is considered essential in the consensus of multi-wheeled mobile robot systems to minimise the total operating time and enhance the system's energy efficiency. This study presents a novel switched-system approach, consisting of bang-bang control and consensus formation algorithms, to address the problem of time-optimal velocity tracking of multiple wheeled mobile robots with nonholonomic constraints. This effort aims to achieve the desired velocity formation in the least time for any initial velocity conditions in a multiple mobile robot system. The main findings of this study are as follows: (i) by deriving the equation of motion along the specified path, the motor's extremal conditions for a time-optimal trajectory are introduced; (ii) utilising a general consensus formation algorithm, the desired velocity formation is achieved; (iii) applying the Pontryagin Maximum Principle, the new switching formation matrix of weights is obtained. Using this new switching matrix of weights guarantees that at least one of the system's motors, of either the followers or the leader, reaches its maximum or minimum value by using extremals, which enables the multi-robot system to reach the velocity formation in the least time. The proposed approach is verified in a theoretical analysis along with the numerical simulation process. The simulation results demonstrated that using the proposed switched system, the time-optimal consensus algorithm behaved very well in the networks with different numbers of robots and different topology conditions. The required time for the consensus formation is dramatically reduced, which is very promising. The findings of this work could be extended to and beneficial for any multi-wheeled mobile robot system.