Abstract:The control of energy recovery system is increasingly rigid for urban mass transit to save energy and stabilize voltage. To design a reliable control algorithm rapidly and efficiently, a model of supercapacitor based energy recovery system has been presented via Simulink/Stateflow. Furthermore, the features and optimization suggestions of Stateflow are provided. The function of the algorithm model is described briefly and verified via simulation, then the embedded C code suitable for the LF2407A DSP platform is automatically generated. It also generalizes the rapid implementation flow based on DSP and provides suggestions to the rapid implementation iteration process by researching the generated C code, and the rapid transition of bi-directional DC/DC converter is also discussed. Finally an experiment is built to show the validity of this approach. This methodology is suitable for other power electronics control system for the urban mass transit, and it can facilitate the project development and shorten the development cycle.