With the development of modern control technology,the control algorithm is more and more complex,verification and code automatic generation has become a trend. Digital signal processor (DSP) provides a platform for the various and complex advanced control algorithms, especially in power electronic system which demand highly real-time control, application of DSP is more and more extensive. The traditional development of motor control algorithm is the system simulation, code, and finally, test, for beginners, using the traditional manual programming way to write the complex control algorithm is very difficult.At the same time, the write introduction of manual error and low efficiency, code debugging later also very time-consuming, testing and programming are not synchronized, these disadvantages resulting in long development cycle, to correct the mistake costly. For algorithm designers, needed a way to solve the above problem.Model Based Design (MBD)platform based on Matlab, can achieve the whole development process from requirement analysis to verify the simulation code, the user can establish a system level model which can optimize system parameters, automatic generation of specific efficient code for target device. Provided by the use of Matlab development environment, users can develop and validate the control algorithm, the successful completion of the design verification algorithm to automatically generate code process.This paper firstly introduces the traditional methods of DSP design and the existing problems, and then introduces the Model Based Design which is increasingly popular, further defined the the advantage of Model Based Design. Then introduces the mathematical model of permanent magnet synchronous motor and the vector control method, based on the theory of sliding mode control, using a sliding mode observer (SMO) methods to achieve speed and angle of the PMSM, completed the system design without control sensor. Finally, under the platform of Matlab/Simulink to build a digital control system, using the simulation results to verify the correctness of the algorithm.The idea of Model Based Design is applied to the development of permanent magnet synchronous motor control system, the designer will mainly focus on the development of the control algorithm, provided by the use of TIC2000DMC software, can easily construct the control system model of permanent magnet synchronous motor, the function of processor in the loop test (PIL) can evaluate the real-time implementation and determine the size and the algorithm of quantization error and efficiency, so as to verify whether the algorithm is designed to meet the requirements. Finally, using the tools of automatic code generation to avoid the manual programming errors. Using model based design method, can realize the whole process of design, validation and implementation. |