International audienceAn ensemble of Brownian particles in a feedback controlled flashing ratchet is studied. The ratchet potential is switched on and off depending on the position of the particles, with the aim of maximizing the current. We study in detail a protocol which maximizes the instant velocity of the center of mass of the ensemble at any time. This protocol is optimal for one particle and performs better than any periodic flashing for ensembles of moderate size, but is defeated by a random or periodic switching for large ensembles