How is the number of poles in a DC machine decided ?

The number of poles is selected such that the frequency of the armature emf is between 25 Hz and 50 Hz.  A higher frequency can result in hysteresis losses in the armature.

The number of poles is an even number like 2, 4, or 6.

Probable number of poles such as 2,4 or 6 are considered and the prospective frequency for each of the number of poles is calculated using the formula

F = N x P/ 120

where  P is the number of poles
           F is the frequency of the armature emf and 
           N is the speed of the motor in rpm