Distributed multifunctional modular IO industrial control board

By adopting the combination of ESP32 and STM32 in distributed IO devices, the flexible combination of modular IO control boards and multi-protocol communication is realized, solving the problems of existing equipment flexibility and resource waste, and improving the flexibility and reliability of the system sex.

CN119126620AInactive Publication Date: 2024-12-13SHANGHAI BIO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411159729.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing distributed IO devices are not very flexible when used, and the number of IO ports is fixed, resulting in waste of resources and high system failure rates.

Method used

A distributed multi-function modular IO industrial control board was designed, using ESP32 as the on-board communication controller and logic controller, and STM32 as the modular IO port controller, communicating through two full-duplex SPI and one UART, supporting Multiple communication protocols and flexible combination of modules through 6-pin industrial plug-in connection terminals, supporting software switching of NPN type and PNP type input and output modes.

Benefits of technology

It improves the flexibility and scalability of the system, reduces resource waste, realizes the reuse of IO functions, and ensures the reliability of remote IO signal transmission through various communication methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119126620A_ABST
    Figure CN119126620A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed multifunctional modular IO industrial control board, and relates to the field of industrial control, the distributed multifunctional modular IO industrial control board comprises an ESP32 serving as an onboard communication controller and a logic controller and used for communicating with external equipment, and compared with the prior art, the distributed multifunctional modular IO industrial control board has the advantages that two GPIOs of an STM32 control one industrial control IO slot, and therefore the communication efficiency is improved; the IO slot can realize multiplexing of input and output functions according to access of different modules, so that a user can access different numbers and different types of modules according to actual conditions, the flexibility of the system is improved, and resource waste can be reduced; according to the scheme of the ESP32 and the STM32, the industrial control board not only can be used as a remote distributed IO module, but also can be used as an independent master controller, and the reliability of distributed IO signal transmission can be ensured while multiple communication modes are provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of industrial control, and in particular to a distributed multifunctional modular IO industrial control board. Background Art

[0002] In the field of industrial control, we often encounter a problem that the equipment requires a variety of sensors and solenoid valves for operation and monitoring. In order to achieve these functions, we usually need to use a large number of long wires to connect these devices to the main controller. This not only increases the complexity of wiring, but also increases the failure rate of the system.

[0003] Although there are some distributed IO devices on the market that can alleviate this problem to a certain extent, they are not very flexible when used, especially since the number of their IO ports is relatively fixed. Unused IO ports will cause a certain amount of resource waste, which needs to be improved. Summary of the invention

[0004] The object of the present invention is to provide a distributed multifunctional modular IO industrial control board to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A distributed multifunctional modular IO industrial control board, comprising:

[0007] ESP32 is used as an onboard communication controller and logic controller to communicate with external devices. The onboard communication can support wired 485 communication, CAN communication, wireless WiFi communication and Bluetooth communication. The logic control is written in C++ / Python / Lua / Rust.

[0008] STM32 is used as a modular IO port controller for module signal transmission. It communicates with the logic controller through two full-duplex SPIs and one UART. The UART is used for debugging, and the two SPIs are used for IO signal transmission and communication expansion interface information transmission respectively.

[0009] Input module, used to read the external input level signal to the controller, supporting software switching between NPN and PNP input modes;

[0010] Output module, used to output level signals to external devices to control the working status of the device, supports software switching of NPN, PNP and push-pull output modes;

[0011] Communication module, used for external communication, supports two-wire communication protocols such as I2C, UART and CAN,

[0012] The input module is connected to ESP32, ESP32 is connected to STM32 and the communication module, and STM32 is connected to the output module.

[0013] As a further solution of the present invention: the slots of the input module, output module, and expandable communication module are all 6-pin industrial plug-in connection terminals, and the pins are defined as 3.3V power supply, GPIO port A, GPIO port B, internal GND, 24V power supply, and external GND.

[0014] As a further solution of the present invention: the input module includes an optocoupler U1, an optocoupler U2, a transistor V1, a transistor V2, a diode D1, a diode D2, a diode D3, and a diode D4. The first end of the optocoupler U1 is connected to the signal through the resistor R1, the second end of the optocoupler U1 is grounded, the third end of the optocoupler U1 is grounded, the fourth end of the optocoupler U1 is connected to one end of the resistor R2, the base of the transistor V2, and the base of the transistor V1, the other end of the resistor R2 is connected to the collector of the transistor V1 and the 24V voltage, the emitter of the transistor V1 is connected to the emitter of the transistor V2, The cathode of diode D2, the anode of diode D4, and the collector of transistor V2 are grounded, the anode of diode D2 is connected to the anode of diode D1 and the second end of optocoupler U2, the cathode of diode D1 is connected to the anode of diode D3, the cathode of diode D3 is connected to the cathode of diode D4 and one end of resistor R3, the other end of resistor R3 is connected to the first end of optocoupler U2, the fourth end of optocoupler U2 is connected to 3.3V voltage, the third end of optocoupler U2 is connected to one end of resistor R4 and one end of resistor R5, the other end of resistor R4 is grounded, and the other end of resistor R5 outputs a signal.

[0015] As a further solution of the present invention: the output module includes an optocoupler U3, an optocoupler U4, a transistor V3, a transistor V4, a diode D5, and a diode D6. The first end of the optocoupler U3 is connected to the signal through the resistor R6, the second end of the optocoupler U3 is grounded, the fourth end of the optocoupler U3 is connected to the 24V voltage, the collector of the transistor V3, and the cathode of the diode D5, the third end of the optocoupler U3 is connected to one end of the resistor R8, the other end of the resistor R8 is connected to the base of the transistor V3, the base of the transistor V4, and one end of the resistor R9, the emitter of the transistor V3 is connected to the emitter of the transistor V4, the anode of the diode D5, and the cathode of the diode D6, the anode of the diode D6 is grounded, the collector of the transistor V4 is grounded, the other end of the resistor R9 is connected to the fourth end of the optocoupler U4, the third end of the optocoupler U4 is grounded, the second end of the optocoupler U4 is grounded, and the first end of the optocoupler U4 is connected to the signal through the resistor R7.

[0016] As a further solution of the present invention: the expandable communication module selects ESP32-PICO-D4 as the onboard communication controller and logic controller, and STM32F407ZET6 as the modular IO port controller.

[0017] As a further solution of the present invention: the onboard communication controller provides two RS485 channels, one CAN channel, WiFi and Bluetooth communications.

[0018] As a further solution of the present invention: the logic controller uses two full-duplex SPIs and one UART to communicate with the modular IO port controller, wherein the UART is used for debugging, and the two SPIs are used for transmission of IO signals and transmission of communication expansion interface information respectively.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention allows two GPIOs of STM32 to control one industrial control IO slot, and the IO slot can realize multiplexing of input and output functions according to different modules connected, so that users can connect different numbers and different types of modules according to actual conditions, which not only improves the flexibility of the system but also reduces resource waste; ESP32 can be used not only as a remote IO but also as a master control, and multiple communication modes are provided while ensuring remote IO signal transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of a 6-pin industrial plug-in connector.

[0021] Figure 2 This is the circuit diagram of the input module.

[0022] Figure 3 This is the circuit diagram of the output module.

[0023] Figure 4 Schematic diagram of NPN output circuit and PNP output circuit. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0025] See also Figure 1 , a distributed multifunctional modular IO industrial control board, comprising:

[0026] ESP32 is used as an onboard communication controller and logic controller to communicate with external devices. The onboard communication can support wired 485, CAN, EtherCAT communication, wireless WiFi and Bluetooth communication, etc. The logic control can be written in C++ / Python / Lua / Rust and other languages;

[0027] STM32 is used as a modular IO port controller for module signal transmission. It communicates with the logic controller through two full-duplex SPIs and one UART. The UART is used for debugging, and the two SPIs are used for IO signal transmission and communication expansion interface information transmission respectively.

[0028] Input module, used to read the external input level signal to the controller, supporting software switching between NPN and PNP input modes;

[0029] Output module, used to output level signals to external devices to control the working status of the device, supports software switching of NPN, PNP and push-pull output modes;

[0030] Communication module, used for external communication, supports two-wire communication protocols such as I2C, UART and CAN,

[0031] The input module is connected to ESP32, ESP32 is connected to STM32 and the communication module, and STM32 is connected to the output module.

[0032] In this example: See Figure 1 The slots for the input module, output module, and expandable communication module are all 6-pin industrial plug-in connection terminals, and the pins are defined as 3.3V power supply, GPIO port A, GPIO port B, internal GND, 24V power supply, and external GND.

[0033] All modules have basically the same shape, and the slots are 6-pin industrial plug-in terminals. The pins are defined as 3.3V power supply, GPIO port A, GPIO port B, internal GND, 24V power supply, and external GND. Figure 1 As shown, the module has isolation function between 24V and 3.3V signals, which can prevent voltage breakdown from burning internal circuits. The module uses a 6-pin slot and the total IO quantity is 48.

[0034] In this example: See Figure 2 and Figure 4The input module includes an optocoupler U1, an optocoupler U2, a transistor V1, a transistor V2, a diode D1, a diode D2, a diode D3, and a diode D4. The first end of the optocoupler U1 is connected to the signal through the resistor R1, the second end of the optocoupler U1 is grounded, the third end of the optocoupler U1 is grounded, the fourth end of the optocoupler U1 is connected to one end of the resistor R2, the base of the transistor V2, and the base of the transistor V1, the other end of the resistor R2 is connected to the collector of the transistor V1 and the 24V voltage, the emitter of the transistor V1 is connected to the emitter of the transistor V2, the The cathode and the anode of the diode D4, the collector of the transistor V2 are grounded, the anode of the diode D2 is connected to the anode of the diode D1 and the second end of the optocoupler U2, the cathode of the diode D1 is connected to the anode of the diode D3, the cathode of the diode D3 is connected to the cathode of the diode D4 and one end of the resistor R3, the other end of the resistor R3 is connected to the first end of the optocoupler U2, the fourth end of the optocoupler U2 is connected to a 3.3V voltage, the third end of the optocoupler U2 is connected to one end of the resistor R4 and one end of the resistor R5, the other end of the resistor R4 is grounded, and the other end of the resistor R5 outputs a signal.

[0035] See also Figure 4 The difference between the NPN output circuit and the PNP output circuit is that the former outputs a valid signal at a low level, which is equivalent to the output end being grounded; the latter outputs a valid signal at a high level, which is equivalent to the output end being connected to the power supply. When both output invalid signals, they are both in a high impedance state. If the circuit is to work properly, the other end of the load needs to be connected to the power supply or ground according to the output mode. When the NPN output is used, the other side of the load needs to be connected to the power supply, while when the PNP output is used, the other side of the load needs to be connected to the ground. Since the input module exists as a load in the circuit, and the load is a diode of an optocoupler, the direction of the current is determined.

[0036] See also Figure 2 When the signal InputSwitch_3V3 is high, the output side of the optocoupler U1 is turned on, the fourth terminal of the optocoupler U1 is low, and the input end of the push-pull circuit composed of a pair of NPN and PNP transistors (V1, V2) is low. At this time, the push-pull circuit outputs 0V, so it can accept PNP input; conversely, the fourth terminal of the output side of the optocoupler U1 is high, because the input end of the push-pull circuit is pulled up to 24V, and the push-pull circuit outputs 24V, so it can accept NPN input. The signal output by the push-pull circuit passes through a full-bridge rectifier circuit composed of 4 Schottky diodes to fix the current direction, and then outputs through the optocoupler U2.

[0037] In this example: See Figure 3The output module includes an optocoupler U3, an optocoupler U4, a transistor V3, a transistor V4, a diode D5, and a diode D6. The first end of the optocoupler U3 is connected to the signal through the resistor R6, the second end of the optocoupler U3 is grounded, the fourth end of the optocoupler U3 is connected to the 24V voltage, the collector of the transistor V3, and the cathode of the diode D5, the third end of the optocoupler U3 is connected to one end of the resistor R8, the other end of the resistor R8 is connected to the base of the transistor V3, the base of the transistor V4, and one end of the resistor R9, the emitter of the transistor V3 is connected to the emitter of the transistor V4, the anode of the diode D5, and the cathode of the diode D6, the anode of the diode D6 is grounded, the collector of the transistor V4 is grounded, the other end of the resistor R9 is connected to the fourth end of the optocoupler U4, the third end of the optocoupler U4 is grounded, the second end of the optocoupler U4 is grounded, and the first end of the optocoupler U4 is connected to the signal through the resistor R7.

[0038] The push-pull output circuit is composed of 2 optocouplers, 2 transistors and 2 Schottky diodes. The upper and lower tubes can be controlled separately, so while having push-pull output capability, NPN or PNP output can also be used. If only the upper tube is controlled to be on and off, the output can only be 24V and high impedance, which is a PNP output; if only the lower tube is controlled to be on and off, the output can only be 0V and high impedance, which is an NPN output; if the upper and lower tubes are given signals at the same time, since the output voltage of the push-pull circuit follows the input, it will not burn the circuit, but can output half of the power supply voltage. Although the load is driven by the emitter, the base input voltage and the output voltage are consistent, so the driving ability of the transistor will not be greatly affected. Two Schottky diodes are used for freewheeling to prevent the inductive components from breaking down the output transistor.

[0039] In this embodiment: the expandable communication module selects ESP32-PICO-D4 as the onboard communication controller and logic controller, and STM32F407ZET6 as the modular IO port controller.

[0040] The logic controller can be programmed using languages ​​such as Lua, MicroPython, C / C++, and Rust. Fixed-function firmware can be used as required, or you can write your own firmware. Therefore, it can be used not only as a remote IO, but also as a master controller. In addition, ESP32 provides two RS485 channels, one CAN channel, WiFi, and Bluetooth communications.

[0041] In this embodiment: the onboard communication controller provides two RS485 channels, one CAN channel, WiFi and Bluetooth communications.

[0042] In this embodiment: the logic controller uses two full-duplex SPIs and one UART to communicate with the modular IO port controller, wherein the UART is used for debugging, and the two SPIs are used for transmission of IO signals and transmission of communication expansion interface information respectively.

[0043] The IO information format sent in SPI communication includes setting IO type, setting output status, and obtaining input status; the communication expansion interface information format sent is a unified format.

[0044] 1. Set IO type:

[0045] The format is shown in Table 1, where the packet type code starts from 0x1000 and the corresponding row number starts from A. For example, if IOB0 to IOB7 are configured, the packet type code is 0x1001. The configuration content is shown in Table 2.

[0046]

[0047] Table 1

[0048]

[0049] Table 2

[0050] 2. Set the output status:

[0051] The format is shown in Table 3. This data packet is only valid for IO that has been configured in output mode.

[0052]

[0053] Table 3

[0054] 3. Get input status:

[0055] The format is shown in Table 4. This data packet is only valid for IO that has been configured in input mode.

[0056]

[0057] Table 4

[0058] 4. Communication extension interface information:

[0059] The communication expansion interface is shown in Table 5. The system will automatically select the communication interface based on the packet type, peripheral type and peripheral ID.

[0060]

[0061] Table 5

[0062] For a series of problems caused by communication failure, the failure logic can be configured in advance according to the actual situation to ensure that the device can still be safely suspended after communication failure.

[0063] Therefore, the present invention can not only greatly improve the flexibility and scalability of distributed IO, but also effectively reduce resource waste. The present invention can provide a new possibility for industrial control systems, making the design and implementation of the system more flexible and more in line with actual application requirements. This new design idea is conducive to promoting the progress and development of industrial control technology.

[0064] The working principle of the present invention is: using ESP32 as an onboard communication controller and logic controller, and STM32 as a modular IO port controller; the logic controller communicates with the modular IO port controller; after the logic controller configures the working mode of the IO port, it reads and writes data to the corresponding IO port.

[0065] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered as exemplary and non-restrictive in all respects.

[0066] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A distributed multifunctional modular IO industrial control board, characterized in that: The distributed multifunctional modular IO industrial control board includes: ESP32 is used as an onboard communication controller and logic controller to communicate with external devices. The onboard communication can support wired 485 communication, CAN communication, wireless WiFi communication and Bluetooth communication. The logic control is written in C++ / Python / Lua / Rust. STM32 is used as a modular IO port controller for module signal transmission. It communicates with the logic controller through two full-duplex SPIs and one UART. The UART is used for debugging, and the two SPIs are used for IO signal transmission and communication expansion interface information transmission respectively. Input module, used to read the external input level signal to the controller, supporting software switching between NPN and PNP input modes; Output module, used to output level signals to external devices to control the working status of the device, supports software switching of NPN, PNP and push-pull output modes; Communication module, used for external communication, supports two-wire communication protocols such as I2C, UART and CAN, The input module is connected to ESP32, ESP32 is connected to STM32 and the communication module, and STM32 is connected to the output module.

2. The distributed multifunctional modular IO industrial control board according to claim 1 is characterized in that: The slots for the input module, output module, and expandable communication module are all 6-pin industrial plug-in connectors, with the pins defined as 3.3V power supply, GPIO port A, GPIO port B, internal GND, 24V power supply, and external GND.

3. The distributed multifunctional modular IO industrial control board according to claim 1 is characterized in that: The input module includes an optocoupler U1, an optocoupler U2, a transistor V1, a transistor V2, a diode D1, a diode D2, a diode D3, and a diode D4. The first end of the optocoupler U1 is connected to the signal through the resistor R1, the second end of the optocoupler U1 is grounded, the third end of the optocoupler U1 is grounded, the fourth end of the optocoupler U1 is connected to one end of the resistor R2, the base of the transistor V2, and the base of the transistor V1, the other end of the resistor R2 is connected to the collector of the transistor V1 and the 24V voltage, the emitter of the transistor V1 is connected to the emitter of the transistor V2 and the cathode of the diode D2 The collector of the transistor V2 is grounded, the anode of the diode D2 is connected to the anode of the diode D1 and the second end of the optocoupler U2, the cathode of the diode D1 is connected to the anode of the diode D3, the cathode of the diode D3 is connected to the cathode of the diode D4 and one end of the resistor R3, the other end of the resistor R3 is connected to the first end of the optocoupler U2, the fourth end of the optocoupler U2 is connected to a 3.3V voltage, the third end of the optocoupler U2 is connected to one end of the resistor R4 and one end of the resistor R5, the other end of the resistor R4 is grounded, and the other end of the resistor R5 outputs a signal.

4. The distributed multifunctional modular IO industrial control board according to claim 1, characterized in that: The output module includes an optocoupler U3, an optocoupler U4, a transistor V3, a transistor V4, a diode D5, and a diode D6. The first end of the optocoupler U3 is connected to the signal through a resistor R6, the second end of the optocoupler U3 is grounded, the fourth end of the optocoupler U3 is connected to the 24V voltage, the collector of the transistor V3, and the cathode of the diode D5, the third end of the optocoupler U3 is connected to one end of the resistor R8, the other end of the resistor R8 is connected to the base of the transistor V3, the base of the transistor V4, and one end of the resistor R9, the emitter of the transistor V3 is connected to the emitter of the transistor V4, the anode of the diode D5, and the cathode of the diode D6, the anode of the diode D6 is grounded, the collector of the transistor V4 is grounded, the other end of the resistor R9 is connected to the fourth end of the optocoupler U4, the third end of the optocoupler U4 is grounded, the second end of the optocoupler U4 is grounded, and the first end of the optocoupler U4 is connected to the signal through a resistor R7.

5. The distributed multifunctional modular IO industrial control board according to claim 1, characterized in that: The expandable communication module selects ESP32-PICO-D4 as the onboard communication controller and logic controller, and STM32F407ZET6 as the modular IO port controller.

6. The distributed multifunctional modular IO industrial control board according to claim 5, characterized in that: The onboard communication controller provides two RS485, one CAN, WiFi and Bluetooth communications.

7. The distributed multifunctional modular IO industrial control board according to claim 5, characterized in that: The logic controller uses two full-duplex SPIs and one UART to communicate with the modular IO port controller, where the UART is used for debugging and the two SPIs are used for the transmission of IO signals and the transmission of communication expansion interface information respectively.