1 Overview
As a remote monitoring and surveillance method, video surveillance is favored by many industries for its rich information and intuitive results. It is widely used in automatic control, product testing, security monitoring, information collection and other fields. Its basic working principle is to collect image information of the monitored object through the camera and transmit it to the corresponding terminal equipment and control equipment to realize the monitoring function. In these systems, the image quality captured by the camera is often the decisive factor in the application effect of the system, so the camera must be properly controlled according to the conditions of the shooting site.
At present, the cameras used in monitoring systems are mainly divided into two categories in terms of structure: one is an integrated camera with a built-in lens, and the other is an independent camera that requires an optional lens. The former is simple in structure and easy to use, and has a variety of control functions, allowing users to remotely control various shooting parameters (including aperture size, shutter speed, image gain, image focus, zoom, etc.) directly through related equipment. It is flexible to use, but due to the influence of its built-in lens performance, its scope of use is limited, and it is not suitable for some special environments or occasions with high shooting requirements. The latter type of camera can select a suitable camera lens according to the needs of the shooting scene to meet various shooting needs, but it is relatively difficult to control the shooting parameters of this type of camera, especially the adjustment of parameters such as aperture, focus, zoom, etc. must be achieved by controlling the lens itself, so an additional set of camera lens control circuits is required to complete this function.
Aiming at this problem, this paper discusses the control method and control circuit design of three variable camera lenses.
2 Camera Lens Control Principle
The main parameters of camera lenses include: the size of the CCD (Charge Coupled Device, i.e. the light-sensing element of the camera), focal length, aperture, focusing method and interface of the matching camera. Among them, focal length, aperture and focus are the parameters that need to be carefully adjusted during the shooting process, especially the adjustment of the aperture size is the fundamental method for the camera to adapt to changes in light. According to the adjustment method of the aperture of the camera lens, the lens is mainly divided into two categories: automatic aperture and manual aperture.
Automatic aperture lenses are divided into two types according to different driving methods: video drive and DC drive. However, both can automatically adjust the aperture size through the internal circuit of the lens according to the brightness of the camera image, so as to achieve a better shooting effect. This type of lens does not require too many external control circuits, especially video-driven automatic aperture lenses. It only needs to connect the video image analog signal generated by the camera to the lens aperture control end. Although this type of lens can automatically adjust the aperture size according to the external light conditions to achieve a better imaging effect, since its adjustment process is not open to the external controller, it is not completely applicable in some occasions that require special control by the system controller. In addition. Current high-definition industrial cameras often do not have analog output of video images, so there are some difficulties in using automatic aperture lenses.
Manual aperture lenses are divided into fixed-focus lenses, manual aperture zoom lenses and three-variable lenses. Among them, fixed-focus lenses and manual aperture lenses need to manually adjust the aperture, focus and other parameters of the lens to achieve lens adjustment, so they are less adaptable to automatic systems. The three-variable lens can adjust the aperture, zoom and focus through the internal motor of the lens, realizing full electrical control of the lens parameters, which is convenient for the automatic control system and remote monitoring to adjust the shooting parameters of the lens according to the actual application needs. To meet specific shooting requirements. This article mainly focuses on this type of lens, and takes Computar's H6Z0812M TVZOOMLENS three-variable lens as an example to discuss the design of its control circuit. The control of this lens is mainly achieved by loading +8V~+12V or -8V~12V power supply on three pairs of control signal lines. These three pairs of control signal lines correspond to the adjustment of aperture, zoom and focus parameters respectively, and the power polarity and existence time of each pair of control signals determine the direction and amount of parameter change. For example, if +12V power is input to the aperture control terminal, the aperture becomes larger, and the longer the power-on time, the larger the aperture opens. Conversely, if -12V power is input, the aperture becomes smaller. The longer the power-on time, the smaller the aperture becomes. The lens control circuit discussed in this article mainly provides control voltage signals with precise pulse width, correct polarity and appropriate amplitude for the three input terminals of the three variable lenses according to the control instructions of the system terminal or computer, so as to realize the complete control of the lens parameters by the system controller.
3. Design of three variable lens control circuit
According to the previous introduction, it can be determined that the control circuit of the three-variable lens needs three steps to complete the control function: 1) communicate with the control computer and receive control instructions; 2) analyze the content of the control instructions and generate basic control signals; 3) control the power circuit to generate the control signal required for lens control. Due to the need to complete the functions of data communication and instruction analysis, this paper selects the 51 series microcontroller 89C51 with a serial communication interface as the core to design the control circuit of the lens. The circuit corresponds to the work of the above three steps and is divided into three parts: serial communication circuit, central control circuit, and execution circuit.
3.1 Serial Communication Circuit
The serial interface of the 89C51 microcontroller uses the TTL level mode, that is, 2.4 V or more represents digital 1, and 0.45 V or less represents digital 0, while the general standard serial communication standard RS232 uses a voltage greater than +2V to represent digital 0 and a voltage less than -2V to represent digital 1. Therefore, the serial communication interface between the 89C51 and the control computer must undergo voltage conversion. The general method is to use a dedicated device (such as MAX232, etc.) to complete this conversion, but an additional set of ±12 V power supplies is required, which is not conducive to the safety of the equipment. In addition, since the circuit only needs to receive serial information, this design uses the circuit shown in Figure 1 to complete the level conversion and realize serial communication.
When RS232 transmits the digital "0", a voltage greater than +2 V appears between TXD and GND, the primary side of the photocoupler TLP521 emits light, the secondary side is turned on, and the output is low level, corresponding to TTL logic "0"; when RS232 transmits the digital "1", a voltage less than -2 V appears between TXD and GND, the primary side of the photocoupler TLP521 does not emit light, the secondary side is not turned on, and the output is high level, corresponding to TTL logic "1", thus completing the level conversion and realizing the reception of serial data. This circuit does not require an additional ±12V power supply, and can avoid direct electrical connection between the control computer and the lens control circuit, which has higher safety for field applications.
3.2 Execution Circuit Design
The hardware design of this part is mainly to realize the output of three variable lens control signals. Figure 2 shows the control circuit of the lens aperture. The control circuit of focus and zoom is exactly the same.
The double-pole double-throw relay S1 in the circuit is used to change the polarity of the power supply to achieve the selection of the direction of the control parameter change. When the S1 coil is not powered, the AB terminal outputs a +12 V voltage to control the aperture to become larger; when the S1 coil is powered, the AB terminal outputs a -12 V voltage to control the aperture to become smaller, completing the conversion of the control parameter change direction.
The control of parameter change value is achieved by controlling the existence time of driving voltage. However, the continuity of mechanical action of relay makes it difficult to achieve precise on-off time control, and its error is generally more than 10ms. Therefore, MOSFET is used as electronic switch in this circuit to achieve precise control of on-off time, with an error of less than 0.1 ms. Under normal conditions, MOSFET is cut off, there is no current at output terminals A and B, and the aperture does not move. When the aperture needs to be enlarged, S1 coil is not energized, A terminal is connected to +12 V, B terminal is grounded through MOSFET, and then 51 single-chip microcomputer sends a control signal to turn on MOSFET, output A and B terminals form a current loop, and drive the aperture to expand; when the aperture needs to be reduced, S1 coil is energized, B terminal is connected to +12 V, A terminal is grounded through MOSFET, and then 51 single-chip microcomputer sends a control signal to turn on MOSFET, output A and B terminals form a current loop, and drive the aperture to reduce. This circuit structure and working mode not only realizes precise control of action time, but also effectively avoids the sparking phenomenon caused by live switching of the circuit, improves the working life of the relay, and reduces interference.
In addition, the optocoupler OP1 in the circuit is mainly used to isolate and transform the +5 V power supply voltage of the 51 microcontroller and the +12 V drive voltage of the lens action; the transistor T1 is used to control the power supply to the relay S1 coil.
3.3 Central control circuit and software design
The central control circuit is shown in Figure 3. The control core of the lens control module is 89C51. It mainly realizes the three functions of receiving control instructions, parsing control instructions and executing control instructions. The software is written in the assembly language of the 51 series microcontroller. The main advantage of using assembly language is that it has fast execution speed, can accurately grasp the action time, and occupies less memory.
Asynchronous serial communication is used between PC and 89C51. The data bit can be up to 8 bits, which are defined as action type and action time. The first 3 bits of the data bit represent 6 action states, including aperture expansion, aperture reduction, image magnification, image reduction, focal length increase and focal length decrease. The last 5 bits of the data bit represent the action time, which can represent 32 different action times in total. According to the three functions to be implemented by the software, the program is initialized first. The two timers/counters of 89C52 are used for baud rate setting and action time timing respectively. The definition of the working modes of the two timers/counters can be completed by setting the working mode control register TMOD. Timer/counter 1 adopts working mode 2 to define the baud rate. Timer/counter 0 adopts working mode 1 for lens action time control.
Then comes the instruction processing part. The instruction is decomposed into two parts: action type and action time through the "logic and ANL" operation. The action type is screened using the comparison transfer instruction CJNE, and the pin setting is completed by assigning values to R1 and R2 in the working register group:
The pin output is performed in interrupt mode. Since changing the state of the double-pole double-throw switch under power may cause "sparking", to avoid this situation, when assigning values to R1 and R2, the double-pole double-throw relay should be changed first and then powered on. The interval between the two steps is 10ms. The action time is in steps of 10 ms. According to the pre-designed instruction protocol, the action time can be controlled in the range of 0 ms to 320 ms, which can meet the requirements of this module.
4 Conclusion
By improving and debugging the software and hardware of this circuit, the expected application effect was obtained, and the qualitative and quantitative control of the lens was realized. The control characteristic curve of the circuit is shown in Figure 4, where the horizontal axis represents the parameter change step size, in units of 10 ms; the vertical axis represents the number of drive levels required for the maximum parameter change range.
The control circuit has a simple structure, reliable control, strong environmental adaptability, and realizes complete control of shooting parameters by intelligent terminal devices. For example, the terminal can expand the aperture of the camera lens when the average brightness of the image is high, so as to make the image in the local shadow clearer. The specific control method can be customized according to actual needs.
Previous article:Design of LED Color Light Controller Based on AT89C51 Single Chip Microcomputer
Next article:Research on Dual-CPU Servo Motion Controller Based on AT89C51+DSP
Recommended ReadingLatest update time:2024-11-16 16:54
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- How to read electrical control circuit diagrams (Classic best-selling books on electronics and electrical engineering) (Zheng Fengyi)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- PyFive RISC-V ASIC Project
- ? ? The probe model above
- SOT-23-3 packaged lithium battery protection chip small current discharge undervoltage protection failure
- How do I understand this sentence for? I don’t understand the idea!
- Solution to network label error in Proteus
- Why do most MCUs operate at 5V?
- CY8CKIT-149 PSoC 4100S Review Summary
- 51 MCU falling edge trigger
- Last few hours: Seek help from power experts Vicor + Pulse load power supply design method white paper download gift
- NIOS automatic operation (paid answer)