本論文將使用Arduino作為主控,利用IMU融合四元數之算法偵測機身俯仰、翻滾、偏航之角度及角速度,並且透過多層PID的結構進行負回授控制以實現機身的自平衡,機器視覺方面是使用RaspberryPi作為影像處理之工具,並將解算後的訊號透過UART回傳至Arduino對姿態進行補償,其中有利用光流法實現懸停,以及霍夫轉換實現追蹤地面目標,本論文將會介紹系統架構、姿態算法、PID回授控制結構、感測器校正、以及如何使用機器視覺補償姿態之原理。;Thesis will use Arduino as the main control, using IMU fusion quaternion algorithm to detect the pitch, roll, yaw angle and angular velocity of the fuselage, and negative feedback control through the structure of multi-layer PID to achieve self-balancing of the fuselage, In machine vision, RaspberryPi is used as a tool for image processing, and the decoded signal is transmitted back to the Arduino through the UART to compensate for the attitude. Among them, the optical flow method is used to achieve hovering, and the Hough transform is used to track the ground target. thesis will introduce the system architecture, attitude algorithm, PID feedback control structure, sensor calibration, and how to use machine vision to compensate for the attitude.