0 Introduction
With the continuous advancement of science and technology, image acquisition technology has been increasingly widely used in the world, such as military industry, medical, electronics and other fields. In China, there is also a widespread demand for industrial automation and intelligentization using image acquisition technology in various industries, and industrial field applications have gradually begun, such as drug testing and packaging in the pharmaceutical industry, printing color testing in the printing industry, surface quality testing of PCB boards, quality testing of LCD screens, etc. Therefore, with image acquisition function as the core, developing an image acquisition system that is suitable for industrial applications, fully functional, and easy to operate will bring great benefits to users.
At present, there are many and very complete solutions for image acquisition. This paper chooses to use FPGA for image acquisition and designs an image acquisition system. Different from the common image acquisition system used in industry, this system adds storage function and improves the traditional control operation method.
1 System overall design
The overall design of the system is as follows: the image is displayed on the monitor through the VGA interface, and the display rate can reach 25 f/s; the system can store the current image seen on the monitor in a bitmap format to a USB flash drive or other USB device, and can echo the stored image; the remote control is used instead of the button control method, and all functions such as exposure, gain, crosshairs, image storage and reading can be adjusted by the remote control within a few meters, which is flexible and convenient to operate. The system uses Micron's 1.3 million pixel MT9T001 as the image sensor; Altera's FPGA chip EP2C8Q208 is used to complete the control of image acquisition and display functions. When browsing images in real time, it collects black and white image data of the Bayer array from MT9T001, and then converts the collected data into 24-bit RGB data using an interpolation algorithm. Since the image acquisition speed is 40 MHz and the VGA display speed is only 25 MHz, the FPGA puts the converted data into SDRAM for buffering before sending it to the ADV7125 chip that drives the VGA display; ADV7125 is ADI's high-speed digital-to-analog conversion chip, which converts digital true color image data into analog video signals that can be transmitted using the VGA interface; Atmel's ATmega 8L chip is used to complete the decoding of the remote control, the control of reading and writing USB devices, and the creation of bitmap formats; FTDI's VNC1L-1A chip with an integrated file system is used as the interface chip for communicating with USB devices. The single-chip microcomputer plus an interface chip completes the USB Host function, eliminating the need to process the file system and saving software development time. This image acquisition system with storage function and remote control mode is applied to the industrial field and made into a product as one of the many industrial cameras. Figure 1 is its overall design block diagram.
2 Storage Module Design
There are many ways to store data at present, such as hard disk, FLASH, CD, etc. Among them, the most portable and convenient ones should be mobile hard disk, USB flash drive, SD card. These methods can transfer data through USB port (SD card or CF can transfer data through USB port with the help of corresponding card reader). It can be seen that the application of USB bus is very common. The advantages of USB bus such as plug-and-play, fast speed and self-power supply are indeed unmatched by other devices. Therefore, the storage part of the system is designed as USB device. USB devices are divided into USB host devices and USB slave devices. USB slave devices can only passively write or read data from the host device, which does not meet the requirements of this system. Therefore, the USBHost device is selected. As long as the USB slave device such as USB flash drive is plugged into the USB port of the system, the current picture to be stored can be stored in the storage device such as USB flash drive.
A typical example of a USB Host device is a PC. This host function is completed under the operating system. Therefore, most of the microcontroller chips on the market that can be transplanted with operating systems have integrated USB Host functions, such as Samsung and Philips' ARM chips, and JZ4740, a MIPS core chip developed by Ingenic. This solution with an operating system is easier to develop for experienced developers, but it requires a certain familiarization process for novices. It is unnecessary to use the operating system to complete the control of the entire system just to realize the USB Host function. This not only wastes resources, but also increases the development time of the underlying driver. Therefore, this design chooses a simpler way, using only a single-chip microcomputer and a USB interface chip to complete the USB Host function. In this way, any developer who can use a single-chip microcomputer can make a USB Host device. The interface chips for USB slave devices on the market include Philips' PDIUSBDl2 and ISPl581, but there are relatively few USB Host interface chips. After testing, the VNClL-1A chip was finally determined as the USB Host controller.
2.1 USB Host Controller
The VNClL-1A chip is the first one in the Vinculum series of FTDI to embed a USB host controller. It can not only process USB Host interface and data, but also has built-in MCU and FLASH, and also encapsulates the USB Device class. It integrates a 12-48 MHz clock multiplier, supports power-on reset function, embeds 64 KB FLASH ROM, 4 KB SRAM, has a standard USB firmware library provided by FTDI, and supports USB 2.0 full speed (12 Mb/s) and low speed (1.5 Mb/s). The 28 GPIOs can be used as general I/O and command monitoring interfaces, and have 2 pairs of USB bus interfaces, which can be programmed using serial ports or disks. When the chip is used as a master device to communicate with slave devices such as USB flash drives, it can handle FAT file systems, support FATl2, FATl6, and FAT32 formats, and the file naming method is the traditional 8.3 format, that is, the file name does not exceed 8 characters and the extension is 3 characters, such as the file name can be text.txt. When performing specific operations, you only need to send a simple command to VNClL to complete functions such as creating a new folder, creating a new file, reading a file, writing a file, opening and closing a file, etc. For example, if you want to create a hello.-txt file in a USB flash drive, you can write the characters "OPW+space+hello.txt+enter" to VNClL one by one in character mode, and you can see a hello.txt file in the USB flash drive, or send "09 20 file OD" in hexadecimal code mode, where file is the corresponding ASCII code value of each character of hello.txt. The manufacturer provides free target code on the website, and users can download different target codes according to different needs. In this design, the VDAPFUL_V3_65.ROM target code with a USB port as USBHost function is selected, and the target code is burned into the chip in serial port mode. Therefore, users do not need to care about how the internal program of VNClL is executed. They only need to care about whether it needs to complete the USB host device, slave device or other functions, and find the corresponding target code. The VNCIL chip after burning the program is equivalent to an interface chip. As long as the interface is connected correctly and the timing operation is correct, the required functions will run normally. VNC-lL has dedicated UART, SPI and parallel port pins, so any of the three interfaces can be used to control it. If you want to see the return value of the operation command, you can connect it to the PC via the serial port. After sending the corresponding command to VNClL using the serial port debugging assistant on the PC, you will see the corresponding return value.
2.2 Implementation of stored procedures
Bitmap images are widely used in computers. For example, in Windows, the text in Notepad and WordPad is represented by bitmap images. Many images stored in other formats are obtained by optimizing bitmap images, such as JPEG images. In digital image processing, many algorithms are designed for 24-bit true color bitmaps or grayscale bitmaps. Therefore, storing the acquired images in bitmap format facilitates the subsequent image processing. The storage format of the bitmap is divided into 24-bit true color format and grayscale bitmap format. The 24-bit true color format is 2/3 larger than the grayscale bitmap format, because the grayscale image uses one byte to represent one pixel, while the 24-bit true color bitmap uses three bytes to represent one pixel, so this design uses the grayscale bitmap format to store images.
When a frame of image is to be stored, ATmega8L sends a new file command to VNC1L, and a new .BMP file is created in the storage device. Then ATmega8L writes the 14 B file header, 40 B information header, and 1 024 B color index table of the bitmap into the beginning of the .BMP file. After writing, ATmega8L gives FPGA a ready signal. After receiving this signal, FPGA directly sends the image data to the .BMP file of the storage device through VNC1L. After sending a frame of image data, FPGA gives ATmega8L an end signal, and then ATmega8L executes the close current file command, and the storage of a BMP image is completed. This design hopes that all images collected by this system are stored in a separate folder in the storage device. In this way, every time a new storage device is inserted, ATmega8L must first send a query command to VNC1L to query whether there is a dedicated folder for this system in the current root directory. If not, create this folder. If yes, query whether there is already a . BMP file. If it does not exist, create a new one, and the file name starts with the number O. If it does exist, query which file name has the largest number, and then use the largest number plus one as the file name to be created. When reading an image from a storage device, ATmega8L also executes a command to query whether the folder and file exist. If both exist, read from the image with the largest file name number. The reading process is similar to the writing process, except that the commands used are different, and when reading, the image data can only be passed to the FPGA after VNC1L has read the 1078B file information of the bitmap. VNC1L communicates with FPGA and ATmega8L in a parallel port, and only 8 data lines and 4 signal lines are needed to complete the data transmission. The interface connection is shown in Figure 2.
3 Remote control function design
At present, most electronic products use switch buttons or touch control methods, such as digital cameras, mobile phones, etc., and the same is true for industrial equipment. The control method described in this article uses a wireless remote control method. This remote control method has been used in the field of televisions for many years. The technology is very mature, the principle is simple, and it is easy to implement. Since the selected remote control is suitable for infrared receivers with a carrier frequency of 36 to 40 kHz, a 36 kHz infrared receiver is selected in the design. ATmega 8L receives the signal from the infrared receiver, parses the code value of each button on the remote control, and will execute the function of the corresponding button on the remote control. There are 21 buttons designed on the remote control, representing all the functions of this system, namely:
Image storage function Press the storage key to store the currently viewed image into the storage device;
The image preview function will read out the pictures stored in the storage device and display them on the monitor. When previewing pictures, you can scroll up or down based on the current picture to cycle through all the stored pictures.
The red, green, blue gain and exposure value adjustment functions can increase and decrease these four parameters;
Double crosshair control and adjustment function: When you want the crosshair function, just press the crosshair button and you will see two crosshairs on the current real-time display. The position of the crosshairs can be moved as needed by the user. When double crosshairs are needed, both control crosshair buttons need to be pressed. Using double crosshairs can circle the key observation range on the entire screen.
Image freeze function: When the freeze key is pressed, the entire screen on the display freezes, and you cannot save, read or perform any other operations.
Current parameter value saving function: After pressing this key, the current values of the current gain, exposure, crosshair position and other parameters will be stored in the E2PROM of ATmega8L. In this way, the system will read out the parameter values saved in E2PROM one by one when the system is started next time;
Reset initial parameter value function If the user accidentally adjusts a parameter value, you can press this key to restore the system's original parameter value.
4 Conclusion
The selection and design of the storage solution in the image acquisition system described in this article can serve as a reference for the design of systems with slightly larger data volumes but not very complex. In addition, the use of remote control technology as a way to control the system operation is refreshing. This image acquisition system is applied in the industrial field, is easy to operate, affordable and novel.
Previous article:Design of role-based security access control in OA system
Next article:Mechanical CAD basics autonomous learning system based on industrial design principles
Recommended ReadingLatest update time:2024-11-17 04:50
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- An article to understand the commonly used microwave transmission lines (I)
- [Q&A] About the selection of C2000
- Summary of MCU delay methods
- EEWORLD University Hall----ADI Online Seminar Differential Circuit Design Technology in Communication Applications
- Who can teach me?
- Understanding the Q and D values of capacitors
- How to solve the problem of power-on reset confusion in single-chip microcomputers
- Threshold voltage question
- How to view ADI data sheet information sharing
- Anlu SparkRoad domestic FPGA evaluation [Problem feedback] ASUS win10 installation Anlu Jtag driver problem