Configurable IO board design method and equipment for numerical control system
By setting up power isolation circuits, polarity adaptive input circuits, and output drive circuits on the CNC system's I/O board, the problem that existing I/O boards can only adapt to sensors of specific polarities is solved, thereby improving the system's stability and flexibility, and reducing hardware costs and on-site debugging complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-04-21
AI Technical Summary
Existing CNC system I/O board designs can only adapt to sensors of specific polarities, resulting in high hardware costs and increased complexity of on-site implementation, and making it impossible to directly wire and use sensors of different polarities.
By setting up power isolation circuits, polarity adaptive input circuits, and output drive circuits, mutually isolated power supply domains are constructed to achieve polarity adaptive input. The external load is then directly driven through the output drive circuit, simplifying wiring and reducing potential failure points.
It improves the system's operational stability and security, reduces hardware costs, simplifies on-site debugging complexity, achieves seamless compatibility with NPN and PNP sensors, and reduces spare parts requirements.
Smart Images

Figure CN121900316A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial automation control technology, and in particular to a method and apparatus for designing a configurable I / O board for a numerical control system. Background Technology
[0002] In CNC systems and automated equipment, input / output (I / O) boards serve as a bridge connecting the control host and external field devices. Their main function is to acquire status signals from external sensors such as limit switches and proximity switches, convert these signals into logic levels recognizable by the CNC host, and simultaneously transmit control commands from the host to external actuators.
[0003] Existing CNC system I / O boards are typically designed for a single input signal detection mode. Their input circuit's common terminal is often fixedly connected to either the positive or negative power supply terminal, limiting the I / O board to sensors of specific polarities, such as only supporting NPN or PNP sensors. When the sensor type used in the industrial environment differs from the I / O board's preset polarity, engineers cannot directly connect the wiring. They usually need to replace the I / O board with a different model or add an additional signal conversion relay device, increasing hardware costs and on-site implementation complexity. Therefore, there is room for improvement. Summary of the Invention
[0004] This application provides a method and apparatus for designing a configurable I / O board for a CNC system, which can improve the versatility and flexibility of the I / O board while also enhancing its driving capability.
[0005] The above-mentioned objective of this application is achieved through the following technical solution:
[0006] A method for designing a configurable I / O board for a CNC system, the method comprising:
[0007] Set up a power isolation circuit and connect it to the external power interface to build mutually isolated external power supply domains and internal power supply domains to block external interference;
[0008] The polarity adaptive input circuit is connected to the common configuration terminal and the contact switch output signal to output an effective level signal;
[0009] The polarity adaptive input circuit connects the contact switch output signal to the common configuration terminal, and selectively conducts the corresponding current path according to the potential state of the common configuration terminal and the contact switch output signal.
[0010] The output drive circuit is connected to the main control logic interface of the CNC system to drive the external load.
[0011] By adopting the above technical solutions, and by setting up power isolation circuits to construct mutually isolated external and internal power supply domains, the transmission path of external electrical interference to the core logic circuit of the CNC system can be cut off, thereby avoiding system restarts or burnouts caused by short circuits or surge impacts in field equipment, greatly improving the system's operational stability and safety. By setting up polarity adaptive input circuits, a single hardware interface can be made capable of responding to signals of different polarities, thereby reducing the need for spare parts due to sensor type incompatibility and lowering hardware costs. By setting up output drive circuits, external high-power loads can be directly driven, thereby eliminating the need for external intermediate relays, simplifying the internal wiring of the control cabinet and reducing failure points. By selectively conducting the corresponding current path according to the potential state of the common configuration terminal and signal input terminal, the physical characteristics of the circuit can be used to automatically complete the input mode switching, thereby achieving seamless compatibility with both NPN and PNP type sensors, reducing the complexity and error rate of field debugging.
[0012] In a preferred embodiment, this application can be further configured such that: the polarity adaptive input circuit is connected to the common configuration terminal and the contact switch output signal of the contact switch to output an effective level signal, including:
[0013] A polarity adaptive input circuit consisting of complementary transistor circuits and optocoupler circuits is set on the IO board;
[0014] The complementary transistor circuit is connected to the common configuration terminal, the contact switch output signal, and the optocoupler circuit respectively, so as to output an effective level signal through the polarity adaptive input circuit.
[0015] By adopting the above technical solution, and by setting a polarity adaptive input circuit composed of complementary transistor circuits and optocoupler circuits on the IO board, the complementary transistor circuit can be used as the sensing and logic judgment unit for the front-end high-voltage signal, and the optocoupler circuit can be used as the back-end isolation conversion unit. Thus, while accurately capturing external signals, it ensures that the internal logic circuits are transmitted with safe low-voltage signals, and guarantees electrical isolation throughout the signal processing process.
[0016] In a preferred embodiment, this application can be further configured such that the polarity adaptive input circuit composed of complementary transistor circuits and optocoupler circuits on the IO board includes:
[0017] The complementary transistor circuit includes a first transistor and a second transistor, the bases of the first transistor and the second transistor are both connected to the common configuration terminal, and the emitters of the first transistor and the second transistor are both connected to the contact switch output signal.
[0018] The optocoupler circuit includes a first optocoupler and a second optocoupler. The anode of the light-emitting diode of the first optocoupler is connected to the external power supply domain, the cathode of the light-emitting diode of the first optocoupler is connected to the collector of the first transistor, the collector of the first optocoupler is connected to the internal power supply domain, and the emitter of the first optocoupler outputs a level signal. The anode of the light-emitting diode of the second optocoupler is connected to the collector of the second transistor, the cathode of the light-emitting diode of the second optocoupler is grounded, the collector of the second optocoupler is connected to the internal power supply domain, and the emitter of the second optocoupler outputs the level signal, wherein the level signal includes an effective level signal and an ineffective level signal.
[0019] By adopting the above technical solution, a parallel complementary structure with common base and common emitter can be constructed by connecting the bases of the first transistor and the second transistor to the common configuration terminal and the emitters to the signal input terminal. This allows the two transistors to respond simultaneously to the potential difference between the ports and automatically switch according to their own conduction characteristics, providing a hardware basis for mode adaptation. By connecting the first optocoupler and the second optocoupler in series in an asymmetrical manner in the collector circuits of the two transistors, it is possible to adapt to the different operating modes of NPN transistor sinking current and PNP transistor outflowing current, thereby ensuring that the current path in both modes can be correctly converted into optical signals.
[0020] In a preferred embodiment, the present application may be further configured such that the first transistor is preset to be an NPN transistor and the second transistor is preset to be a PNP transistor.
[0021] By adopting the above technical solution, the polarity of the two core switching elements in the complementary circuit can be clearly defined, thus providing a physical premise for the circuit to selectively lock one transistor and activate the other transistor according to the high or low potential of the common configuration terminal. This is a necessary condition for realizing reliable switching between NPN and PNP modes.
[0022] In a preferred embodiment, this application can be further configured such that: selectively conducting the corresponding current path based on the potential state of the common configuration terminal and the contact switch output signal includes:
[0023] Different external power supply polarities are respectively set and connected to the common configuration terminal and the contact switch output signal;
[0024] Based on the potential state of the common configuration terminal, determine whether the first transistor or the second transistor is in a ready-to-conduct state, and obtain the circuit input response mode based on the determination result;
[0025] Based on the circuit input response mode, if the potential state of the contact switch output signal meets the conduction condition, then the corresponding current path is turned on.
[0026] By adopting the above technical solution, the circuit input response mode is obtained by determining whether the transistor is in a ready-to-conduct state based on the potential state of the common configuration terminal. The complex mode selection task can be automatically completed by the physical bias state of the hardware, thus eliminating the need for software intervention and simplifying the upper-level control logic. By detecting whether the potential state of the signal input terminal meets the conduction condition based on the established circuit input response mode, it can be ensured that the circuit only responds to valid signals that conform to the current mode, thereby improving the accuracy of signal detection and anti-interference capability.
[0027] In a preferred embodiment, this application can be further configured as follows: determining whether the first transistor or the second transistor is in a ready-to-conduct state based on the potential state of the common configuration terminal, and obtaining the circuit input response mode based on the determination result, includes:
[0028] In response to the high potential of the common configuration terminal, the first transistor is determined to be in a ready-to-conduct state. Based on the determination result, the circuit input response mode is determined to be NPN mode.
[0029] In response to the low potential of the common configuration terminal, the second transistor is determined to be in a ready-to-conduct state. Based on the determination result, the circuit input response mode is determined to be PNP mode.
[0030] By adopting the above technical solution, it is possible to accurately determine whether the first transistor or the second transistor is in a state of being ready to conduct based on the potential state of the common configuration terminal, thereby determining whether the circuit input response mode is NPN mode or PNP mode. This achieves configurable input polarity, enabling the IO board to adapt to both PNP and NPN types of sensors, thus improving versatility and flexibility.
[0031] In a preferred embodiment, this application can be further configured such that: based on the circuit input response mode, detecting whether the potential state of the contact switch output signal meets the conduction condition, and then the corresponding current path is turned on includes:
[0032] If the circuit input response mode is NPN mode, the potential state of the contact switch output signal is detected as low. If it is, the conduction condition is met, the circuit path of the first transistor is turned on, and the effective level signal is output. Otherwise, it is not turned on, and the ineffective level signal is output.
[0033] If the circuit input response mode is PNP mode, it detects whether the potential state of the contact switch output signal is high. If it is, the conduction condition is met, the circuit path of the second transistor is turned on, and the effective level signal is output. Otherwise, it is not turned on, and the ineffective level signal is output.
[0034] By adopting the above technical solution, the potential state of the signal input terminal is detected according to the circuit input response mode. If it is NPN mode and the signal input terminal is at a low potential, or PNP mode and the signal input terminal is at a high potential, the circuit path of the corresponding transistor is turned on and an effective level signal is output. Otherwise, it is not turned on and an ineffective level signal is output. This realizes configurable input polarity, so that the same IO board can be adapted to both PNP and NPN sensors without hardware modification, improving versatility, making it convenient for users to select according to existing equipment, and reducing the types of spare parts.
[0035] In a preferred embodiment, this application can be further configured such that: the setting output drive circuit is connected to the main control signal of the CNC system to drive an external load according to the main control signal, including:
[0036] A MOS transistor output circuit consisting of a MOS transistor and an optocoupler is set on the IO board. The output terminal of the optocoupler is connected to the gate of the MOS transistor to drive the MOS transistor to conduct.
[0037] An RC network is provided between the output port of the MOSFET and ground to absorb the reverse electromotive force generated when the MOSFET is turned off at the end of the driving process.
[0038] By adopting the above technical solution, and by setting an RC network between the output port of the MOSFET and ground, an effective buffer and dissipation path can be provided for the surge voltage generated when the MOSFET turns off the inductive load. This can effectively clamp the voltage spike between the drain and source of the MOSFET, preventing it from being damaged due to overvoltage, and greatly improving the reliability and service life of the IO board when driving highly inductive loads such as solenoid valves.
[0039] In a preferred embodiment, this application can be further configured such that: the setting output drive circuit is connected to the main control logic interface of the CNC system to drive an external load includes:
[0040] A relay output circuit composed of relays is set on the IO board. One side of the coil of the relay is connected to the external power supply domain, and the other side of the coil of the relay is grounded through a drive switch component.
[0041] The control terminal of the drive switch component is connected to the main control logic interface to control the on / off state of the relay coil;
[0042] A diode is connected in reverse parallel across the two ends of the relay coil to provide clamping protection.
[0043] By adopting the above technical solution, and grounding the other side of the relay coil through the drive switch component, a mature and reliable low-side drive method can be used to control the relay, thereby simplifying the drive logic. By connecting a diode in reverse parallel across the two ends of the relay coil, a freewheeling circuit can be provided for the induced current generated when the coil is de-energized, thereby clamping the reverse electromotive force at a safe voltage level, protecting the front-end drive switch component from being broken down by high voltage back shock, and ensuring the long-term stable operation of the relay drive circuit.
[0044] The second objective of this invention is achieved through the following technical solution:
[0045] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above for designing a configurable I / O board for a numerical control system.
[0046] In summary, this application includes at least one of the following beneficial technical effects:
[0047] 1. By setting up a power isolation circuit to construct mutually isolated external and internal power supply domains, the transmission path of external electrical interference to the core logic circuit of the CNC system can be cut off, thereby avoiding system restart or burnout caused by short circuits or surge impacts of field equipment, greatly improving the system's operational stability and safety; by setting up a polarity adaptive input circuit, a single hardware interface can be made capable of responding to signals of different polarities, thereby reducing the need for spare parts due to sensor type incompatibility and lowering hardware costs; by setting up an output drive circuit, it can directly drive external high-power loads, thereby eliminating the need for external intermediate relays, simplifying the internal wiring of the control cabinet and reducing failure points; by selectively conducting the corresponding current path according to the potential state of the common configuration terminal and signal input terminal, the physical characteristics of the circuit can be used to automatically complete the input mode switching, thereby achieving seamless compatibility with both NPN and PNP sensor types, reducing the complexity and error rate of field debugging; Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating the implementation of a method for designing a configurable I / O board for a CNC system, as provided in an embodiment of this application.
[0049] Figure 2 This is a schematic diagram of the polarity adaptive input circuit provided in the embodiments of this application;
[0050] Figure 3 This is a schematic diagram of the circuit principle of the MOS transistor output circuit provided in the embodiment of this application;
[0051] Figure 4This is a schematic diagram of the relay output circuit provided in the embodiments of this application;
[0052] Figure 5 This is a schematic diagram of the internal structure of a computer device according to an embodiment of this application. Detailed Implementation
[0053] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0054] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0055] The present application will be further described in detail below with reference to the accompanying drawings.
[0056] Please refer to Figure 1 , Figure 1 This application provides a flowchart illustrating a method for designing a configurable I / O board for a CNC system. The method includes the following steps:
[0057] S1. Connect the power isolation circuit to the external power interface to build mutually isolated external power supply domains and internal power supply domains to block external interference.
[0058] In this embodiment, the power isolation circuit refers to a circuit structure that can transmit electrical energy between the input and output terminals but cut off the electrical connection. For example, it can be a DC-DC converter circuit implemented using transformer coupling or optocoupler principles. This application uses a DC-DC power isolation chip, such as the B0505S model. The input pin of the DC-DC power isolation chip is connected to an external power interface. After conversion, it outputs a voltage isolated from the external power supply to power the internal power supply circuitry. This design isolates the external and internal power supplies. When the external power supply experiences short circuits or surges, it will not directly affect the internal power supply, thus blocking the impact of external interference on the CNC system.
[0059] S2. Connect the polarity adaptive input circuit to the common configuration terminal and the contact switch output signal to output an effective level signal.
[0060] In this embodiment, the polarity adaptive input circuit refers to an interface circuit unit that can automatically adjust its internal signal flow direction according to external wiring conditions; the common configuration terminal refers to the wiring port used to define the reference potential of the input signal, usually marked as the COM terminal; the contact switch can change the level state of the contact switch output signal by connecting to an external power supply, or one end of the contact switch can be connected to the contact switch output signal of this IO board, and the other end can be directly connected to the ground of the external power supply domain. When the contact switch is closed, it pulls the contact switch output signal directly to the ground potential of 0V. Alternatively, one end of the contact switch can be connected to the contact switch output signal of this IO board, and the other end can be connected to the positive +24V of the external power supply domain. When the contact switch is closed, it applies the +24V voltage of the external power supply domain to the contact switch output signal; by physically connecting the polarity adaptive input circuit to these two ports respectively, a front-end network for signal detection is constructed. When the external sensor is activated, the circuit can sense the change in the input terminal potential and convert it into a logic level that the CNC system can recognize, i.e., an effective level signal. This signal is usually represented by a logic low level or a logic high level, used to trigger the corresponding control logic of the CNC system.
[0061] In step S2, setting the polarity adaptive input circuit to connect to the common configuration terminal and the contact switch output signal of the contact switch to output an effective level signal includes: setting a polarity adaptive input circuit composed of a complementary transistor circuit and an optocoupler circuit on the IO board; connecting the complementary transistor circuit to the common configuration terminal, the contact switch output signal and the optocoupler circuit respectively, so as to output an effective level signal through the polarity adaptive input circuit.
[0062] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the polarity adaptive input circuit provided in an embodiment of this application. The polarity adaptive input circuit, consisting of a complementary transistor circuit and an optocoupler circuit, is configured on the I / O board, including:
[0063] The complementary transistor circuit includes a first transistor and a second transistor. The bases of both the first transistor and the second transistor are connected to a common configuration terminal, and the emitters of both the first transistor and the second transistor are connected to the output signal of the contact switch.
[0064] The optocoupler circuit includes a first optocoupler and a second optocoupler. The anode of the LED in the first optocoupler is connected to an external power supply domain, the cathode of the LED in the first optocoupler is connected to the collector of a first transistor, and the collector of the first optocoupler is connected to an internal power supply domain. The emitter of the first optocoupler outputs a level signal. The anode of the LED in the second optocoupler is connected to the collector of a second transistor, the cathode of the LED in the second optocoupler is grounded, the collector of the second optocoupler is connected to an internal power supply domain, and the emitter of the second optocoupler outputs a level signal, wherein the level signal includes an active level signal and an inactive level signal. The first transistor is preset to be an NPN transistor, and the second transistor is preset to be a PNP transistor.
[0065] In this embodiment, the polarity adaptive input circuit includes a complementary transistor circuit and an optocoupler circuit. The complementary transistor circuit includes a first transistor and a second transistor. The first transistor is preset to be an NPN transistor, and the second transistor is preset to be a PNP transistor. For example, the NPN transistor can be an S8050, which has a high current amplification factor and fast switching speed, suitable for signal amplification and switch control circuits. The PNP transistor can be an S8550, forming a complementary pair with the S8050. The bases of both the first and second transistors are connected to a common configuration terminal, and their emitters are both connected to the contact switch output signal. The optocoupler circuit includes a first optocoupler and a second optocoupler. The anode of the LED in the first optocoupler is connected to an external power supply domain, the cathode is connected to the collector of the first transistor, the collector is connected to an internal power supply domain, and the emitter outputs a level signal. The anode of the LED in the second optocoupler is connected to the collector of the second transistor, the cathode is grounded, the collector is connected to an internal power supply domain, and the emitter also outputs a level signal. The optocoupler here can be a model such as the PC817, which has good electrical isolation performance and signal transmission characteristics.
[0066] S3. The contact switch output signal is connected to the common configuration terminal through the polarity adaptive input circuit, and the corresponding current path is selectively turned on according to the potential state of the common configuration terminal and the contact switch output signal.
[0067] In this embodiment, achieving connection through a polarity adaptive input circuit refers to constructing a specific electrical loop between the contact switch output signal and the common configuration terminal. Selective conduction based on potential state means that the circuit can automatically identify the potential polarity of the common configuration terminal (e.g., connected to the positive or negative terminal) and, in conjunction with the potential changes of the contact switch output signal (e.g., floating, high, or low), automatically select one of one or more preset current paths for conduction. For example, when the common configuration terminal is connected to a high potential, the circuit automatically blocks certain paths and opens paths sensitive to low-level signals, and vice versa. This physical selection mechanism based on potential state allows the same circuit interface to automatically adapt to external input signals of different polarities without manual modification of hardware jumpers or software configuration, achieving true adaptive compatibility.
[0068] In one embodiment, selectively activating the corresponding current path based on the potential state of the common configuration terminal and the contact switch output signal includes:
[0069] Different external power supply polarities are set and connected to the common configuration terminal and the contact switch output signal respectively.
[0070] In this embodiment, the process is automatically achieved through the physical bias state of the circuit. First, setting different external power supply polarities means that the user connects the common configuration terminal to the positive terminal of the external power supply, such as +24V, or the negative terminal, such as 0V, according to the type of field sensor.
[0071] Based on the potential state of the common configuration terminal, it is determined whether the first transistor or the second transistor is in a ready-to-conduct state. Based on the determination result, the circuit input response mode is obtained. Specifically, this includes the following steps:
[0072] If the voltage state of the common configuration terminal is high, the first transistor is determined to be in a ready-to-conduct state. Based on the determination result, the circuit input response mode is determined to be NPN mode.
[0073] If the potential state of the common configuration terminal is low, it is determined that the second transistor is in the turn-on state. Based on the determination result, the circuit input response mode is determined to be PNP mode.
[0074] In this embodiment, when the user connects the common configuration terminal to the positive terminal of the external power supply domain, such as +24V, the base potentials of both the NPN type first transistor and the PNP type second transistor are clamped at a high level. At this time, for the second transistor, its base potential is higher than or equal to the highest potential that its emitter may receive, causing its emitter junction to be unable to be forward biased and thus being cut off. For the first transistor, its high base potential puts it into a ready-to-conduct state, ready to respond to changes in its emitter potential. Therefore, the circuit's input response mode is uniquely determined to be the NPN mode. When the user connects the common configuration terminal to the negative terminal of the external power supply domain, i.e., ground 0V, the base potentials of both transistors are clamped at a low level. At this time, the first transistor is cut off due to its low base potential, while the second transistor enters a ready-to-conduct state due to its low base potential. Therefore, the circuit's input response mode is uniquely determined to be the PNP mode. For example, in NPN mode, the current path of the corresponding first transistor will only be turned on when the contact switch output signal is pulled low by an external sensor to meet the conduction condition of the first transistor, i.e., the base-emitter voltage difference exceeds the threshold. This completes the entire process from potential state identification to current path selection.
[0075] Based on the circuit input response mode, the potential state of the contact switch output signal is detected to determine if the conduction condition is met, and if so, the corresponding current path is activated. Specifically, this includes the following steps:
[0076] If the circuit input response mode is NPN mode, it detects whether the potential state of the contact switch output signal is low. If it is, the conduction condition is met, the circuit path of the first transistor is turned on, and an effective level signal is output. Otherwise, it is not turned on, and an ineffective level signal is output.
[0077] If the circuit input response mode is PNP mode, it detects whether the potential state of the contact switch output signal is high. If it is, the conduction condition is met, the circuit path of the second transistor is turned on, and an effective level signal is output. Otherwise, it is not turned on, and an ineffective level signal is output.
[0078] In this embodiment, under the corresponding mode, the potential state of the contact switch output signal is detected. If the conduction condition is met, the circuit path of the corresponding transistor is turned on, the optocoupler is triggered, and an effective level signal is output; otherwise, an ineffective level signal is output. This achieves the polarity adaptive function, allowing the I / O board to be compatible with sensors of different polarities.
[0079] Specifically, in NPN mode, the circuit continuously monitors the potential state of the contact switch output signal. When the external NPN sensor is turned on, pulling the contact switch output signal to a low potential (e.g., 0V), a sufficiently large forward voltage difference is formed between the base and emitter of the first transistor, exceeding its conduction voltage threshold, thus satisfying the conduction condition. This activates the current path of the first transistor, driving the first optocoupler at the back end to work and output a valid level signal. Conversely, if the contact switch output signal remains at a high potential or floating, the first transistor remains off, outputting an invalid level signal. In PNP mode, the circuit continuously monitors the potential state of the contact switch output signal. When the external PNP sensor is turned on, outputting a high potential (e.g., +24V) to the contact switch output signal, a sufficient forward voltage difference is formed between the emitter and base of the second transistor, satisfying its conduction condition. This activates the current path of the second transistor, driving the second optocoupler to work and also outputting a valid level signal. Conversely, an invalid level signal is output.
[0080] S4. Set the output drive circuit to connect with the main control logic interface of the CNC system to drive the external load.
[0081] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the MOS transistor output circuit provided in an embodiment of this application. The output drive circuit is connected to the main control signal of the CNC system to drive an external load according to the main control signal, including:
[0082] A MOSFET output circuit consisting of a MOSFET and an optocoupler is set up on the IO board. The output terminal of the optocoupler is connected to the gate of the MOSFET to drive the MOSFET to conduct.
[0083] An RC network is set between the output port of the MOSFET and ground to absorb the reverse electromotive force generated when the MOSFET is turned off at the end of the driving process.
[0084] In this embodiment, the MOSFET output circuit is typically used to drive DC loads such as DC solenoid valves and indicator lights. For example, an IRF540N MOSFET can be selected, as its large continuous drain current can meet the driving requirements of most 24V industrial loads. An optocoupler such as the TLP521 can be used to isolate control signals and power signals, improving the circuit's anti-interference capability. The output terminal of the optocoupler is connected to the gate of the MOSFET. When the main control signal of the CNC system is transmitted to the gate of the MOSFET through the optocoupler, the MOSFET is driven to conduct. An RC network is set between the output port of the MOSFET and ground. The RC network consists of a resistor and a capacitor; the resistor limits current, and the capacitor stores charge. When the MOSFET switches from conduction to turn-off, the magnetic field energy stored in the external inductive load will generate a very steep reverse voltage spike. At this time, the RC network can provide a momentary low-impedance path to absorb and dissipate this spike energy, effectively clamping the overvoltage across the MOSFET and preventing it from being damaged by breakdown.
[0085] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the relay output circuit provided in an embodiment of this application. The output drive circuit is connected to the main control signal of the CNC system to drive an external load according to the main control signal, including:
[0086] A relay output circuit consisting of relays is set on the IO board. One side of the relay coil is connected to the external power supply domain, and the other side of the relay coil is grounded through the drive switch component.
[0087] The control terminal of the drive switch component is connected to the main control logic interface to control the on / off state of the relay coil;
[0088] A diode is connected in reverse parallel across the relay coil to provide clamping protection.
[0089] In this embodiment, the relay output circuit consists of a relay. A small electromagnetic relay with high voltage and current withstand capabilities can be selected. One side of the relay coil is connected to an external power supply, and the other side is grounded via a drive switch component. The control terminal of the drive switch component is connected to the main control logic interface, and the relay coil's on / off state can be controlled via signals from the main control logic interface. A diode is connected in reverse parallel across the relay coil. This diode acts as a clamping protection; when the relay coil is de-energized, the diode provides a discharge path for the induced current in the coil, preventing excessive reverse voltage from damaging other components.
[0090] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0091] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for designing a configurable I / O board for a CNC system.
[0092] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0093] Set up a power isolation circuit and connect it to the external power interface to build mutually isolated external power supply domains and internal power supply domains to block external interference;
[0094] The polarity adaptive input circuit is connected to the common configuration terminal and the contact switch output signal to output an effective level signal;
[0095] The contact switch output signal is connected to the common configuration terminal through a polarity adaptive input circuit, and the corresponding current path is selectively turned on according to the potential state of the common configuration terminal and the contact switch output signal.
[0096] The output drive circuit is connected to the main control logic interface of the CNC system to drive the external load.
[0097] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0098] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for designing a configurable I / O board for a CNC system, characterized in that, The method includes: Set up a power isolation circuit and connect it to the external power interface to build mutually isolated external power supply domains and internal power supply domains to block external interference; The polarity adaptive input circuit is connected to the common configuration terminal and the contact switch output signal to output an effective level signal; The polarity adaptive input circuit connects the contact switch output signal to the common configuration terminal, and selectively conducts the corresponding current path according to the potential state of the common configuration terminal and the contact switch output signal. The output drive circuit is connected to the main control logic interface of the CNC system to drive the external load.
2. The method according to claim 1, characterized in that, The polarity adaptive input circuit is connected to the common configuration terminal and the contact switch output signal of the contact switch to output an effective level signal, including: A polarity adaptive input circuit consisting of complementary transistor circuits and optocoupler circuits is set on the IO board; The complementary transistor circuit is connected to the common configuration terminal, the contact switch output signal, and the optocoupler circuit respectively, so as to output an effective level signal through the polarity adaptive input circuit.
3. The method according to claim 2, characterized in that, The polarity adaptive input circuit, consisting of complementary transistor circuits and optocoupler circuits, is configured on the I / O board, including: The complementary transistor circuit includes a first transistor and a second transistor, the bases of the first transistor and the second transistor are both connected to the common configuration terminal, and the emitters of the first transistor and the second transistor are both connected to the contact switch output signal. The optocoupler circuit includes a first optocoupler and a second optocoupler. The anode of the light-emitting diode of the first optocoupler is connected to the external power supply domain, the cathode of the light-emitting diode of the first optocoupler is connected to the collector of the first transistor, the collector of the first optocoupler is connected to the internal power supply domain, and the emitter of the first optocoupler outputs a level signal. The anode of the light-emitting diode of the second optocoupler is connected to the collector of the second transistor, the cathode of the light-emitting diode of the second optocoupler is grounded, the collector of the second optocoupler is connected to the internal power supply domain, and the emitter of the second optocoupler outputs the level signal, wherein the level signal includes an effective level signal and an ineffective level signal.
4. The method according to claim 3, characterized in that, The first transistor is preset to be an NPN transistor, and the second transistor is preset to be a PNP transistor.
5. The method according to claim 3, characterized in that, The step of selectively energizing the corresponding current path based on the potential state of the common configuration terminal and the contact switch output signal includes: Different external power supply polarities are respectively set and connected to the common configuration terminal and the contact switch output signal; Based on the potential state of the common configuration terminal, determine whether the first transistor or the second transistor is in a ready-to-conduct state, and obtain the circuit input response mode based on the determination result; Based on the circuit input response mode, if the potential state of the contact switch output signal meets the conduction condition, then the corresponding current path is turned on.
6. The method according to claim 5, characterized in that, The step of determining whether the first transistor or the second transistor is in a ready-to-conduct state based on the potential state of the common configuration terminal, and obtaining the circuit input response mode based on the determination result, includes: In response to the high potential of the common configuration terminal, the first transistor is determined to be in a ready-to-conduct state. Based on the determination result, the circuit input response mode is determined to be NPN mode. In response to the low potential of the common configuration terminal, the second transistor is determined to be in a ready-to-conduct state. Based on the determination result, the circuit input response mode is determined to be PNP mode.
7. The method according to claim 6, characterized in that, The step of detecting whether the potential state of the contact switch output signal meets the conduction condition based on the circuit input response mode, and then the corresponding current path is turned on, includes: If the circuit input response mode is NPN mode, the potential state of the contact switch output signal is detected as low. If it is, the conduction condition is met, the circuit path of the first transistor is turned on, and the effective level signal is output. Otherwise, it is not turned on, and the ineffective level signal is output. If the circuit input response mode is PNP mode, it detects whether the potential state of the contact switch output signal is high. If it is, the conduction condition is met, the circuit path of the second transistor is turned on, and the effective level signal is output. Otherwise, it is not turned on, and the ineffective level signal is output.
8. The method according to claim 1, characterized in that, The setting of the output drive circuit to be connected to the main control signal of the CNC system, so as to drive the external load according to the main control signal, includes: A MOS transistor output circuit consisting of a MOS transistor and an optocoupler is set on the IO board. The output terminal of the optocoupler is connected to the gate of the MOS transistor to drive the MOS transistor to conduct. An RC network is provided between the output port of the MOSFET and ground to absorb the reverse electromotive force generated when the MOSFET is turned off at the end of the driving process.
9. The method according to claim 1, characterized in that, The setting of the output drive circuit to be connected to the main control logic interface of the CNC system to drive the external load includes: A relay output circuit composed of relays is set on the IO board. One side of the coil of the relay is connected to the external power supply domain, and the other side of the coil of the relay is grounded through a drive switch component. The control terminal of the drive switch component is connected to the main control logic interface to control the on / off state of the relay coil; A diode is connected in reverse parallel across the two ends of the relay coil to provide clamping protection.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 9.