The synchronization of a number of self-excited nonidentical pendula (with the same masses and different lengths) hanging on the same beam which can move vertically has been investigated. We identify different synchronous configurations and investigate their stability. An approximate analytical analysis of the energy balance allows to derive the synchronization conditions, phase difference between the pendula and explains the observed types of synchronizations. We give evidence of two thresholds (in a number of pendula and differences in lengths) after which the synchronization is not observed. It has been shown that for more than three pendula with sufficiently large differences in the lengths the synchronization is not observed and the pendula perform quasi-periodic oscillations. Our results are robust as they exist for the wide set of system parameters.