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

Publisher:颐真阁Latest update time:2009-09-16 Keywords:USB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

In the wire rope flaw detection, 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 of its technology and its wide application, how to use single-chip microcomputer control to complete the mobile storage process has become a hot topic in the field of industrial control.

2 Introduction to USB Functional Module

2.1 Module Overview

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

MemMaster is the host device in the USB system and has a RootHUB that 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 they can be processed in the PC when needed.

After being integrated into the user system, the 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 reads responses and corresponding data from the specified area to obtain the services provided by the MemMaster module. In this way, both parties realize protocol interaction.

2.2 Hardware Configuration

MemMaster supports the 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 devices). The INTR pin is used as the interrupt signal from the RAM to the microcontroller, BUSYR is used as the working signal of the RAM, SEMR is used as the synchronization signal, CER is used as the chip select signal, and other pins are not described in detail here. 2.3 The interface uses MemMaster to connect directly to the user's microcontroller system through the bus through the dual-port RAM. Therefore, as far as the user's microcontroller system is concerned, MemMaster appears as an external RAM, and some areas in the RAM cannot be used, some areas are used for the interaction of protocol commands and data, 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 the area available to the user system;

The two bytes 0xFFFE-0xFFFF are used as system protocol interaction indicators 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

[page]

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 trickle current. Its I/O pins are used as data input and output, as reset signal input, and SCLK as clock signal input.

The MCU used is Winbond's W78E58B[5], which is an 8-bit MCU with 32KB Flash/EEPROM. Its pin functions are fully compatible with the 8051 series MCUs. 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]:

[page]

#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 the file exists*/

{

CreateFileCmdPkg*crCmdPkg;

/*CreateFileCmdPkg is to create a command package, including the various attributes of the creation command*/

crCmdPkg=(CreateFileCmdPkg*)Command;

MemSet((char*)crCmdPkg,0,64);

MemSet(crCmdPkg->FileName,0x20,8);

crCmdPkg->CommandCode=SYS_CREATE_FILE;

/*SYS_CREATE_FILE is the creation 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 name*/

crCmdPkg->FileAttr=0x20;

crCmdPkg->CreateTime[0]=min;

crCmdPkg->CreateTime[1]=hour;

/*CreateTime is the creation time*/

[page]

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 the dual-port RAM receives the 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.

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, dynamically detect whether there are files with the same name in the mobile storage, 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 a real-time alarm for broken wires, which facilitates real-time processing.

The device applies the USB standard to the wire rope detection system, adapts to the development trend of computers, has the advantages of easy portability, fast operation, low cost, large storage capacity, etc., has good effects and broad application prospects.

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

Previous article:Excellent design of anti-theft alarm - "Walnut-shaped prevention plan"
Next article:Analysis and application of information fusion technology in fire alarm system

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

Tsinghua Unigroup builds DRAM plant to accelerate memory layout, causing concern among Taiwanese manufacturers
On August 27, Tsinghua Unigroup announced that it would invest in a factory dedicated to the manufacture of 12-inch DRAM memory chips. The factory will start construction at the end of this year and is expected to be completed and put into production in 2021. A researcher at the China Institute of Taiwan Studies said
[Mobile phone portable]
Application of Virtual Instrument in USB Interface Data Processing System
  Virtual instrument technology has been rapidly and widely promoted and applied in the field of computer measurement and control, from simple instrument control and data acquisition to cutting-edge measurement and control and industrial automation; from university laboratories to industrial sites; from exploratory res
[Test Measurement]
Application of Virtual Instrument in USB Interface Data Processing System
Study summary on S3C2440 (I) -- memory allocation and startup method
ARM is a more powerful single-chip microcomputer. In the process of learning bare metal programming, I found that ARM integrates more peripherals than general single-chip microcomputers, including more GPIOs and more registers. The relevant pins are controlled by setting and enabling registers, thereby controlling r
[Microcontroller]
51 MCU memory expansion: jump from on-chip ROM to off-chip ROM
A year ago, I wanted to write an OS for 51 by myself. I selected Large mode for compilation. The whole process ran well during debugging, but I couldn't get the expected effect after burning it to the chip. Later, I found out from a book that there is only 4K ROM on the 51 microcontroller. If there is no external ROM
[Microcontroller]
51 MCU memory expansion: jump from on-chip ROM to off-chip ROM
Software and hardware design of USB communication system based on CH372 chip
USB communication technology is widely used due to its features of easy to use, hot plug, fast speed and low power consumption. Based on this, this paper proposes a USB communication technology based on CH372 chip, which can realize USB communication between microcontroller and computer. 1 CH372 Introduction
[Microcontroller]
STM32 USB clock configuration
1. First, configure the system clock as follows: RCC_DeInit(); //Reset the peripheral RCC register to the default value     /* Enable HSE */     RCC_HSEConfig(RCC_HSE_ON); //Set external high speed crystal oscillator (HSE)     /* Wait till HSE is ready */     HSEStartUpStatus = RCC_WaitForHSEStartUp(); //Wait f
[Microcontroller]
Infineon Technologies Expands Radiation-Tolerant Memory Portfolio with Industry’s First Space-Qualified Parallel Interface 1 Mb and 2 Mb F-RAMs
Space applications are an important area for Infineon Technologies AG. Infineon's products are used in satellites, Mars rover instruments, space telescopes, etc., and these applications must have excellent reliability even under extremely harsh conditions. Infineon, a global semiconductor leader in power sy
[Embedded]
Infineon Technologies Expands Radiation-Tolerant Memory Portfolio with Industry’s First Space-Qualified Parallel Interface 1 Mb and 2 Mb F-RAMs
PIC microcontroller introduction_PICC pointer to RAM
question: Put the largest number among 30h, 31h, and 32h into 40h. Programming with pointers to RAM is as follows:   span style="font-size:18px;" #include pic.h static volatile unsigned char add1 @0x30; static volatile unsigned char add2 @0x31; static volatile unsigned char add3 @0x32; static volatile unsigned c
[Microcontroller]
Latest Security Electronics 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号