Angle detection technology in the field of precision measurement has important significance. The angle measurement compares the measured angle with the standard angle to obtain the actual value or deviation value of the measured angle. At present, China’s angle measurement technology has achieved productization, but there are still obvious defects in some special measurement fields. The angle measuring instrument based on the auto-collimation principle has a large volume and has high requirements for the measurement environment. Nowadays, with the development of optoelectronic technology, it is necessary to develop high-precision, portable and automated angle measuring instruments. The autocollimation is a very important measuring instrument for small angle measurements. It is often used to compare or measure small angles. Widely used due to its high accuracy and measurement resolution. In order to study the effect of the magnetic field in space on the bending degree of the extension rod of the star sensor, it is necessary to carry out the precise measurement of the three-dimensional small angle. Due to the small installation and measurement space of the satellite and the strong electromagnetic interference and temperature changes in the measurement environment, the existing three-dimensional angle measurement method cannot measure the three-dimensional bending small angle of the star-sensitive sensor extension rod with high precision, and even damage the instrument. In order to achieve the high precision measurement of three-dimensional small angle in small space conditions, this paper develops a three-dimensional small angle measurement system based on embedded system for data acquisition and data processing. And the algorithm based on the principle of auto-collimation is studied. Firstly, this paper introduces the hardware structure and measurement principle of the angle measurement system, and briefly describes the design of the optical amplification system. According to the working principle of the optical autocollimation and the two-dimensional PSD, a optical auto-collimation system is designed. Secondly, the application of auto-collimation principle in three dimensional angle measurement is introduced. Finally, based on the synthesis and decomposition of the spatial three dimensional angle, a three-dimensional angle measurement algorithm is proposed and taking the theoretical parameters as an example to analyze the theoretical error of the optical autocollimator system and the installation error of reflector. The focal length, resolution and magnification of the optical system are calculated based on the design objectives. On the basis of this, the optical devices are selected and the optical auto-collimation system is designed. Finally, the experimental results were analyzed by data obtained from several experiments, and a passive non-contact three-dimensional angle measurement method was proposed. The experimental results show that the proposed three-dimensional angle measuring instrument has the advantages of anti-interference and high precision, and its working accuracy is 0.23 arc seconds. The method is mainly applied in the narrow and strong electromagnetic interference three-dimensional angle measurement field, and it meets the requirements of stable and reliable, high precision and strong anti-interference ability of the three-dimensional angle measurement under the condition of small space. It solves the problem of three-dimensional angle measurement under small space conditions to a certain extent.