The position and posture of the hydraulic support seriously affect the efficiency of coal mining and the safety of coal production. However, most of the current detection technologies have poor reliability, and the detection methods are difficult to adapt to the complex environment of coal mines. To effectively monitor the hydraulic support, and thereby improve the efficiency of coal mining, we propose a new method to detect the relative position and posture of the hydraulic support. The method is based on the mathematical idea that three points can determine a plane. Firstly, we use angle sensors and displacement sensors to build the detection device, use STM32 microprocessor to collect data, and realize real-time display of the data on the PC. Then, we conduct a single point detection experiment and a plane moving experiment, and combined the particle swarm optimization (PSO) algorithm to optimize the data. Experiment results show that the relative error of the single-point detection can reach 0.53%. Thirdly, we carry out a detection experiment of three points on the plane. Experiment results show that the detection accuracy of the two planes can reach 0.2°. Finally, to test the monitoring effect of the detection device on the hydraulic support, we carry out the relative position and posture detection experiment of the canopy. The experiment results show that the device can effectively detect the posture change of the canopy when the hydraulic support are moving. The method we use is contact measurement, which has high reliability and strong stability. The research on the relative position and posture detection of hydraulic support provides a reliable method to monitor the support working status. It lays the foundation for the intelligent control of the mining working face straightness and the perception of the support posture.