本論文透過Matlab/Simulink、Matlab/GUI與TI(德州儀器) ezDSP2812建立一套硬體迴路測試系統,將藉由Simulink建立的數學模型套入硬體迴路測試系統中,再將於Simulink設計好的控制迴路透過RTW編譯成C Code下載到DSP中,驗證其在DSP上是否確實可用,並達到控制的要求,使得所有開發過程都在同一個環境下完成,達到節省成本與加快開發速度的效果,亦具備開發過程之安全性,及維護與修理之簡單性等優點。最後,再透過簡單的轉換,直接燒錄程式碼進DSP,再經由DA電路輸出電壓,即可立即對實際的受控體去做自動控制。 論文裡先將燃料電池的模型在simulink裡建立出來,再透過硬體迴路測試去開發控制器;驗證的部份由於無法取得一真正的燃料電池,故選用空氣壓馬達來做驗證,也是先將空氣壓馬達的模型在simulink裡建構出來,先用硬體迴路測試去做模擬與開發控制器,再透過本論文所建立的電路系統,對實際的空壓馬達做控制,比較實際的控制與模擬控制之間的差別。 The thesis built a hardware-in-the-loop test system through Matlab/Simulik, Matlab/Gui and TI ezDsp2812. First of all, putting the math model set by Simulink into the hardware-in-the-loop test system. Secondly, compile the control loop designed by Simulink to C Code through RTW. Next, download it to DSP and test to determine its usefulness in order to conform with the requests of control. All of the developing processes were controlled in the same environment to reach the goal of accelerating development and cutting costs. It also has the advantage of developing safely and maintaining simply. Thirdly, burn the program code into DSP directly through a simple transformation. Lastly, control the practical controlled platform automatically through the output voltage of DA circuit. The thesis set up a model of fuel cell first. Then, develop a controller by hardware-in-the-loop test. Choose an air motor to test because the real fuel cell is unavailable. Build the model of air motor in simulink first. Then, use the hardware-in-the-loop test to simulate and develop controller. Eventually, control the practical air motor through the electronic system by the thesis and compare the difference between practical controls and simulate controls.