Design of wire rope flaw detection alarm system based on USB mobile storage

Publisher:buzzedyLatest update time:2009-09-09 Source: 微计算机信息Keywords:USB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

In the flaw detection of wire ropes, it is necessary to realize the data exchange from the detection sensor to the memory. USB mobile memory has the advantages of easy portability, fast operation and low cost. With the development and wide application of its technology, how to use single-chip microcomputer control to complete the mobile storage process has become a hot topic in the field of industrial control.

2USB Function Module Introduction

2.1 Module Overview

USB[1] is a polling bus, where all data transfers are initiated by the host controller. Peripherals connected to the USB share the USB bandwidth through host-scheduled and token-based protocols. Currently, most host function roles are integrated into various types of PCs (or higher-level machines). Various USB-based mobile devices, including USB mobile storage devices and digital cameras with USB interfaces, have integrated USB Slave function roles. As a result, these digital devices with USB interfaces that serve as USB Slaves cannot be used in embedded systems. The fundamental solution to this problem is to integrate the USBHost function module into the embedded system that needs to use USB devices, so that it has the ability to transmit data with USB Slave devices. The MemMaster[2] module has this function.

MemMaster is a host device in the USB system, with a RootHUB, which allows users to access USB mobile storage devices as slaves. The MemMaster module complies with the USB1.1 protocol specification, supports all USB-based mobile storage devices, and supports FAT12 and FAT16 file systems. The MemMaster module can be integrated into the user's data acquisition system through the bus in a modular manner to provide users with the ability to save the acquired data in the form of files in the mobile storage device through the module so that it can be processed in the PC when needed.

After being integrated into the user system, MemMaster behaves as an external dual-port RAM of the user system. The user system controls the operation of the MemMaster module by writing commands and corresponding data to the specified area of ​​the external RAM, and obtains the services provided by the MemMaster module by reading responses and corresponding data from the specified area. In this way, both parties realize protocol interaction.

2.2 Hardware Configuration

MemMaster supports USB1.1 standard, with a maximum write rate of 100KB/s (depending on the test environment), an input voltage of 5V, and an operating current of 100mA (excluding USB mobile storage). The INTR pin is used as an interrupt signal from RAM to the microcontroller, BUSYR is used as a working signal for RAM, SEMR is used as a synchronization signal, and CER is used as a chip select signal. Other pins are not described in detail here.

2.3 Interface Usage

MemMaster is connected to the user's MCU system directly through the bus via a dual-port RAM. Therefore, as far as the user's MCU system is concerned, MemMaster appears as an external RAM, and some areas in the RAM cannot be used, some areas are used for protocol commands and data interaction, and the remaining areas can be controlled and used by the user. In the dual-port RAM, the area allocation is as follows:

The area 0x0000-0xF8F has been occupied by the system;
0x5F80-0x5FBF, a total of 64 bytes, is used to store system commands;
0x5FC0-0x5FFF, a total of 64 bytes, is used to store system responses;
0x6000-0xDFFF, a total of 32768 bytes, is used to store the data part;
0xE000-0xFFFD is an area that can be used by the user system;
0xFFFE-0xFFFF two bytes are used as system protocol interaction instructions and cannot be used by users for data storage.

The protocol interaction commands between the user system and the MemMaster system include two types: Command and Response. Command is sent from the user system to the MemMaster system, while Response is sent in the opposite direction, from the MemMaster to the user system. The specific implementation is introduced in Section 4.

3. System Design

3.1 System Working Principle

Nowadays, the application of wire rope is becoming more and more extensive. In order to protect personal and property safety, wire rope flaw detection instruments have also developed accordingly. At present, wire rope flaw detection mostly uses PC as the receiving and storage device for detection data, but this is costly and inconvenient to carry. Here, the use of MemMaster module to store on-site detection data in mobile storage overcomes these shortcomings and improves the cost performance of the system. The working principle of the system is described as follows: When the detection sensor starts working, it outputs a pulse signal as a synchronization signal for the control circuit, and at the same time detects the three-way parameter data (analog signal) of the wire rope. When the control circuit obtains the synchronization signal, it starts the A/D conversion and obtains the conversion result. After the system processes the data, it determines whether there is a broken wire, and if so, it alarms. At the same time, the data is written into the file created in the mobile storage when the control circuit is powered on, so as to facilitate future analysis and processing.

3.2 System Configuration

Here, the A/D conversion device used is MAX186[3]. MAX186 integrates 8-channel analog switches, high-bandwidth tracking/holding circuits, 12-bit A/D converters and shift registers into a 20-pin dual in-line chip, eliminating transmission errors and improving sampling accuracy and conversion accuracy. It has a small size, fast conversion speed, high conversion accuracy, low power consumption, and is powered by a 5V single power supply or a V dual power supply. The analog input can be set by software to single or bipolar and single-ended or differential input conversion modes. Its SCLK pin is used as a clock signal input and a chip select signal input, DIN is used as a serial signal input, and DOUT is used as a serial signal output.

When the system is powered on, a receiving file needs to be created. The creation time of the file is provided by DS1302[4]. DS1302 is a high-performance, low-power real-time clock circuit with RAM launched by DALLAS Corporation of the United States. It can count the year, month, day, weekday, hour, minute, and second, and has a leap year compensation function. The operating voltage is 2.5V to 5.5V. It uses a three-wire interface to communicate synchronously with the CPU, has dual power pins for main power supply/backup power supply, and provides the ability to charge the backup power supply with a trickle current. Its I/O pins are used as data input and output, as reset signal input, and SCLK as clock signal input.
The microcontroller used is Winbond's W78E58B[5], which is an 8-bit microcontroller with 32KB Flash/EEPROM. Its pin functions are fully compatible with the 8051 series microcontrollers. The system connection diagram is shown in Figure 1.

4. Software Design

In order to make each part of the hardware circuit work in a certain order, the application program written in C51 is solidified in the program memory of the single-chip microcomputer, including the system initialization program, time parameter acquisition program, file creation program, A/D conversion program, alarm analysis program, and data writing program. The software adopts a modular design method to divide each function into independent modules. Among them, the A/D conversion program is placed in the interrupt program. The program flow chart is shown in Figure 2.

4.1 Analysis of alarm algorithm

The wire rope broken wire detection signal is an abnormal signal in a local area superimposed on the noise background. In order to be able to alarm for broken wires, it should first be separated from the detection signal. According to the real-time processing requirements of the alarm, the method for extracting the broken wire detection signal should be simple, with short computing time and small memory space. A peak-to-peak value exceeding limit method is given below.

The peak-to-peak value exceeding limit method uses the peak-to-valley difference characteristics of the local abnormal signal waveform to extract the broken wire detection signal. From the signal waveform, the detection signal is composed of a large number of local peaks and valleys, and there will be a complete peak-to-valley waveform signal in each tiny part of the detection signal. The peak-to-peak value is defined as the absolute value of the difference between the peak value and the valley value of a local peak-to-valley waveform signal. When the peak-to-peak value of a local peak-to-valley waveform signal exceeds the threshold, it is considered to be a local abnormal waveform signal. In the wire rope broken wire detection based on magnetic concentrator, the detection signal waveform is a complete local peak-to-valley waveform, which is determined by the distribution of the leakage magnetic field of the broken wire fracture. When the structure of the magnetic concentrator and the layout position of the detection element are selected, the broken wire detection signal will be a single positive peak signal, and the peak-to-peak value of the signal is much larger than the adjacent signal waveform, so it is easy to extract it using the peak-to-peak value exceeding limit method.

Suppose vn, n=0, 1, 2, 3, 4, are 5 consecutive local extreme points. In the program we judge: when ((v[1]-v[2])>3*(v[1]-v[0]))&&((v[3]-v[2])>3*(v[3]-v[4]))&&(v[0]-v[2]>26)&&(v[4]-v[2]>26), an alarm is issued.

4.2 USB data storage program design

In the interface usage, it has been introduced that the protocol interaction commands between the user system and the MemMaster system include two types: Command and Response. The following is a detailed explanation of the Command/Response message.

The Command/Response message is used to inform the other party (MemMaster or user system) that the Command or Response is ready and can be executed after the command or response to be issued by the user system or MemMaster system and the corresponding data are ready. This message is completed by writing/reading data to the 0xFFFE or 0xFFFF address of the dual-port RAM. This message is implemented through interrupts, that is, for the user system, when data is written to 0xFFFE, it notifies the MemMaster that there is a command to be executed. When the system enters the interrupt program, it means that the MemMaster has completed the command and prepared the response, and can proceed to the next step. At this time, the interrupt is cleared from 0xFFFF. The current system definition is that the value written to 0xFFFE and read from 0xFFFF is 0x01. The reference code is as follows [6]:

#defineDPRAMRInt((char*)0xFFFF)
#defineDPRAMLInt((char*)0xFFFE)
#defineSEND_SYSCMD*DPRAMLInt=0x01
voidservice_int1()interrupt0/*External interrupt 0*/
{
bRecvResp=*DPRAMRInt;
}

The following file creation function is given to illustrate how the user system and the MemMaster system implement Command message transmission (Response messages are similar).

voidCreateFile(unsignedcharnm)/*nm is used to determine whether a file exists*/
{
CreateFileCmdPkg*crCmdPkg;
/*CreateFileCmdPkg is a create command package, including various attributes of the create command*/
crCmdPkg=(CreateFileCmdPkg*)Command;
MemSet((char*)crCmdPkg,0,64);
MemSet(crCmdPkg->FileName,0x20,8);
crCmdPkg->CommandCode=SYS_CREATE_FILE;
/*SYS_CREATE_FILE is the create command code*/
crCmdPkg->FileName[0]='T';

crCmdPkg->FileName[1]='A'+nm;
/*FileName is the file name*/
crCmdPkg->ExtensionName[0]='S';
crCmdPkg->ExtensionName[1]='H';
crCmdPkg->ExtensionName[2]='J';
/*ExtensionName is the suffix*/
crCmdPkg->FileAttr=0x20;
crCmdPkg->CreateTime[0]=min;
crCmdPkg->CreateTime[1]=hour;
/*CreateTime is the creation time*/
crCmdPkg->CreateDate[0]=date;
crCmdPkg->CreateDate[1]=year;
/*CreateDate is the creation date*/
/*min, hour, date, year are calculated from the data provided by DS1302*/
crCmdPkg->Option=0x00;
bRecvResp=0;
SEND_SYSCMD;/*Send Command message*/
cs_ram=1;/*Cancel dual-port RAM chip select*/
Delayms(10);
while(!bRecvResp);/*Judge whether dual-port RAM receives message*/
cs_ram=0;/*Chip select*/
}

5 Experimental results analysis

The wire rope detection system is to magnetize the tested wire rope, detect the leakage magnetic field at the broken wire of the wire rope with sensitive elements, so as to judge whether there is broken wire, and then analyze the waveform of the leakage magnetic field through the computer and corresponding software, further judge the number of broken wires, and determine the position of the corresponding broken wire through the photoelectric encoder. In the experiment, a wire rope sample with a 24 (67) structure was selected, and a broken wire was made at the specified position. The experiment was divided into two groups, 50 times in each group, and the system was used for measurement. The experimental analysis results are shown in Table 1.

Experimental analysis results

The analysis and calculation of Table 1 (negative sign indicates missed judgment, positive sign indicates wrong judgment) show that: when no wrong judgment is required (the number of wrongly detected broken wires is 0), the quantitative judgment rate of broken wires is 95%; when one wrong judgment is allowed (the number of wrongly detected broken wires is -1, 0, 1), the quantitative judgment rate of broken wires is 100%, so it meets the working condition requirements. At the same time, the alarm system also gives a real-time alarm for broken wires.

6 Conclusion

The wire rope detection system requires a detection speed of 0~2000 data per second. This device is fully capable of this task, while ensuring the accuracy of the measurement. The device can store data in a specified format, and dynamically detect whether there are files with the same name in the mobile storage device, and automatically add files. It can achieve multiple detections without manual intervention, and is extremely convenient to use. At the same time, the alarm system can give real-time alarms for broken wires, facilitating real-time processing.
The device applies the USB standard to the wire rope detection system, adapts to the development trend of computers, and has the advantages of easy portability, quick operation, low cost, large storage capacity, etc. It has good results and broad application prospects.

Keywords:USB Reference address:Design of wire rope flaw detection alarm system based on USB mobile storage

Previous article:Application of Computer Simulation Technology in Grinding Temperature Field
Next article:Simulation Study of Hybrid Active Power Filter in Industrial Control

Recommended ReadingLatest update time:2024-11-16 20:44

A brief history of USB Type-C
In October 2019, Microsoft released the Surface Pro 7, Amazon released the Kindle Fire HD 10, and Sony also announced its latest Play Station 5; these three devices belong to PC, tablet and game console respectively, but compared with their respective previous generation products, these three devices have one thing in
[Internet of Things]
A brief history of USB Type-C
Design of portable blood pressure monitor based on MSP430 and USB bus
At present, most of the sphygmomanometers on the market are still mercury sphygmomanometers. Electronic sphygmomanometers have been widely used abroad, but they have just begun to be used in my country. The doctor must wear a stethoscope to measure each time with a mercury sphygmomanometer. The measurement process i
[Microcontroller]
Design of portable blood pressure monitor based on MSP430 and USB bus
STM32 routine USB HID bidirectional data transmission
Program Features Enumerate the STM32 USB as a HID device. STM32 uses 3 endpoints, endpoint 0 is used for enumeration, and endpoints 1 and 2 are used for sending and receiving data. The endpoint length is 64, which means that a maximum of 64 bytes of data can be transmitted at a time. STM32 obtains the data sent by
[Microcontroller]
Teledyne FLIR IIS launches new modular compact USB3 machine vision camera series
The Dragonfly S series combines Teledyne's excellent performance in USB and experience in embedded system solutions, and is suitable for life science instrumentation, factory automation and other fields. USB camera industry pioneer Teledyne FLIR IIS (formerly Point Gray Research) has launched the new Dragonfly®S U
[Industrial Control]
Teledyne FLIR IIS launches new modular compact USB3 machine vision camera series
Linux uses USB to serial port to debug ARM development board
The USB to serial port uses the PL2303 chip, and Linux 2.4 and above versions already have built-in drivers. 1. Install minicom In Ubuntu, use sudo apt-get install minicom to install it 2. Configure minicom    # minicom -s    Serial port setup      +-------------------------------------------------------------+    
[Microcontroller]
MC34063 USB charging circuit diagram
1. Production process According to the circuit schematic, design a single-sided PCB as shown below. Before soldering the circuit board, first prepare all the components in Appendix 1. Use a multimeter to test all of them to ensure that there are no problems with the components. Next, you can st
[Power Management]
MC34063 USB charging circuit diagram
USB3.0 electrical energy parameter test
    USB3.0 is a dual-bus architecture, which adds a Super Speed ​​bus to USB2.0. The signal rate of the Super Speed ​​bus reaches 5Gbps, uses 8B/10B encoding, works in full-duplex mode, and supports a maximum cable length of 3 meters. The bus architecture of USB3.0 is shown in Figure 1. Figure 1. Dual-bus architecture
[Test Measurement]
USB3.0 electrical energy parameter test
Design and implementation of infrared data transmission system based on USB2.0
1 Introduction With the development and application of test technology and wireless communication technology, test instruments are developing towards miniaturization and low power consumption. Infrared data transmission is low-cost, simple and easy to use, and is widely used in many small de
[Security Electronics]
Design and implementation of infrared data transmission system based on USB2.0
Latest Industrial Control 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号