Background
With the continuous maturity of industrial control and automatic measurement technologies, more and more signal detection tends to be automated and intelligent. Oscilloscopes are common instruments used in electrical signal detection.
Many input device analog signal often need be gathered in the industry, but there is very big drawback in gathering multichannel analog signal through an AD converter, and plug interface joint that need not stop switches, and is obviously more troublesome, also can cause wearing and tearing to precision instruments or AD converter's interface in addition, reduces its life.
The single chip microcomputer is also called a single chip microcontroller, and is not a chip for completing a certain logic function, but a computer system is integrated on one chip. At present, the single chip microcomputer is widely applied to various control fields, such as intelligent instruments, medical equipment, robots and the like. Relays have a switch-like function, and are widely used in various electronic device control circuits for isolating control signals from loads. Some special outputs require that the outputs can be output only when the control signals are sent out according to a preset logic sequence, and generally, only one relay can control the gating of one signal, and the four relays are generally required to control the gating of four signals. At present, a signal control circuit is generally realized by a chip digital circuit, the circuit is complex, and the technical requirement on designers is high. And the existing oscillograph has fewer channels and cannot detect multipath signals exceeding the number of the channels at the same time. Therefore, when detecting a plurality of signals, it is common to perform signal switching and detect a signal to be measured a plurality of times.
Disclosure of Invention
In order to solve the problem, the utility model provides a relay board that multichannel signal switches detection can accomplish single or a plurality of passageway measuring signal's automatic switch-over according to the disconnection closure of a plurality of corresponding relays in the custom agreement control relay board.
The technical scheme of the utility model as follows:
a relay board for multi-channel signal switching detection comprises an MCU (microprogrammed control unit), wherein the MCU is electrically connected to a relay driving and controlling module; the MCU is also electrically connected to the main control module through the CAN communication module and is electrically connected to the PC end through the USB-to-TTL module; MCU still electric connection to switch module and storage module, the relay board of relay adopts 8 relay boards at most cascaded mode to insert same oscilloscope, and the BNC interface of relay board includes BNC interface 1 and BNC interface 2, and the cascade in-process, BNC interface 1 of relay board is connected to the oscilloscope, and BNC interface 2 of relay board is connected to the BNC interface 1 of next relay board.
Preferably, the model of the chip adopted by the MCU is STM32F407VGT 6.
Preferably, the PC terminal is electrically connected to the USB to TTL module through a USB cable, and the USB to TTL module is electrically connected to the UART1 pin of the MCU through the UART _ TX and the UART _ RX.
Preferably, the main control module is electrically connected with the CAN communication module through twisted pairs of CAN _ H and CAN _ L, and the CAN communication module is electrically connected with the CAN1 pin of the MCU through CAN _ TX and CAN _ RX.
Preferably, the switch module adopts a 3Pin vertical dial switch.
Preferably, the memory module adopts an M24C16 chip and is electrically connected to the MCU through an I2C bus.
Preferably, the power supply module further comprises a series-connected external power supply, namely a voltage transformation rectifying circuit.
Preferably, the relay driving and control module is provided with 4 channels, and an expansion interface of the 4 channels is connected between the relay driving and control module and the tested module.
The utility model has the advantages that:
the utility model provides a labour has been practiced thrift in the use of relay board, has improved production efficiency, and the control signal that the relay board can discern host computer or other host system realizes oscilloscope to the switching that the multichannel signal detected, realizes that different control system adopts different interface communication, makes its function mutual independence, and it is strong to have the expansibility, and is compatible good, advantages such as control stability have solved the short circuit problem between the signal that the relay adhesion leads to the multistage control method of relay simultaneously.
Detailed Description
The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
As shown in fig. 1, a relay board for switching and detecting multiple signals includes a main control MCU, a CAN communication module (CAN transceiver), a USB to TTL module, a relay driver and control module, a dial switch module, a memory module, a channel expansion interface, a BNC interface 1, and a BNC interface 2.
The PC end is connected to the USB-to-TTL module, and the USB-to-TTL module is connected to a UART1 pin of the main control MCU through UART _ TX and UART _ RX. And other external master control modules are connected with the CAN transceiver through CAN _ H and CAN _ L, and the CAN transceiver is connected with a CAN1 pin of the master control MCU through CAN _ TX and CAN _ RX. The storage module is connected with an I2C1 pin of the main control MCU through I2C _ SDA and I2C _ SCL, the main control MCU is connected to the relay driving and controlling module through the pin, the main control MCU is connected to the dial switch module through the pin, and the BNC interface 1, the BNC interface 2 and the channel expansion port are respectively connected to the relay driving and controlling module.
The main control MCU CAN receive a self-defined protocol communication control signal of a PC end or other main control modules, the PC is connected with the USB-to-TTL module through a USB cable to convert a USB level into a TTL level for the MCU to identify communication data, the main control modules and the relay board are communicated through a controller area network (namely CAN), the other main control modules are connected to the CAN transceiver through CAN _ H and CAN _ L twisted pairs, and the CAN transceiver is subjected to level conversion to identify the communication data by the main control MCU.
As an embodiment of the utility model, what switch module adopted is the vertical dial switch of 3Pin, master control MCU CAN be through the level height of reading the corresponding Pin of dial switch, confirm the state that the switch is located, when relay board and host system carry out the CAN communication, CAN be according to the identifier of state screening relay board receipt message that dial switch is located, to avoid receiving wrong data frame to carry out the error control to the relay, and simultaneously, when a plurality of relay boards cascade, also CAN carry out the differentiation control to different relay boards according to the dial switch state. In the embodiment, as the relay board adopts the 3Pin dial switch, at most 8 relay boards can be cascaded.
As an embodiment of the utility model, the storage module uses is the M24C16 chip, storage module passes through I2C bus connection to master control MCU, master control MCU writes in the switch number of times of all relays to storage module, PC end or other host system can read the switch number of times of relay and check whether all relays are all in the maximum switch number of times scope through self-defined agreement, the user can change the switch number of times of this relay in the relay that corresponds the switch number of times and surpass the scope and the zero clearing memory.
As an embodiment of the utility model discloses an, still include power module, power module includes the external power source of establishing ties and vary voltage rectifier circuit promptly, and external power source adopts the 12V power in this embodiment.
As shown in fig. 2, one relay board has four channel expansion interfaces in total, and can access 64 paths of signals at most, wherein 16 paths of differential signals exist.
The relay driving and controlling module is divided into four channels, and the expansion interfaces of the channels 1-3 are all connected with 16 signal lines and a ground wire. The channel 4 is used for differential signal detection, and the channel expansion interface has 32 signal line accesses in total.
The contact structure problem of the relay is that the contact damage can cause the adhesion problem of the relay. In this embodiment, the relay board adopts the relay hierarchical control mode as shown in fig. 3, and when the relay is adhered, the condition that a plurality of signals are simultaneously connected to the oscilloscope is not caused due to unsuccessful control signal switching, so that short circuits among a plurality of signals on the same channel in the same relay board and a plurality of signals on the same channel when different relay boards are cascaded are avoided.
When the number of signals to be detected exceeds the maximum number of the extension interfaces of one relay board, a relay board cascade mode is used for detecting more signals, and the cascade mode is as follows: the BNC interface 1 of the second relay board is connected to the BNC interface 2 of the first relay board, the oscilloscope is connected with the BNC interface 1 of the first relay board, and when a plurality of relay boards are required to be cascaded, the BNC interface 1 of the next relay board is connected to the BNC interface 2 of the previous relay board.
The method for detecting the signal on the second relay board when the relay boards are cascaded comprises the following steps: the first relay board channel main control relay 0 is controlled to be switched to the BNC interface 2 to be connected into the second relay board through a user-defined protocol, and then the second relay board channel main control relay 0 is controlled to be switched to the relay 1 and control other relays to be switched to select a certain signal to be connected into the oscilloscope for detection.
When a plurality of relay boards are cascaded, only the main relay 0 on the relay board where the signal to be detected is located needs to be switched to the relay 1, other relays on the channel are reasonably controlled to be switched, and then the main relays 0 on other relay boards are switched to the BNC interface 2.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, and are not intended to limit the technical solution of the present invention, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: those skilled in the art can still modify or easily conceive of changes in the technical solutions described in the foregoing embodiments or make equivalent substitutions for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention. Are all covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.