This paper presents the application of the cuckoo search (CS) algorithm in attempts to the minimization of the commutation torque ripple in the brushless DC motor (BLDC). The optimization algorithm was created based on the cuckoo’s reproductive behavior. The lumped-parameters mathematical model of the BLDC motor was developed. The values of self-inductances, mutual inductances, and back-electromotive force waveforms applied in the mathematical model were calculated by the use of the finite element method. The optimization algorithm was developed in Python 3.8. The CS algorithm was coupled with the static penalty function. During the optimization process, the shape of the voltage supplying the stator windings was determined to minimize the commutation torque ripple. Selected results of computer simulation are presented and discussed.