Analog output device and method capable of selectively outputting voltage or current
By introducing a microcontroller unit and a signal conversion unit into the analog output device, selective output and switching of voltage or current signals are achieved, and the problems of single output type and inconvenient switching are solved, which improves application flexibility and operation convenience.
Patent Information
- Application Number
- CN201810712215.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-06-29
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2038-06-29
AI Technical Summary
The existing analog output device has a single output type, or the output signal type is inconvenient to switch, and hardware settings need to be adjusted, which affects application flexibility and operational convenience.
Design an analog output device that can selectively output voltage or current, receive voltage or current driving signals through the microcontroller unit, selectively output voltage or current, and set digital/analog signal conversion unit and analog/digital in the output channel Signal conversion unit realizes flexible switching and fault detection of signal types.
The same output channel can selectively output voltage or current, and switch through control commands, no need to change hardware settings, easy operation, and multiple output channels can be configured separately, making application flexible.
Smart Images

Figure CN108829006B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrical automation control, and in particular to an analog output device and method capable of selectively outputting voltage or current. Background Art
[0002] In the instrumentation and control system of a nuclear power plant, the analog output device is the output control input and output node of the field control station, and is the most critical module in the instrumentation and control system. Its performance and parameter characteristics are very important. For example, the Chinese patent application number CN200910249911.7 discloses a high-reliability analog output device including: a D / A conversion module, a current drive output module, an A / D output readback module, an MCU, a CPLD and a communication circuit. The current drive output module is a current driver, and the current driver is connected to the signal connector to output a current signal; it can achieve output readback detection coverage and has the advantages of safe output function.
[0003] Existing analog output devices are generally divided into two types: one, for the same device, only voltage or current can be output (as mentioned in the above patent CN200910249911.7), that is, the output type of the device is fixed, either the device can output a voltage signal or the device can output a current signal; two, for the same device, both voltage and current signals can be output, but not at the same time, and the output signal type needs to be selected through a hardware jumper or switch.
[0004] However, the inventors found in the process of implementing the present invention that the analog output device of the prior art has the following shortcomings:
[0005] 1. The disadvantage of the first output method mentioned above is that the output type is single and the application is limited.
[0006] 2. The disadvantage of the second output method is that it is inconvenient to switch the output signal type, and it is necessary to adjust the jumper or switch and change the device form. If the device is inserted into the chassis, it is necessary to unplug the device for setting; if the device includes a shell, it is necessary to open the shell for setting or consider the jumper or switch exposure when designing the shell structure. Summary of the invention
[0007] In order to solve the technical problem that the analog output device mentioned in the prior art cannot conveniently output different analog signals, the present invention provides an analog output device and method that can selectively output voltage or current, which can selectively output voltage or current only by inputting different instructions.
[0008] In order to achieve the above object, the technical solution provided by the present invention includes:
[0009] In one aspect, the present invention provides an analog output device capable of selectively outputting voltage or current, characterized in that it comprises:
[0010] The output channel is provided with a voltage output module and a current output module, and selectively outputs voltage or current according to different driving signals received by the output channel;
[0011] A micro control unit connected to the input end of the output channel, the micro control unit inputting a voltage drive signal or a current drive signal to the output channel;
[0012] When the microcontroller inputs a voltage driving signal, the output channel outputs a voltage; when the microcontroller inputs a current driving signal, the output channel outputs a current.
[0013] In a preferred embodiment of the present invention, the device comprises a plurality of output channels, and the microcontroller unit is provided with drive signal output ports corresponding to the plurality of output channels respectively, so that each output channel receives a voltage drive signal or a current drive signal separately.
[0014] Preferably, in an embodiment of the present invention, the device further comprises: a digital / analog signal conversion unit located between the microcontroller unit and the output channel, and an analog / digital signal conversion unit connected to the output end of the digital / analog signal conversion unit, wherein the analog / digital signal conversion unit collects the analog signal of the digital / analog signal conversion unit, converts the analog signal into a digital signal, and then feeds it back to the microcontroller unit.
[0015] It is further preferred that in an embodiment of the present invention, when the difference between the digital signal fed back by the analog / digital signal conversion unit and the digital signal input by the digital / analog signal conversion unit is greater than a predetermined value, the microcontroller unit determines that the output channel connected to the digital / analog signal conversion unit is faulty, and stops the output of the digital / analog signal conversion unit.
[0016] Preferably, in an embodiment of the present invention, the output end of the output channel is also connected to the micro control unit, and when the analog output device is in the voltage output mode, if the load is short-circuited or the load is too small, the fault indication pin is at a low level; when the analog output device is in the current output mode, if the load is open-circuited or the load is too large, the fault indication pin is at a low level.
[0017] Another aspect of the present invention provides an analog output method capable of selectively outputting voltage or current, characterized in that it comprises:
[0018] The microcontroller unit inputs a driving signal to the output channel;
[0019] Determining whether the driving signal represents a voltage driving signal or a current driving signal;
[0020] When the microcontroller inputs a voltage driving signal, the output channel outputs a voltage; when the microcontroller inputs a current driving signal, the output channel outputs a current.
[0021] In a preferred embodiment of the present invention, the microcontroller unit inputs a driving signal to an output channel in the following manner: the microcontroller unit is provided with driving signal output ports corresponding to the multiple output channels respectively, so that each output channel receives a voltage or current driving signal separately.
[0022] Preferably, in an embodiment of the present invention, the method further comprises: inputting an analog signal into the output channel via a digital / analog signal conversion unit located between the microcontroller unit and the output channel; collecting an analog signal of the digital / analog signal conversion unit via an analog / digital signal conversion unit connected to the output end of the digital / analog signal conversion unit, and after converting the analog signal into a digital signal, feeding it back to the microcontroller unit.
[0023] It is further preferred that in an embodiment of the present invention, when the difference between the digital signal fed back by the analog / digital signal conversion unit and the digital signal input by the digital / analog signal conversion unit is greater than a predetermined value, the microcontroller unit determines that the output channel connected to the digital / analog signal conversion unit is faulty, and stops the output of the digital / analog signal conversion unit.
[0024] Preferably, in an embodiment of the present invention, when the microcontroller inputs a voltage drive signal, if the load is short-circuited or the load is too small, the fault indication pin is at a low level; when the microcontroller inputs a current drive signal, if the load is open-circuited or the load is too large, the fault indication pin is at a low level.
[0025] By adopting the above technical solution provided by the present application, at least one of the following beneficial effects can be obtained:
[0026] 1. For the same output channel, voltage signal or current signal can be selectively output, and the output of different signal types can be switched through control instructions, without changing the hardware settings, easy to operate; and there is no restriction on the design of the device structure.
[0027] 2. When the analog output device is provided with multiple output channels, each channel can be individually configured with voltage or current output, which makes it easier to control the multiple output channels of the analog output device separately; each output channel can be individually configured, and the application is flexible.
[0028] Other features and advantages of the invention will be described in the following description, and partly become apparent from the description, or understood by implementing the technical solution of the invention. The purpose and other advantages of the invention can be achieved and obtained by the structures and / or processes specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of an analog output device capable of selectively outputting voltage or current provided by an embodiment of the present invention Figure 1 .
[0030] Figure 2 A schematic diagram of an analog output device capable of selectively outputting voltage or current provided by an embodiment of the present invention Figure 2 .
[0031] Figure 3 A schematic diagram of an output voltage state of an output channel in an analog output device capable of selectively outputting voltage or current provided by an embodiment of the present invention.
[0032] Figure 4 A schematic diagram of an output current state of an output channel in an analog output device capable of selectively outputting voltage or current provided by an embodiment of the present invention.
[0033] Figure 5 A schematic diagram of an analog output device capable of selectively outputting voltage or current provided by another embodiment of the present invention.
[0034] Figure 6 A flowchart of an analog output method capable of selectively outputting voltage or current is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that these specific descriptions are only to make it easier and clearer for ordinary technicians in the field to understand the present invention, rather than a restrictive interpretation of the present invention; and as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0036] Additionally, the steps shown in the flowcharts of the accompanying drawings may be executed in a control system such as a set of controller executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown here.
[0037] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments:
[0038] Example
[0039] like Figure 1 As shown, this embodiment provides an analog output device capable of selectively outputting voltage or current, the analog output device comprising:
[0040] The output channel 200 is provided with a voltage output module 210 and a current output module 220, and selectively outputs voltage or current according to different driving signals received by the output channel;
[0041] A micro control unit 100 connected to an input end of the output channel 200, the micro control unit 100 inputs a voltage drive signal or a current drive signal to the output channel 200;
[0042] When the micro control unit 100 receives a voltage driving signal, the output channel 200 outputs a voltage; when the micro control unit 100 receives a current driving signal, the output channel 200 outputs a current.
[0043] It should be noted that the voltage output module 210 and the current output module 220 mentioned in this embodiment can be independent modules, such as a chip with an independent voltage signal output function, a peripheral circuit connected to the voltage signal control chip, and a chip with an independent current signal output function, a peripheral circuit connected to the current signal control chip; according to different output requirements, enable signals are input to different chips. The voltage output module 210 and the current output module 220 can also be integrated in a chip and a peripheral circuit with both voltage output and current output functions, that is, the voltage output module 210 and the current output module 220 have overlapping circuits; for example, according to the received voltage input enable signal, the output circuit formed is the voltage output module 210; according to the received current input enable signal, the output short circuit formed is the current output module 220. These different specific implementations all belong to the protection scope of this application.
[0044] Among them, the microcontroller unit (MCU), also known as a single chip microcomputer or a single chip microcomputer, appropriately reduces the frequency and specifications of the central processing unit (CPU), and integrates memory, timer, USB, A / D conversion, UART, PLC, DMA and other peripheral interfaces, and even LCD drive circuits on a single chip to form a chip-level computer, which performs different combination controls for different application scenarios; specifically, the microcontroller unit provided in this embodiment also includes GPIO (General Purpose Input Output), and the GPIO product can provide control and monitoring functions; for example, GPIO can output high level or low level, and a high level (or low level) can be selected as a voltage drive signal, and the enable module corresponding to the output channel 200 enables the voltage output module 210; and correspondingly, a low level (or high level) can be selected as a current drive signal, and the enable module corresponding to the output channel 200 enables the current output module.
[0045] like Figure 2 As shown, in this embodiment, preferably, the analog output device further includes: a digital / analog signal conversion unit (D / A chip) located between the microcontroller unit and the output channel, and an analog / digital signal conversion unit (A / D chip) connected to the output end of the digital / analog signal conversion unit, the analog / digital signal conversion unit (D / A chip) collects the analog signal of the digital / analog signal conversion unit (A / D chip), and after converting the analog signal into a digital signal, feeds it back to the microcontroller unit. In this embodiment, further preferably, when the difference between the digital signal fed back by the analog / digital signal conversion unit (D / A chip) and the digital signal input by the digital / analog signal conversion unit (A / D chip) is greater than a predetermined value, the microcontroller (single-chip microcomputer) determines that the output channel connected to the digital / analog signal conversion unit (D / A chip) is faulty, and stops the output of the digital / analog signal conversion unit.
[0046] More specifically, the microcontroller outputs digital signals to the D / A chip through SPI0, and the D / A chip outputs analog voltage signals after conversion. SPI is the abbreviation of Serial Peripheral Interface. SPI is a high-speed, full-duplex, synchronous communication bus, and only occupies four wires on the chip pins, saving the chip pins and saving space on the PCB layout, providing convenience. It is precisely because of this simple and easy-to-use feature that more and more chips now integrate this communication protocol, such as AT91RM9200. The voltage signal output by the D / A chip is sent to the output channel on the one hand, and after conditioning, it can output the final required signal; on the other hand, it is converted from analog to digital through the A / D acquisition chip and sent to the microcontroller through SPI1 as a basis for diagnosis. If the digital signal output by SPI0 is too different from the digital signal collected by SPI1, it is considered that the channel is faulty and the D / A output is stopped. Figure 2 A preferred implementation manner in which: the voltage output module in the output channel can directly receive the analog signal output by the D / A chip after the enabling module receives the voltage driving signal input by the single-chip microcomputer, and then convert and output the corresponding voltage; the voltage output module in the output channel can directly receive the analog signal output by the D / A chip after the enabling module receives the current driving signal input by the single-chip microcomputer, and then convert and output the corresponding current.
[0047] In this embodiment, preferably, the analog output device includes multiple output channels, and the microcontroller unit is provided with drive signal output ports (such as multiple GPIO ports) corresponding to the multiple output channels respectively, so that each output channel receives a voltage drive signal or a current drive signal separately.
[0048] Of course, as an alternative implementation, multiple output channels with the same output signals (for example, multiple channels always require voltage signals under a certain condition, and always require current signals under another condition) can be connected to the same GPIO port, which can save hardware resources.
[0049] like Figure 2As shown, in this embodiment, preferably, the output end of the output channel is also connected to the microcontroller, and when the analog output device is in the voltage output mode, if the load is short-circuited or the load is too small, the fault indication pin is low level; when the analog output device is in the current output mode, if the load is open-circuited or the load is too large, the fault indication pin is low level. That is, if the I / O port of the single-chip microcomputer outputs a low level, the device outputs a voltage signal; the single-chip microcomputer can also detect the fault indication pin of the output channel through the I / O port to detect the load fault in time. In the voltage output mode, if the load is short-circuited or the load is too small, the fault indication pin is low level; in the current output mode, if the load is open-circuited or the load is too large, the fault indication pin is low level.
[0050] Combine the following Figure 3 , Figure 4 Specifically describe how the output channel in the embodiment of the present application selectively outputs a voltage signal or a current signal according to the input signal:
[0051] like Figure 3 and Figure 4 As shown, an existing, dedicated voltage and current output chip is provided in the output channel; the voltage and current output chip is connected to the GPIO port of the single-chip microcomputer, and the voltage or current output can be selected by controlling the M1 and M2 pins of the output chip through the GPIO port of the single-chip microcomputer; the specific control logic is shown in Table 1.
[0052] M1 M2 MODE L L Vout (voltage output) L H Iout (current output)
[0053] Table 1. Output channel input and output control logic relationship table
[0054] like Figure 5 As shown, this embodiment also provides an analog output method that can selectively output voltage or current, and the analog output method includes:
[0055] S1. The microcontroller unit inputs a driving signal to the output channel; specifically: a. The microcontroller unit can receive the input signal of the input unit in the control unit, and then output it to the output channel; b. The signal input by the external input device connected to the microcontroller unit through the bus is then output to the output channel; c. The corresponding signal is directly output to the output channel through the specified code loaded in the microcontroller unit memory; More specific implementation: For example, the microcontroller unit receives communication data through the CAN bus, and the data includes the output signal type (voltage or current) and output data (i.e., the size of the voltage or current). Then the microcontroller unit controls the output type of the output channel through the GPIO port on the one hand, and sends the output data (digital quantity) to the DA (digital-to-analog conversion circuit) through the SPI on the other hand. The DA (digital-to-analog conversion circuit) converts the output data into analog quantity and finally outputs it to the output channel.
[0056] S2, determine whether the driving signal represents a voltage driving signal or a current driving signal; the microcontroller unit or the output channel determines the type of the driving signal output in step S1, that is, determines whether the signal is a voltage driving signal or a current driving signal; as a preferred solution, as mentioned above, the signal input by the GPIO can be distinguished as a voltage driving signal or a current driving signal by high or low, and similarly, it can also be determined whether it is a voltage driving signal or a current driving signal by whether the signal is high voltage or low voltage;
[0057] S3. When the microcontroller inputs a voltage driving signal, the output channel outputs a voltage; when the microcontroller inputs a current driving signal, the output channel outputs a current.
[0058] It should be noted that the above “when the microcontroller inputs a voltage drive signal” and “when the microcontroller inputs a current drive signal” refer to the input signal for the output channel (or output chip) connected to the microcontroller, and the output signal for the microcontroller itself.
[0059] In this embodiment, preferably, in step S1 of the analog output method, the microcontroller unit inputs a driving signal to the output channel, including: the microcontroller unit is provided with driving signal output ports corresponding to the plurality of output channels respectively, so that each output channel receives a voltage or current driving signal separately.
[0060] In this embodiment, preferably, the analog output method further includes: inputting an analog signal to the output channel through a digital / analog signal conversion unit located between the microcontroller unit and the output channel; collecting the analog signal of the digital / analog signal conversion unit through an analog / digital signal conversion unit connected to the output end of the digital / analog signal conversion unit, and after converting the analog signal to a digital signal, feeding it back to the microcontroller unit. Further preferably, when the difference between the digital signal fed back by the analog / digital signal conversion unit and the digital signal input by the digital / analog signal conversion unit is greater than a predetermined value, the microcontroller unit determines that the output channel connected to the digital / analog signal conversion unit is faulty, and stops the output of the digital / analog signal conversion unit.
[0061] In the present embodiment, preferably, in the above-mentioned analog output method, when the microcontroller inputs a voltage drive signal, if the load is short-circuited or the load is too small, the fault indication pin is a low level; when the microcontroller inputs a current drive signal, if the load is open-circuited or the load is too large, the fault indication pin is a low level.
[0062] like Figure 6As shown, the analog output device or analog output method provided in this embodiment can be applied in the SpeedyHold platform of the DCS instrumentation and control system, for example, to realize a 4-channel analog output device.
[0063] The analog output device is divided into four parts: output channel, single-chip system, communication, and power supply; the power supply of the channel, single-chip system, and communication is independent of each other. The analog output device has 4 output channels, and the output type can be controlled by different GPIO ports. The output type of each channel is independent; the output of D / A is read back by A / D to realize the self-diagnosis function.
[0064] Specifically, the CAN bus interface of the MCU of the analog output device is connected to an external first connector through a CAN communication bus, and the first connector can be connected to a main control unit of a DCS instrumentation and control system; and the first connector inputs the required power signal to the MCU through a plurality of power modules; the MCU is also provided with Figure 2 The same D / A chip (DAC), A / D chip (ADC), and a signal isolation device is provided between the MCU and the D / A chip and the A / D chip; a digital / analog signal conversion unit (D / A chip) located between the microcontroller unit (MCU) and the output channel, and an analog / digital signal conversion unit (A / D chip) connected to the output end of the digital / analog signal conversion unit, the analog / digital signal conversion unit (D / A chip) collects the analog signal of the digital / analog signal conversion unit (A / D chip), and after converting the analog signal into a digital signal, feeds it back to the microcontroller unit; when the difference between the digital signal fed back by the analog / digital signal conversion unit (D / A chip) and the digital signal input by the digital / analog signal conversion unit (A / D chip) is greater than a predetermined value, the microcontroller unit (single-chip microcomputer) determines that the output channel connected to the digital / analog signal conversion unit (D / A chip) is faulty, and stops the output of the digital / analog signal conversion unit. . And the MCU inputs driving signals to the four output channels respectively through the GPIO port, and the output channels input the required voltage signal or current signal to the module requiring the corresponding signal in the DCS instrumentation and control system through the second connector.
[0065] By adopting the above technical solution provided by the present application, at least one of the following beneficial effects can be obtained:
[0066] 1. For the same output channel, voltage signal or current signal can be selectively output, and the output of different signal types can be switched through control instructions, without changing the hardware settings, easy to operate; and there is no restriction on the design of the device structure.
[0067] 2. When the analog output device is provided with multiple output channels, each channel can be individually configured with voltage or current output, which makes it easier to control the multiple output channels of the analog output device separately; each output channel can be individually configured, and the application is flexible.
[0068] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0069] Finally, it should be noted that the above description is only the best embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the art can make many possible changes and simple replacements to the technical solution of the present invention by using the above disclosed practices and technical contents without departing from the scope of the technical solution of the present invention, which all belong to the scope of protection of the technical solution of the present invention.
Claims
1. An analog output device capable of selectively outputting voltage or current, applied to a DCS instrumentation control system, characterized in that: include: The output channel is provided with a voltage output module and a current output module, and selectively outputs voltage or current according to different driving signals received by the output channel; A micro control unit connected to the input end of the output channel, the micro control unit inputting a voltage drive signal or a current drive signal to the output channel; A digital / analog signal conversion unit located between the microcontroller unit and the output channel, and an analog / digital signal conversion unit connected to the output end of the digital / analog signal conversion unit, wherein the analog / digital signal conversion unit collects the analog signal of the digital / analog signal conversion unit, converts the analog signal into a digital signal, and then feeds it back to the microcontroller unit; when the difference between the digital signal fed back by the analog / digital signal conversion unit and the digital signal input by the digital / analog signal conversion unit is greater than a predetermined value, the microcontroller unit determines that the output channel connected to the digital / analog signal conversion unit is faulty, and stops the output of the digital / analog signal conversion unit; A signal isolation device is provided between the micro control unit and the digital / analog signal conversion unit, and between the analog / digital signal conversion unit; Wherein, when the microcontroller inputs a voltage driving signal, the output channel outputs a voltage; when the microcontroller inputs a current driving signal, the output channel outputs a current; The output end of the output channel is also connected to the micro control unit, and when the analog output device is in the voltage output mode, if the load is short-circuited or the load is too small, the fault indication pin is at a low level; when the analog output device is in the current output mode, if the load is open-circuited or the load is too large, the fault indication pin is at a low level.
2. The device according to claim 1, characterized in that The device comprises a plurality of output channels, and the micro control unit is provided with drive signal output ports respectively corresponding to the plurality of output channels, so that each output channel receives a voltage drive signal or a current drive signal separately.
3. An analog output method capable of selectively outputting voltage or current, applied to a DCS instrumentation control system, characterized in that: include: The microcontroller unit inputs a driving signal to the output channel; Determining whether the driving signal represents a voltage driving signal or a current driving signal; An analog signal is input into the output channel through a digital / analog signal conversion unit located between the microcontroller unit and the output channel; an analog signal of the digital / analog signal conversion unit is collected through an analog / digital signal conversion unit connected to the output end of the digital / analog signal conversion unit, and after converting the analog signal into a digital signal, the analog signal is fed back to the microcontroller unit; when the difference between the digital signal fed back by the analog / digital signal conversion unit and the digital signal input by the digital / analog signal conversion unit is greater than a predetermined value, the microcontroller unit determines that the output channel connected to the digital / analog signal conversion unit is faulty and stops the output of the digital / analog signal conversion unit; and a signal isolation device is provided between the microcontroller unit and the digital / analog signal conversion unit and the analog / digital signal conversion unit; Wherein, when the microcontroller inputs a voltage driving signal, the output channel outputs a voltage; when the microcontroller inputs a current driving signal, the output channel outputs a current; When the microcontroller inputs a voltage drive signal, if the load is short-circuited or too small, the fault indication pin is at a low level; when the microcontroller inputs a current drive signal, if the load is open-circuited or too large, the fault indication pin is at a low level.
4. The method according to claim 3, characterized in that The manner in which the microcontroller unit inputs a driving signal to an output channel includes: the microcontroller unit is provided with driving signal output ports corresponding to a plurality of output channels respectively, so that each output channel receives a voltage or current driving signal separately.
