Servo valve temperature zero drift measurement and control system based on C8051F020

Publisher:andyliow1980Latest update time:2010-01-22 Source: 单片机与嵌入式系统 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The automatic measurement and control system with high-performance single-chip C8051F020 as the core control chip can automatically measure temperature, automatically output linear current at the temperature measurement point, automatically collect load pressure, etc., and calculate, display and print test data. Its reliability, accuracy and efficiency are greatly improved.

1 System design

When the system enters the temperature zero drift test state, it is controlled by the embedded microcomputer. The temperature rise signal drives the 11 kW-class heating tubes in the oil tank to quickly heat up through the photoelectric isolation control solid relay group. When it reaches a certain temperature measurement point, the analog triangle wave periodic signal after D/A conversion is automatically output and added to the winding of the servo valve to drive the servo valve to work, so that the pressure values ​​of the two load chambers of the valve change differentially with the control current. The pressure change acts on the pressure transmitter, and the A/D continuously samples and compares. When the difference is the smallest (two minimum values ​​appear in one cycle), the computer calculates the corresponding current zero bias value added to the servo valve. When the cycle reaches the highest temperature, the heater is automatically turned off, and the solenoid valve is controlled to open the water cooling radiator to cool down, and then the above test process is repeated until the temperature drops back to the starting temperature point, and the test ends. During this period, the computer displays and prints the temperature of the current temperature point and the required data in real time. The control system block diagram is shown in Figure 1.

Control system block diagram

2 Hardware Composition

C8051F020 is a fully integrated mixed signal system-level MCU chip (SoC), which integrates almost all analog and digital peripherals and other functional components required to form a single-chip data acquisition or control system. These peripherals or functional components include: analog multiplexer, ADC, programmable gain amplifier, DAC, voltage comparator, voltage reference, temperature sensor, timer, internal oscillator, RAM, Flash memory, watchdog, etc. It processes instructions in a "pipeline" structure, with high operating efficiency, and most of them only need 1 or 2 system clocks. This greatly simplifies the hardware design, and it is very convenient to expand the corresponding conditioning circuit on its periphery to form the entire hardware system. In the D/A conversion channel circuit, the internal voltage reference VREF from F020 is buffered and amplified by U1 and used as the reference voltage of the negative terminal of U2. The positive terminal of U3 is connected to the DA single-stage output of F020, and becomes a 0~±5V output signal after being processed by a first-order low-pass filter and buffer amplification. Due to the existence of the offset circuit, a -5mA instantaneous current will be generated before the chip D/A port is initialized or reset, which will have an adverse impact on the servo valve. To avoid this, an I/O is used to control an OM-RON high-response relay (about 1 ms) after photoelectric isolation, and the connection with the servo valve is connected and disconnected according to the instruction, as shown in Figure 2.

D/A conversion channel circuit

In the A/D acquisition channel circuit, the analog input signal is output after passing through a first-order low-pass filter and buffering inversion. As shown in Figure 3, there are three identical circuits that are switched by internal analog switches.

A/D acquisition channel circuit

8-bit LED display, 5 soft keyboard inputs, using a dedicated CH452 digital tube display driver and keyboard scan control chip, its peripheral circuit is extremely simple, the interface speed is fast, the performance is stable, and it uses a 4-wire serial interface with the C8051F020 controller. It mainly uses its hardware to realize most of its functions, and programming is relatively simple, as shown in Figure 4.

keyboard

The temperature control is composed of photoelectric isolation circuit, G3NA-220B solid relay and water valve relay, which are used to control the heating pipe or water cooling radiator of the oil tank to increase and decrease the temperature. The whole circuit adopts a variety of anti-interference measures, among which WS series three-port V/V voltage input and V/I current output isolation terminals are added to the input and output. The output signal of the temperature and pressure transmitter is 0~5 V. The current output is 0~±5 mA, with constant current characteristics, and the accuracy is 0.2% within the range of valve winding impedance variation.

The power supply adopts a modular integrated linear power supply with small ripple and good EMI. An embedded micro printer is used to print simple Chinese characters and data.

3 Data collection and processing

The D/A analog output of the system is Vo = 5 × (D-2 048) / 2 048, and the D value range is 0 to 4 096, that is, 0 to ±5 V output, which is converted into 0 to ±5 mA control current through V/I isolation. The accuracy of the isolation device is better than 0.3%. D/A analog conversion current resolution = analog current value / D = 5/2 048 ≈ 2.441 4μA

Due to the existence of valve hysteresis, the frequency of the triangular wave current signal added to the servo valve control winding is required to be low, and its period T=20 s. The digital values ​​that make up the periodic triangular waveform are placed in 4 096 buffers in the DA. When the DA automatic conversion is started, it is controlled by the T3 timer and interrupted once every 20/4 096=0.004 882 s to send out the waveform value in the buffer. Since a 22.118 4 MHz crystal oscillator is used as the clock source, the processing speed of C8051F020 is very fast, and it is more than enough to complete the acquisition and related filtering processing calculation in the 4.88 ms time of the program interrupt. The system simultaneously collects 1 oil temperature, 1 room temperature, and 2 pressure signals with a sampling frequency of 20 kHz. After continuous cycle acquisition, the maximum and minimum values ​​are removed and the digital average filtering method is used to filter the collected signals.

The heating and cooling cycle of the servo valve temperature zero drift test varies with the external climate and is about one hour. Because the test time at the temperature point is relatively short, that is, the actual temperature change at this point does not change much during the test time of about 20 seconds, the temperature control adopted for each temperature point is relatively simple. According to the measured external temperature and oil temperature, the program is slightly controlled before reaching a certain temperature test point, so that the control accuracy is not greater than ±2°C within 20 seconds.

4 System Software Design

This software is programmed using C51. C51 is a C language specifically used for 51 series single-chip microcomputer programming. It inherits most of the characteristics of the standard C language, but at the same time it is expanded on the specific hardware structure of the 51 series. It has the same advantages as the C language in terms of function, structure, readability, and maintainability, and the generated target code is very efficient. With the help of the integrated development environment (IDE) Keil μVision3-C51, the source program modules are initially created, edited, and connected on the PC, and then simulation debugging and emulation are completed by setting breakpoints, etc., and program errors are found and modified according to various information on the Keil μVision3 interface. Finally, the entire application system hardware that has been implemented is connected to external related signals and devices according to the design requirements, and then the generated HEX target program is downloaded to the Flash memory of the chip through the serial port adapter EC3 and the standard JTAG interface configured by C8051F020, and it is directly debugged and modified in real time on the chip in a non-intrusive manner, without occupying on-chip resources, and at full speed online until the design requirements are met.

In order to facilitate design and maintenance, a top-down and step-by-step structured module design method is adopted. All subroutines with independent functions are set as subroutine modules, and related functions are implemented by corresponding functional subroutines. The main program flow is shown in Figures 5 and 6.

Main process flow

Main process flow

① The main program mainly completes the C8051F020 system initialization, sets the system clock, adjusts the key processing and display program, and sets the ADC and DAC, etc., and calls the corresponding subroutine according to the function selected by the key.

②The calibration program is used to calibrate the system test accuracy. According to the calibration requirements, the program compares the input and output signals with the standard signals through the display on the internal LED.

③The LED display subroutine and printing subroutine mainly complete the display and printing of the input model and number, as well as the display and printing of the temperature value, zero bias current, zero drift value after data processing, and the input voltage and output current results during calibration.

④The temperature zero drift test program completes the control of heating and cooling temperature measurement. The zero drift test program is called once at each test temperature point for display and real-time printing.

⑤ The zero bias test program is the core program of this system. After calling this program, the timer continuously outputs the digital triangle waveform value of the DAC buffer at the set frequency, and starts the ADC to perform data acquisition, digital filtering, comparison, calculation, scale conversion and display, etc.

⑥The calculation formula of zero bias current is as follows:

Pressure difference Vp=VP1-VP2 Zero bias I[i]=(I1+I2)/2

Zero drift IP = (Imax-Imin) Percentage per = Ip/Ie×100%

Vp1 and Vp2 are the pressure values ​​of the two load chambers respectively; I1 is the zero-point current value when the pressure difference is the smallest when the current changes from positive to negative, and I1<0 is a negative value; I2 is the zero-point current value when the pressure difference is the smallest when the current changes from negative to positive, and I2>0 is a positive value; Imax and Imin are the maximum and minimum values ​​in the corresponding temperature zero bias array I[i]; Ie is the rated current value.

5 Conclusion

The design of the instrument is relatively simple. It has a friendly human-machine interface, is easy to operate, and has a high cost-effectiveness. Actual field applications show that the entire system runs smoothly, has reliable performance, and improves test accuracy and production efficiency. It has been successfully applied to the measurement and control of the servo valve high temperature test at Nanjing Electromechanical Hydraulic Center. With a little improvement, it can be extended to the measurement and control system of the entire servo valve performance test.

Reference address:Servo valve temperature zero drift measurement and control system based on C8051F020

Previous article:Design of intelligent integrated instrument based on low power consumption single chip microcomputer
Next article:Temperature and humidity analysis remote control door and window opening system based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 19:31

Port Configuration of C8051F020
C8051F020 introduces the concept of cross switch, that is, the pins of the microcontroller can only be configured when the cross switch is enabled. Therefore, during initialization, the cross switch must be enabled first. The official configuration tool Config2 is very convenient and recommended for everyone to use. Th
[Microcontroller]
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号