This paper presents an efficient coronavirus optimization algorithm (CVOA) to find the optimal values of the PID controller to track a preselected reference speed of a brushless DC (BLDC) motor under several types of disturbances. This work simulates how the coronavirus (COVID-19) spreads and infects healthy people. The initial values of PID controller parameters consider the zero patient, who infects new patients (other values of PID controller parameters). The model aims to simulate as accurately as possible the coronavirus activity. The CVOA has two major advantages compared to other similar strategies. First, the CVOA parameters are already adjusted according to disease statistics to prevent designers from initializing them with arbitrary values. Second, the approach has the ability to finish after several iterations where the infected population initially grows at an exponential rate. The proposed CVOA was investigated with well-known optimization techniques such as the genetic algorithm (GA) and Harmony Search (HS) optimization. A multi-objective function was used to allow the designer to select the desired rise time, the desired settling time, the desired overshoot, and the desired steady-state error. Several tests were performed to investigate the obtained proper values of PID controller parameters. In the first test, the BLDC motor was exposed to sudden load at a steady speed. In the second test, the continuous sinusoidal load was applied to the rotor of the BLDC motor. In the third test, different operating points of reference speed were selected to the rotor of the BLDC motor. The results proved that the CVOA-based PID controller has the best performance among the techniques. In the first test, the CVOA-based PID controller has a minimum rise time (0.0042 s), minimum settling time (0.0079 s), and acceptable overshoot (0.0511%). In the second test, the CVOA-based PID controller has the minimum deviation about the reference speed (±4 RPM). In the third test, the CVOA-based PID controller can accurately track the reference speed among other techniques.