In this paper, we extend the idea of composite pulses to achieve robust population inversion in a three-level quantum system. The scheme is based on the modulation of the coupling strength, and the pulse waveforms are designed according to the Taylor expansion. The composite pulses sequence can compensate systematic errors to any desired order. In particular, this scheme keeps good performance under the disturbance of waveform deformations. Moreover, we employ the composite pulses sequence to realize the generation of the W state in the superconducting circuits. The numerical results show that the fidelity can still maintain a high level in a decoherence environment.