Adjustable trigger voltage pulse width control method

文档序号:787792 发布日期:2021-04-09 浏览:22次 中文

阅读说明:本技术 一种可调触发电压脉冲宽度控制方法 (Adjustable trigger voltage pulse width control method ) 是由 王晶晶 黄勇 肖金荣 邓启路 黎立文 于 2020-12-09 设计创作,主要内容包括:本发明公开了一种可调触发电压脉冲宽度控制方法,包括第一步,通过单片机发出初始脉冲宽度调制信号;第二步,所述初始脉冲宽度调制信号进入到数模转换电路,将数字信号转换成模拟信号输出;第三步,将第二步中获得的模拟信号通过放大电路外接放大电压;所述第一放大器上还接入防反接保护电路;第四步,所述第一放大器通过比较所述基准电压信号和对比电压信号后再输出需要发送到所述单片机的触发信号。本发明通过将单片机输出的脉冲宽度调制信号通过数模转换后再经过放大为基准电压,如果触发电压较低,要求速度较快时可以调低基准电压和设置输入脉宽小;根据实际需要分开调节基准电压和设置输入脉宽以达到更强的抗干扰能力。(The invention discloses a pulse width control method of an adjustable trigger voltage, which comprises the first step of sending an initial pulse width modulation signal through a single chip microcomputer; secondly, the initial pulse width modulation signal enters a digital-to-analog conversion circuit, and a digital signal is converted into an analog signal to be output; thirdly, externally connecting the analog signal obtained in the second step with an amplifying circuit to amplify voltage; the first amplifier is also connected with an anti-reverse connection protection circuit; and fourthly, the first amplifier outputs a trigger signal which needs to be sent to the singlechip after comparing the reference voltage signal with the comparison voltage signal. The pulse width modulation signal output by the singlechip is amplified into the reference voltage after digital-to-analog conversion, and if the trigger voltage is lower, the reference voltage can be reduced and the input pulse width is set to be small when the required speed is higher; and the reference voltage is separately adjusted and the input pulse width is set according to actual requirements so as to achieve stronger interference resistance.)

1. A method for controlling the pulse width of an adjustable trigger voltage is characterized by comprising the following steps:

firstly, sending an initial pulse width modulation signal through a single chip microcomputer;

secondly, the initial pulse width modulation signal enters a digital-to-analog conversion circuit, and a digital signal is converted into an analog signal to be output;

thirdly, externally amplifying the voltage of the analog signal obtained in the second step through an amplifying circuit, outputting the analog signal at a higher voltage, and inputting the analog signal serving as a reference voltage signal into a first amplifier for comparing the voltage; the first amplifier is also connected with an anti-reverse connection protection circuit and outputs a comparison voltage signal to the first amplifier;

and fourthly, the first amplifier outputs a trigger signal which needs to be sent to the singlechip after comparing the reference voltage signal with the comparison voltage signal.

2. The method as claimed in claim 1, wherein in the fourth step, the signal from the first amplifier is divided by a divider resistor and then input to the single chip.

3. The adjustable trigger voltage pulse width control method of claim 2, wherein the digital-to-analog conversion circuit comprises a first resistor, a second resistor, a first capacitor and a second capacitor; the first end of the first resistor receives a pulse width modulation signal sent by the singlechip, the second end of the first resistor is coupled to the first end of the second resistor, and the second end of the second resistor is coupled to the amplifying circuit; a first terminal of the first capacitor is coupled to a connection point between the first resistor and the second resistor, a second terminal of the first capacitor is coupled to a first terminal of the second capacitor, and a second terminal of the second capacitor is coupled to a second terminal of the second resistor; the connecting point between the first capacitor and the second capacitor is grounded, the resistance values of the first resistor and the second resistor are both 10k omega, and the capacitance values of the first capacitor and the second capacitor are 0.1 uf.

4. The adjustable trigger voltage pulse width control method of claim 3, wherein the amplifying circuit comprises a third resistor, a fourth resistor, and a second amplifier; the first end of the third resistor is grounded, and the second end of the third resistor is connected to the negative end of the second amplifier; a first terminal of the fourth resistor is coupled to a second terminal of the third resistor, and a second terminal of the fourth resistor is coupled to an output terminal of the second amplifier; the positive end of the second amplifier is coupled with the second end of the second resistor, an external amplification voltage is connected to the second amplifier, and the output end of the second amplifier is coupled to the negative end of the first amplifier; the resistance value of the third resistor is 1k omega, the resistance value of the fourth resistor is 7.5k omega, and the voltage value of the external amplification voltage is 24V.

5. The adjustable trigger voltage pulse width control method of claim 4, wherein the reverse-connection protection circuit comprises a diode, a transient suppression diode, a fifth resistor and a sixth resistor; a cathode of the diode is coupled to the first end of the fifth resistor, and a second end of the fifth resistor is coupled to a positive end of the first amplifier; a first terminal of the sixth resistor is coupled to a second terminal of the fifth resistor, and a second terminal of the sixth resistor is coupled to an anode terminal of the transient suppression diode; the cathode end of the transient suppression diode is coupled to the cathode end of the diode; the resistance value of the fifth resistor is 1k omega, and the resistance value of the sixth resistor is 100k omega.

Technical Field

The invention relates to the technical field of optics, in particular to a pulse width control method for adjustable trigger voltage.

Background

For a machine vision light source controller in the current market, trigger control can only use trigger voltage in a fixed range, when interference or other problems exist in a field, low voltage or high voltage needs to be replaced for triggering, the trigger voltage cannot be changed easily, and the controller in the current market cannot trigger and control a light source by identifying pulse width and setting a trigger pulse width condition.

Disclosure of Invention

In view of the above-mentioned existing trigger control can only use trigger voltage of a fixed range, when there is interference or other problems in the field, it cannot be changed easily when low voltage or high voltage trigger needs to be replaced, and the controller in the market at present cannot trigger and control the light source by identifying the pulse width and setting the trigger pulse width condition. The invention provides a method for controlling the pulse width of an adjustable trigger voltage.

A control method for pulse width of adjustable trigger voltage comprises the following steps:

firstly, sending an initial pulse width modulation signal through a single chip microcomputer;

secondly, the initial pulse width modulation signal enters a digital-to-analog conversion circuit, and a digital signal is converted into an analog signal to be output;

thirdly, externally amplifying the voltage of the analog signal obtained in the second step through an amplifying circuit, outputting the analog signal at a higher voltage, and inputting the analog signal serving as a reference voltage signal into a first amplifier for comparing the voltage; the first amplifier is also connected with an anti-reverse connection protection circuit and outputs a comparison voltage signal to the first amplifier;

and fourthly, the first amplifier outputs a trigger signal which needs to be sent to the singlechip after comparing the reference voltage signal with the comparison voltage signal.

Preferably, in the fourth step, the signal sent from the first amplifier is divided by a voltage dividing resistor and then input to the single chip microcomputer.

Preferably, the digital-to-analog conversion circuit comprises a first resistor, a second resistor, a first capacitor and a second capacitor; the first end of the first resistor receives a pulse width modulation signal sent by the singlechip, the second end of the first resistor is coupled to the first end of the second resistor, and the second end of the second resistor is coupled to the amplifying circuit; a first terminal of the first capacitor is coupled to a connection point between the first resistor and the second resistor, a second terminal of the first capacitor is coupled to a first terminal of the second capacitor, and a second terminal of the second capacitor is coupled to a second terminal of the second resistor; the connecting point between the first capacitor and the second capacitor is grounded, the resistance values of the first resistor and the second resistor are both 10k omega, and the capacitance values of the first capacitor and the second capacitor are 0.1 uf.

Preferably, the amplifying circuit comprises a third resistor, a fourth resistor and a second amplifier; the first end of the third resistor is grounded, and the second end of the third resistor is connected to the negative end of the second amplifier; a first terminal of the fourth resistor is coupled to a second terminal of the third resistor, and a second terminal of the fourth resistor is coupled to an output terminal of the second amplifier; the positive end of the second amplifier is coupled with the second end of the second resistor, an external amplification voltage is connected to the second amplifier, and the output end of the second amplifier is coupled to the negative end of the first amplifier; the resistance value of the third resistor is 1k omega, the resistance value of the fourth resistor is 7.5k omega, and the voltage value of the external amplification voltage is 24V.

Preferably, the reverse connection prevention protection circuit comprises a diode, a transient suppression diode, a fifth resistor and a sixth resistor; a cathode of the diode is coupled to the first end of the fifth resistor, and a second end of the fifth resistor is coupled to a positive end of the first amplifier; a first terminal of the sixth resistor is coupled to a second terminal of the fifth resistor, and a second terminal of the sixth resistor is coupled to an anode terminal of the transient suppression diode; the cathode end of the transient suppression diode is coupled to the cathode end of the diode; the resistance value of the fifth resistor is 1k omega, and the resistance value of the sixth resistor is 100k omega.

Has the advantages that: the invention has novel concept, reasonable design and convenient use, the pulse width modulation signal output by the singlechip is amplified into reference voltage after digital-to-analog conversion and then output to the first amplifier, the comparison is carried out by accessing the comparison voltage output by the reverse connection prevention protection circuit on the first amplifier, and then the signal voltage is output back to the singlechip according to the comparison condition, compared with the prior art, the trigger voltage range is changed by the circuit, the influence of interference signals on false triggering is avoided, and the pulse width triggering can be set by pulse width detection; if the field interference is large, the reference voltage is increased and the input pulse width is set to be large, so that the interference signal can be effectively filtered; if the trigger voltage is low, the reference voltage can be reduced and the input pulse width is set to be small when the required speed is high; and the reference voltage is separately adjusted and the input pulse width is set according to actual requirements so as to achieve stronger interference resistance.

Drawings

Fig. 1 is a circuit diagram of a single chip microcomputer according to an embodiment of the present invention.

Fig. 2 is a circuit diagram of the external circuit of the single chip microcomputer according to an embodiment of the present invention.

Detailed Description

The invention is further illustrated by the following examples in conjunction with the accompanying drawings:

as shown in fig. 1-2, an adjustable trigger voltage pulse width control circuit includes:

the singlechip is used for controlling the light source, and sending out a pulse width modulation signal and receiving a trigger signal;

the digital-to-analog conversion circuit is used for receiving the pulse width modulation signal sent by the singlechip and converting the pulse width modulation signal into an analog signal;

the amplifying circuit is used for amplifying the analog signal output by the digital-to-analog conversion circuit and outputting the analog signal as reference voltage VEF;

the first amplifier receives the reference voltage VEF and the comparison voltage, and outputs a signal voltage to the single chip microcomputer after comparison;

and the reverse connection prevention protection circuit is used for being connected to the amplifier and providing the contrast voltage.

Specifically, the digital-to-analog conversion circuit comprises a first resistor R4, a second resistor R5, a first capacitor C5 and a second capacitor C4; a first end of the first resistor R4 receives a pulse width modulation signal sent by the singlechip, a second end of the first resistor R4 is coupled to a first end of the second resistor R5, and a second end of the second resistor R5 is coupled to the amplifying circuit; a first terminal of the first capacitor C5 is coupled to a connection point between the first resistor R4 and the second resistor R5, a second terminal of the first capacitor C5 is coupled to a first terminal of the second capacitor C4, and a second terminal of the second capacitor C4 is coupled to a second terminal of the second resistor R5; the connection point between the first capacitor C5 and the second capacitor C4 is grounded.

Specifically, the amplifying circuit comprises a third resistor R1, a fourth resistor R2 and a second amplifier U2B; a first end of the third resistor R1 is grounded, and a second end of the third resistor R1 is connected to a negative terminal of the second amplifier U2B; a first terminal of the fourth resistor R2 is coupled to a second terminal of the third resistor R1, and a second terminal of the fourth resistor R2 is coupled to an output terminal of the second amplifier U2B; the positive terminal of the second amplifier U2B is coupled to the second terminal of the second resistor R5, the second amplifier U2B is connected to an external amplifying voltage, and the output terminal of the second amplifier U2B is coupled to the negative terminal of the first amplifier U2A.

Specifically, the reverse connection prevention protection circuit comprises a diode D1, a transient suppression diode D2, a fifth resistor R7 and a sixth resistor R8; a cathode of the diode D1 is coupled to the first terminal of the fifth resistor R7, and a second terminal of the fifth resistor R7 is coupled to a positive terminal of the first amplifier U2A; a first terminal of the sixth resistor R8 is coupled to a second terminal of the fifth resistor R7, and a second terminal of the sixth resistor R8 is coupled to an anode terminal of the transient suppression diode D2; the cathode terminal of the transient suppression diode D2 is coupled to the cathode terminal of the diode D1.

Specifically, the output end of the first amplifier U2A is connected in series with a voltage dividing resistor. As shown in fig. 2, the voltage dividing resistor is a seventh resistor R9 and an eighth resistor R10 connected in series, where R9 has a resistance of 100K and R10 has a resistance of 15K.

Specifically, the resistances of the first resistor R4 and the second resistor R5 are both 10k Ω, and the capacitance values of the first capacitor C5 and the second capacitor C4 are 0.1 uf.

Specifically, the resistance of the third resistor R1 is 1k Ω, the resistance of the fourth resistor R2 is 7.5k Ω, and the voltage value of the external amplification voltage is 24V.

Specifically, the resistance of the fifth resistor R7 is 1k Ω, and the resistance of the sixth resistor R8 is 100k Ω.

In summary of all the above solutions, in actual use of the present invention, as shown in fig. 1 and fig. 2, the PB7 pin of the MCU outputs a PWM signal, and then enters a digital-to-analog conversion circuit, specifically, the PWM signal is switched in through the first resistor R4, and is converted by the conversion circuit formed by the first resistor R4, the second resistor R5, the first capacitor C5, and the second capacitor C4, and then is output as a voltage of 3.3V. The 3.3V voltage is connected to the positive electrode of the second amplifier U2B in the amplifying circuit, and is output as the reference voltage VEF under the action of the third resistor R1, the fourth resistor R2 and the external amplifying voltage on the second amplifier U2B. The reference voltage VEF is input into the negative electrode of the first amplifier U2A, compared with the contrast voltage from the reverse connection prevention protection circuit, then output as a signal voltage, and is connected to the PA0 pin of the single chip microcomputer after voltage division.

In combination with the above, in another embodiment, there is provided an adjustable trigger voltage pulse width control method, including the following steps:

firstly, sending an initial pulse width modulation signal through a single chip microcomputer;

secondly, the initial pulse width modulation signal enters a digital-to-analog conversion circuit, and a digital signal is converted into an analog signal to be output;

thirdly, externally amplifying the voltage of the analog signal obtained in the second step through an amplifying circuit, outputting the analog signal at a higher voltage, and inputting the analog signal serving as a reference voltage signal into a first amplifier for comparing the voltage; the first amplifier is also connected with an anti-reverse connection protection circuit and outputs a comparison voltage signal to the first amplifier;

and fourthly, the first amplifier outputs a trigger signal which needs to be sent to the singlechip after comparing the reference voltage signal with the comparison voltage signal.

Preferably, in the fourth step, the signal sent from the first amplifier is divided by a voltage dividing resistor and then input to the single chip microcomputer.

The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种体育场馆用照明灯光智能控制系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!