Rotation speed control method, system and equipment based on direct current brushless motor and medium
By collecting the current and voltage signals of the DC brushless motor, combining the position signals of the Hall element, optimizing the parameters of the PID controller, the complex problem of PID controller parameter adjustment in the prior art is solved, and higher accuracy and stable speed control is achieved.
Patent Information
- Application Number
- CN202411788588.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, the speed control of the DC brushless motor has the problem that the PID controller parameter adjustment process is complicated, and it depends on the experience of debuggers, making it difficult to achieve optimal parameter control.
The signal is collected through the current detection circuit and the voltage detection circuit, overvoltage and overcurrent protection detection is performed, and then transmitted to the analog-to-digital sampling module. The position signal of the motor rotor is obtained in combination with the Hall element, the real-time speed is calculated, and incrementally controlled through the speed controller to optimize the parameters of the PID controller.
The steady-state load change of DC brushless motor during dynamic processes is realized, which reduces the deviation of the speed control process and improves the anti-interference ability and control accuracy of the motor.
Smart Images

Figure CN119582651A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of motor control, and in particular relates to a speed control method, system, equipment and medium based on a brushless DC motor. Background Art
[0002] The brushless DC motor adopts the principle of electronic commutation, has good speed regulation performance, large starting torque, and convenient maintenance. It has been widely used in medical instruments, machine tool industry, textile industry, automobile and other fields. The traditional brushless DC motor needs to be manually adjusted to change the output speed of the motor, which limits the application scope of this motor. At the same time, manual adjustment determines that the adjustment accuracy of this adjustment method is greatly affected by people, and has the disadvantage of inaccurate speed regulation. The prior art uses PID (proportional-integral-differential) controller to perform high-precision speed control on the brushless DC motor. Its algorithm is simple, reliable, and does not require detailed system dynamics knowledge. However, the complex multivariable and nonlinear characteristics of the brushless DC motor make the traditional PID controller have complex parameter adjustment process and high requirements for engineering personnel experience. It is difficult to achieve the optimal parameter control of the motor servo system. The traditional PID controller does have some complexity and high requirements for engineering personnel experience in the parameter adjustment process. First, the PID controller consists of three parts: proportional (P), integral (I) and differential (D). The parameter adjustment of each part requires precise control to achieve the best control effect. For example, the proportional parameter Kp corresponds to the immediate impact of the error, the integral parameter Ki handles the error accumulation, and the differential parameter Kd predicts the error change trend. In practical applications, the tuning of PID parameters usually requires experimental adjustment based on the relationship between the dynamic performance and steady-state performance of the system, which requires experienced commissioning personnel to complete. Common adjustment methods include the critical proportionality method and the Ziegler-Nichols engineering tuning method. Although these methods have a certain theoretical basis, they still require the commissioning personnel to adjust according to the specific situation, so the experience requirements of the commissioning personnel are relatively high. In addition, the parameter setting of the PID controller directly affects the control effect. Appropriate PID parameter setting can improve the automatic control utilization rate and increase the stability of the device operation. However, since the parameter adjustment process of the PID controller is complicated and depends on the experience of the commissioning personnel, it is difficult to achieve the optimal parameter control of the motor servo system. Summary of the invention
[0003] In order to solve the above problems existing in the prior art, the present invention provides a speed control method based on a brushless DC motor.
[0004] The purpose of the present invention can be achieved by the following technical solutions:
[0005] S1: The current signal of the DC bus of the stator winding of the motor is collected through the current detection circuit, and the voltage signal is collected through the voltage detection circuit. The current signal and the voltage signal are isolated and processed to perform overvoltage and overcurrent protection detection. If the detection result of the overvoltage and overcurrent protection detection is within a preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module;
[0006] S2: obtaining a position signal of the motor rotor through a Hall element arranged on the motor shaft in the brushless DC motor, and calculating the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor;
[0007] S3: Preset a reference speed target value, and obtain a current reference value by performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value;
[0008] S4: Convert the current signal into current numerical data through the analog-to-digital sampling module, and adjust and control the current reference value and the current numerical data through the current controller to obtain the current control quantity; adjust the duty cycle of the pulse modulation unit through the control quantity and output the closing and closing signals of the motor switch.
[0009] Specifically, the current detection circuit sampling resistor and the operational amplifier circuit bias and amplify the voltage signal obtained on the sampling resistor through the operational amplifier circuit and then output it to the analog-to-digital sampling module; the voltage detection circuit outputs the collected voltage signal to the analog-to-digital sampling module through a mutual inductor, a signal conditioning circuit, and an anti-aliasing filter circuit.
[0010] The analog-to-digital sampling module adopts a high-precision analog-to-digital converter to ensure the sampling accuracy of the current signal and the voltage signal to meet the needs of precise control. The analog-to-digital sampling module digitizes the input analog signal, converts it into a digital signal, and then further processes and analyzes it through a digital signal processor (DSP) or a microcontroller (MCU). In the DSP or MCU, an overvoltage and overcurrent protection detection algorithm is implemented, which can monitor the voltage and current signals in real time. Once a signal beyond the safety range is detected, the protection mechanism is immediately triggered to cut off the power supply to the motor to prevent damage to the motor. In addition, the analog-to-digital sampling module is also responsible for transmitting the processed current numerical data and voltage numerical data to the speed controller and the current controller, providing the necessary data support for the precise control of the motor.
[0011] Specifically, the overvoltage and overcurrent protection detection performs a circuit cutting operation according to indicator lights of the overcurrent protector and the overvoltage protector.
[0012] Specifically, S2 includes:
[0013] The Hall element is three switch-type Hall sensors installed on the motor with a difference of 120° electrical angle, and the conduction angle of the Hall sensor is set to 180°. The Hall sensor outputs a corresponding level signal according to the positive and negative changes of the magnetic field strength of the rotor, and the rotor rotation angle is calculated according to the level signal. The rotation interval is divided according to the rotor rotation angle, and the start and end positions of each interval are determined. The output results of the three Hall sensors are combined and the zero vector is removed to obtain the time corresponding to the rotation interval. The real-time speed of the motor is calculated according to the electrical angle of the motor rotor and the time of the rotor rotation interval.
[0014] Specifically, the speed controller is used to calculate a control sequence, and the control sequence is used to make the output of the real-time speed of the motor close to the reference speed target value;
[0015] The speed controller performs predictive control on the control quantity based on the parameter model. The parameter model predicts that the difference between the output and the reference trajectory is the smallest through the minimum performance index function process. The performance index function calculation formula is:
[0016]
[0017] Wherein, J(t) is a performance index parameter, which is used to emphasize the requirements of the state and control variables in the entire control process; E is the expectation, N1 is the target optimization lower limit, N2 is the target optimization upper limit, representing the starting point and the end point of the optimization time domain, N1 is the lower limit of the predictive control, when N1 = 0, the prediction time domain starts from the current time point and lasts for (k + N2) time steps, which means that when the system is optimized, it will consider the difference between the output error and the expected signal in the future period starting from the current moment; the current moment of the system is t, y(t + j) is the error between the actual output of the system model and the predicted output at the moment t + j, w(t + j) is the expected signal of the system, λ(j) is the weighting coefficient, which is used to assign weights to different errors and control increment changes during the optimization process; Δu(t + j-1) is the control increment, that is, the change in the control signal. The control increment is calculated during the optimization process and is used to adjust the system output to make it closer to the expected value; the calculation of the control increment usually involves an objective function, which achieves optimization by minimizing the system output error and the change in the control increment;
[0018] The speed controller adjusts the control sequence in real time to minimize the value of the performance index function J(t), thereby achieving precise control of the motor speed. In practical applications, the controller will dynamically adjust the weighting coefficient λ(j) and the control increment Δu(t+j-1) according to the current operating state of the motor and changes in the external environment to adapt to different working conditions and load changes.
[0019] The reference trajectory calculation formula is:
[0020] y r (k+i)=c(k)-β i [c(k)-y(k)],
[0021] Among them, y r (k+i) is the reference trajectory value at time k+i, which is the expected output value at time k+i. This value is determined according to the set target of the system and is used to guide the system to reach the expected state at a certain time in the future; c(k) is the reference speed target value at time k. In some control systems, such as motor speed control, the reference speed target value c(k)c represents the speed target expected to be achieved at time k. This value is calculated by the controller to ensure that the system can run at the predetermined speed; β i is the system softening factor, which is a parameter between 0 and 1, used to smooth the reference trajectory and reduce the system's response to sudden input changes. When the system softening factor is 0, there is no softening effect, and when the softening factor increases, the system softening effect increases, thereby improving the robustness of the system, but may reduce the rapidity of control; y(k) is the actual output of the system at time k. The actual system output y(k) refers to the output value actually achieved by the system at time k. This value is measured by the sensor and is used to compare with the reference trajectory value to evaluate the performance of the system.
[0022] By introducing the softening factor, the calculation of the reference trajectory can more smoothly reflect the changing trend of the desired speed, thereby reducing the mutations and oscillations in the system response process. In practical applications, the selection of the softening factor is crucial, and it needs to be adjusted according to the dynamic characteristics of the motor and the real-time feedback of the control system to ensure the stability and response speed of the speed control. In addition, the calculation of the reference trajectory also takes into account the reference speed target value at the current moment, which enables the controller to adjust according to the latest control target, further improving the flexibility and adaptability of the control.
[0023] Specifically, the current controller controls the proportional and integral coefficients of the PID controller through the deviation between the current reference value and the current numerical data and the rate of change of the deviation, obtains the optimal parameters by optimizing the proportional and integral coefficients, and obtains the current control amount based on the optimal parameters.
[0024] Specifically, the parameter optimization method is:
[0025] S101: setting the obtained proportional and integral coefficients as a parameter combination, initializing the total number of the parameter combinations, presetting the feasible solution dimension, the maximum number of iterations, the position parameter limit and the speed parameter limit, initializing the position and speed of the parameter combination, the position and speed of the parameter combination being used to characterize the state of the parameter combination in the solution space and the search efficiency;
[0026] S102: updating the speed of the parameter combination according to the speed update function to obtain the search time speed, the calculation formula is:
[0027] v ij (t+1)=wv ij (t)+c1r1(t)[p ij (t)-x ij (t)]+c2r2(t)[p gj (t)-x ij (t)],
[0028] Among them, v ij (t+1) is the search speed, w is the inertia weight, c1r1(t) is the individual learning weight, c2r2(t) is the social learning weight, v ij (t) is the velocity at the previous moment, x ij (t) is the position parameter of the parameter combination, p ij (t) is the optimal fitness point of the parameter combination individual, p gj (t) is the optimal fitness point of the parameter combination in the search space;
[0029] S103: if the speed at the search time is greater than the speed parameter limit or the position parameter corresponding to the parameter combination exceeds the position parameter limit, modify the speed parameter limit according to the speed at the search time or change the position parameter to a boundary value of the position parameter limit; perform accumulation processing on the position parameters of the parameter combination;
[0030] S104: Iterate S102-S103 according to the feasible solution dimension and the total number of parameter combinations, and if the number of iterations is greater than the maximum number of iterations, return the optimal parameter combination.
[0031] A speed control system based on a brushless DC motor, comprising a circuit detection module, a speed detection module, a speed and current control module, and a control drive module;
[0032] The circuit detection module is used to collect the current signal of the DC bus of the stator winding of the motor through the current detection circuit, collect the voltage signal through the voltage detection circuit, and perform overvoltage and overcurrent protection detection on the current signal and the voltage signal after isolation processing. If the detection result of the overvoltage and overcurrent protection detection is within the preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module;
[0033] The speed detection module is used to obtain the position signal of the motor rotor through the Hall element arranged on the motor shaft in the brushless DC motor, and calculate the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor;
[0034] The speed and current control module is used to preset a reference speed target value, and to obtain a current reference value by performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value;
[0035] The control drive module converts the current signal into current numerical data through the analog-to-digital sampling module, and adjusts and controls the current reference value and the current numerical data through the current controller to obtain the current control amount; the duty cycle of the pulse modulation unit is adjusted through the control amount and the closing and closing signals of the motor switch are output.
[0036] The beneficial effects of the present invention are:
[0037] Through the parameter optimization method, the parameter setting of the PID controller is optimized in the speed control of the DC brushless motor, so that the control speed follows the reference speed, the load steady-state change of the DC brushless motor in the dynamic process is realized, the speed deviation in the control process is reduced, and the anti-interference ability of the motor is improved; by performing position detection for the position sensor, and compensating the signal through the mutual inductor, signal conditioning circuit, and anti-aliasing filter circuit, the positive sequence component in the signal is extracted through coordinate transformation, and the compensation of the AC error is realized, and the motor rotor position is detected according to the Hall sensor array, the rotor position detection method is optimized, and the calculation accuracy of the rotation angle is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0039] Figure 1 The figure is a flow chart of a speed control method based on a brushless DC motor according to the present invention. DETAILED DESCRIPTION
[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0041] See also Figure 1 , a speed control method based on brushless DC motor:
[0042] S1: The current signal of the DC bus of the stator winding of the motor is collected through the current detection circuit, and the voltage signal is collected through the voltage detection circuit. The current signal and the voltage signal are isolated and processed to perform overvoltage and overcurrent protection detection. If the detection result of the overvoltage and overcurrent protection detection is within a preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module;
[0043] S2: obtaining a position signal of the motor rotor through a Hall element arranged on the motor shaft in the brushless DC motor, and calculating the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor;
[0044] S3: Preset a reference speed target value, and obtain a current reference value by performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value;
[0045] S4: Convert the current signal into current numerical data through the analog-to-digital sampling module, and adjust and control the current reference value and the current numerical data through the current controller to obtain the current control quantity; adjust the duty cycle of the pulse modulation unit through the control quantity and output the closing and closing signals of the motor switch.
[0046] Specifically, the current detection circuit sampling resistor and the operational amplifier circuit bias and amplify the voltage signal obtained on the sampling resistor through the operational amplifier circuit and then output it to the analog-to-digital sampling module; the voltage detection circuit outputs the collected voltage signal to the analog-to-digital sampling module through a mutual inductor, a signal conditioning circuit, and an anti-aliasing filter circuit.
[0047] Specifically, the overvoltage and overcurrent protection detection performs a circuit cutting operation according to indicator lights of the overcurrent protector and the overvoltage protector.
[0048] In this embodiment, the current detection circuit uses the LM358 high-speed dual operational amplifier, which contains two independent operational amplifiers with high gain and internal frequency compensation; the LM358 is used to form a high-precision half-wave rectifier circuit and adder, saving control board space and making the circuit design more concise and sophisticated. The anti-aliasing circuit uses a Sallen Key structure to filter out the high-frequency noise and interference of the signal on the path, reduce the aliased signal noise pollution signal and eliminate the optical drive signal outside the filter bandwidth, and avoid the noise signal and the noise spikes superimposed on the signal to saturate the analog modulation of the A / D.
[0049] Specifically, S2 includes:
[0050] The Hall element is three switch-type Hall sensors installed on the motor with a difference of 120° electrical angle, and the conduction angle of the Hall sensor is set to 180°. The Hall sensor outputs a corresponding level signal according to the positive and negative changes of the magnetic field strength of the rotor, and the rotor rotation angle is calculated according to the level signal. The rotation interval is divided according to the rotor rotation angle, and the start and end positions of each interval are determined. The output results of the three Hall sensors are combined and the zero vector is removed to obtain the time corresponding to the rotation interval. The real-time speed of the motor is calculated according to the electrical angle of the motor rotor and the time of the rotor rotation interval.
[0051] In this embodiment, it is necessary to project the rotor magnetic pole coordinates calculated according to the Hall sensor array onto the same plane as the initial position of the rotor magnetic pole; convert the data collected by the Hall sensor into a 0-1 signal according to a set threshold, and encode the output result of the sensor array after the conversion; project the obtained magnetic pole coordinates onto the corresponding plane, and calculate the angle of rotation of the rotor around the rotation axis according to the coordinates of the projection point. When multiple rotor magnetic pole coordinates are obtained at a sampling moment, the angle of rotor rotation corresponding to each rotor magnetic pole coordinate is calculated respectively, and the average value of these angles is taken as the angle of rotation of the rotor at the sampling moment.
[0052] Specifically, the speed controller is used to calculate a control sequence, and the control sequence is used to make the output of the real-time speed of the motor close to the reference speed target value;
[0053] The speed controller performs predictive control on the control quantity based on the parameter model. The parameter model predicts that the difference between the output and the reference trajectory is the smallest through the minimum performance index function process. The performance index function calculation formula is:
[0054]
[0055] Wherein, J(t) is the performance index parameter, E is the expectation, N1 is the lower limit of the target optimization, N2 is the upper limit of the target optimization, the current time of the system is t, y(t+j) is the error between the actual output and the predicted output of the system model at time t+j, w(t+j) is the expected signal of the system, λ(j) is the weighting coefficient, and Δu(t+j-1) is the control increment;
[0056] The reference trajectory calculation formula is:
[0057] y r (k+i)=c(k)-β i [c(k)-y(k)],
[0058] Among them, y r (k+i) is the reference trajectory value at time k+i, c(k) is the reference speed target value at time k, β i is the system softening factor, and y(k) is the actual output of the system at time k.
[0059] In this embodiment, the speed controller is based on the discrete formula of the incremental PID, and the output of the controller is the increment of the controlled object. The specific calculation formula is:
[0060]
[0061] From the above formula, it can be seen that the incremental PID is related to the deviations at time n, time n-1, and time n-2, but the deviations will not be accumulated. Therefore, the calculation amount is smaller than that of the position PID, and it will not be related to the past deviations. Therefore, the Diophantine equation is first used to determine the initial parameters of the PID. The importance of the Diophantine equation is that it converts the adjustment process into an algebraic equation, which can be solved by matrix. The input and output sequences are observed in the discrete domain within the predetermined sampling time. The preset scenario applies the self-tuning PID controller method to the original transfer function of the DC motor. The target optimization lower limit and target optimization upper limit involved are control limits based on the time domain, which are set here as the time domain width of the system control optimization time. The weighting coefficient is a parameter set according to the actual application and needs to be obtained based on experiments; the reference trajectory is a numerical trajectory curve set to make the system output smooth and close to the system reference target value, which is used to measure the output stability. The system softening factor is a constant component set according to the influence of signal disturbances encountered during actual operation.
[0062] Specifically, the current controller controls the proportional and integral coefficients of the PID controller through the deviation between the current reference value and the current numerical data and the rate of change of the deviation, obtains the optimal parameters by optimizing the proportional and integral coefficients, and obtains the current control amount based on the optimal parameters.
[0063] Specifically, the parameter optimization method is:
[0064] S101: setting the obtained proportional and integral coefficients as a parameter combination, initializing the total number of the parameter combinations, presetting the feasible solution dimension, the maximum number of iterations, the position parameter limit and the speed parameter limit, initializing the position and speed of the parameter combination, the position and speed of the parameter combination being used to characterize the state of the parameter combination in the solution space and the search efficiency;
[0065] S102: updating the speed of the parameter combination according to the speed update function to obtain the search time speed, the calculation formula is:
[0066] v ij (t+1)=wv ij (t)+c1r1(t)[p ij (t))—x ij (t)]+c2r2(t)[p gj (t)-x ij (t)],
[0067] Among them, v ij (t+1) is the search speed, w is the inertia weight, c1r1(t) is the individual learning weight, c2r2(t) is the social learning weight, v ij (t) is the velocity at the previous moment, x ij (t) is the position parameter of the parameter combination, p ij (t) is the optimal fitness point of the parameter combination individual, p gj (t) is the optimal fitness point of the parameter combination in the search space;
[0068] S103: if the speed at the search time is greater than the speed parameter limit or the position parameter corresponding to the parameter combination exceeds the position parameter limit, modify the speed parameter limit according to the speed at the search time or change the position parameter to a boundary value of the position parameter limit; perform accumulation processing on the position parameters of the parameter combination;
[0069] S104: Iterate S102-S103 according to the feasible solution dimension and the total number of parameter combinations, and if the number of iterations is greater than the maximum number of iterations, return the optimal parameter combination.
[0070] In this embodiment, the particle swarm optimization (PSO) algorithm is used to perform parameter optimization (randomly initializing the position and velocity of the particles is of great significance. This initialization method can ensure that the algorithm starts from a relatively broad and random search space, thereby avoiding falling into the local optimal solution and increasing the possibility of finding the global optimal solution.) In the PSO algorithm, the position and velocity of each particle are its two main attributes: the position of each particle is a multidimensional vector, which represents the specific position of the particle in the solution space. When optimizing the parameters of the PID controller, the position of each particle can be expressed as a set of control parameters. These position vectors reflect the current state of the solution space of the particle and are the basis for evaluating the fitness of the particle; the velocity of the particle is also a multidimensional vector, which determines the direction and distance of the particle's movement. The velocity update formula usually includes the influencing factors of inertia weight, individual optimal position and group optimal position. The change in velocity directly affects the trajectory of the particle, and thus affects its search efficiency in the solution space.
[0071] A speed control system based on a brushless DC motor, comprising a circuit detection module, a speed detection module, a speed and current control module, and a control drive module;
[0072] The circuit detection module is used to collect the current signal of the DC bus of the stator winding of the motor through the current detection circuit, collect the voltage signal through the voltage detection circuit, and perform overvoltage and overcurrent protection detection on the current signal and the voltage signal after isolation processing. If the detection result of the overvoltage and overcurrent protection detection is within the preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module;
[0073] The speed detection module is used to obtain the position signal of the motor rotor through the Hall element arranged on the motor shaft in the brushless DC motor, and calculate the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor;
[0074] The speed and current control module is used to preset a reference speed target value, and to obtain a current reference value by performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value;
[0075] The control drive module converts the current signal into current numerical data through the analog-to-digital sampling module, and adjusts and controls the current reference value and the current numerical data through the current controller to obtain the current control amount; the duty cycle of the pulse modulation unit is adjusted through the control amount and the closing and closing signals of the motor switch are output.
[0076] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0077] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0078] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0079] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A speed control method based on a brushless DC motor, comprising: S1: The current signal of the DC bus of the stator winding of the motor is collected through the current detection circuit, and the voltage signal is collected through the voltage detection circuit. The current signal and the voltage signal are isolated and processed to perform overvoltage and overcurrent protection detection. If the detection result of the overvoltage and overcurrent protection detection is within a preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module; S2: obtaining a position signal of the motor rotor through a Hall element arranged on the motor shaft in the brushless DC motor, and calculating the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor; S3: presetting a reference speed target value, and performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value to obtain a current reference value; S4: converting the current signal into current numerical data through the analog-to-digital sampling module, and adjusting and controlling the current reference value and the current numerical data through a current controller to obtain a current control value; The duty cycle of the pulse modulation unit is adjusted by the control variable and the closing and closing signals of the motor switch are output.
2. The method according to claim 1, characterized in that The current detection circuit sampling resistor and operational amplifier circuit bias and amplify the voltage signal obtained on the sampling resistor through the operational amplifier circuit and then output it to the analog-to-digital sampling module; the voltage detection circuit outputs the collected voltage signal to the analog-to-digital sampling module through a mutual inductor, a signal conditioning circuit, and an anti-aliasing filter circuit.
3. The method according to claim 1, characterized in that The overvoltage and overcurrent protection detection performs a circuit cutting operation according to the indicator lights of the overcurrent protector and the overvoltage protector.
4. The method according to claim 1, characterized in that: S2 specifically includes: The Hall element is three switch-type Hall sensors installed on the motor with a difference of 120° electrical angle, and the conduction angle of the Hall sensor is set to 180°. The Hall sensor outputs a corresponding level signal according to the positive and negative changes of the magnetic field strength of the rotor, and the rotor rotation angle is calculated according to the level signal. The rotation interval is divided according to the rotor rotation angle, and the start and end positions of each interval are determined. The output results of the three Hall sensors are combined and the zero vector is removed to obtain the time corresponding to the rotation interval. The real-time speed of the motor is calculated according to the electrical angle of the motor rotor and the time of the rotor rotation interval.
5. The method according to claim 1, characterized in that The speed controller is used to calculate a control sequence, and the control sequence is used to make the output of the real-time speed of the motor close to the reference speed target value; The speed controller performs predictive control on the control amount based on the parameter model. The parameter model minimizes the difference between the predicted output value of the control amount and the reference trajectory by minimizing the performance index function. The calculation formula of the performance index function is: Wherein, J(t) is the performance index parameter, E is the expectation, N1 is the lower limit of the target optimization, N2 is the upper limit of the target optimization, the current time of the system is t, y(t+j) is the error between the actual output and the predicted output of the system model at time t+j, w(t+j) is the expected signal of the system, λ(j) is the weighting coefficient, and Δu(t+j-1) is the control increment; The reference trajectory calculation formula is: and r (k+i)=c(k)-β i [c(k)-y(k)], Among them, y r (k+i) is the reference trajectory value at time k+i, c(k) is the reference speed target value at time k, β i is the system softening factor, and y(k) is the actual output of the system at time k.
6. The method according to claim 1, characterized in that The current controller controls the proportion and integral coefficient of the PID controller through the deviation between the current reference value and the current numerical data and the rate of change of the deviation, obtains the optimal parameters by optimizing the proportion and integral coefficients, and obtains the current control amount according to the optimal parameters.
7. The method according to claim 6, characterized in that The parameter optimization method is: S101: setting the obtained proportional and integral coefficients as a parameter combination, initializing the total number of the parameter combinations, presetting the feasible solution dimension, the maximum number of iterations, the position parameter limit and the speed parameter limit, initializing the position and speed of the parameter combination, the position and speed of the parameter combination being used to characterize the state of the parameter combination in the solution space and the search efficiency; S102: updating the speed of the parameter combination according to the speed update function to obtain the search time speed, the calculation formula is: v ij (t+1)=wv ij (t)+c1r1(t)[p ij (t)-x ij (t)]+c2r2(t)[p gj (t)-x ij (t)], Among them, v ij (t+1) is the search speed, w is the inertia weight, c1r1(t) is the individual learning weight, c2r2(t) is the social learning weight, v ij (t) is the velocity at the previous moment, x ij (t) is the position parameter of the parameter combination, p ij (t) is the optimal fitness point of the parameter combination individual, p gj (t) is the optimal fitness point of the parameter combination in the search space; S103: if the speed at the search time is greater than the speed parameter limit or the position parameter corresponding to the parameter combination exceeds the position parameter limit, modify the speed parameter limit according to the speed at the search time or change the position parameter to a boundary value of the position parameter limit; perform accumulation processing on the position parameters of the parameter combination; S104: Iterate S102-S103 according to the feasible solution dimension and the total number of parameter combinations, and if the number of iterations is greater than the maximum number of iterations, return the optimal parameter combination.
8. A speed control system based on a brushless DC motor, characterized in that: It includes a circuit detection module, a speed detection module, a speed and current control module, and a control drive module; The circuit detection module is used to collect the current signal of the DC bus of the stator winding of the motor through the current detection circuit, collect the voltage signal through the voltage detection circuit, and perform overvoltage and overcurrent protection detection on the current signal and the voltage signal after isolation processing. If the detection result of the overvoltage and overcurrent protection detection is within the preset safety limit range, the current signal and the voltage signal are transmitted to the analog-to-digital sampling module; The speed detection module is used to obtain the position signal of the motor rotor through the Hall element arranged on the motor shaft in the brushless DC motor, and calculate the real-time speed of the motor according to the position signal and the electrical angle of the motor rotor; The speed and current control module is used to preset a reference speed target value, and to obtain a current reference value by performing incremental control through a speed controller according to the difference between the real-time speed of the motor and the reference speed target value; The control driving module converts the current signal into current numerical data through the analog-to-digital sampling module, and adjusts and controls the current reference value and the current numerical data through the current controller to obtain the current control amount; The duty cycle of the pulse modulation unit is adjusted by the control variable and the closing and closing signals of the motor switch are output.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the speed control method based on the brushless DC motor is implemented as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the speed control method based on a brushless DC motor as described in any one of claims 1 to 7 when executed by a computer processor.