本論文基於Altera的SOPC(System on Programmable Chip)技術,使用經濟型FPGA晶片(Cyclone II)實現一個嵌入式視覺伺服系統。其中,系統的影像迴路、運動迴路與運算單元等邏輯電路在FPGA晶片中實現,其餘VGA顯示器所須的DAC(Digital/Analog Converter)、記憶體單元與驅動馬達所須的功率放大晶片則於外部電路實現。 於運動平台置入兩個直流伺服馬達,使相機能有兩個維度的轉動。當系統的硬體部分建構完成,本論文設計一套方法在Matlab/Simulink下建立馬達控制系統的模擬環境。基於傳統理想線性的馬達模型,以實驗數據對實際非理想的馬達模型進行修正,使得在模擬環境下所設計出的數位控制器,以軟體方法實現於伺服系統時能更貼近實際的應用情形。 系統軟體方面,藉由在系統內置入μC/OS-II即時作業系統使得兩個馬達的控制工作符合即時性,在μC/OS-II下,視覺演算、控制演算各自獨立為一個工作(Task)。平台根據視覺演算結果使相機鏡頭追蹤特定目標物,目標物始終維持在相機畫面中央,達到視覺伺服的目的。 嵌入式視覺伺服系統不僅解決建構系統的成本問題,硬體電路被微縮至單顆至數顆晶片中,縮小了系統所佔用的體積。除此之外,基於SOPC的特性,硬體架構也是可更動的,已完成的系統可以整合額外的IP(Intellectual Property)擴充系統功能,也可以對視覺演算進行軟硬體共同設計,增強平台在影像處理上的效能,使嵌入式視覺伺服系統更能適用於其他應用場合。
This thesis focuses on Altera corporation’s SOPC(System on Programmable Chip) technology, using low-cost FPGA (Cyclone II) implements a embedded visual servo system. Except DAC(Digital/Analog Converter) of VGA monitor, memory unit chip and the power amplifiers of motor driver. Some logic circuit such as vision, motion and computation are implement base on FPGA. The motion platform includes two DC servo motor such camera have two degree of rotation. After complete the hardware component, this thesis designs a method to build the simulation of motor control system by computer software Matlab/Simulink. Refer to the concept of linear motor; the experimental data is used to modify the non-ideal motor model. Thus, the digital controller which is designed on such environment will be realistic. In software environment of the embedded visual servo system, a well-known real-time operating system, μC/OS-II, is utilized to ensure the real-time control of two DC servo motors. Visual algorithms and control algorithms are separate tasks under μC/OS-II . According to the result of visual algorithms, camera can track a specific target such that target is always in the center of picture. Embedded visual servo system not only resolves the cost problem, but also reduces the circuit area. Additionally, hardware architecture is flexible because of the characteristic of SOPC. A complete system can integrate extra IP (Intellectual Property) to extend system function, and promotes the vision algorithm by hardware-software co-design. So that embedded visual servo system are fitter in other application situation.