Full-digital high-frequency LED constant current driving circuit and control methodTechnical Field
The invention relates to the field of electricity, in particular to a full-digital high-frequency LED constant current driving circuit and a control method.
Background
In recent years, the constant current driving technology of LEDs is becoming mature. However, in some high-frequency short exposure and wide-range precise adjustment situations, such as high-speed machine vision, digital pathological scanning, etc., the current of the LED needs to be constant, and also needs to be adjusted in a wide range to adjust the brightness, and even microsecond level exposure without stroboflash when a high-speed camera is used for shooting needs to be achieved, which puts extremely high requirements on precise adjustment and control of the current of the LED: the current should be regulated over the full range and remain continuous and with low ripple.
Conventional LED dimming schemes often employ constant current source chips or linear dimming techniques: the constant current source chip can only maintain the current at a fixed value, and the microcontroller adjusts the average value of the output current through periodic enabling/disabling, so that the precision and continuity of the current when the small current is output cannot be ensured; the linear dimming technology can obtain a relatively stable current regulation effect, but the linear dimming technology has low efficiency, high heating, difficult high-frequency control and limited application scenes.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a full-digital high-frequency LED constant current driving circuit and a control method.
The invention provides a full-digital high-frequency LED constant current driving circuit, which comprises:
a power unit: energy transmission and conversion are carried out in a half-bridge topological switching mode, and the inductor is charged and flows current to enable the LED to obtain continuous current;
a feedback unit: measuring the voltage of the direct current bus and the output current of the power unit, and sending the measured voltage and the output current to the control unit for processing;
a control unit: and according to the external PWM signal and the output current measured by the feedback unit, a pair of complementary PWM signals is obtained through calculation and is output to the power unit, the power unit is controlled to carry out energy transmission and conversion, and the working state is fed back.
Preferably, the power unit includes:
a gate drive circuit: converting the pair of complementary PWM signals output by the control unit into a strong signal for driving a field effect transistor;
half-bridge of field effect transistor: connecting the gate drive circuit, the direct current bus and the LED, and driving the LED in a half-bridge topology form;
current sampling resistance: is positioned at the high end of the power supply;
the inductance: and storing energy when the lower bridge arm of the field effect transistor half bridge is switched on, and releasing the energy in the form of current when the lower bridge arm of the field effect transistor half bridge is switched off so that the current passing through the LED is kept constant in a full PWM period.
Preferably, the feedback unit includes:
the voltage division following circuit: connecting the direct current bus and the control unit, dividing and filtering the direct current bus through a resistance-capacitance network, and reducing the output impedance of a voltage dividing circuit;
a differential amplifier circuit: and connecting the two ends of the sampling resistor and the control unit, and amplifying the voltage difference value at the two ends of the sampling resistor.
Preferably, the control unit includes:
a microcontroller;
an input shaping circuit: the microcontroller is connected to filter and shape the external PWM signal;
a communication interface circuit: connecting the microcontroller with an external PC;
a clock line: the microcontroller is connected to provide a clock signal.
According to the control method of the all-digital high-frequency LED constant current drive circuit provided by the invention, the all-digital high-frequency LED constant current drive circuit of any one of claims 1 to 4 is adopted, and the control method comprises the following steps:
analyzing the pulse instruction: capturing an external PWM signal, calculating the pulse width of the external PWM signal, and converting the pulse width into a control target given value of a constant current control algorithm after digital low-pass filtering;
and (3) serial port communication processing: analyzing the received serial port data according to a self-defined communication protocol to generate a serial port data frame conforming to the self-defined communication protocol;
load parameter identification: identifying a voltage-current parameter table based on a nonlinear discrete current observer;
current control step: performing open-loop feedforward control based on a voltage-current parameter table, performing feedback control based on current deviation, and generating the pair of complementary PWM signals for half-bridge control;
comprehensive function steps: coordinating commands, switching functions, detecting faults and implementing protection.
Preferably, the serial port communication processing step includes:
a plurality of protocol frames composed of multiple bytes are specified to form a serial port instruction protocol set for issuing instructions, configuring parameters and monitoring states;
and analyzing the received serial port data according to the serial port instruction protocol set to generate a data frame conforming to the serial port instruction protocol set.
Preferably, the current controlling step includes:
feed-forward control: calculating the open-loop feedforward control PWM duty ratio according to the voltage-current parameter table of the LED;
feedback control: and carrying out nonlinear PID control based on the current deviation, and calculating the closed-loop feedback control PWM duty ratio.
Preferably, the load parameter identification step includes:
recording the voltage-current relation of the LED to form a voltage-current parameter table, and storing the voltage-current parameter table in a storage unit of the micro-control;
and predicting output current through a nonlinear discrete current observer, performing feedback correction on voltage-current parameters according to actual current, and iteratively calculating a real voltage-current parameter table.
Preferably, the integrated function step includes:
command coordination: selecting an external PWM signal or a serial port instruction;
function switching: the switching function is a normal output mode or a load identification mode;
and (3) system fault detection: and when the output current is detected to exceed the preset current range or preset time, an overcurrent signal is given, the PWM output is placed in a safe state, and the power supply of the grid drive circuit is cut off through an ENA signal.
Compared with the prior art, the invention has the following beneficial effects:
1. the full-digital high-frequency LED constant current driving circuit and the control method realize the wide-range and high-precision adjustment of current, and ensure the requirements of continuously adjustable LED light source brightness and no flicker at high frequency under the precise occasion;
2. compared with a linear constant current source, the efficiency, the precision and the high-frequency control performance of the power supply are greatly improved, so that the application scene is widened;
3. the unique power supply control method improves the steady-state precision and the response speed of current control and enhances the expansibility and the flexibility of the digital power supply.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a schematic diagram of the structure of a full digital high frequency LED constant current driving circuit of the present invention;
FIG. 2 is a schematic diagram of a control method of the all-digital high-frequency LED constant current driving circuit of the present invention;
FIG. 3 is a waveform diagram of an output of the LED driving circuit according to the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
A structural schematic diagram of an all-digital high-frequency LED constant current driving circuit is shown in fig. 1, and includes: the device comprises a power unit, a feedback unit and a control unit.
The power unit is used for energy conversion; specifically, the power transistor comprises power transistors Q1 and Q2, an inductor L1, a sampling resistor R1 and a high-speed gate driving circuit; the power tubes Q1 and Q2 are alternately conducted, the inductor L1 is charged and freewheeled in a switching mode, and constant current and constant voltage are formed on the load LED; further, by changing the time for which Q1 and Q2 are turned on, i.e., the duty ratio, the voltage of the load can be controlled, and thus the current thereof can be controlled; further, the current forms a voltage difference on the sampling resistor R1, and the magnitude of the load current can be obtained by measuring the voltage difference.
The feedback unit is used for measuring the state quantity; specifically, the voltage measuring circuit consists of a voltage division following circuit and a differential amplifying circuit, and the voltage measuring circuit measures the voltages at two ends of a direct current bus voltage and a current sampling resistor respectively and sends the voltages to a control unit for processing.
The control unit takes a microprocessor as a core, receives external signals such as PWM signals or serial communication signals, configures system parameters, samples the output of the feedback unit, outputs high-precision complementary PWM signals through calculation of an internal algorithm unit, directly controls the power unit to carry out energy transmission and conversion, and feeds back the state of the system in a serial mode; specifically, the device comprises an input shaping circuit, a communication interface circuit, a high-precision clock and a microcontroller.
The power unit works at higher frequency and higher power, so that requirements are provided for the selection of power tubes Q1 and Q2 and the selection of a gate driver circuit, and a high-speed gate driver circuit with high speed and strong driving capability should be selected by selecting a power MOSFET with low internal resistance and high speed;
further, Q1 and Q2 are set not to be on simultaneously, the state of the lower tube (Q2) is set to 1 when it is on, and the on time is set to t
onThe state of the lower tube is 0 when the lower tube is turned off, and the turn-off time is t
offThen the on state of Q2 is related to the output voltage and current as shown in fig. 3; setting an average voltage across an LED load to u
ledSetting the DC bus voltage to u
busSetting output current ripple Delta I, setting inductance to be L and defining duty ratio to be
Defining switching frequency
The relationship can be found: u. of
led=u
bus×D,
According to the two formulas, the current ripple can be reduced by improving the duty ratio, the inductor size and the switching frequency, and the duty ratio is related to the input voltage and the LED property (LED working voltage), so that the current ripple is reduced by selecting a proper direct-current bus voltage and selecting a proper inductor and switching frequency.
According to different direct-current bus voltages, the feedback unit should select a proper voltage division proportion for the voltage division follower circuit, and the differential amplifier circuit should consider the common mode range.
The core of the control unit is a microcontroller, which requires a high main frequency due to the need of generating a high-precision PWM signal, or has a high-precision timer module, otherwise, the output voltage cannot be finely adjusted, and thus fine current control cannot be obtained.
Secondly, the control method and the design key points of the all-digital high-frequency LED constant current drive circuit are explained.
A schematic diagram of a control method of an all-digital high-frequency LED constant current driving circuit is shown in fig. 2, and includes: the device comprises a pulse instruction analysis module, a serial port communication processing module, a current control module, a load parameter identification module and a comprehensive function module.
The pulse instruction analysis module captures the time of the rising edge and the falling edge of an external pulse by adopting the input capture function of a timer and calculates the high-level pulse width; the pulse width is digitally low-pass filtered and converted to a given value for the current control module.
The serial port communication processing module comprises a serial port protocol analysis module and a serial port data generation module, wherein the serial port protocol analysis module and the serial port data generation module generate two functions and a serial port instruction protocol set; the serial port instruction protocol set specifies a plurality of protocol frames consisting of a plurality of bytes and is used for issuing instructions, configuring parameters and monitoring states; the serial port protocol analysis function is used for analyzing the received serial port data according to a serial port instruction protocol set; and a serial port data generation function for generating a data frame conforming to a serial port instruction protocol set.
The current control module comprises a feedforward control module and a feedback control module. The feedforward control module carries out open-loop feedforward control on the basis of the voltage-current parameter table; the feedback control module performs nonlinear PID control based on the current deviation and comprises the technologies of integral amplitude limiting, control quantity filtering, differential signal extraction and the like, so that the control quality is improved; the feedforward control module outputs are overlapped with the feedback control module outputs to obtain the final control output.
The load parameter identification module comprises a voltage-current parameter table and a nonlinear discrete current observer; the voltage-current parameter table is a table for recording the voltage-current relation of the load LED and is stored in a storage unit of the micro-control; the nonlinear discrete current observer obtains the deviation from the actual output by predicting the current output, and the deviation is used for carrying out feedback correction on the parameter table, so that more accurate load data is obtained.
The comprehensive function module comprises an instruction coordination module, a function switching module and a system fault detection and module; the instruction coordination module is used for selecting an output instruction of the pulse instruction analysis module or an output instruction of the serial port protocol analysis module; the function switching module is used for controlling the switching system function to be in a normal output mode or a load identification mode; the system fault detection and protection module records the time when the output current exceeds the set current, judges and gives an overcurrent signal, places the PWM output in a safe state, and cuts off the power supply of the grid drive circuit through an ENA signal.
The voltage-current parameter table should adopt a mode of discrete key points + linear or nonlinear interpolation to obtain higher-precision feedforward and shorter identification time; when performing parameter identification, it should be ensured that the identification curve is monotonous.
The nonlinear discrete current observer is used for setting the feedback correction parameters in a heuristic manner and ensuring the convergence of the feedback correction; when convergence is not guaranteed, the recognition result should indicate an error and exit.
The nonlinear PID control is properly configured according to actual needs; when the requirement on the steady-state precision is high and the transient response speed is not required, the requirement can be met by adopting integral control; when a certain response speed is required, proportional control should be added; when no overshoot in response is required, differential control should be added; setting PID parameters in a segmented mode, and debugging according to actual conditions; the adjustment of the PID parameters is also possible. The resulting output waveform is shown in fig. 3.
In the description of the present application, it is to be understood that the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.