PurposeIn this paper, a new application of the Selected Harmonic Elimination Pulse Width Modulation (SHEPWM) technique used in the cascade multilevel inverter topology which is formed by series connections of one‐phase bridge type inverters (H‐bridge) is introduced. The advantage of the SHEPWM technique is its ability to operate in low switching frequency that makes it suitable for high power applications.Design/methodology/approachFirst, the switching angles are calculated using constrained optimization technique. By using these switching angles, the fundamental harmonic can be controlled and the selected harmonics can be eliminated. Then, using these calculated switching angles, a set of equation is formed which calculate the switching angles with respect to the modulation index. The switching angles at any modulation index can be easily obtained by solving the equation set. In this study, this equation set has been solved online using dSPACE DS1103 controller board. Using this technique, three‐phase voltages have been obtained from a five‐level cascade inverter. These voltages are applied to an induction motor.FindingsThe simulation results are verified by the experimental results. The results show that selected harmonics can be eliminated and an ac voltage with variable amplitude and frequency can be obtained using the proposed technique.Originality/valueThis paper presents a new application of the (SHEPWM) technique for multilevel inverters.