Design and implementation of rail pressure tester based on single chip microcomputer

Publisher:码字狂人Latest update time:2010-01-11 Source: 西北工业大学动力与能源学院 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Track circuit is an important outdoor equipment for signal interlocking, which plays a role in ensuring the safety of driving and shunting operations. It can supervise and check whether there are trains running, shunting operations or vehicle occupation on the line (including station line) in a fixed section, and can show whether the rails in the section are intact. It uses the rails as conductors, and the rail seams are connected by connecting wires. One end is connected to the power supply and the other end is connected to the receiver. It works through the track current.

Whether the track circuit can work properly directly affects the safe driving of the train. Therefore, the detection of the track circuit is particularly important. At present, there are few detection equipment on the market, and they generally have shortcomings such as high power consumption, high price, and large size. To this end, this paper analyzes and studies the track circuit and designs a high-precision pressure test instrument to simulate the pressure of the train on the track, so as to verify the performance of the track circuit.

System composition and working principle

This system uses PIC16F876A microcontroller as the core, and realizes data processing and real-time control of the system through software programming. The system block diagram is shown in Figure 1, which consists of the main control MCU module, A/D sampling module, power management module, display module and sensor.

System structure diagram

Figure 1 System structure diagram

The main functions of each part of this system are: the power management is mainly responsible for detecting and boosting the battery voltage. When the voltage is lower than 3V, the system stops working and issues an undervoltage alarm. The main control MCU is responsible for mathematical calculations of the collected pressure signal, converting the voltage signal into a pressure value, displaying it on the digital tube, and can perform manual zero adjustment and full-scale adjustment. The system accuracy requirement is ±0.1kN; over-range alarm and sensor disconnection alarm can be performed. In order to achieve the purpose of low power consumption, sleep and shutdown functions are implemented in the software.

System hardware design

1. Power management circuit design

The power management mainly boosts and stabilizes the battery voltage, and can also perform overvoltage protection and low voltage alarm functions. The boost circuit is composed of the TPS60230 chip, which is a new type of charge pump DC/DC converter produced by TI . Its application principle is shown in Figure 2. The battery voltage of 2~5.4V is connected to the TPS60230 input pin IN. In the figure, C1 and C2 are charge pump capacitors, and capacitors with small equivalent resistance are used. R1 and R2 divide the voltage to determine the low voltage alarm threshold. When it is lower than the voltage division value of R1 and R2, LBO outputs a low level. After the microcontroller finds out that there is a low level, it controls the analog switch to cut off the power supply of the subsequent circuit; the output 5V is connected to the analog switch and microcontroller behind.

Power Management Circuit

Figure 2 Power management circuit

2. Single chip microcomputer and sampling circuit design

According to the accuracy requirements, this system uses ADI's 16-bit A/D chip AD7705. The AD7705 chip integrates amplification, filtering and A/D conversion units. It is a low-cost, wide dynamic range, and high-resolution A/D conversion chip. AD7705 and the microcontroller communicate data through SPI. The connection is shown in Figure 3, where CH1 and CH2 are differential input channels, REF is the full-scale level, and the full-scale level is set by adjusting RP1. The microcontroller is the host and is connected to the AD7705 through a four-wire (CS, SCLK, DI, DO) SPI. DRDY is the data conversion completion signal, which is valid at low level and connected to the RC2 port of the microcontroller. When the microcontroller finds that the RC2 port has a low level, it starts to send a read register instruction to the AD7705 to obtain the AD value. CH1+ and CH1- are pressure signals from the pressure sensor, and CH2+ and CH2- are signals sent by the zero potentiometer.

Sampling circuit

Figure 3 Sampling circuit

3. Display and alarm circuit design

The display and alarm circuit is shown in Figure 4. The display part uses a 7-segment 4-bit digital tube display. The PORTB port is connected to the segment code of the digital tube. The RC0, RC1, RC6, and RC7 ports are driven and amplified by transistors to control the selection end of the digital tube. When the microcontroller detects a low-level signal at the RA1 port, it controls the analog switch to cut off the power supply of the subsequent circuit. At the same time, D1 and buzzer B send out an alarm signal. When the pressure exceeds the system range, D2 and the buzzer alarm. In order to distinguish between low-pressure alarms and over-range alarms, D1 and D2 use different colors, and the buzzer rings at different times in equal intervals.

Display and alarm circuit

Figure 4 Display and alarm circuit [page]

System software design

1 Sampling and data processing

①AD7705 read and write timing

AD7705 communicates with the microcontroller via four-wire SPI. Its read and write timing diagrams are shown in Figure 5 (a) and (b). During the read and write process, the high bit of the serial data comes first and the low bit comes last. DRDY is low, indicating that the A/D conversion has been completed, the data is ready, and the read and write instructions can be started. Whenever you want to read or write the AD7705, you must check whether DRDY is low.

Figure 5 AD7705 read and write timing diagram

Figure 5 AD7705 read and write timing diagram

②Registers of AD7705

The first is the communication register (communicationRegister), which selects the acquisition channel, whether the next operation is to read or write, and which register to read or write next.

The second is the setup register (SetupRegister), which determines the calibration mode, gain setting, polarity setting, and buffer mode.

The third is the clock register (CLOCKRegister), which sets the filter memory clock control bit.

The software programming idea is also written in this order, first set the communication register, then write the setting register, and finally set the clock register. After setting, as long as DRDY is detected as a low level, the clock can be started to read the converted data in the AD7705 data register.

2 Data processing algorithm ideas

Data processing mainly converts voltage signals into pressure values ​​and converts the collected data. It is known that: the sensor parameter is 10mV corresponds to 30kN, the full-scale voltage of A/D is 1.5V, the collected A/D value is K, the converted pressure is X, the A/D value corresponding to 10mV is D, and the gain is 64, then the above parameters can be calculated:

From the above parameters, we can find (1)
From the above parameters, we can find (2)

Formula (2) is the relationship between the converted pressure value and the collected A/D value.

Because the microcontroller does not support floating-point operations, in order to accurately display the results, the software is used to simulate floating-point division operations. The main idea is to define an integer variable INTD and store the result of the division in INTD. Because it is an integer variable, the result of the division only takes the integer part, for example, 5/4=1. The algorithm of simulated division is mainly based on this feature.

In the first step, if the collected value K is greater than 932, K/932 is stored in an integer variable to get the integer part.

The second step is to use K to take the modulus of 932 to get R. Obviously R is less than 932. Then Use K to get R modulo 932 get the first decimal place. Then use R×10 to take the modulus of 932 to get R1, the second decimal place The second decimal place . And so on, get the third decimal place dec3.

In the third step, if the collected value K is less than 932, proceed directly to the second step.

The fourth step is to compare with the logical zero point to obtain the theoretical pressure value, convert it into BCD and display it on the digital tube.

Software Flowchart

Figure 6 Software Flowchart

3. Programming ideas and flow chart

The system software programming adopts the state machine mechanism. After power-on, each module is initialized, including I/O port initialization, timer initialization, SPI initialization, etc. After initialization, the system enters the loop, and tasks are processed according to the task flag in the loop body. The main tasks are: undervoltage processing, data acquisition, sleep, shutdown, etc. When processing data, the value of channel 2 is collected first, and then channel 1. If the sensor is not connected, the collected value is zero or approximately zero, and the system alarm waits. If the collected value is greater than zero, it participates in the calculation. The theoretical value is calculated and displayed.

Reference address:Design and implementation of rail pressure tester based on single chip microcomputer

Previous article:Ankerui-5000 energy consumption monitoring system based on DTSF1352 electric meter
Next article:Development of high-precision data acquisition device based on dsPIC30F

Latest Test Measurement Articles
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号