# Random PWM Technique Based Two-State Markov Chain for Permanent Magnet Synchronous Motor Control
## 1 Introduction
Reference [14] analyzes the effects of five random modulation strategies on EMI and switching current harmonics of simple and interleaved buck converters and proposes a random carrier frequency fixed duty cycle modulation strategy as the best modulation scheme that can significantly reduce EMI and current harmonics, but the random number generator used has limitations in accuracy and randomness range that can affect the accuracy of the experiment. However, the core challenge of the RPWM lies in the quality of random number generation [15]. Ideal uniformly distributed random numbers rely on hardware implementation, which is costly and difficult to integrate into on-board microprocessors, while pseudo-random numbers generated by algorithms such as the linear congruential method have problems such as high sequence repetitiveness and statistical characteristic deviations, leading to incomplete spectrum expansion and even secondary problems such as motor resonance [16]. Compared with ideal random numbers, pseudo-random numbers may show continuous values greater than or less than the central value in certain time periods, thereby reducing random performance and directly affecting the suppression effect of the RPWM on high-amplitude harmonics. To address this issue, researchers have proposed numerous approaches, with the Markov chain demonstrating the most significant efficacy. In reference [17], a two-state Markov chain was employed for random number generation and integrated with the asymmetric SVPWM technique to mitigate high-frequency harmonics in the IMC-PMSM system. In reference [18], building upon random pulse position modulation, the Markovchain was leveraged to optimize random number generation, thereby improving the suppression of high-frequency sideband harmonics. In summary, the RPWM technology still has certain limitations at present. Although existing research has optimized the random number performance of the RPWM by using Markov chains, it has not deeply analyzed the reasons for its impact on the RPWM. Based on this, this study takes the permanent magnet synchronous motor as the research object and proposes a control method for permanent magnet synchronous motors based on two-state Markov chain random spread spectrum. Different from the existing literature, this method fully considers the influence of spread spectrum parameters and combines the immune algorithm for parameter optimization to avoid the problem of poor spread spectrum effect caused by human selection. The contributions of this article are as follows:  
1. The working principle of the SVPWM is expounded, and the distribution characteristics of its output harmonics are deeply analyzed, laying a foundation for the theoretical analysis of the RPWM;
2. An RPWM based on a two-state Markov chain is proposed. By introducing the concepts of Markov process and Markov chain, the mathematical model of the two-state Markov chain is derived to optimize the random number performance of the RPWM;
3. A thorough analysis was conducted on the influence of transition probability and random gain on the two-state Markov chain RPWM, and the immune algorithm was employed to optimize these two key parameters, thereby resolving the issue of ineffective reduction in high-frequency harmonics due to improper parameter selection. The rest of this paper is organized as follows: Section 2 introduces the working principle of traditional SVPWM and the analysis of output harmonics. Section 3 presents the traditional RPWM, followed by the proposal of an improved RPWM technique based on a two-state Markov chain and the use of an immune algorithm to optimize the spread spectrum parameters. In Section 4, the feasibility and effectiveness of the proposed method are verified through the construction of a permanent magnet synchronous motor experimental platform, and its advantages over traditional methods are demonstrated. In Section 5, the contributions and methods of this paper are summarized.