Hardware development platform suitable for measuring and marking products

By designing an integrated hardware development platform, using the RS485 bus and a microcontroller to control the binocular camera and projection optical machine, the problem that the existing platform cannot control the hardware separately is solved, and the precise measurement and labeling function of complex industrial products is realized, which improves the Development platform flexibility and control accuracy.

CN119065289APending Publication Date: 2024-12-03NANJING CHENWEI AUTOMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411173186.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing measurement and labeling product development platform cannot control hardware equipment separately, and the development conditions are not flexible enough to meet the assembly needs of complex industrial products such as aviation industry products.

Method used

A hardware development platform was designed, including the core board of the industrial control machine, the timing synchronization board, the binocular camera and the projection optical machine. The synchronization control between devices is realized through the RS485 bus, and the data transmission is used by the MAX485 chip, and the STC89LE516 and the STC12C5A60S2 microcontroller. Instruction processing to realize distributed acquisition control system.

Benefits of technology

It realizes precise control of camera photography, optical machine projection, flash exposure, temperature environment monitoring and battery capacity acquisition, and has high flexibility and is suitable for the development of a variety of measurement and marking products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065289A_ABST
    Figure CN119065289A_ABST
Patent Text Reader

Abstract

The invention discloses a hardware development platform suitable for measuring and marking products, which is characterized by comprising an industrial personal computer core board host with a plurality of expansion interfaces, a time sequence synchronization board, a binocular camera and a projection light machine, and the time sequence synchronization board is in telecommunication connection with the industrial personal computer core board host based on an RS485 bus; an exposure signal sent by the host is received, a TTL level signal is output, and the binocular camera is triggered to photograph; and the industrial personal computer core board host is in signal connection with the acquisition binocular camera and the projection optical machine based on an Ethernet interface, acquires image data of the binocular camera, and projects an image photo generated by the host to the outside. The platform is designed and developed based on the RS485 bus, hardware equipment and software instructions of the platform can be flexibly deleted and added, the platform is suitable for all control over equipment such as multiple cameras and optical machines, and the platform is a universal measurement marking product hardware development platform and has good popularization value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of platform development, and in particular relates to a hardware development platform suitable for application of measurement and marking products. Background Art

[0002] Some industrial products, especially aviation industry products, have complex structures, numerous parts, large assembly workload, and high technical requirements for workers engaged in assembly work. Projection marking technology is an important technical approach to improve the degree of digitization and production efficiency of manual assembly. The marking-based vision-projection system uses visual sensing to identify and solve the spatial posture information of the workpiece to be marked, and then directly displays the required processing information on the outer surface of the part through projection. Especially in the assembly and manufacturing of large equipment such as aerospace, workers can obtain the required digital information with their naked eyes without the help of any equipment, and meet the requirements of multi-person collaboration and long-term work. General measurement and marking products include two major parts, one is the camera acquisition part, such as two binocular cameras installed at a certain angle. The other is the projection part, such as laser projection and optical machine. The measurement and marking system uses a binocular camera to capture the left and right views of the target object at the same time, retrieves the matching pixels in the two images through an algorithm, and then uses the position difference between the matching pixels to calculate the three-dimensional spatial information of the matching pixels according to the parallax principle, and projects the position information using projection. Therefore, the measurement and marking system consists of at least three parts in terms of hardware composition: computer (host), image acquisition and projection, and these three parts need to work in an orderly manner according to certain control logic. There is no development platform that integrates the above three parts in the prior art, and the development conditions of the existing development platform are not flexible enough and cannot control the hardware separately. Summary of the invention

[0003] In response to the above-mentioned defects, the present invention provides a hardware development platform suitable for the application of measurement and marking products. It is a hardware research and development platform and command communication system that can control functions including multiple cameras, projection optical machines, etc., and can achieve individual and accurate control of the devices in the system.

[0004] A hardware development platform suitable for measuring and marking products includes an industrial computer core board host with several expansion interfaces, a timing synchronization board, a binocular camera and a projection optical machine. The timing synchronization board is connected to the industrial computer core board host through telecommunication based on an RS485 bus, receives an exposure signal sent by the host and outputs a TTL level signal to trigger the binocular camera to take photos; the industrial computer core board host is connected to the binocular camera and the projection optical machine through telecommunication based on an Ethernet interface, collects image data from the binocular camera, and projects image photos generated by the host externally.

[0005] Preferably, each binocular camera is equipped with a flash board, and each flash board is equipped with a flash control board; at the same time, the timing synchronization board sends a flash trigger instruction to the two flash control boards, so that the flash is exposed and flashes during the photo shooting.

[0006] Preferably, the development platform also includes an auxiliary device control board, a battery and a temperature sensor. The auxiliary device control board is connected to the industrial computer core board host via telecommunication based on the RS485 bus communication protocol to collect battery power data and temperature data from the temperature sensor and upload them to the host. The auxiliary device control board is also connected to the status indicator light via telecommunication to monitor the status of the development platform in real time and display status information to the outside through the status indicator light.

[0007] Preferably, the core board host of the industrial computer is connected to the 485 interfaces on the auxiliary equipment control board and the timing synchronization board through the RS485 communication interface chip to form a main communication structure; the timing synchronization board outputs trigger signals of the binocular camera, flash control board and projection light machine, and the auxiliary equipment control board outputs acquisition signals of the battery, temperature sensor and status signal of the status indicator light to form a slave communication structure, and the development platform as a whole constitutes a distributed acquisition control system.

[0008] Preferably, a MAX485 chip is used to implement 485 communication. MAX485 is a bidirectional transceiver, including a sending module and a receiving module. The sending module converts the single-ended TTL voltage signal received by the chip into a differential CMOS voltage signal, and the differential signal is transmitted to the signal receiving end through a balanced twisted pair cable; the receiving module converts the received differential CMOS voltage signal into a single-ended TTL voltage signal to implement data reception or logic control functions.

[0009] Preferably, a 120Ω resistor is connected in parallel at both ends of the differential signal of the MAX485 chip to ensure signal quality.

[0010] Preferably, the timing synchronization board adopts the STC89LE516 chip, the auxiliary equipment control board adopts the STC12C5A60S2 chip, and the DE pin of the MAX485 chip is connected to the STC89LE516 chip and the STC12C5A60S2 chip to realize the sending and receiving function of the 485 instructions on the bus.

[0011] Preferably, the TTL triggering of the binocular camera and the flash control board is realized based on the P2.0 and P2.1 pins of the STC12C5A60S2 chip. The STC12C5A60S2 chip receives the trigger instruction sent by the industrial computer core board host, and outputs a high level from the P2.0 and P2.1 pins respectively. After the binocular camera and the flash control board receive the TTL level, the circular flash board installed in front of the binocular camera lens performs an exposure operation, and the binocular camera performs a photo operation.

[0012] Preferably, the temperature sensor adopts a DS18B20 chip, uses a single bus, and implements input and output communication based on a DQ pin; the DQ pin is connected to the P0.3 pin of the STC12C5A60S2 microcontroller, and sends out high and low levels specified by the timing.

[0013] Preferably, the indicator light is connected to the P0.5, P0.6 and P0.7 pins of the STC12C5A60S2 chip, and the industrial computer core board host sends the control instruction of the indicator light to the STC12C5A60S2 through the 485 bus. The STC12C5A60S2 chip outputs different high and low levels from the P0.5, P0.6 and P0.7 pins to change the color of the indicator light.

[0014] Preferably, the battery (11) is connected to P14 of the STC12C5A60S2 chip, and a voltage divider circuit is provided between the battery and the STC12C5A60S2 chip, the voltage divider circuit comprising three resistors R33, R34, and R35 connected in series in sequence, the P14 pin is connected between R34 and R35, and the voltage at the P14 end is expressed as: Vp14=(InputV / (R33+R34+R35))*R35, where V is the battery voltage.

[0015] The beneficial effects of the present invention are:

[0016] (1) The development platform disclosed in this application can realize a series of functions such as camera photography, optical projection, flash exposure, laser light indication, product internal temperature environment monitoring, battery power collection and working status output display by increasing the number of devices on the bus and cooperating with the lower computer;

[0017] (2) The development platform disclosed in this application is an integrated general platform that assigns different addresses to different devices and functions and integrates them in the form of a bus to form a closed-loop control system that can achieve distributed, configurable, and precise control;

[0018] (3) The development platform disclosed in the present application can conveniently add and delete the number of node devices on the bus according to the different functions of the products. It has high flexibility and is suitable for the construction and development of various measurement marking products. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below.

[0020] Figure 1 It is an overall schematic diagram of a measurement marking product according to an embodiment of the present invention;

[0021] Figure 2 is a bus connection schematic diagram of an embodiment of the present invention;

[0022] Figure 3 It is a master-slave communication structure diagram of RS485 of an embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of a 485 bus instruction format received by a single chip microcomputer according to an embodiment of the present invention;

[0024] Figure 5 It is a 485 bus instruction format sent by a single chip microcomputer end in one embodiment of the present invention;

[0025] Figure 6 is a schematic diagram of triggering a camera and a flashlight according to an embodiment of the present invention;

[0026] Figure 7 is a temperature reading flow chart of an embodiment of the present invention;

[0027] Figure 8 A battery power voltage divider circuit according to an embodiment of the present invention;

[0028] Fig. 9 is a schematic diagram of a fitting curve between battery power and decimal digital quantity according to an embodiment of the present invention;

[0029] Fig.10 1 is a schematic diagram of indicator light control according to an embodiment of the present invention.

[0030] Reference numerals:

[0031] 1- industrial computer core board host, 2- timing synchronization board, 3- auxiliary equipment control board, 4, 5- binocular camera, 6- projection optical machine, 7, 8- flash board, 9, 10- flash control board, 11- battery, 12- temperature sensor, 13- external status indicator light. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] like Figures 1 to 10As shown, taking a 3D projection system with a marking function as an example, the present invention discloses a hardware development platform suitable for the application of measurement and marking products, which can be applied not only to 3D projection systems, but also to other products that require marking functions, such as stereoscopic vision (binocular camera) and defect detection. The development platform disclosed in this embodiment has a series of functions such as camera photography, optical projection, flash exposure, laser light indication, product internal temperature environment monitoring, battery power collection and working status output display, which are realized by increasing the number of devices on the bus and cooperating with the lower computer. The development platform disclosed in this embodiment is an integrated general platform, which writes different addresses for different devices and functions, and integrates them in the form of a bus to form a closed-loop control system, realizing distributed configurable precision control. The development platform disclosed in this embodiment can conveniently add and delete the number of node devices on the bus according to the different functions of the product, has high flexibility, and is suitable for the construction and development of a variety of measurement and marking products.

[0034] The following are the descriptions of the plans:

[0035] (1) Overall layout

[0036] An overall schematic diagram suitable for measuring and marking products is as follows Figure 1 As shown. The hardware development platform of the application includes an industrial computer core board host 1, a timing synchronization board 2, an auxiliary equipment control board 3, two binocular cameras 4, 5, a projection optical machine 6, a rechargeable large-capacity battery 11, a temperature sensor (12) and an external status indicator light (13) and other equipment. The two binocular cameras 4, 5 are each equipped with a circular flash board 7, 8, and each circular flash board 7, 8 is equipped with a flash control board 9, 10.

[0037] The industrial computer core board host 1 is a core board with multiple expansion interfaces. It is the control core of the system and is responsible for collecting image data from two binocular cameras 4 and 5 through the Ethernet port, while communicating with the projection optical machine 6 to project the image photos generated by the host.

[0038] The timing synchronization board 2 uses the communication protocol of the RS485 bus to communicate with the host. After receiving the exposure signal sent by the host, the timing synchronization board 2 sends a TTL level signal to trigger the two binocular cameras 4 and 5 to take pictures. At the same time, the timing synchronization board 2 sends a flash trigger instruction to the two flash control boards 9 and 10, so that the flash boards 7 and 8 flash during exposure.

[0039] The auxiliary equipment control board 3 is responsible for collecting the power of the large-capacity rechargeable battery 11 and uploading the power data to the host, collecting the temperature data of the temperature sensor 12 and uploading it to the host, monitoring the status of the entire system in real time and displaying the status information to the outside through the status indicator light 13.

[0040] (2) Bus structure

[0041] The industrial computer core board communicates with the timing synchronization board and auxiliary equipment control board installed inside the product in the form of RS485, forming an RS485 master-slave communication structure. The bus connection diagram is shown in the figure. Figure 2 As shown, the master-slave communication structure diagram of RS485 is as follows Figure 3 shown.

[0042] The host is connected to the 485 interface on the control board through the RS485 communication interface chip. In addition to the synchronous circuit board and auxiliary equipment control board described in this application, other devices can be expanded. Up to 256 devices can be expanded to form a distributed acquisition control system. In actual design, the complexity of the equipment carried by the product can be determined. The use of this RS485 networking has the advantages of simple interface, good flexibility, and easy control. It has been widely used in precision electronic systems such as automotive electronics, smart grids, and aerospace. The maximum transmission rate of the RS485 bus can reach 10Mbps, and the rate decays less when the transmission distance becomes farther, which makes it have obvious advantages over the CAN bus under high-speed long-distance conditions.

[0043] STC89LE516 and STCXXX microcontroller chips are designed on the timing synchronization board and the auxiliary equipment control board respectively to control hardware devices such as cameras. At the same time, MAX485 is designed on the two control boards as a 485 communication chip for data interaction between different microcontrollers, building a bridge between the host and the microcontroller.

[0044] MAX485 is a bidirectional transceiver specially used for multi-node data bus, which is divided into a transmitting module and a receiving module, and the design rate is 40Mbps. The transmitting module is used to convert the single-ended TTL voltage signal received by the chip into a differential CMOS voltage signal, and the differential signal is transmitted to the signal receiving end through a balanced twisted pair (A and B); the receiving module converts the received differential CMOS voltage signal into a single-ended TTL voltage signal to realize data reception or logic control function. The selection of transmission and reception is realized by selecting the DE pin of the chip itself. In this embodiment, the DE pin is connected to the single-chip microcomputer, and the data transmission and reception function on the bus is realized by programming the single-chip microcomputer. MAX485 not only realizes half-duplex communication of data, but also its integrated power isolation function can effectively ensure that the signal transmitted on the bus is not interfered by the external complex voltage environment. In order to meet the long-line transmission and improve the stability of data transmission in harsh environments, a 120Ω resistor is connected in parallel to the differential signal (A and B) end to ensure signal quality.

[0045] (3) Synchronous and auxiliary circuit control board

[0046] Due to the difference in functions, STC89LE516 and STC12C5A60S2 core microprocessor chips are designed on the synchronization and auxiliary circuit control boards to control the equipment. STC89LE516AD is a high-performance single-chip microcomputer produced by China Hongjing Technology. The instruction code is fully compatible with the 8051 single-chip microcomputer. It can arbitrarily select 12 clocks / cycle or 6 clocks / cycle. It has the advantages of high speed, low power consumption, and super strong anti-interference. In the actual design, this single-chip microcomputer is used to write a program to realize the reception and transmission of 485 instructions, and to send synchronous trigger signals for two cameras and flash lights.

[0047] The auxiliary circuit control board uses the STC12C5A60S2 chip, which is a single clock / machine cycle (1T) single-chip microcomputer chip produced by Hongjing Technology. Unlike the STC89LE516AD, the STC12C5A60S2 has an internal integrated MAX810 dedicated reset circuit, 2-way PWM, and 8-way high-speed 10-bit A / D conversion (250K / S). Considering that the temperature acquisition and battery power acquisition in this embodiment require fast analog / digital conversion, the STC12C5A60S2 is used as the core microprocessor chip in the auxiliary circuit control board. In practice, it is also programmed to realize the reception and transmission of 485 instructions, and the precise control of other auxiliary devices such as temperature, power, and indicator lights.

[0048] (4) Communication instructions

[0049] After completing the design of each device in hardware, it is also necessary to define the address code and control code of each device in the instruction, so that each device integrated on the 485 bus has its own unique address code and control code, so as to ensure that all device actions on the 485 bus will not conflict or malfunction. This embodiment discloses a newly defined instruction system, which includes two parts: receiving and sending. The instructions are all received from the host side in a hexadecimal format and sent to the host side. The formats of the instructions for receiving and sending are as follows: Figure 4 and Figure 5 The specific instruction content is shown in Table 1.

[0050] Table 1: Measurement and marking product instruction table

[0051]

[0052]

[0053]

[0054]

[0055]

[0056] For example, if the host wants to collect the current temperature data, it needs to send the following command "AA32013B" to the RS485 bus, where the binary of the first byte "AA" is "10101010", "1" and "0" are separated, indicating a byte of communication test. The second byte "32" is the unique address code of the temperature sensor, the third byte "01" indicates that the function of collecting temperature is to be realized, and the last byte "3B" is a semicolon in ASCII, and the semicolon is used as the terminator, indicating that the instruction is sent. In this way, the microcontroller on the auxiliary circuit control board receives this instruction and parses it. First, it determines that AA is received without error, and then extracts the device code "32", indicating that the object of the operation is the temperature sensor, and then extracts "01" to read the temperature data. At this point, the microcontroller will start a series of temperature reading programs.

[0057] (5) Camera and flash trigger

[0058] The binocular camera system is often used in measurement and marking products. That is, two identical camera sensors are used to collect images, and the left and right images are matched with the same-name points through a stereo matching algorithm to obtain a disparity map and then obtain the depth information of the target object. The binocular camera used in this embodiment has an external trigger function, that is, the camera can be externally triggered to expose by sending a low to high level to the camera. In this embodiment, STC12C5A60S2 is used as a single-chip microcomputer to receive instructions from the host. The trigger diagram of the camera and flash is shown in the figure. Figure 6 As shown, a group of binocular cameras and flash control boards are connected to the P2.0 pin of the STC12C5A60S2 chip, and a group of binocular cameras and flash control boards are connected to the P2.1 pin of the STC12C5A60S2 chip. As shown in Table 1, an exposure instruction is AA22013B. First, determine whether the address is AA through programming, and then continue to determine whether the next byte is 22. If it is 22, it means that the operation object is the camera and the flash. Next, continue to determine whether the next byte is 01. If so, a high level of 20ms is sent from the two pins P2.0 and P2.1 of the microcontroller to trigger the camera. At the same time, the flash is also triggered by the TTL level. After receiving the TTL level, the flash installed in front of the camera lens performs an exposure operation.

[0059] (6) Temperature collection

[0060] A temperature sensor is installed in the measuring and marking product to detect the temperature inside the product, infer whether the product has thermal deformation, and then determine whether the internal optical path needs to be corrected.

[0061] The temperature sensor used in this embodiment is DS18B20. DS18B20 sensor is a single bus temperature sensor. The unique bus interface only needs one pin to communicate, and only occupies one I / O port of the single chip. In addition, it does not need to build peripheral circuits. The power supply range is: 3.0V~5.5V, the temperature range that can be collected is: -55℃~+125℃, and the collection accuracy is ±0.5℃ (-10℃~+85℃). In terms of packaging, DS18B20 is a stainless steel packaged sensor probe. Each pin in the sensor chip inside the probe is wrapped separately with heat shrink tubing to separate it from other pins to prevent short circuits caused by short circuits. At the same time, the stainless steel package can be waterproof, moisture-proof and rust-proof in complex working environments. In summary, the use of DS18B20 meets the system technology and assembly design requirements.

[0062] Because there are only three pins, two power pins, ground and a digital input and output DQ pin. DS18B20 uses single bus technology, and all control signals operate on the input and output DQ pins, so the timing requirements are very strict. In this embodiment, the input and output DQ pins of DS18B20 are controlled by P0.3 of the STC12C5A60S2 microcontroller, which sends out high and low levels specified by the timing. According to the DS18B20 temperature sensor communication protocol, it must go through three steps to control it to complete a temperature conversion measurement, namely initialization, ROM operation instructions and memory RAM operation instructions. It needs to be reset before each reading and writing. The commonly used ROM operation instructions and memory RAM operation instruction tables are shown in Table 2:

[0063] Table 2: DS18B20 operation instruction table

[0064] Function Code Read ROM 0x33 Skip ROM 0xCC Read RAM 0xBE Temperature Conversion 0x44 Write RAM 0x4E

[0065] DS18B20 initialization and temperature reading and writing timing Figure 7 shown.

[0066] After the circuit board is powered on, the initialization program of the temperature sensor is executed first. During the initialization program, the P0.3 pin of the microcontroller first outputs a low level greater than 480 microseconds, and then delays slightly, 15 microseconds to 60 microseconds, and then reads the P0.3 pin for about 5 milliseconds. If the DS18B20 is ready to communicate with the microcontroller, it returns a 60-240 microsecond pulse. If there is still no such pulse in 5 milliseconds, it is considered that the initialization has failed and needs to be initialized again. If there is such a pulse, it means that the sensor has been initialized successfully.

[0067] Then write the instruction code 0XCC to DS18B20, skip the ROM operation command, and then write 0X44 to start DS18B20 and start temperature conversion. Delay for a while, initialize DS18B20 again, write the 0XCC instruction, skip the ROM operation instruction, write the 0XBE instruction, and read the temperature conversion value of DS18B20, because the conversion data of DS18B20 starts from the lowest bit, read the lower eight bits first and then read the upper eight bits, and judge whether it is "1" for each bit read. If it is "1", first OR it with 0X80, and then shift it left by one bit. If it is "0", directly shift it left by one bit. After shifting left eight times, assign a character variable, and then shift it left 8 times to assign another character variable. Finally, shift the upper 8-bit character variable left by 8 bits and OR it with the lower 8-bit character variable, and assign it to an integer variable. The integer variable is the final temperature conversion value of DS18B20.

[0068] After getting the final temperature result, add the AA communication code and address number 33 before the result in the program, divide the temperature result into high 8 bits and low 8 bits and add them after the address code, and finally add 3B, such as AA33XXYY3B. Then send this string of 5 bytes of data in hexadecimal form to the RS485 bus as the return of the temperature acquisition instruction AA32013B.

[0069] (7) Battery power collection

[0070] This embodiment uses a power supply battery pack to power the system. The rated output voltage of the battery pack is 12V. As the system consumes power, the voltage of the battery pack will decrease. When it decreases to 9V, the system is considered to be in a low-power state. At this time, the buzzer of the hardware circuit starts to work, and a sound alarm is issued to the outside to remind the user that the current power is low and needs to be charged. In this process, the STC12C5A60S2 microcontroller needs to realize the analog-to-digital conversion function.

[0071] Obtaining the power value is actually divided into three steps:

[0072] Step 1: 12V to 5V conversion

[0073] STC12C5A60S2 cannot detect 12V voltage directly, because the highest input voltage of the microcontroller is 5V, so it is necessary to map the external input voltage to the input pin of the microcontroller, that is, the external 12V corresponds to the pin 5V, and the external 0V corresponds to the pin 0V. It can be seen that the external input voltage and the input pin of the microcontroller need a linear calculation. For this reason, a voltage divider circuit is designed externally to achieve this function. The voltage divider circuit is as follows Figure 8 As shown:

[0074] According to the voltage division principle, the voltage Vp14 at the P14 end = (InputV / (5+2+5))*5 (1)

[0075] When the input InputV is 12V (when the rechargeable battery is fully charged), the voltage Vp14 obtained by the P14 microcontroller pin is substituted into the above formula (1) to be exactly 5V, which does not exceed the maximum level input range of the microcontroller pin. And when the 12V input voltage decreases, Vp14 also changes linearly. This calculation is very beneficial to the calculation and calibration of the input voltage.

[0076] Step 2: ADC digital-to-analog conversion

[0077] Since the voltage range of the microcontroller input pin is 0V~5V, assuming that the highest 12V of the external battery corresponds to the 5V input of the microcontroller, and the 0V of the battery corresponds to the 0V input of the microcontroller, first write the microcontroller 0V~5V analog to digital conversion program. In order to realize this analog to digital conversion, we use the ADC function of STC12C5A60S2.

[0078] The ADC of STC12C5A60S2, i.e., analog-to-digital converter, consists of a multiplexer, a comparator, a successive comparison register, a 10-bit DAC, a conversion result register, and ADC_CONTR, as shown in Table 3. The ADC of STC12C5A60S2 is a successive comparison type ADC. Through the successive comparison logic, starting from the highest bit (MSB), each input voltage is sequentially compared with the output of the built-in D / A converter. After multiple comparisons, the converted digital quantity is gradually approached to the corresponding value of the input analog quantity. Through the analog multiplexer, the analog input through ADC0-7 is sent to the comparator, and the analog quantity converted by the digital-to-analog converter (DAC) is compared with the analog quantity of this input through the comparator. Starting from the highest bit (MSB), each input voltage is sequentially compared with the output of the built-in D / A converter. After multiple comparisons, the converted digital quantity is gradually approached to the corresponding value of the input analog quantity. Finally, the comparison result is saved in the successive comparator, and the conversion result is output through the successive comparison register. After the A / D conversion is completed, the A / D conversion end flag ADC_FLAG in the ADC control register ADC_CONTR is set for program query or interrupt request. In the STC12LE5A60S2 microcontroller, the operation of AD is mainly set by the register ADC_CONTR. ADC_POWER is the ADC power control bit. If it is cleared to 0, the ADC power is turned off, and if it is set to 1, the ADC power is turned on; SPEED1 and SPEED0 are ADC conversion speed control bits; ADC_FLAG is the A / D conversion end flag bit. After the A / D conversion is completed, ADC_FLAG = 1, which must be cleared by software; ADC_START is the A / D conversion start control bit. ADC_START = 1, start conversion, ADC_START = 0, stop conversion; CHS2, CHS1, CHS0 are analog input channel selection. This project uses the P14 pin, which means that CHS2, CHS1, and CHS0 must be set to 1, 0, and 0 respectively.

[0079] Table 3: ADC_CONTR register setting table

[0080]

[0081]

[0082]

[0083] The value of ADC_POWER is 0x80, the value of ADC_SPEEDLL is 0x00, the value of ch is 4; the value of ADC_START is 0x08. After such a configuration is written to the ADC_CONTR register, an analog-to-digital conversion can be started. After that, you need to wait before asking. Until the conversion is completed. The completion of the conversion is judged by the sentence while(!(ADC_CONTR&ADC_FLAG)). The idea is to use the current register ADC_CONTR and the conversion end flag ADC_FLAG for AND operation. If the register flag bit in ADC_CONTR is "0", then the value after the AND operation is 0x00 (00000000). After negation, the result is true, and the while loop is entered to wait. However, if the flag bit ADC_FLAG is "1", the value after the AND operation is 0x10 (0001

[0084] 0000), after negation, the result is false, the program jumps out of the loop, indicating that the ADC conversion is completed, and continues to execute the following closing ADC and returning the conversion result. After obtaining the ADC conversion result, it is sent to the 485 bus in the format of AA31XXYY3B for the host to obtain. In the AA31XXYY3B instruction, XX represents the high 8-bit value of the power, and YY represents the low 8-bit value of the power.

[0085] Step 3: Calculate the fitting formula for 12V input

[0086] Digitizing the battery power. The previous step is to convert 12V to 5V and then digitize the voltage within 5V. The third step is to integrate the first two steps to digitize the battery power. To this end, we adjust the 12V voltage of the battery from 12V to 10.2V. At this time, P14 of the microcontroller gradually decreases from 5V, and then starts the ADC conversion program to obtain the high 8-bit and low 8-bit data after conversion. The results after conversion are recorded as shown in Table 4.

[0087] Table 4: Correspondence between battery power, MCU input and ADC decimal conversion

[0088]

[0089]

[0090] The table records the high 8-bit and low 8-bit data after digital-to-analog conversion. After decimal conversion, the decimal value has a linear relationship with the input battery voltage. Through linear fitting, the relationship between the battery voltage and the decimal value is obtained. The fitting curve is as follows: Fig. 9 shown.

[0091] Battery voltage value y = 0.04*x-10.68 Formula (2)

[0092] Where x is the decimal value obtained after ADC conversion.

[0093] After receiving the data returned by AA31XXYY3B, the host program extracts the high 8 bits of XX and the low 8 bits of YY, and then uses the above fitting formula (2) to obtain the battery voltage value, that is, the battery power status.

[0094] (8) Indicator light

[0095] The status of the measurement and marking product needs to be displayed externally through the status indicator light installed on the outside. The main status includes normal, abnormal, task start, measurement or calibration multiple light status. This design uses a three-color (red, green, blue) three-in-one high-brightness LED to display the above status. The specific status information is shown in Table xx. The light is output externally through programming control of the pins of the STC12C5A60S2 microcontroller. The design uses the P0.5, P0.6 and P0.7 pins to control the red, green and blue colors of the three-color light. The indicator light control is as follows Fig.10 As shown,

[0096] The color of the light can be changed by simply changing the high and low states of P0.5, P0.6 and P0.7. To change the color of the light, the host needs to send the control command of the indicator light to STC12C5A60S2 through the 485 bus. The STC12C5A60S2 microcontroller program writes the parsing command of the judgment address and control word to realize the correspondence between the three colors of lights and the commands.

[0097] Through the design of the camera, flash, indicator light, battery power, temperature sensor and software instructions, a whole hardware device control platform for measurement and marking products is constructed. And because this platform is designed based on RS485 bus, its hardware devices and software instructions can be flexibly deleted and added, which is suitable for the full control of multiple cameras, optical machines and other equipment. It is a universal measurement and marking product hardware development platform, which can be widely applied to other imaging measurement products.

[0098] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A hardware development platform suitable for measuring and marking products, It is characterized in that The invention comprises an industrial computer core board host (1) with a plurality of expansion interfaces, a timing synchronization board (2), a binocular camera (4-5) and a projection optical machine (6); the timing synchronization board (2) is connected to the industrial computer core board host (1) via a telecommunication bus based on an RS485 bus, receives an exposure signal sent by the host and outputs a TTL The level signal triggers the binocular camera (4-5) to take a photo; the industrial computer core board host (1) is connected to the binocular camera (4-5) and the projection optical machine (6) based on the Ethernet interface, collects the image data of the binocular camera (4-5), and projects the image photos generated by the host externally.

2. The development platform according to claim 1, It is characterized in that The binocular cameras (4-5) are each equipped with a flash board (7-8), and each flash board (7-8) is each equipped with a flash control board (9-10); at the same time, the timing synchronization board (2) sends a flash trigger instruction to the two flash control boards (9-10), so that the flash is exposed and flashes during the photo shooting.

3. The development platform according to claim 2, It is characterized in that The development platform also includes an auxiliary device control board (3), a battery (11) and a temperature sensor (12). The auxiliary device control board (3) is connected to the industrial computer core board host (1) based on the communication protocol of the RS485 bus, collects the power data of the battery (11) and the temperature data of the temperature sensor (12) and uploads them to the host; the auxiliary device control board (3) is also connected to the status indicator light (13) to monitor the status of the development platform in real time and display the status information to the outside through the status indicator light (13).

4. The development platform according to claim 3, It is characterized in that The industrial computer core board host (1) is connected to the 485 interfaces on the auxiliary equipment control board (3) and the timing synchronization board (2) respectively through the RS485 communication interface chip, forming a main communication structure; the timing synchronization board (2) outputs trigger signals of the binocular camera (4-5), the flash control board (9-10) and the projection optical machine (6), and the auxiliary equipment control board (3) outputs acquisition signals of the battery (11), the temperature sensor (12) and the status signal of the status indicator light (13), forming a slave communication structure, and the development platform as a whole constitutes a distributed acquisition control system.

5. The development platform according to any one of claims 1 to 4, It is characterized in that The MAX485 chip is used to implement 485 communication. The MAX485 is a bidirectional transceiver, including a sending module and a receiving module. The sending module converts the single-ended TTL voltage signal received by the chip into a differential CMOS voltage signal, and the differential signal is transmitted to the signal receiving end through a balanced twisted pair cable; the receiving module converts the received differential CMOS voltage signal into a single-ended TTL voltage signal to implement data reception or logic control functions.

6. The development platform according to claim 5, It is characterized in that The timing synchronization board (2) adopts the STC89LE516 chip, the auxiliary equipment control board (3) adopts the STC12C5A60S2 chip, and the DE pin of the MAX485 chip is connected to the STC89LE516 chip and the STC12C5A60S2 chip to realize the sending and receiving function of the 485 instructions on the bus.

7. The development platform according to claim 6, It is characterized in that The binocular camera (4-5) and the corresponding flash control board (9-10) are connected to the P2.0 / P2.1 pins of the STC12C5A60S2 chip. The STC12C5A60S2 chip receives a trigger instruction sent by the industrial computer core board host (1) and outputs a high level from the P2.0 / P2.1 pins. After the binocular camera (4-5) and the flash control board (9-10) receive the TTL level, the circular flash board (7-8) installed in front of the lens of the binocular camera (4-5) performs an exposure, and the binocular camera (4-5) takes a picture.

8. The development platform according to claim 6, It is characterized in that The temperature sensor (12) adopts a DS18B20 chip, uses a single bus, and realizes input and output communication based on a DQ pin; the DQ pin is connected to the P0.3 pin of the STC12C5A60S2 single-chip computer and sends out high and low levels specified by the timing.

9. The development platform according to claim 6, It is characterized in that The indicator light (13) is connected to the P0.5, P0.6 and P0.7 pins of the STC12C5A60S2 chip. The industrial computer core board host (1) sends a control instruction of the indicator light to the STC12C5A60S2 chip through the 485 bus. The STC12C5A60S2 chip outputs different high and low levels from the P0.5, P0.6 and P0.7 pins to change the color of the indicator light.

10. The development platform according to claim 6, It is characterized in that The battery (11) is connected to P14 of the STC12C5A60S2 chip, and a voltage divider circuit is provided between the battery and the STC12C5A60S2 chip. The voltage divider circuit includes three resistors R33, R34, and R35 connected in series in sequence. The P14 pin is connected between R34 and R35. The voltage at the P14 end is expressed as: Vp14=(InputV / (R33+R34+R35))*R35, where V is the battery voltage.