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 system control 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.
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 alarms and sensor disconnection alarms 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
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. TPS60230 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 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.
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 single-chip microcomputer 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 single-chip microcomputer 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 single-chip microcomputer. When the single-chip microcomputer finds that the RC2 port has a low level, it starts to send a register read 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.
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 by transistors to amplify and 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.
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 through a four-wire SPI. Its read and write timing diagram is 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. At any time to read and write the AD7705, it is necessary to check whether DRDY is low.
Figure 5 AD7705 read and write timing diagram
②AD7705 registers
The first is the communication register, which selects the acquisition channel, whether the next operation is to read or write, and which register to read or write next time.
The second is the setup register, which determines the calibration mode, gain setting, polarity setting, and buffer mode.
The third is the clock register, which sets the filter memory clock control bit.
The software programming idea is also written in this order, first setting the communication register, then writing the setup register, and finally setting the clock register. After setting, as long as DRDY is detected to be low, 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. Given 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:
(1)
(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.
The first step is that if the collected value K is greater than 932, K/932 is stored in the 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
get the first decimal place, and then use R×10 to take the modulus of 932 to get R1, the second decimal place
, and so on, to get the third decimal place dec3.
The third step is to directly perform the second step if the collected value K is less than 932.
The fourth step is to compare with the logical zero point to get the theoretical pressure value, and perform BCD conversion to display on the digital tube.
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, it enters the system loop, and performs task processing according to the task flag in the loop body. The main tasks are: undervoltage processing, data acquisition, sleep, shutdown, etc. When processing data, first collect the value of channel 2, and then collect 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. Calculate the theoretical value for display.
Previous article:High-precision data acquisition device based on PIC16F87X series microcontroller
Next article:Design and application of programmable power supply based on PIC16F874 microcontroller
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- I've been stuck here for a long time. If I can solve this problem, I can solve the third problem.
- TE Online Classroom: Experts interpret the design trends of contemporary IoT smart antennas
- Locking and unlocking the C2000 chip
- What's going on with this KICAD failure?
- EEWORLD University Hall----On-time Atom NIOS II Video Tutorial
- 5G carrier aggregation technology is here, take a look if you are interested.
- "Recommend Chinese Chip" + STC8 series
- T12 electric soldering iron production sharing process 1
- Application Note (AN5063) LPS33HW Digital Pressure Sensor: System Integration Guide
- Practical sharing | Key technologies and solutions for 5G Internet of Vehicles