0 IntroductionUniversal material testing machine is one of the basic equipment to determine the mechanical properties of materials. It is mainly used to test the tensile, compression, bending and shear mechanical properties of metals, rubber, plastics, ceramics and cement. It can complete the testing of strength, plasticity, elasticity and toughness of materials. With the deepening of internationalization, the development of material testing machines at home and abroad mainly presents the characteristics of computerization, comprehensive data processing, accurate control and comprehensiveness.
At present, the development of measurement and control system of universal material testing machine has a certain complexity. It is necessary to integrate multiple functions such as data acquisition, processing, man-machine interface, serial communication and so on in as small a space as possible. Because of the single function of traditional single chip microcomputer, it often can not meet the requirements, or even if it can be realized, it also needs to use a large number of MCU to work together. It will encounter great difficulties in signal connection, programming and reducing volume. It is difficult to develop, maintain and expand the front and rear system directly on the bare metal, and such a system is essentially a program super cycle, which can not guarantee the real-time requirements of the measurement and control system.
The measurement and control system of universal material testing machine not only requires the system to respond to random external events in time and deal with them quickly, but also needs to execute multiple tasks at the same time and respond to each task in real time. If the embedded system technology is used, the single-chip embedded CPU can be used to integrate multiple functions and gradually solve the existing problems.Based on this background, this paper proposes a real-time operating system based on SEP3203 processor Implementation of measurement and control system of high precision universal material testing machine based on C / OS - .1 system working principle
The testing machine uses the controller to control the motor operation through the AC servo unit, and then decelerate through the precision reducer. Through the reverse backlash travel nut, the motor drives the double screw lead screw pair to drive the moving beam to move up and down, so as to realize the loading process of the sample and complete the tensile, compression and other mechanical property tests of the sample. Its working principle is shown in Figure 1. During tensile test or other tests, the bridge produces a weak unbalanced voltage output due to the imbalance between the load sensor of the testing machine and the sample. The voltage is linearly proportional to the magnitude of the force in a certain range. However, the deformation caused by load is obtained by electronic extensometer. The small signals output by the load sensor and the electronic extensometer are amplified and processed by the measuring unit and sent to the data acquisition input of the controller for data processing to obtain the force and deformation values, and draw the characteristic curves such as output and deformation. In addition, the displacement of the moving beam is obtained by digital measurement of the photoelectric encoder installed on the motor shaft.
2 hardware design of measurement and control systemAccording to the functional requirements and working principle of the testing machine, the hardware architecture of the system is shown in Figure 2.2.1 core board and power module
The processor on the core board adopts SEP3203 of boson company of Southeast University. SEP3203 processor is embedded with ARM7TDMI processor core provided by British arm company, and embedded with 20KB on-chip zero wait static memory; Integrated LCD controller supporting black-and-white, gray and color; Support SPI protocol for connecting touch screen communication. One channel real-time clock module, 85 general I / O ports and 18 external interrupt sources.The memory part of the core board includes 8 MB SDRAM and 2 mbnor flash. The reset and wakeup function pins used in the core board are introduced through the expansion socket; The 22 bit address line, 32-bit data line and unused control signals are extended to the motherboard through the expansion socket.The system requires multi-channel power supply. For example, the arm core board needs 3.3V and 5V power supplies; In the peripheral components of the system, the LCD control module needs 5 V power supply; The A / D conversion module needs 6 V power supply at the same time; The servo driver needs 12 V power supply, so the input power supply should be designed for voltage stabilization and shunt.
2.2 peripheral general interface module
The peripheral general interface module of the tester controller mainly includes general I / O port, USB interface, JTAG debugging port, etc. In the testing machine system, the controller not only needs to communicate with the upper and lower layers, but also involves the data acquisition of sensor measurement parameters and the output of servo control signal. At the same time, the switching value is also one of the simplest and frequently used signals in the measurement and control field, such as the limit switch of the test motorized beam, the LCD control and the on and off of the indicator light. The general I / O port of SEP3203 is used to realize the input / output of these signals.
SEP3203 provides 85 general I / O ports and 18 external interrupt sources without expanding I / O ports. When using the port function, first define the pin function mode in the program, that is, each port is configured as input mode, output mode or interrupt function mode. Each multiplexed pin has corresponding register bits to select the actual function mode. In this design, the I / O channel uses a bidirectional buffer device 74lvch162245a to enhance the bus driving ability.In addition, two USB interfaces are added to the system for output of test results or as standby interfaces.2.3 signal acquisition module
The signal acquisition module includes multi-channel force value acquisition module and multi-channel deformation signal acquisition module.
Force and deformation are the main signals collected by the system. The voltage signal of the sensor is input into the analog-to-digital converter CS5530. The differential input of CS5530 can directly measure the millivolt signal from the sensor, which simplifies the connection with the peripheral circuit. The programmable gain amplifier can set the magnification from 1 to 32, which greatly improves the dynamic characteristics of the system. Multistage program-controlled digital filter can select the data output rate in the range of 7.5 Hz 3.84 kHz, which facilitates the connection with peripherals. In addition, CS5530 has a complete self-tuning system, which can carry out self calibration and system calibration, so as to eliminate the zero gain and drift error of a / D itself, as well as the offset and gain error of system channel. In addition, the working voltage is supplied by the linear voltage stabilizing element 7806 to ensure the signal acquisition accuracy.
2.4 human computer interaction moduleIn order to make the measurement and control system of universal testing machine have better human-computer interaction interface and facilitate user debugging and operation, it needs to be equipped with display devices, such as LCD and signal light prompt. In addition, for human-computer interaction, there must be an input device, so that users can send commands to the arm main controller or input necessary control parameters. The system adopts touch screen input.
According to the actual needs of the system, the LCD module adopts 240 320 black-and-white 4-level gray display, compatible with color 7-inch 64K color TFT LCD, and the touch screen is integrated with LCD. The touch screen adopts AC97 ucb1400 working mode. The small size and low voltage (3.3 V) characteristics of ucb1400 make it an ideal choice for the new generation of PDA applications. It integrates advanced audio codec, touch screen controller and power management, and provides customized functions in a standard and immediately available product form. As the interface between LCD and arm, ucb1400 controller is used to directly drive the display of LCD control characters, Chinese characters and graphics. With the help of ucb1400, the I / O port of SEP3203 can be directly used to simulate the reading / writing and control timing of liquid crystal, so that the operation of arm on liquid crystal is actually changed into the operation of arm on liquid crystal display controller ucb1400, which simplifies the hardware connection and software programming of interface circuit.
3. Software design of measurement and control system C / OS - is a fully separable real-time operating system designed for embedded applications. It can manage 64 tasks, of which the application program left to users can have 56 tasks at most. The development process of this RTOS application software is as follows:(1) Define the function of the application software according to the system design scheme;
(2) Combined with the concurrent characteristics (or quasi concurrent characteristics) of RTOS, the functions to be realized by the application software are divided appropriately, that is, the functions of the application software are divided into several task modules according to certain principles;(3) Carefully confirm the communication and delay between tasks.stay In C / OS - , each task is an infinite cycle, which may be in the following five states: sleep state, ready state, running state, suspended state and interrupted state. The transition between task states is shown in Figure 3.
3.1 software module analysis of measurement and control system
The main functions of the system are the collection of test data (including force value and displacement value), the display of test data on LCD, the control of servo motor, human-computer interaction and data communication. Since the force value and displacement value are two key data of the testing machine system, which will directly characterize the mechanical properties of the tested parts, and have high requirements for real-time and accuracy of acquisition, it is necessary to continuously transmit the real-time force value and displacement value to the main controller in the testing process. The main controller will determine the current test state and control operation based on the obtained force value and displacement value. As shown in Figure 4 and figure 5.
According to the above, the system is divided into several task modules to assign tasks with high real-time requirements to high priority; Assign tasks with low real-time requirements to low priority. The specific division of the system tasks is shown in Table 1.In the table, the tasks of systaskstart are mainly to complete the initialization of system hardware, user configuration, graphical interface GUI and the creation of other tasks. The main test task tasktest is the core of the measurement and control system of the whole material testing machine. This task is used to realize the test logic of the material testing machine, read the values of the force sensor and displacement sensor in real time, judge the test state, execute the corresponding control operations according to different states to complete the test, and finally save the test results.3.2 human computer interaction interface design
Man machine interface is an important part of embedded system. It allows users to easily input parameters, perform operations, and present necessary information to prompt users in time. When testing materials, users need to frequently send different operation commands to the controller or change system parameters, so a friendly human-computer interaction interface is necessary. The system uses C / GUI to design man-machine interface. C / GUI is an open source GUI, which can realize windows style graphical interface. Miniaturization is its biggest feature. At the same time, it occupies very small system resources, is easy to transplant and has powerful functions; Can run in C / OS - operating system; It is written in 100% ansic and can be applied to any LCD and CPU; Coupled with its open source characteristics, it is very flexible to use.
4 ConclusionThe measurement and control system of the universal material testing machine is based on SEP3203 microprocessor and Based on C / OS - embedded real-time operating system, it has the characteristics of high precision, good real-time performance and friendly interface. Its modular design is convenient for fault finding and system transformation and upgrading in the future.