I ruled out students picking their own partners and randomly assigned partners for the first two projects. We made a game of the selection process by passing around a deck of cards. Each student took a card and matching cards determined the team. Randomly assigning partners caused problems when students with vast differences in ability or motivation were teamed together. Midway through the semester I identified three types of students based on the work they had done.
Motivated students have the ability and time to devote to the projects and do excellent work.
Willing students may not have the same ability as motivated students but they work hard and do acceptable work. Unmotivated students either do not care or do not have the time necessary to do acceptable work. For the third project I assigned partners based on what I had observed during the semester. I assigned at least one motivated student to each team. The number of motivated and willing students were approximately equal.