Fast and stable constant current source system with automatic switching for dual lamp fault diagnosis
Through digital + analog dual closed-loop constant current source system and field effect tube automatic switching technology, the problems of short stable adjustment time of constant current source and unstable switch of backup lamps are solved, and the rapid stability of constant current source and automatic switching of dual lamps are realized. , improves the working efficiency and reliability of the instrument.
Patent Information
- Application Number
- CN201811449479.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-30
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2038-11-30
AI Technical Summary
The existing constant current source has insufficient stability adjustment time, and the use of mechanical switches to switch backup lamps in the instrument leads to circuit instability and noise problems, affecting working performance.
Using digital + analog dual closed-loop fast and stable constant current source system, the three-stage working modes of large preset value start, dual closed-loop PID rough adjustment fast and stable and single closed-loop stable current can be achieved quickly and stably, and the conduction of the field effect tube is used. Features to perform dual-light fault detection and automatic switching to avoid controller intervention.
It realizes rapid and stable adjustment of the constant current source, reduces the noise and mechanical fatigue of the circuit in the instrument, and improves working efficiency and equipment reliability.
Smart Images

Figure CN109348603B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a circuit for steady-current power supply of light sources for electronic measurement and control, spectrum analysis and instrument calibration, and is particularly suitable for instruments requiring fast and stable power supply and automatic switching of standby lamps, especially portable spectrometers and airborne hyperspectral light source systems. Background Art
[0002] The existing constant current source technology is mature. It adopts a negative feedback amplifier circuit based on a standard voltage. By comparing the standard voltage with the sampled feedback voltage, the output of the amplifier circuit is adjusted to control the current in the load circuit to be constant. By changing the standard voltage, the output of the constant current source can be controlled, which is called a controllable constant current source. Accuracy and stability are important technical indicators of constant current sources. At present, the stability, accuracy and other indicators of constant current sources at home and abroad have reached more than 0.1%. However, the stable adjustment time of the constant current source has not received much attention in current research. The data show that the high-precision constant current source developed by Zeng Bin (1994) of Tianshui Kangcai Measurement and Control Technology Research Institute has a stability of ±0.005%, but within 10 minutes, there will be a trend of slow current increase or decrease; the high-precision wide-range constant current source developed by Wu Maocheng (2011) of Soochow University has an output current of 1uA-1A, an accuracy of 0.152%, a stability of 0.047%, and a preheating time of 10min; in the last century, constant current source research has been carried out, but there is no research report on the rapid stability of constant current sources.
[0003] PID control is a commonly used closed-loop control method, but in the constant current source system, the application of PID algorithm has not significantly improved the accuracy and stability of the constant current source. Bao Yujun et al. (2013) of Changzhou Institute of Technology designed a variable load high-stability constant current source with PID algorithm, which has an output current of 0-2000mA, and the accuracy and constant current stability both reach 0.1%. Moreover, PID is dynamically adjusted, and analysis shows that its rapid adjustment is difficult to guarantee.
[0004] In addition, for instruments that require backup lamps, mechanical switches or analog switches are often used for dual lamp switching. Compared with the two, analog switches have the characteristics of low power consumption, high speed, no mechanical contacts, small size and long service life. For easy control, controllable mechanical switch relays are often used, which have low switching frequency. When switching, the opening and closing jitter and current overshoot will affect the stability of the working circuit and introduce noise; and there are mechanical fatigue and safety hazards. Summary of the invention
[0005] The purpose of the present invention is to provide a "digital + analog dual closed loop" fast and stable constant current source with controllable output current, which is a fast and stable controllable constant current source realized by the "digital + analog dual closed loop" method, in view of the requirements of high spectral stability and short stabilization time of the light source of the spectrometer, while the existing constant current source has the problem of long stabilization time caused by slow changes in the early stage of work. The invention is aimed at the requirements of high spectral stability and short stabilization time of the light source of the spectrometer, and ..., in order to provide a fast and stable constant current source with controllable output current, and the invention is a fast and stable controllable constant current source realized by the "digital + analog dual closed loop" method. The three-stage working mode of fast preheating, fast stabilization of dual closed loop PID coarse adjustment and single closed loop current stabilization is started by the large preset value of the dual closed loop circuit, so as to speed up the adjustment process and quickly reach the current stable state.
[0006] At the same time, another purpose of the present invention is to address the problem of unstable circuit operation caused by opening and closing jitter and overshoot when a mechanical switch is used to control the switching of the instrument's working light and standby light. A dual-lamp fault control detection + automatic switching circuit is provided, which utilizes the conduction characteristics of the field effect transistor to achieve automatic fault detection and switching of the working light without the need for a controller. Control is only required when a standby light fault is detected, thereby avoiding the opening and closing of the relay when the power supply system is working, which affects the stability of the instrument's operation.
[0007] The objective of the present invention is achieved through the following technical solutions:
[0008] A fast and stable constant current source system for dual-lamp fault diagnosis and automatic switching, comprising four modules: control processing, controllable constant current source, dual-lamp switching and power supply. The power supply module is respectively connected to the control processing module, the controllable constant current source module and the dual-lamp switching module. The four modules respectively constitute a digital + analog dual closed-loop fast and stable constant current source circuit and a dual-lamp fault control detection + automatic switching two functional circuits;
[0009] The control processing module includes a microprocessor, a standard voltage output terminal, a voltage acquisition terminal 1, a voltage acquisition terminal 2, a control signal terminal, a status signal terminal, a serial communication interface, a power supply terminal U C The microprocessor includes an MPU, a DAC, a dual-channel ADC circuit, a serial port, and an IO port; the DAC is connected to the standard voltage output terminal through the IO port; the dual-channel ADC is respectively connected to the voltage acquisition terminal 1 and the voltage acquisition terminal 2 through the IO port; the serial port is connected to the serial communication interface; the control signal terminal and the status signal terminal are connected to the IO port of the microprocessor; the power port of the microprocessor is connected to the power terminal U C connect;
[0010] The controllable constant current source module is composed of a differential amplifier circuit, a sampling resistor, a feedback circuit, a standard voltage input terminal, a feedback voltage terminal, a load interface positive and negative terminals, and a power supply terminal U IThe module is composed of a constant current source circuit that simulates a closed loop. When a standard voltage is connected to the standard voltage input terminal, the output current value is the ratio of the standard voltage to the sampling resistor. The two input terminals of the differential amplifier circuit: the standard voltage terminal and the feedback voltage terminal are respectively connected to the standard voltage output terminal and the feedback circuit output terminal, and its output terminal is connected to one end of the sampling resistor; the two input terminals of the feedback circuit are respectively connected to the two ends of the sampling resistor, and its output terminal is connected to the feedback voltage input terminal and the feedback voltage terminal of the differential amplifier circuit; the positive terminal of the load interface is connected to the power supply terminal U I Connection, the negative end of the load interface is connected in series with one end of the sampling resistor; the power supply U I The positive and negative terminals are respectively connected to the positive and negative power supply terminals of the differential amplifier circuit and the feedback circuit;
[0011] The dual-lamp switching module is composed of a dual-lamp parallel circuit, a load interface positive terminal, a load interface negative terminal, a voltage sampling terminal 2, a relay control terminal and a power supply terminal U DL The dual-lamp parallel circuit consists of a working lamp connected in series with the relay K, and a standby lamp connected in series with the field effect tube Q; the power supply terminal U DL They are respectively connected to the power supply end of relay K and the gate G of field effect tube Q; the positive end of the load interface is connected to the working light and standby light connection ends, and the negative end of the load interface is connected to the switch end of relay K, the drain D of field effect tube Q, and the voltage sampling end 2; the relay control end is connected to the control end of relay K;
[0012] The power supply module is respectively connected to the processing control, dual lamp switching and controllable constant current source modules through the power supply terminal to provide the required power supply voltage for the other three modules.
[0013] The standard voltage input terminal of the controllable constant current source module is connected to the standard voltage output terminal of the control processing module, the feedback voltage terminal is connected to the voltage acquisition terminal 1 of the control processing module, and the positive and negative terminals of the load interface are connected to the positive and negative terminals of the load interface of the dual-lamp switching module; the voltage acquisition terminal 2 and the control signal terminal of the control processing module are respectively connected to the voltage sampling terminal 2 and the relay control terminal of the dual-lamp switching module, and the status signal terminal and the serial communication interface are respectively connected to the external controller or the host computer to provide the current working status to the outside.
[0014] The digital + analog dual closed-loop fast and stable constant current source circuit is composed of a controllable constant current source module, a control processing module, a valid load of a dual-lamp switching module, and a power supply module; the standard voltage input end of the controllable constant current source module is connected to the standard voltage output end of the control processing module, the feedback voltage end is connected to the voltage acquisition end 1 of the control processing module, and the positive and negative ends of the load interface are connected to the positive and negative ends of the load interface of the dual-lamp switching module; the three modules are connected to the power supply module through the power supply end.
[0015] The digital + analog dual closed-loop fast and stable constant current source circuit achieves a steady current state through the following three-stage working mode:
[0016] A. Large preset value starts fast preheating:
[0017] ① The output terminal of the status signal is set to 0, indicating that the system is not in a stable state;
[0018] ②DAC assigns a larger value D DA0 ;
[0019] Increase the standard voltage to make the system quickly thermally stable, where D DA0 Calculated by formula (1):
[0020]
[0021] Where n is the number of bits of the DAC, I 0 is the initial load current, and its value is the maximum load current I of the load light source max and the larger value of the working current I, not exceeding I max In the case of S is the resistance of the sampling resistor, U DA is the maximum output voltage of the DAC;
[0022] B. Dual closed-loop PID coarse adjustment for fast and stable operation: Start the PID link in time for fast coarse adjustment. The steps are as follows:
[0023] ①i=1, start ADC1 acquisition processing, and get the measured value D of the sampling voltage of the sampling resistor Si , and the load current I is calculated by formula (2) S The error e with the working current I i :
[0024]
[0025] In the formula, m 1 is the number of bits of ADC1; U AD is the maximum input voltage of ADC;
[0026] ② Start the proportional and differential links, according to the current error e i , adjust the DAC value D according to formula (3) using the proportional and differential links DA :
[0027] Δ i =K P ·e i +K D (e i -e i-1 ) (3)
[0028] Where: k P , k D are the proportional and differential coefficients respectively, and their values are determined according to the basic rules for PD parameter adjustment; then the corresponding D DAi Calculated by formula (4):
[0029]
[0030] Control the DAC converter output voltage so that the output current error e reaches the requirement as soon as possible, speeding up the adjustment process. When the output current error e reaches the 1%I requirement, end the PD adjustment and enter step ③; otherwise i=i+1, ADC1 collects D Si , calculate the current error e according to formula (2) i , continue to cycle this step;
[0031] ③i=1, set the estimated adjustment time and start timing;
[0032] ④PID link adjustment D DAi . Start the integral link to eliminate the net difference produced by the proportional and differential link adjustments, D DAi Error adjustment value Δ i Determine according to formula (5):
[0033]
[0034] Where: k I is the integral coefficient, and its value is determined according to the basic rules of PID parameter adjustment. The D after this PID adjustment is calculated according to formula (4). DAi When the adjustment time reaches the expected time, this step ends and the process goes to step C; otherwise, i=i+1 and data D is collected according to ADC1. Si , the error e is calculated according to formula (2): i , continue to cycle this step;
[0035] C. Single closed loop steady flow:
[0036] D DA Assign the working value and start the timing wait. When the set time is reached, exit the wait. According to formula (6), assign the DAC value D according to the working current I DA :
[0037]
[0038] The output voltage of the standard voltage output terminal of the fixed control processing module is started, and the ADC collection processing of the voltage collection terminal 2 is started. According to the judgment basis of the working state of the dual lamps, according to its collection value D kDetermine the working status of the two lamps: When the judgment result is the dual-lamp switching state, the status signal terminal output is set to 0, and return to step A; when the judgment result is the working light or the standby light is in normal working state, the analog closed-loop constant current source circuit works independently, delays for a certain period of time, so that the output current reaches the set value, and the status signal terminal output is set to 1; when the judgment result is the dual-lamp fault state, the status signal terminal output is set to 0, and the serial port reports the lamp replacement warning information to the instrument.
[0039] The dual-lamp fault control detection + automatic switching circuit is composed of a dual-lamp switching module, a control processing module, a power supply module and a constant current source part of a controllable constant current source module; the dual-lamp parallel circuit of the dual-lamp switching module is connected to the positive and negative ends of the load interface of the controllable constant current source as a load, the voltage sampling terminal 2 is connected to the voltage acquisition terminal 2 of the microprocessor module, and the relay control terminal is connected to the control signal terminal of the control processing module. When the system is working, the relay is in a closed state, and the characteristic that the field effect tube is in the pinch-off zone when the gate-source voltage of the field effect tube is less than the pinch-off voltage is used to automatically switch the dual lamps, and by comparing the sampling value D of the voltage acquisition terminal 2 k D in different states kt , t = 1, 2, 3, determine the working status of the dual lights; where:
[0040]
[0041]
[0042] D k3 =0 (9)
[0043] In the formula, m 2 is the number of bits of ADC2, U AD2 is the maximum input voltage of ADC2, V CC is the positive terminal voltage of the load end of the controllable constant current source module, U 1 The voltage across the lamp when it is powered by a constant current I, U 2 The voltage of the drain D and source S when the field effect tube in the dual-lamp switching module is turned on;
[0044] Method for judging the working status of dual lights:
[0045] (1) When D k In D k1 When it is nearby, the work light is in normal working state;
[0046] (2) When D k In D k2 When nearby, the standby light is in normal working condition, and the working light is out of order;
[0047] (3) When D k In D k1 Jump to D nearby k2When nearby, the double lights are switched;
[0048] (4) When D k In D k3 When it is nearby, it is in the double lamp failure state and the system does not work;
[0049] When the working lamp is not faulty and the standby lamp needs to be diagnosed, the relay is disconnected and the ADC2 sampling value D of the voltage acquisition terminal 2 is k , determine whether the standby lamp is faulty:
[0050] (1) When D k In D k2 When nearby, the backup lights are not faulty;
[0051] (2) When D k In D k3 When nearby, the backup light is faulty.
[0052] Beneficial effects: The digital + analog dual closed-loop circuit proposed by the present invention can quickly stabilize the constant current source, solving the problems of long stabilization time of the existing constant current driven halogen tungsten lamp and complicated constant current source debugging process; dual lamp fault control detection + automatic switching does not require control, when the working lamp fails, it can automatically switch to the backup lamp as the light source, avoiding the opening and closing jitter and overshoot of the existing instrument when the backup lamp is switched by controlling the mechanical switch, which affects the unstable circuit operation; in the non-working state of the system, the two lamps can also be respectively detected for faults by controlling the closing and opening of the relay. It improves work efficiency and reduces the use cost and operating expenses. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 The structural block diagram of the fast and stable constant current source system with automatic switching for dual lamp fault diagnosis.
[0054] Figure 2 For attachment Figure 1 Structural block diagram of the control processing module.
[0055] Figure 3 For attachment Figure 1 Structural block diagram of controllable constant current source.
[0056] Figure 4 This is a working diagram of the "digital + analog dual closed loop" fast and stable constant current source of the present invention.
[0057] Figure 5 This is the dual lamp fault control detection + automatic switching circuit diagram of the present invention. DETAILED DESCRIPTION
[0058] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments:
[0059] The fast and stable constant current source circuit system for automatic switching of dual light source fault diagnosis of the present invention includes four modules: control processing, controllable constant current source, dual light switching, and power supply. Figure 1 shown.
[0060] A fast and stable constant current source system for dual-lamp fault diagnosis and automatic switching, comprising four modules: control processing, controllable constant current source, dual-lamp switching and power supply. The power supply module is respectively connected to the control processing module, the controllable constant current source module and the dual-lamp switching module. The four modules respectively constitute a digital + analog dual closed-loop fast and stable constant current source circuit and a dual-lamp fault control detection + automatic switching two functional circuits;
[0061] The control processing module includes a microprocessor, a standard voltage output terminal, a voltage acquisition terminal 1, a voltage acquisition terminal 2, a control signal terminal, a status signal terminal, a serial communication interface, a power supply terminal U C The microprocessor includes an MPU, a DAC, a dual-channel ADC circuit, a serial port, and an IO port; the DAC is connected to the standard voltage output terminal through the IO port; the dual-channel ADC is respectively connected to the voltage acquisition terminal 1 and the voltage acquisition terminal 2 through the IO port; the serial port is connected to the serial communication interface; the control signal terminal and the status signal terminal are connected to the IO port of the microprocessor; the power port of the microprocessor is connected to the power terminal U C connect;
[0062] The controllable constant current source module is composed of a differential amplifier circuit, a sampling resistor, a feedback circuit, a standard voltage input terminal, a feedback voltage terminal, a load terminal, and a power supply terminal U I The module is composed of a constant current source circuit that simulates a closed loop. When a standard voltage is connected to the standard voltage input terminal, the output current value is the ratio of the standard voltage to the sampling resistor. The differential amplifier circuit has two input terminals: the standard voltage terminal and the feedback voltage terminal are respectively connected to the standard voltage output terminal and the feedback circuit output terminal, and its output terminal is connected to one end of the sampling resistor; the two input terminals of the feedback circuit are respectively connected to the two ends of the sampling resistor, and its output terminal is connected to the feedback voltage input terminal and the feedback voltage terminal of the differential amplifier circuit; the positive terminal of the load interface is connected to the power supply terminal U I Connection, the negative end of the load interface is connected in series with one end of the sampling resistor; the power supply U I The positive and negative terminals are respectively connected to the positive and negative power supply terminals of the differential amplifier circuit and the feedback circuit;
[0063] The dual-lamp switching module is composed of a dual-lamp parallel circuit, a load interface positive terminal, a load interface negative terminal, a voltage sampling terminal 2, a relay control terminal and a power supply terminal U DL The dual-lamp parallel circuit consists of a working lamp connected in series with the relay K, and a standby lamp connected in series with the field effect tube Q; the power supply terminal U DLThey are respectively connected to the power supply end of relay K and the gate G of field effect tube Q; the positive end of the load interface is connected to the working light and standby light connection ends, and the negative end of the load interface is connected to the switch end of relay K, the drain D of field effect tube Q, and the voltage sampling end 2; the relay control end is connected to the control end of relay K;
[0064] The power supply module is respectively connected to the processing control, dual lamp switching and controllable constant current source modules through the power supply terminal to provide the required power supply voltage for the other three modules.
[0065] The standard voltage input terminal of the controllable constant current source module is connected to the standard voltage output terminal of the control processing module, the feedback voltage terminal is connected to the voltage acquisition terminal 1 of the control processing module, and the positive and negative terminals of the load interface are connected to the positive and negative terminals of the load interface of the dual-lamp switching module; the voltage acquisition terminal 2 and the control signal terminal of the control processing module are respectively connected to the voltage sampling terminal 2 and the relay control terminal of the dual-lamp switching module, and the status signal terminal and the serial communication interface are respectively connected to the external controller or the host computer to provide the current working status to the outside.
[0066] The digital + analog dual closed-loop fast and stable constant current source circuit is composed of a controllable constant current source module, a control processing module, a valid load of a dual-lamp switching module, and a power supply module; the standard voltage input end of the controllable constant current source module is connected to the standard voltage output end of the control processing module, the feedback voltage end is connected to the voltage acquisition end 1 of the control processing module, and the positive and negative ends of the load interface are connected to the positive and negative ends of the load interface of the dual-lamp switching module; the three modules are connected to the power supply module through the power supply end.
[0067] The control processing module uses the stm32f103zet6 microprocessor and port circuits, such as Figure 2 The microprocessor has a built-in 12-bit DAC and a multi-channel ADC. The port circuit includes a standard voltage output terminal, a voltage acquisition terminal 1, a voltage acquisition terminal 2, a control signal terminal, a status signal terminal, a serial communication terminal, and a power supply terminal U C There are 7 ports in total. The DAC output of the microprocessor leads to the standard voltage output terminal, and the two input channels of the microprocessor ADC are selected to lead to the voltage acquisition terminal 1 and voltage acquisition terminal 2 respectively. One I / O port of the microprocessor leads to the status signal terminal to indicate whether the system is in a steady current working state, and one I / O port leads to the control signal terminal as the control signal terminal for the switch control of the dual-lamp switching module. The serial communication terminal is led as the communication interface between the system and other devices. Through the power supply terminal U C Connect to the power module to obtain 3.3V supply voltage.
[0068] Controllable constant current source such as Figure 3 As shown, it consists of a differential amplifier circuit, a sampling resistor, a feedback circuit, a standard voltage input terminal, a feedback voltage terminal, a positive and negative terminal of a load interface, and a power supply terminal U IThe internal connection relationship of each part is: the standard voltage input terminal and the feedback circuit output terminal are introduced as input into the differential amplifier circuit, and the output terminal of the differential amplifier circuit is connected to one end of the sampling resistor; the two ends of the sampling resistor are connected to the input end of the feedback circuit, and the load interface is connected in series with the sampling resistor. The standard voltage input terminal is connected to the standard voltage output terminal of the control processing module, and the feedback voltage terminal is connected to the voltage acquisition terminal 1 of the control processing module. The positive and negative ends of the load interface are connected to the positive and negative ends of the load interface of the dual-lamp switching module. Through the power supply terminal U I Connect to the power module to obtain ±12V power supply voltage. This module is an analog closed-loop constant current source circuit. When a standard voltage is connected to the standard voltage input terminal, the output current value is the ratio of the standard voltage to the sampling resistor. This module, the processing control module and one effective load of the dual-lamp switching module form a "digital + analog dual closed-loop" fast and stable constant current source. The "digital + analog dual closed-loop" fast and stable constant current source is as follows (such as Figure 4 The three-stage working mode (as shown) completes the steady flow work:
[0069] A. Large preset value starts fast preheating:
[0070] ① The status signal output terminal is set to 0, indicating that the system is not in a stable state.
[0071] ②DAC assigns a larger value D DA0 .
[0072] Increase the standard voltage to make the system quickly thermally stable. DA0 Calculated by formula (1):
[0073]
[0074] Where n = 12, which is the number of bits of the DAC; I 0 is the initial load current, and its value is the maximum load current I of the load light source max =1.66A and the operating current I = 1.2A, the larger value, take I 0 =1.5A; R S =1Ω, which is the resistance of the sampling resistor; U DA =3.3V, which is the maximum output voltage of DAC. Then D DA0 =1861.
[0075] B. Dual closed-loop PID coarse adjustment for fast and stable operation: Start the PID link in time for fast coarse adjustment. The steps are as follows:
[0076] ①i=1, start ADC1 acquisition processing, and get the measured value D of the sampling voltage of the sampling resistor Si And the load current I is calculated by formula (2) S The error e with the working current I i:
[0077]
[0078] In the formula, m 1 =12, the number of bits of ADC1; U AD =3.3V, which is the maximum input voltage of ADC; then e i =D Si / 1241-1.2(A).
[0079] ② Start the proportional and differential links, according to the current error e i , the DAC value D is adjusted according to formula (3) using the proportional and differential links. DA :
[0080] Δ i =K P ·e i +K D (e i -e i-1 ) (3)
[0081] Where: k P =0.378, k D =0.02, which are proportional and differential coefficients respectively. Then the corresponding D DAi Calculated by formula (4):
[0082]
[0083] Control the DAC converter output voltage so that the output current error e reaches the requirement as soon as possible, speeding up the adjustment process. When the output current error e reaches the 1%I requirement, the PD adjustment ends; otherwise i=i+1, ADC1 collects D Si , calculate the current error e according to the formula i , continue to cycle this step.
[0084] ③i=1, set the estimated adjustment time and start timing;
[0085] ④PID link adjustment D DAi . Start the integral link to eliminate the net difference produced by the proportional and differential link adjustments. Set the expected adjustment time, i = 1, D DAi Error adjustment value Δ i Determine according to formula (5):
[0086]
[0087] Where: k I is the integral coefficient, and its value is determined according to the basic rules of PID parameter adjustment. Calculate D after this PID adjustment according to formula (4): DAiWhen the adjustment time reaches the expected time, otherwise i=i+1, data D is collected according to ADC1 Si , the error e is calculated according to formula (2) i , continue to cycle this step.
[0088] C. Single closed loop steady flow:
[0089] ①D DA Assign working value and delay stability:
[0090] Assign D to DAC according to the working current I DA , D DA Calculate according to formula (6):
[0091]
[0092] Start timing and waiting, and when the set time is reached, exit the waiting state;
[0093] ②Fix the output voltage of the standard voltage output terminal of the control processing module, start the ADC collection processing of the voltage collection terminal 2, and judge the working status of the dual lamps according to the collection value D k Determine the working status of the two lamps: When the judgment result is the dual-lamp switching state, the status signal terminal output is set to 0, and return to step A; when the judgment result is the working light or the standby light is in normal working state, the analog closed-loop constant current source circuit works independently, delays for a certain period of time, so that the output current reaches the set value, and the status signal terminal output is set to 1; when the judgment result is the dual-lamp fault state, the status signal terminal output is set to 0, and the serial port reports the lamp replacement warning information to the instrument.
[0094] Dual light switching module Figure 5 As shown, it consists of a dual lamp parallel circuit, a load interface positive terminal, a load interface negative terminal, a voltage sampling terminal 2, an electric switch control terminal and a power supply terminal U DL It consists of a double lamp parallel circuit, a positive end of the load interface, a negative end of the load interface, a voltage sampling terminal 2, an electric switch control terminal and a power supply terminal U DL One of the two-lamp parallel circuit is connected in series with the working lamp and the relay K, and the other is connected in series with the standby lamp and the field effect tube Q; the power supply terminal U DL 1 port (3.3V) and the power supply terminal of relay K, power supply terminal U DL The 2nd port (6V) of the load interface is connected to the gate G of the field effect tube Q; the positive end of the load interface is connected to the connection end of the working light and the standby light, and the negative end of the load interface is connected to the switch end of the relay K, the drain D of the field effect tube Q, and the voltage sampling terminal 2; the relay control end is connected to the control end of the relay K. When the system is working, the relay is in the closed state, and the field effect tube is in the pinch-off zone when the gate-source voltage of the field effect tube is less than the pinch-off voltage, so the dual lights are automatically switched. In the system working state-the relay is closed, by comparing the sampling value D of the voltage acquisition terminal 2k D in different states kt , t = 1, 2, 3, determine the working status of the dual lights; where:
[0095]
[0096]
[0097] D k3 =0(9)
[0098] In the formula, m 2 =12, which is the number of bits of ADC2; U AD2 =3.3V, the maximum input voltage of ADC2; V CC =12V, which is the positive terminal voltage of the load end of the controllable constant current source module; U 1 =8.7, V is the voltage across the lamp when the constant current I=1.2A is supplied; U 2 =1.3V, which is the voltage of drain D and source S when the field effect tube Q in the dual-lamp load module is turned on. Then D k1 =4095,D k2 =3226. The basis for judging the working status of the dual lights is as follows:
[0099] (1) When D k In D k1 When it is nearby, the work light is in normal working state;
[0100] (2) When D k In D k2 When nearby, the standby light is in normal working condition, and the working light is out of order;
[0101] (3) When D k In D k1 Jump to D nearby k2 When nearby, the double lights are switched;
[0102] (4) When D k In D k3 When it is nearby, it is in dual lamp failure state and the system does not work.
[0103] When the working lamp is not faulty and the standby lamp needs to be diagnosed, the relay is disconnected and the ADC sampling value D of the voltage acquisition terminal 2 is k , determine whether the standby lamp is faulty:
[0104] (1) When D k In D k2 When nearby, the backup lights are not faulty;
[0105] (2) When D k In D k3 The backup lights failed when near.
Claims
1. A fast and stable constant current source system with automatic switching for dual lamp fault diagnosis, including four modules: control processing, controllable constant current source, dual lamp switching and power supply, characterized in that: The power module is connected to the control processing module, the controllable constant current source module and the dual-lamp switching module respectively. The four modules respectively form a digital + analog dual closed-loop fast and stable constant current source circuit and a dual-lamp fault control detection + automatic switching two functional circuits; The digital + analog dual closed-loop fast and stable constant current source circuit is composed of a controllable constant current source module, a control processing module and a valid load of a dual-lamp switching module. The standard voltage input end of the controllable constant current source module is connected to the standard voltage output end of the control processing module, the feedback voltage end is connected to the voltage acquisition end 1 of the control processing module, and the positive and negative ends of the load interface are connected to the positive and negative ends of the load interface of the dual-lamp switching module; the voltage acquisition end 2 and the control signal end of the control processing module are respectively connected to the voltage sampling end 2 and the relay control end of the dual-lamp switching module, and the state signal end and the serial communication interface are respectively connected to the external controller or the host computer to provide the current working state to the outside; the controllable constant current source module, the control processing module and the dual-lamp switching module are connected to the power supply module through their respective power supply ends; The dual-lamp fault control detection + automatic switching circuit is composed of a dual-lamp switching module, a control processing module, a power supply module and a constant current source part of a controllable constant current source module; the dual-lamp parallel circuit of the dual-lamp switching module is connected to the positive and negative ends of the load interface of the controllable constant current source as a load, the voltage sampling end 2 is connected to the voltage collection end 2 of the microprocessor module, and the relay control end is connected to the control signal end of the control processing module; The control processing module is composed of a microprocessor, a standard voltage output terminal, a voltage acquisition terminal 1, a voltage acquisition terminal 2, a control signal terminal, a status signal terminal, a serial communication interface, a power supply terminal U C The microprocessor includes an MPU, a DAC, a dual-channel ADC circuit, a serial port, and an IO port; the DAC is connected to a standard voltage output terminal through the IO port; the dual-channel ADC is respectively connected to a voltage acquisition terminal 1 and a voltage acquisition terminal 2 through the IO port, and the dual-channel ADC includes ADC1 and ADC2; the serial port is connected to a serial communication interface; the control signal terminal and the status signal terminal are connected to the IO port of the microprocessor; the power port of the microprocessor is connected to the power terminal U C connect; The controllable constant current source module is composed of a differential amplifier circuit, a sampling resistor, a feedback circuit, a standard voltage input terminal, a feedback voltage terminal, a load interface positive and negative terminals, and a power supply terminal U I The module is composed of a constant current source circuit that simulates a closed loop. When a standard voltage is connected to the standard voltage input terminal, the output current value is the ratio of the standard voltage to the sampling resistor. The two input terminals of the differential amplifier circuit: the standard voltage terminal and the feedback voltage terminal are respectively connected to the standard voltage output terminal and the feedback circuit output terminal, and its output terminal is connected to one end of the sampling resistor; the two input terminals of the feedback circuit are respectively connected to the two ends of the sampling resistor, and its output terminal is connected to the feedback voltage input terminal and the feedback voltage terminal of the differential amplifier circuit; the positive terminal of the load interface is connected to the power supply terminal U I Connect, the negative end of the load interface and one end of the sampling resistor in series; Power supply I The positive and negative terminals are respectively connected to the positive and negative power supply terminals of the differential amplifier circuit and the feedback circuit; The dual-lamp switching module is composed of a dual-lamp parallel circuit, a load interface positive terminal, a load interface negative terminal, a voltage sampling terminal 2, a relay control terminal and a power supply terminal U DL The dual-lamp parallel circuit consists of a working lamp connected in series with the relay K, and a standby lamp connected in series with the field effect tube Q; the power supply terminal U DL They are respectively connected to the power supply end of relay K and the gate G of field effect tube Q; the positive end of the load interface is connected to the working light and standby light connection ends, and the negative end of the load interface is connected to the switch end of relay K, the drain D of field effect tube Q, and the voltage sampling end 2; the relay control end is connected to the control end of relay K; The power supply module is connected to the control processing, dual-lamp switching and controllable constant current source modules through the power supply terminal to provide the required power supply voltage for the other three modules; The three-stage working mode of fast preheating, fast stabilization of dual closed-loop PID coarse adjustment and single closed-loop current stabilization is started by the large preset value of the dual closed-loop circuit to speed up the adjustment process and quickly reach the current stable state; The digital + analog dual closed-loop fast and stable constant current source circuit achieves a steady current state through the following three-stage working mode: A. Large preset value starts fast preheating: ① The output terminal of the status signal is set to 0, indicating that the system is not in a stable state; ②DAC assignment D DA0 ; Increase the standard voltage to make the system quickly thermally stable, where D DA0 Calculated by formula (1): Where n is the number of bits of the DAC, I0 is the initial load current, R S is the resistance of the sampling resistor, U DA is the maximum input voltage of the DAC; B. Dual closed-loop PID coarse adjustment for fast and stable operation: Start the PID link in time for fast coarse adjustment. The steps are as follows: ①i=1, start ADC1 acquisition processing, and get the measured value D of the sampling voltage of the sampling resistor Si , and the load current I is calculated by formula (2) S The error e with the working current I i : Where m1 is the number of bits of ADC1; U AD is the maximum input voltage of ADC; ② Start the proportional and differential links, according to the current error e i , adjust the DAC value D according to formula (3) using the proportional and differential links DA : Δ i =K P ·And i +K D (And i -And i-1 ) (3) Where: K P , K D are proportional and differential coefficients respectively; then corresponding to D DAi Calculated by formula (4): Control the DAC converter output voltage so that the output current error e reaches the requirement as soon as possible, speeding up the adjustment process. When the output current error e reaches the 1% I requirement, end the PD adjustment and enter step ③, where I is the working current; otherwise, i=i+1, and ADC1 collects D Si , calculate the current error e according to formula (2) i , continue to cycle this step; ③i=1, set the estimated adjustment time and start timing; ④PID link adjustment D DAi , start the integral link to eliminate the net difference produced by the proportional and differential link regulation, D DAi Error adjustment value Δ i Determine according to formula (5): Where: K I is the integral coefficient, and D after this PID adjustment is calculated according to formula (4). DAi When the adjustment time reaches the expected time, this step ends and the process goes to step C; otherwise, i=i+1 and data D is collected according to ADC1. Si , the error e is calculated according to formula (2) i , continue to cycle this step; C. Single closed loop steady flow: ①D DA Assign working value and delay stability: Assign D to DAC according to the working current I DA , D DA Calculate according to formula (6): Start timing and waiting, and when the set time is reached, exit the waiting state; ②Fix the output voltage of the standard voltage output terminal of the control processing module, start the ADC2 acquisition processing of the voltage acquisition terminal 2, and judge the working status of the dual lamps according to the acquisition value D k Determine the working status of the two lamps: When the judgment result is the dual-lamp switching state, the status signal terminal output is set to 0, and return to step A; when the judgment result is the working light or the standby light is in normal working state, the analog closed-loop constant current source circuit works independently, delays for a certain period of time, so that the output current reaches the set value, and the status signal terminal output is set to 1; when the judgment result is the dual-lamp fault state, the status signal terminal output is set to 0, and the serial port reports the lamp replacement warning information to the instrument.
2. The fast stable constant current source system with automatic switching for dual lamp fault diagnosis according to claim 1, characterized in that:When the system is working, the relay is in the closed state. The double lamps are automatically switched by comparing the sampling value D of the voltage acquisition terminal 2 by using the characteristic that the gate-source voltage of the field effect tube is less than the pinch-off voltage and the field effect tube is in the pinch-off zone. k D in different states kt , t = 1, 2, 3, determine the working status of the dual lights; where: D k3 =0 (9) Where m2 is the number of bits of ADC2, U AD2 is the maximum input voltage of ADC2, V CC is the positive terminal voltage of the load end of the controllable constant current source module, U1 is the voltage across the lamp when the constant current I is supplied, and U2 is the voltage of the drain D and source S when the field effect tube in the dual-lamp switching module is turned on; Method for judging the working status of dual lights: (1) When D k In D k1 When it is nearby, the work light is in normal working state; (2) When D k In D k2 When nearby, the standby light is in normal working condition, and the working light is out of order; (3) When D k In D k1 Jump to D nearby k2 When nearby, the double lights are switched; (4) When D k In D k3 When it is nearby, it is in the double lamp failure state and the system does not work; When the working lamp is not faulty and the standby lamp needs to be diagnosed, the relay is disconnected and the ADC2 sampling value D of the voltage acquisition terminal 2 is k , determine whether the standby lamp is faulty: (1) When D k In D k2 When nearby, the backup lights are not faulty; (2) When D k In D k3 When nearby, the backup light is faulty.
