Constant current control device for electro-deposition and control method thereof
By applying BP neural network to calculate the optimal duty cycle and adjusting the switch state of the MOS tube in the electrodeposition device, the problems of small constant current output regulation range and low resistance to external environment changes in the prior art are solved, and stable and efficient constant current control is achieved.
Patent Information
- Application Number
- CN202411964868.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art has problems in constant current output with small regulation range and low resistance to external environment changes.
A constant current control device for electrodeposition is adopted to calculate the optimal current duty cycle through the BP neural network, and adjust the switching state of the MOS tube in the buck circuit in real time to realize constant current control. The device integrates electrical parameter sensors and electrolyte parameter sensors, which can collect and process input voltage, load resistance, electrolyte concentration and other parameters in real time.
It realizes a stable constant current output over a wide current regulation range, significantly reducing the delay caused by the tentative adjustment process in traditional methods, improving the response speed and dynamic adjustment capabilities of the control system, and improving control stability.
Smart Images

Figure CN119847268A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of power electronics, in particular to a constant current control device for electrodeposition and a control method thereof. Background Art
[0002] Constant current sources are widely used in LED lighting drive power supplies, battery charge and discharge control systems, power management, and precision electronic instruments for stable and reliable current output. Traditional constant current sources are mostly designed with transistors, and common types include mirror current sources and proportional current sources. Among them, the output current of the mirror current source is easily affected by external environmental factors such as temperature, resulting in insufficient stability; while the proportional current source is difficult to achieve precise control over a wide range due to its limited adjustment range.
[0003] Patent No. CN117539317A discloses that a control voltage is applied between the drain and source of an NMOS tube to make the NMOS tube work in a constant current region to achieve load constant current output. Patent No. CN102723868B discloses that a load constant current output is achieved by utilizing the constant current output characteristics of a MOSFET. Patent No. CN114977821A discloses that a constant current output is achieved based on a Buck converter and a PID control method.
[0004] The above technical solution still has the problems of small control range of output current and low ability to resist interference from changes in external environment. Summary of the invention
[0005] The technical problem to be solved by the present invention is: in order to solve the problems existing in the prior art in the above-mentioned background technology, a constant current control device for electrodeposition is provided.
[0006] The technical solution adopted by the present invention to solve its technical problems is: a constant current control device for electrodeposition, comprising a step-down circuit, an electrodeposition device, an electrolyte parameter sensor, an electrical parameter sensor, a single-chip microcomputer, a host computer and a computer, wherein the electrolyte parameter sensor is connected to the electrodeposition device and is used to collect parameters of the electrolyte in the electrodeposition device, the electrical parameter sensor is used to collect electrical parameters of the step-down circuit, the electrical parameter sensor and the electrolyte parameter sensor are both electrically connected to the single-chip microcomputer, the single-chip microcomputer collects data of the electrolyte parameter sensor and the electrical parameter sensor in real time, and sends the collected data to the host computer through a serial port, the host computer then transmits the data to the computer, the computer calculates the optimal duty cycle D of the current in the step-down circuit through a BP neural network based on the collected data, and feeds the data back to the single-chip microcomputer through the host computer, the single-chip microcomputer adjusts the switch state of the MOS tube in the step-down circuit according to the duty cycle D to achieve constant current control.
[0007] Furthermore, the step-down circuit is mainly composed of an input power supply, an inductor L, a MOS tube, an output filter capacitor C and a load R; the electrical parameter sensor includes a current sensor, a voltage sensor and a resistance sensor, the voltage sensor is connected to the input end of the step-down circuit to detect the input voltage; the current sensor is connected to the output end of the step-down circuit to monitor the output current; the resistance sensor is connected to the output end of the step-down circuit to measure the load resistance value.
[0008] Furthermore, the electrolyte parameter sensor includes a conductivity sensor, a temperature sensor, a pH microelectrode and an online concentration detector.
[0009] Also provided is a control method for the constant current control device for electrodeposition of the above scheme, comprising the following steps: S1. Divide the current duty cycle D of the step-down circuit into M equal parts. The values of the duty cycle D are D from small to large. 1 ~D M+1 , where the duty cycle D ranges from ; S2, set the duty cycle D of the step-down circuit to D 1 ~D M+1 , record the corresponding output current value for ~ , with D 1 ~D M+1 and ~ As the training data set ∑A is input into the BP neural network A training, the output current is obtained Predicted optimal duty cycle Model; S3. Set the required output current value Constant , use BP neural network A to calculate the optimal duty cycle ; S4. Record Duty cycle under conditions , and the input voltage collected by the voltage sensor and the resistance sensor at this time , load resistance And the value of the electrolyte concentration Q in the electrodeposition device collected by the online concentration detector is added to the training data set ∑B as a training sample of a neural network B; S5, the duty cycle The computer sends it to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit to , realize constant current output of step-down circuit; S6, when the duty cycle of the step-down circuit is adjusted to After that, the microcontroller monitors the actual output current and the required constant value The relative error Exceed , then repeat steps S1 to S4, and calculate and update the duty cycle through BP neural network A ; S7. When the amount of data in the training data set ∑B reaches n, the required constant output current value is , Input voltage , load resistance , electrolyte concentration Q as the input of the neural network model, duty cycle Used as output to train neural network B; S8, load the trained BP neural network B model into the computer, and collect the input voltage of the current sensor, voltage sensor and resistance sensor. , load resistance The data of the electrolyte concentration Q in the electrodeposition device collected by the online concentration detector is sent to the host computer through the single chip microcomputer, and the host computer transmits the data to the computer, and the computer BP neural network B obtains the required constant output current value. , Input voltage , load resistance , optimal duty cycle under electrolyte concentration Q ; S9, will and As the upper and lower limits of the duty cycle D, respectively, and replace the upper limit 1 and lower limit 0 in step S1, repeat steps S1 to S5 to obtain the optimal duty cycle ; S10, the computer uses the serial port to Sent to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit , realize constant current output of step-down circuit; S11. Human judgment on whether to stop.
[0010] Furthermore, in step S1, M is 50; in step S3 is 300mA; in step S7, n is 500; in step S9 is 10%.
[0011] Furthermore, the relative error in step S6 Satisfy the formula: , It is 3%.
[0012] Furthermore, in step S7, the data set ∑B needs to be preprocessed before training the neural network B, and the training set data is normalized to [-1, 1] using the Sigmoid function, a transfer function of the neuron; Initialize the BP neural network model B again, set the input layer to 4 layers, which are the constant output current values , Input voltage , load resistance and electrolyte concentration Q, the hidden layer is 10 layers, and the output layer has 1 layer of duty cycle , and use trainbr as the training algorithm, then extract the weight matrix from the input layer to the hidden layer w 1 , and get the bias of the hidden layer b 1 ; Then get the weight matrix from the hidden layer to the output layer w 2 and the bias of the output layer b 2 .
[0013] Furthermore, during the training of the BP neural network B, the weights are adjusted by the back propagation algorithm. w and bias b , in order to reduce the error between the predicted output and the target output, specifically: First, BP neural network B receives input data and performs forward propagation to obtain predicted output; then, by comparing the predicted output and target output , using the mean square error formula: , calculate the error ; Then, the error Back propagate from the output layer to each layer and calculate each weight w and bias b Gradients of ; use these gradients and adjust the weights using gradient descent w and bias b , the update formula is: , in, is the learning rate, w old and w new are the weights before and after the same training process, representing the weight values before and after the update, respectively. b old and b new are the front and back biases in the same training process, representing the bias values before and after the update respectively; The above process is repeated to gradually reduce the error, making the network output closer and closer to the target output. At the same time, the training will stop when the error reaches 0.00001 or the maximum number of training times is 1000.
[0014] Furthermore, 5% of the data are randomly selected from the 500 sets of data to verify the training effect, specifically: The data of the validation set needs to be normalized, and the normalized test data is input into the trained BP neural network model B for prediction. The prediction results are denormalized to the original data scale, and the error between the predicted value and the true value is calculated based on the mean absolute error MAE. The calculation formula of the absolute error MAE is as follows:
[0015] in, n is the total number of samples, It is The predicted value of samples, It is The true value of samples; The performance of neural network B on the test set is evaluated based on the calculated mean absolute error MAE, and the error with the actual output is analyzed. When the error between the predicted optimal duty cycle and the actual duty cycle is higher than 0.005, the BP neural network model B is manually adjusted; when the error between the predicted optimal duty cycle and the actual duty cycle is lower than 0.005, the training of BP neural network B is completed.
[0016] Beneficial effects of the present invention: The present invention realizes the function of automatically adjusting the duty cycle D by nesting the application of BP neural network A and BP neural network B, thereby achieving stable constant current output within a wide current regulation range, while significantly reducing the delay caused by the tentative adjustment process in the traditional method, and improving the response speed and dynamic adjustment capability of the control system; the constant current control device introduces key input variables such as input voltage, load resistance, electrolyte parameters and output current, which can adapt to changes in the external environment in real time, thereby improving the stability of the control of the entire device. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0018] Figure 1 It is a structural block diagram of the constant current control device for electrodeposition of the present invention.
[0019] Figure 2 It is a flow chart of the control method of the constant current control device for electrodeposition of the present invention.
[0020] Figure 3 It is an output current diagram of the constant current control device for electrodeposition of the present invention.
[0021] Figure 4 It is a comparison chart of the expected value in the control method of the present invention and the predicted value output by the BP neural network B.
[0022] In the figure: 1. step-down circuit; 2. electrodeposition device; 3. electrolyte parameter sensor; 4. electrical parameter sensor; 5. single chip microcomputer; 6. host computer; 7. computer. DETAILED DESCRIPTION
[0023] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0024] like Figure 1 As shown, a constant current control device for electrodeposition includes a buck circuit 1, an electrodeposition device 2, an electrolyte parameter sensor 3, an electrical parameter sensor 4, a single-chip microcomputer 5, a host computer 6 and a computer 7. The electrolyte parameter sensor 3 is connected to the electrodeposition device 2 and is used to collect parameters of the electrolyte in the electrodeposition device 2. The electrical parameter sensor 4 is used to collect electrical parameters of the buck circuit 1. The electrical parameter sensor 4 and the electrolyte parameter sensor 3 are both electrically connected to the single-chip microcomputer 5. The single-chip microcomputer 5 collects data from the electrolyte parameter sensor 3 and the electrical parameter sensor 4 in real time, and sends the collected data to the host computer 6 through the serial port. The host computer 6 then transmits the data to the computer 7. Based on the collected data, the computer 7 calculates the optimal duty cycle D of the current in the buck circuit 1 through the BP neural network, and feeds the data back to the single-chip microcomputer 5 through the host computer 6. The single-chip microcomputer 5 adjusts the switching state of the MOS tube in the buck circuit 1 according to the duty cycle D to achieve constant current control.
[0025] Among them, the buck circuit 1 is mainly composed of an input power supply, an inductor L, a MOS tube, an output filter capacitor C and a load R; the electrical parameter sensor 4 includes a current sensor, a voltage sensor and a resistance sensor, the voltage sensor is connected to the input end of the buck circuit 1, and is used to detect the input voltage; the current sensor is connected to the output end of the buck circuit 1, and is used to monitor the output current; the resistance sensor is connected to the output end of the buck circuit 1, and is used to measure the load resistance value. The electrolyte parameter sensor 3 includes a conductivity sensor, a temperature sensor, a pH microelectrode and an online concentration detector. In the electroplating process, there are many electrolyte parameters, but the most influencing parameter is still the concentration of the electrolyte, so in actual detection, generally only the concentration of the electrolyte is considered.
[0026] like Figure 2 As shown, the control method of the constant current control device for electrodeposition comprises the following steps: S1. Divide the current duty cycle D of the step-down circuit into 50 equal parts. The values of the duty cycle D are D from small to large. 1 ~D 51 , where the duty cycle D ranges from .
[0027] S2, set the duty cycle D of the step-down circuit to D 1 ~D 51 , record the corresponding output current value for ~ , with D 1 ~D 51 and ~ As the training data set ∑A is input into the BP neural network A training, the output current is obtained Predicted optimal duty cycle Model.
[0028] S3. Set the required output current value The current is constant at 300mA, and the optimal duty cycle is calculated using BP neural network A. .
[0029] S4. Record the duty cycle under 300mA condition , and the input voltage collected by the voltage sensor and the resistance sensor at this time , load resistance And the value of the electrolyte concentration Q in the electrodeposition device 2 collected by the online concentration detector is added to the training data set ∑B as a training sample of the neural network B.
[0030] S5, the duty cycle The computer sends it to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit to , achieving a constant current output of 300mA of the buck circuit 1.
[0031] S6, when the duty cycle of the step-down circuit is adjusted to After that, the microcontroller monitors the actual output current and the required constant value The relative error If it exceeds 3%, repeat steps S1 to S4 and calculate and update the duty cycle through BP neural network A. ; Among them, the relative error The calculation formula is: .
[0032] S7. When the amount of data in the training data set ∑B reaches n, the required constant output current value is , Input voltage , load resistance , electrolyte concentration Q as the input of the neural network model, duty cycle Used as output to train neural network B; Before training the neural network B, the data set ∑B needs to be preprocessed. The training set data is normalized to [-1, 1] using the Sigmoid function, the transfer function of the neuron. Then initialize the BP neural network model B, set the input layer to 4 layers, namely the constant output current value of 300mA, the input voltage , load resistance and electrolyte concentration Q, the hidden layer is 10 layers, and the output layer has 1 layer of duty cycle , and use trainbr as the training algorithm, then extract the weight matrix from the input layer to the hidden layer w 1 , and get the bias of the hidden layer b 1 ; Then get the weight matrix from the hidden layer to the output layer w 2 and the bias of the output layer b 2 ; Weight matrix w 1 , Bias b 1 , weight matrix w 2 and bias b 2 It is the key parameter between each layer in the neural network, which together determine the mapping relationship from input to output. w 1 and bias b 1 Controls the weighted input and bias from the input layer to the hidden layer, which affects the output representation of the hidden layer; the weight matrix w 2 and bias b 2 It controls the mapping from the hidden layer to the output layer and determines the final network output.
[0033] During the training process of BP neural network B, the weights are adjusted through the back propagation algorithm. w and bias b , in order to reduce the error between the predicted output and the target output, specifically: First, BP neural network B receives input data and performs forward propagation to obtain predicted output; then, by comparing the predicted output and target output , using the mean square error formula: , calculate the error ; Then, the error Back propagate from the output layer to each layer and calculate each weight w and bias b Gradients of ; use these gradients and adjust the weights using gradient descent w and bias b , the update formula is: , in, is the learning rate, w old and w new are the weights before and after the same training process, representing the weight values before and after the update, respectively. b old and b new are the forward and backward biases in the same training process, representing the bias values before and after the update respectively; through such an update process, the network continuously adjusts the weights and biases, gradually reducing the loss and thus improving the prediction accuracy.
[0034] The above process is repeated to gradually reduce the error, making the network output closer and closer to the target output. At the same time, the training will stop when the error reaches 0.00001 or the maximum number of training times is 1000.
[0035] Finally, 5% of the data is randomly selected from the 500 sets of data to verify the training effect, specifically: The data of the validation set needs to be normalized, and the normalized test data is input into the trained BP neural network model B for prediction. The prediction results are denormalized to the original data scale, and the error between the predicted value and the true value is calculated based on the mean absolute error MAE. The calculation formula of the absolute error MAE is as follows:
[0036] in, n is the total number of samples, It is The predicted value of samples, It is The true value of samples; The performance of neural network B on the test set is evaluated based on the calculated mean absolute error MAE, and the error with the actual output is analyzed. When the error between the predicted optimal duty cycle and the actual duty cycle is higher than 0.005, the BP neural network model B is manually adjusted; when the error between the predicted optimal duty cycle and the actual duty cycle is lower than 0.005, the training of BP neural network B is completed.
[0037] S8, load the trained BP neural network B model into the computer, and collect the input voltage of the current sensor, voltage sensor and resistance sensor. , load resistance The data of the electrolyte concentration Q in the electrodeposition device collected by the online concentration detector is sent to the host computer through the single chip microcomputer, and the host computer transmits the data to the computer, and the computer BP neural network B obtains the required constant output current value. , Input voltage , load resistance , optimal duty cycle under electrolyte concentration Q .
[0038] S9, will and As the upper and lower limits of the duty cycle D, respectively, and replace the upper limit 1 and lower limit 0 in step S1, repeat steps S1 to S5 to obtain the optimal duty cycle .
[0039] S10, the computer uses the serial port to Sent to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit , realizing constant current output of buck circuit.
[0040] S11. Human judgment on whether to stop.
[0041] Neural network A performs preliminary duty cycle prediction, and its main task is to predict the optimal duty cycle based on the input current data. :Neural network A passes through a series of discrete duty cycles D 1 , D 2 , …, D 51 And the corresponding output current value I out1 ,I out2 ,…,I out_51 The data reflects the performance under different duty cycles. The data is used to train the neural network A. The neural network A learns the relationship between duty cycle D and output current. I out Given the required output current of 300mA, neural network A will calculate a corresponding duty cycle , according to the prediction of neural network A, the duty cycle is transmitted to the step-down circuit 1, adjusts the output current, and the microcontroller 5 measures the actual output current I out , and compare it with the target current 300mA to calculate the relative error η. If the error η exceeds the set threshold of 3%, it means that the current duty cycle If the target accuracy is not reached and the system needs to be optimized, repeat steps S1 to S4 to calculate and update the duty cycle through BP neural network A. .
[0042] The main task of neural network B is to calculate the input voltage based on the environmental parameter. , load resistance The duty cycle is optimized by using the electrolyte concentration Q in the electrodeposition device collected by the online concentration detector, so that the system can adjust the current more accurately under different environments. When the system is fed back to the system in step S6, the system environmental data such as input voltage , load resistance and electrolyte concentration Q, and compare these data with the corresponding duty cycle As training samples, we construct the training set ΣB of neural network B. When the training set ΣB reaches the required 500, we train neural network B to obtain the model of neural network B. The goal of neural network B is to correct and optimize the duty cycle according to the current environmental changes. , allowing the device to respond quickly and maintain precise constant current output.
[0043] The optimal duty cycle obtained by neural network B The feedback is sent back to neural network A for retraining to optimize the duty cycle prediction model. In step S9, neural network B calculates a new duty cycle. , and redefine the duty cycle search range by adjusting the upper and lower limits of the duty cycle. In steps S1 to S5, the neural network A is retrained through the new search range to adjust its ability to predict the duty cycle, and the duty cycle of the new training data set ΣA is retrained. . This feedback iteration process allows neural networks A and B to continuously optimize and gradually approach the optimal control effect of the system. Neural network A is mainly responsible for predicting the duty cycle based on the output current, and gradually optimizes the accuracy of duty cycle prediction as the system runs and feedback. Neural network B mainly optimizes the duty cycle through environmental data (input voltage, load resistance, control parameters, etc.) to adapt to different working conditions, and provides feedback to neural network A to help it better adjust the duty cycle under new environmental conditions.
[0044] In this embodiment, the desired output current value is 300mA, and the control device can achieve stable output current regulation within the range of 50mA to 2000mA through this method. In this embodiment, by continuously optimizing the BP neural network A and the BP neural network B, the duty cycle D is adjusted to achieve a wide range of constant current output, such as Figure 3 As shown, it can adapt to external disturbance conditions and significantly improve the response speed of the system.
[0045] like Figure 4 As shown, the ordinate is the value of the duty cycle D, the abscissa is the number of validation sets, the error is almost 0, and the expected value (the duty cycle D of the actual training set) and the predicted value (the value of the duty cycle predicted by the neural network B) almost coincide.
[0046] The constant current control device for electrodeposition of this embodiment is not limited to constant current control during electrodeposition treatment, and can be applied to any object requiring constant current control. The electrodeposition device 2, electrolyte parameter sensor 3 and electrical parameter sensor 4 can be modified according to actual needs.
[0047] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A constant current control device for electrodeposition, characterized in that: The invention comprises a step-down circuit, an electrodeposition device, an electrolyte parameter sensor, an electrical parameter sensor, a single-chip microcomputer, a host computer and a computer. The electrolyte parameter sensor is connected to the electrodeposition device and is used to collect parameters of the electrolyte in the electrodeposition device. The electrical parameter sensor is used to collect electrical parameters of the step-down circuit. Both the electrical parameter sensor and the electrolyte parameter sensor are electrically connected to the single-chip microcomputer. The single-chip microcomputer collects data of the electrolyte parameter sensor and the electrical parameter sensor in real time, and sends the collected data to the host computer through a serial port. The host computer then transmits the data to the computer. Based on the collected data, the computer calculates the optimal duty cycle D of the current in the step-down circuit through a BP neural network, and feeds the data back to the single-chip microcomputer through the host computer. The single-chip microcomputer adjusts the switch state of the MOS tube in the step-down circuit according to the duty cycle D to achieve constant current control.
2. The constant current control device for electrodeposition according to claim 1, characterized in that: The step-down circuit is mainly composed of an input power supply, an inductor L, a MOS tube, an output filter capacitor C and a load R; the electrical parameter sensor includes a current sensor, a voltage sensor and a resistance sensor, the voltage sensor is connected to the input end of the step-down circuit to detect the input voltage; the current sensor is connected to the output end of the step-down circuit to monitor the output current; the resistance sensor is connected to the output end of the step-down circuit to measure the load resistance value.
3. The constant current control device for electrodeposition according to claim 1, characterized in that: The electrolyte parameter sensor comprises a conductivity sensor, a temperature sensor, a pH microelectrode and an online concentration detector.
4. A control method for a constant current control device for electrodeposition as claimed in any one of claims 1 to 3, characterized in that: The steps include: S1. Divide the current duty cycle D of the step-down circuit into M equal parts. The values of the duty cycle D are D1 to D M+1 , where the duty cycle D ranges from ; S2, set the duty cycle D of the step-down circuit to D1~D M+1 , record the corresponding output current value for ~ , with D1~D M+1 and ~ As the training data set ∑A is input into the BP neural network A training, the output current is obtained Predicted optimal duty cycle Model; S3. Set the required output current value Constant , use BP neural network A to calculate the optimal duty cycle ; S4. Record Duty cycle under conditions , and the input voltage collected by the voltage sensor and the resistance sensor at this time , load resistance And the value of the electrolyte concentration c in the electrodeposition device collected by the online concentration detector is added to the training data set ∑B as a training sample of a neural network B; S5, the duty cycle The computer sends it to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit to , realize constant current output of step-down circuit; S6, when the duty cycle of the step-down circuit is adjusted to After that, the microcontroller monitors the actual output current and the required constant value The relative error Exceed , then repeat steps S1 to S4, and calculate and update the duty cycle through BP neural network A ; S7. When the amount of data in the training data set ∑B reaches n, the required constant output current value is , Input voltage , load resistance , electrolyte concentration Q as the input of the neural network model, duty cycle Used as output to train neural network B; S8, load the trained BP neural network B model into the computer, and collect the input voltage of the current sensor, voltage sensor and resistance sensor. , load resistance The data of the electrolyte concentration Q in the electrodeposition device collected by the online concentration detector is sent to the host computer through the single chip microcomputer, and the host computer transmits the data to the computer, and the computer BP neural network B obtains the required constant output current value. , Input voltage , load resistance , optimal duty cycle under electrolyte concentration Q ; S9, will and As the upper and lower limits of the duty cycle D, respectively, and replace the upper limit 1 and lower limit 0 in step S1, repeat steps S1 to S5 to obtain the optimal duty cycle ; S10, the computer uses the serial port to Sent to the host computer, which transmits it to the microcontroller, which adjusts the duty cycle of the control circuit , realize constant current output of step-down circuit; S11. Human judgment on whether to stop.
5. The control method of the constant current control device for electrodeposition according to claim 4, characterized in that: In step S1, M is 50; in step S3, is 300mA; in step S7, n is 500; in step S9 is 10%.
6. The control method of the constant current control device for electrodeposition according to claim 4, characterized in that: The relative error in step S6 Satisfy the formula: , It is 3%.
7. The control method of the constant current control device for electrodeposition according to claim 4, characterized in that: In step S7, the data set ∑B needs to be preprocessed before training the neural network B, and the training set data is normalized to [-1, 1] using the Sigmoid function, a transfer function of the neuron; Initialize the BP neural network model B again, set the input layer to 4 layers, which are the constant output current values , Input voltage , load resistance and electrolyte concentration Q, the hidden layer is 10 layers, and the output layer has 1 layer of duty cycle , and use trainbr as the training algorithm, then extract the weight matrix from the input layer to the hidden layer w 1, and get the bias of the hidden layer b 1; then obtain the weight matrix from the hidden layer to the output layer w 2 and the bias of the output layer b 2.
8. The control method of the constant current control device for electrodeposition according to claim 7, characterized in that: During the training of BP neural network B, the weights are adjusted through the back propagation algorithm. w and bias b , in order to reduce the error between the predicted output and the target output, specifically: First, BP neural network B receives input data and performs forward propagation to obtain predicted output; then, by comparing the predicted output and target output , using the mean square error formula: , calculate the error ; Then, the error Back propagate from the output layer to each layer to calculate each weight w and bias b The gradient of Use these gradients to adjust the weights via gradient descent w and bias b , the update formula is: , in, is the learning rate, w old and w new are the weights before and after the same training process, representing the weight values before and after the update, respectively. b old and b new are the front and back biases in the same training process, representing the bias values before and after the update respectively; The above process is repeated to gradually reduce the error, making the network output closer and closer to the target output. At the same time, the training will stop when the error reaches 0.00001 or the maximum number of training times is 1000.
9. The control method of the constant current control device for electrodeposition according to claim 8, characterized in that: Randomly select 5% of the data from 500 sets of data to verify the training effect, specifically: The data of the validation set needs to be normalized, and the normalized test data is input into the trained BP neural network model B for prediction. The prediction results are denormalized to the original data scale, and the error between the predicted value and the true value is calculated based on the mean absolute error MAE. The calculation formula of the absolute error MAE is as follows: in, n is the total number of samples, It is The predicted value of samples, It is The true value of samples; The performance of neural network B on the test set is evaluated based on the calculated mean absolute error MAE, and the error with the actual output is analyzed. When the error between the predicted optimal duty cycle and the actual duty cycle is higher than 0.005, the BP neural network model B is manually adjusted; when the error between the predicted optimal duty cycle and the actual duty cycle is lower than 0.005, the training of BP neural network B is completed.
Citation Information
Patent Citations
Constant current source
CN102723868B
Constant current control method and system of Buck type converter
CN114977821A
Constant current source circuit
CN117539317A