| With the proposed double carbon goal,wind power generation is developing rapidly.However,the high randomness and uncertainty of wind have a great impact on the generating efficiency and output power of the generator set,which requires real-time wind speed and direction information in the wind field to adjust the running state of the generator set and ensure the efficient,reliable and safe operation of the generator set.In this paper,the ultrasonic wind speed and direction sensor is designed based on the time difference method.The STM32F407VET6 microprocessor is selected as the control core of the system,and the ultrasonic propagation time is measured,so as to calculate the specific value of wind speed and direction.The system is designed mainly from hardware and software.Hardware part: design the microprocessor minimum system,so that it can realize the logic control of the whole system;The high power switch tube is directly driven by fixed pulse to generate ultrasonic wave.The low power and high bandwidth operational amplifier is used to design the signal processing circuit,and the received signal is amplified and filtered,and then converted to digital signal by voltage comparator and finally captured and processed by microprocessor.HMC5883 L is used as the azimuth detection unit of the system to provide reference for the installation of sensors.BMP180 is used as the environment detection unit of the system to detect the working environment of sensors in real time.DC-DC module and LDO power chip are used to construct the power supply circuit of the system as the power supply source of each chip in the hardware circuit.Altium Designer 20 software was used to draw,wire and fabricate the system PCB board,and finally complete the overall testing of the hardware circuit.In the software part,the propagation time of ultrasonic wave is obtained by the interrupt mode of timer capture,and saved by the array record,which is convenient to be called when the microprocessor is calculating.The output control relay of microprocessor IO and the channel switch of ADG904 realize the conversion of transmitting and receiving functions of the transducer;The register of barometric temperature module and geomagnetic module is operated by IIC communication mode to realize the accurate measurement of the information of pressure and temperature.The communication protocol and clock configuration at the bottom of the system are designed to realize the communication between the peripheral module and the microprocessor.A test platform was built in the laboratory environment,and the ultrasonic wind speed and direction sensor was tested,and the measurement error was analyzed.For the measurement of ultrasonic propagation time,the Hill-wavelet transform is used to optimize the signal arrival time,which is two cycles earlier than the threshold method,and the measurement accuracy of ultrasonic signal propagation time is improved. |