We investigated the lock-in transition of charge density waves (CDWs) in quasi-one-dimensional conductors, based on McMillans free energy. The higher-order umklapp terms play an essential role in this study. McMillans theory was extended by Nakanishi and Shiba in order to treat multiple CDW vectors. Although their theories were aimed at understanding CDWs in quasi-two-dimensional conductors, we applied them to the quasi-one-dimensional conductors, including K$_{0.3}$MoO$_3$, NbSe$_3$, and $m$-TaS$_3$, and confirmed its validity for these cases. Then we discussed our previous experimental result of $o$-TaS$_3$, which revealed the coexistence of commensurate and incommensurate states. We found that the coexistence of multiple CDW vectors is essential for the lock-in transition to occur in $o$-TaS$_3$. The even- and odd-order terms in the free energy play roles for amplitude development and phase modulation, respectively. Moreover, consideration of the condition of being commensurate CDWs allowed us to relate it with that of the weak localization in random media.