Linear control method of laser controller
Technical Field
The invention belongs to the technical field of laser control, and particularly relates to a method for linearly controlling a laser controller.
Background
The laser controller generally adopts current or voltage to drive the light source module, because various reasons such as light source characteristics, optical fiber assembly and the like can cause that the light source is not excited when the current or voltage input value of the controller is smaller than a certain threshold value, and after the current or voltage is excited, the input value and the emergent light power of the optical fiber outlet do not start from an output 0 value and do not show a linear relation. In the actual working process, a user can adjust the expected output of the laser at any time according to the process, in a laser controller which does not realize linear control, the specific output cannot be predicted, and the input value cannot be simply quantized according to the process requirement, in addition, in some special processes, the user can expect the same linear expression with the linear output interval in a low output range, so the invention provides a method for linear control of the laser controller for solving the problem.
Disclosure of Invention
In order to solve the problems of the scheme, the invention provides a method for linearly controlling a laser controller.
The aim of the invention can be achieved by the following technical scheme:
A method for linear control of a laser controller specifically comprises the following steps:
Opening all channels of a laser, acquiring an effective input range of the laser, measuring data output of the laser in the effective input range according to the acquired effective input range, and integrating and recording input data and output data into a data table T 1;
Step two, under the premise that one or more groups of channels of the laser are opened, measuring data output of the laser in an effective input range, intersecting the output data range with a data table T 1 and a linear output interval which is finally expected to be controlled, and recording input/output data table T 2 and corresponding channel information Ch;
Step three, importing a data table T 1 and a data table T 2 into a laser controller, respectively calculating linear parameters L 1 and L 2 controlled by a laser in a driving mode according to the imported data table T 1 and the imported data table T 2 through linear fitting, and recording an input and output extremum of the data table T 1 and an input and output extremum of the data table T 2;
Step four, when the laser is turned on, calculating the expected output value of the user according to the input value I ideal of the user and the linear parameter L 1
Step five, according to the expected output value O ideal calculated in the step four, searching an output interval [ O n,On+1 ] where O ideal is located and a corresponding input interval [ I n,In+1 ] in a data table T 1, and calculating a current ideal laser driving input value I ideal;
step five, when the input value searching is successful, the input value I ideal is appointed to control the laser driver and the opening of all channels of the laser, and the whole working flow is finished;
Step seven, if the expected output value O ideal is smaller than the minimum output value Min output in the data table T 1, searching the output interval [ O 'n,O'n+1 ] where the expected output value O ideal is located and the corresponding input interval [ I' n,I'n+1 ] in the imported data table T 2, calculating the current ideal laser driving input value I 'ideal, controlling the laser driver according to the specified input value I' ideal parameters after searching successfully, and controlling the laser controller to turn on the laser according to the channel information Ch recorded in the data table T 2, so as to complete the linear correction of the laser controller.
Further, the method ,T1=[I0,O0][I1,O1]…[Ik,Ok][Ik+1,Ok+1].
Further, the method ,T2=[I'0,O'0][I'1,O'1]…[I'k,O'k][I'k+1,O'k+1].
Further, the input/output extremum of the data table T 1 is Min input、Maxinput、Minoutput、Maxoutput;
The input/output extremum of the data table T 2 is Min' input、Max'input、Min'output、Max'output.
Further, the method comprises the steps of,
Further, the method comprises the steps of,
Further, at least one global set of input/output data tables needs to be imported when importing input/output data.
Further, in making the linearity correction, the global input-output data table parameters are preferentially used.
Compared with the prior art, the method has the advantages that data test is simple and convenient to import, the control precision of the data step length according to the imported data table is high, part of the channel data table can be adjusted at any time to use each channel in a rotating mode, the problem that the channel light source is attenuated to prolong the service life of the light source due to the fact that one or more channels are used for a long time in low output time is avoided, and the method is controllable in low output range and has linear performance.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a table of full channel I/O data for a laser according to the present invention;
FIG. 3 is a table of partial channel I/O data for a laser according to the present invention.
Detailed Description
The technical solutions of the present invention will be clearly and completely described in connection with the embodiments, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1 to 3, a method for linear control of a laser controller specifically includes:
Opening all channels of a laser, acquiring an effective input range of the laser, measuring data output of the laser in the effective input range according to the acquired effective input range, and integrating and recording input data and output data into a data table T 1;
Wherein T1=[I0,O0][I1,O1]…[Ik,Ok][Ik+1,Ok+1],I is the input control current value, possibly voltage or other quantifiable control signal, O is the actual measured power output, possibly illuminance or other quantifiable measured value;
Step two, under the premise that one or more groups of channels of the laser are opened, measuring data output of the laser in an effective input range, intersecting the output data range with a data table T 1 and a linear output interval which is finally expected to be controlled, and recording input/output data table T 2 and corresponding channel information Ch;
Wherein the method comprises the steps of ,T2=[I'0,O'0][I'1,O'1]…[I'k,O'k][I'k+1,O'k+1];
Step three, importing a data table T 1 and a data table T 2 into a laser controller, respectively calculating linear parameters L 1 and L 2 controlled by a laser in a driving mode according to the imported data table T 1 and the imported data table T 2 through linear fitting, and recording an input and output extremum of the data table T 1 and an input and output extremum of the data table T 2;
the input/output extremum of the data table T 1 is Min input、Maxinput、Minoutput、Maxoutput;
The input/output extremum of the data table T 2 is Min' input、Max'input、Min'output、Max'output.
The linear parameters L 1 and L 2 controlled by the laser are calculated in the driving by linear fitting according to the imported data table T 1 and the imported data table T 2 respectively, and the corresponding linear parameters L 1 and L 2 can be fitted according to the data table T 1 and the data table T 2 by the existing linear fitting method, and the corresponding straight lines can be fitted according to the corresponding point position distribution according to the existing mathematical method, so that the specific fitting process is not described in detail.
Step four, when the laser is turned on, calculating the expected output value of the user according to the input value I ideal of the user and the linear parameter L 1
Because the linear parameter L 1 is fitted, a corresponding fitting straight line y=ax+b can be obtained according to the linear parameter L 1, and the input value I ideal of the user is taken into the fitting straight line as x, so as to obtain a corresponding y value, namely, a desired output value of the user.
Step five, according to the expected output value O ideal calculated in the step four, searching an output interval [ O n,On+1 ] where O ideal is located and a corresponding input interval [ I n,In+1 ] in a data table T 1, and calculating a current ideal laser driving input value I ideal;
step five, when the input value searching is successful, the input value I ideal is appointed to control the laser driver and the opening of all channels of the laser, and the whole working flow is finished;
Step seven, if the expected output value O ideal is smaller than the minimum output value Min output in the data table T 1, searching the output interval [ O 'n,O'n+1 ] where the expected output value O ideal is located and the corresponding input interval [ I' n,I'n+1 ] in the imported data table T 2, calculating the current ideal laser driving input value I 'ideal, controlling the laser driver according to the specified input value I' ideal parameters after searching successfully, and controlling the laser controller to turn on the laser according to the channel information Ch recorded in the data table T 2.
The laser controller is thus linearly calibrated.
At least one global set of I/O data tables need to be imported when I/O data is imported.
In the linear correction, the global input/output data table parameters are preferably used.
The above formulas are all formulas with dimensions removed and numerical values calculated, the formulas are formulas which are obtained by acquiring a large amount of data and performing software simulation to obtain the closest actual situation, and preset parameters and preset thresholds in the formulas are set by a person skilled in the art according to the actual situation or are obtained by simulating a large amount of data.
The working principle of the invention is as follows: s1, under the premise that all channels of the laser are enabled to be opened, measuring the output in the effective input range of the laser, and recording an input/output data table; s2, under the premise that partial channels (one or more groups) of the laser are enabled to be opened, measuring output in an effective input range of the laser, wherein the output data range needs to intersect with the output range of the data table recorded in the S1 and a linear output interval which is finally expected to be controlled, and recording a current input/output data table; s3, importing the S1 data table and the S2 data table into a laser controller, the linear parameters controlled by the laser are calculated in the controller through linear fitting according to the imported S1 data table and S2 data table respectively; s4, when the laser is turned on, calculating the expected output value of the user according to the input value of the user and the linear parameter of the S1 data table; s5, according to the expected output value calculated in the S4, preferentially searching an input value which is required to be used by the laser controller when the expected output value is searched in the S1 data table, and calculating in a linear interpolation mode in a section; s6, in the step S5, if the input value searching is successful, controlling a laser driver and controlling the opening of the full channel of the laser according to the specified input value parameter, and ending the whole working flow; s7, if the expected output value of S4 is smaller than the minimum value in the S1 data table, the input value which should be used by the laser controller when the expected output value is searched in the imported S2 data table, the interval is calculated in a linear interpolation mode, after the search is successful, the laser driver is controlled according to the designated input value parameter, and the laser channel is opened according to the channel information recorded in the S2 data table, so that the linear correction of the laser controller is completed.
The above embodiments are only for illustrating the technical method of the present invention and not for limiting the same, and it should be understood by those skilled in the art that the technical method of the present invention may be modified or substituted without departing from the spirit and scope of the technical method of the present invention.