Design of Hydrological Cableway Test System Based on AT89S8252 Single Chip Microcomputer

Publisher:alpha11Latest update time:2013-10-24 Source: eefocusKeywords:AT89S8252 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  Cableway flow measurement is a unique flow measurement method based on my country's national conditions. It is particularly suitable for measuring the cross-sectional area and average flow velocity of natural riverbeds where the flow measurement section is easily changed. It is irreplaceable by other flow measurement methods. Hydrological cableway testing itself is a dynamic change process of a complex spatial system. Factors such as cableway bouncing, mechanical motion inertia, and flow velocity changes all affect the accuracy of flow measurement, and it is a random variable. These main variables are established into mathematical models, corresponding programs are compiled, and input into microcomputers. The microcomputer automatically calculates and adjusts to obtain correct results, which will greatly improve the accuracy of hydrological testing and provide results data in a timely manner.

  After nearly 50 years of development, hydrological flow measurement has become mainly based on cableway flow measurement, especially cableway flow measurement technology, which has developed rapidly in recent years and has basically formed the conditions for standardized construction. For example, cableway erection has developed from diversification to the basic use of open cruise ship labor-saving method; hydrological winch has developed from hand-cranked, belt-connected to slip-speed electric drive, DC servo motor drive to ordinary AC asynchronous motor drive winch used in conjunction with AC frequency conversion speed regulation; cableway signals have developed from DC wired, AC wired, AC wireless and radio signals to ground loop transmission of cableway integrated signals; flow velocity measurement has evolved from electric bells, sound counting and self-counting, time counting and direct flow velocity measurement to direct calculation of flow results report; starting point distance and water depth measurement have evolved from knot measurement and rope length counting measurement to actual distance measurement with automatic correction of sag arc; driving control has also developed from manual, electric, slip speed regulation to DC thyristor speed regulation to today's AC frequency conversion speed regulation; the overall bypass flow measurement system has also developed from manual to semi-automatic to fully automatic control flow measurement system.

  1 System Configuration

  The system block diagram is shown in Figure 1.   The AT89S8252 single-chip microcomputer is used. Since the amount of data in the river channel test is large and the calculation is relatively complex, and the memory capacity inside the single-chip microcomputer is limited, external memories RAM6116 and ROM6264 are added. The input acquisition interface of the external signal is based on the multi-channel A/D chip ADC0809, which sends the cableway signal and water level signal to the single-chip microcomputer P1 port and P3 port to undertake the interface of other input and output signals. The following introduces the main interface circuit and working process based on the characteristics of hydrological testing.

  1.1 ADC0809 interface circuit

  ADC0809 is a CMOS monolithic successive approximation A/D converter. The main features of ADC0809 are:

  1. It is an A/D converter with 8-channel analog input and 8-bit digital output.

  2. Conversion time is 100μs.

  3. The analog input voltage range is 0V~+5V, and no zero point and full scale calibration is required.

  4. Low power consumption, about 15mW.

  He transforms the water level change signal of the telemeter and the velocity, deflection, water surface and bottom signals sent by the cableway and transmits them to the single chip microcomputer. The interface has the characteristics of simple circuit, stable and reliable, strong anti-interference, etc.

  1.1.1 Acquisition of water level signal

  The teletype water level gauge is used to monitor the change of water level. In order to obtain the water level signal, the sensor part of the teletype water level gauge has been modified. Reed relays J3, J4, and J5 are added inside the sensor, and the internal battery is removed and powered directly by the system. Resistors R5~R8 form a voltage divider, and the voltage divider outputs to the ADCIN2 port circuit as shown in Figure 2. When the water level changes, the float rises and falls accordingly. The float rises and falls 3 cm, and the magnetic steel inside the sensor rotates one circle, that is, a reed relay will be turned on and off once for every 1 cm change. When J3, J4, and J5 are respectively energized, the voltage of the IN2 port is about 1.6 V, 2.5 V, and 3.2 V respectively. When no relay is energized, the voltage of the IN2 port is +5 V. According to the voltage value of the ADCIN2 port, it can be determined which reed relay is turned on and off. The rise or fall of the water level can be known from the change law of the voltage at the IN2 terminal as shown in Figure 3. In Figure 3, (a) is rising and (b) is falling.   1.1.2 Acquisition of water surface and bottom signals


  When measuring the vertical depth, the lead fish starts to descend after it moves to the designated vertical position of the river section. Once the lead fish touches the water surface, the depth counter starts to count the depth. When the lead fish continues to descend and touches the bottom of the water, the bottom switch closes and stops counting. The count value is the initial value of the depth of this vertical line. The working process is as follows: During the descent of the lead fish, the single-chip microcomputer continuously reads the voltage at the ADCIN1 port. Before the lead fish enters the water, the relays J1 and J2 are in the normally closed position. The voltage at the input terminal IN1 of ADC0809 is determined by the voltage divider of R3 and R4 to be 2.5 V. Once the lead fish touches the water surface, the +5 V voltage passes through the underwater plate → river water → lead fish → auxiliary rope 1 → ADC0809 to make the voltage at the IN1 terminal rise to more than 3 V. The single-chip microcomputer determines that the lead fish has touched the water surface based on the voltage at the IN1 port and starts the water depth counting. At the same time, it makes P3.4 output a high level and the relay J1 connects to the normally open contact. From the circuit diagram, it can be seen that the river water resistor is connected in parallel with R4 to make the voltage at the IN1 port about 1.5 V. When the lead fish continues to descend until it touches the river bottom, the river bottom switch K2 is pressed through, and the voltage at the ADCIN1 port of the 4.5 V battery E1 connected to the lead fish drops below 0 V. The microcontroller determines that the river bottom has been reached, stops counting the water depth, and outputs a signal through the P1 port to stop the water depth motor from running.

  1.1.3 Obtaining the deflection signal

  The cableway is equipped with a special inclinometer to correct the water depth measurement error caused by the water flow that causes the lead fish to not fall vertically to the bottom of the water. The inclinometer can measure the angle at which the lead fish deviates from the normal position due to the water flow, and then correct the water depth error by looking up a table or calculating with a formula according to the size of the deflection angle. Manual measurement is to estimate the size of the deflection angle by eye according to the scale of the inclinometer, and the error is large. We slightly modified the inclinometer to add a potentiometer W1 and the corresponding circuit as shown in Figure 1. The displacement of the deflection angle is converted into the rotation of the potentiometer through a mechanical linkage device to change the resistance value of W1, and the voltage change caused by the change in deflection angle is sent to the ADCIN0 port by using the auxiliary cable 2. Considering the particularity of field work, a wirewound potentiometer with stable performance and good sealing is used. Since the voltage change at the IN0 port is not linearly related to the deflection angle, the deflection angle value is determined by software lookup table. In order to reduce the influence of factors such as mechanical displacement and cable resistance, in actual operation, the deflection angle is measured once as a reference when the lead fish has not entered the water. When it reaches the water surface and the bottom of the water, the water surface deflection angle and the bottom deflection angle are measured respectively. After correction, a more accurate deflection value can be obtained.

  1.1.4 Acquisition of flow velocity signal

  The flow velocity is measured by the velocity meter. When measuring the flow velocity, relays J1 and J2 are connected to the normally open contacts and a voltage of -5 V is applied to the underwater plate. K1 is the internal switch of the velocity meter. K1 is turned on and off once for each rotation of the velocity meter. When K1 is disconnected, the voltage of ADCIN0 port is about 1.5 V. After K1 is connected, the voltage change of ADCIN0 port is greater than 0.5 V. As long as the voltage difference of IN0 port is monitored, the rotation of the velocity meter can be judged. In actual measurement, the voltage difference of IN0 port is related to the distance of the vertical line of the measuring point and the water quality. The greater the distance, the smaller the voltage difference. In a river channel of 150 m, the voltage difference of the velocity signal is greater than 0.5 V. Using ADC0809 to monitor the velocity signal, when VREF=5V, the resolution is 0.02 V, which is enough to distinguish the rotation of the velocity meter. Considering some uncertain interference factors, the resolution of the voltage difference is set at 0.1 V, which can meet the test requirements of general medium and small rivers. For wider rivers, the voltage difference can be increased by improving the circuit or increasing the working voltage. Interface information composed of PC communication interface, etc., such as:

  (1) Travel signals such as water depth and horizontal distance;

  (2) Water level signal;

  (3) The output control signal is used to control the motor to rotate forward, reverse, or stop, so that the lead fish can move as required to perform fixed-point measurement.

  The interface circuit is shown in Figure 1. The circuit makes full use of the ADC0809 multi-channel analog-to-digital converter to convert complex interface information into digital signals. At the same time, the photoelectric gate is used to convert the working rope stroke (water depth and horizontal distance movement) into an electrical pulse signal, which is sent to the ATMEL89 single-chip microcomputer for processing, display, and control to complete the automatic test.

  1.2 Interface circuit for obtaining travel signal

  The travel signal of the lead fish includes the travel signal of the horizontal reciprocating movement of the lead fish, and the water depth signal of the vertical movement of the lead fish when measuring the water depth. The acquisition of the displacement signal is shown in Figure 4. It is obtained by the light-cutting plate and the photoelectric gate installed on the mechanical transmission device. The design is that the light-cutting plate blocks the light once every 1 cm movement of the cable, and the photoelectric gate generates a pulse. The water depth and reciprocating signals are taken out from the photodiodes D3 and D4 respectively, and added to the external interrupt 0 input terminal of the microcontroller P3.2 after passing through the XOR gate. An interrupt is generated every time the lead fish moves 1 cm. The interrupt service program can distinguish whether the lead fish is moving horizontally and vertically at this time, and only one of the two is selected.   1.3 Other circuit parts


  The input function of the P1 port is to read the operation command and initialization value from the control panel, and the output function is to output the control signal. One is to control the forward, reverse and stop of the stroke motor to make the lead fish move vertically and horizontally according to the test requirements; the other is to control the closing and opening of relays J1 and J2 during the water depth measurement to obtain the water surface and bottom signals. The display and printing circuit part uses 6 LED tubes for display and a micro printer for simple printing. The P3.1 serial port is connected to the PC to transfer and further process, display and print data.

  2 System software flow chart

  The software of this system occupies about 7 kB, and the system program flow chart is shown in Figure 5.   The program is divided into three modules: system management, operation processing, and test control. The system management module includes programs such as initialization, system monitoring, operation switching, and emergency processing. The operation processing module includes programs such as data calculation, error correction, and display printing. The test control module is composed of many subroutines including: distance from the vertical line to the starting point, water depth of the vertical line, flow velocity of the vertical line, water level of the vertical line, and interface data acquisition. In   order to minimize the measurement error and ensure that the measurement accuracy strictly meets the requirements of hydrological regulations, a secondary entry operation is used in the vertical line water depth subroutine. The program flow is shown in Figure 6.   In actual water depth measurement, the movement of the lead fish will cause the cable to fluctuate and cause measurement errors. The operation we set in the program is: when the lead fish enters the water, it will pause on the water surface for 10 s without counting the water depth. After it stabilizes, it will rise 20 cm above the water surface and then enter the water surface for the second time. After the lead fish reaches the water surface for the second time, the water depth counting is started and the descent is stopped to measure the water surface deviation angle θA. The lead fish continues to descend until it reaches the river bottom, the water depth counting is stopped, and the water bottom deviation angle θB is measured. Finally, the actual water depth value of the vertical line is calculated based on the dry rope length (the height from the water surface), the wet rope length (initial water depth), θA, and θB.





  3 Conclusion

  The ATMEL89 single-chip hydrological cableway test system has strong compatibility and is suitable for automatic or semi-automatic testing of medium and small rivers. It is easy to operate and has stable performance. The test accuracy meets the requirements of the "Specifications" issued by the ministry, effectively reducing the operator's labor intensity and working time.

Keywords:AT89S8252 Reference address:Design of Hydrological Cableway Test System Based on AT89S8252 Single Chip Microcomputer

Previous article:Design of anti-collision car system based on AT89S52
Next article:Multi-channel telephone recording system based on USB line

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号