An adaptive particle swarm control method for offshore electric surfboards
The adaptive particle swarm control method is used to adjust the PID parameters of the offshore electric surfboard, which solves the problem of difficulty in adjusting the traditional method and the inability to adapt to the offshore environment in real time, and improves control accuracy and safety.
Patent Information
- Application Number
- CN202211136840.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-09-19
AI Technical Summary
The traditional PID control method is difficult to adjust parameters in offshore electric surfboards and cannot adapt to the changing marine environment in real time, affecting the safety of surfers.
The adaptive particle swarm control method is used to adjust the PID parameters of the speed outer loop and current inner loop through the speed error calculation and current acquisition module, combined with the adaptive particle swarm algorithm, to achieve real-time control parameter adjustment.
It solves the problems of difficulty in parameter adjustment of the traditional PID control method and the inability to adapt to the offshore environment in real time, and improves the control accuracy and safety of offshore electric surfboards.
Smart Images

Figure CN115407646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of surfboards, and in particular to an adaptive particle swarm control method for offshore electric surfboards. Background Art
[0002] With the popularity and development of surfing in China, the number of surfers has gradually increased. Sea electric surfboards have gradually replaced traditional windsurfing boards and become the first choice for surfers because of their power devices, independent of wind and waves, and adaptability to various environments.
[0003] The working environment of offshore electric surfboards is special and they need to operate at sea for a long time. Therefore, the design of the control method of offshore electric surfboards is particularly critical, and its quality will directly affect the power and speed of offshore electric surfboards, and thus affect the safety of surfers.
[0004] The control system of an offshore electric surfboard is a nonlinear, strongly coupled, multivariable complex system, so accurate targeted control is difficult to directly apply to the control system of an offshore electric surfboard. At present, the control method of an offshore electric surfboard usually adopts a double closed-loop control of a speed outer loop and a current inner loop, and its control usually adopts a traditional PID control method.
[0005] Although the traditional PID control method is simple to implement, there are two problems when it is applied to the control system of offshore electric surfboards. First, after the traditional PID control method is designed, the adjustment of its parameters requires experience. In addition, different offshore electric surfboards and different working environments make the adjustment of the parameters of the PID control method difficult. Second, the traditional PID control method cannot adjust the parameters in real time. When facing the ever-changing offshore environment, it is impossible to make parameter adjustments in time, which affects the safety of surfers. Summary of the invention
[0006] The purpose of the present invention is to provide an adaptive particle swarm control method for an offshore electric surfboard, so as to solve the problem that the traditional PID control method for the offshore electric surfboard is difficult to adjust parameters.
[0007] The purpose of the present invention is to provide an adaptive particle swarm control method for an offshore electric surfboard, so as to solve the problem that the traditional PID control method of the offshore electric surfboard cannot adjust parameters in real time in the face of a changing offshore environment, thereby affecting the safety of surfers.
[0008] The object of the present invention is achieved through the following technical solutions: An adaptive particle swarm control method for an offshore electric surfboard comprises: an offshore electric surfboard power device module, a speed acquisition module, a current acquisition module, a speed error calculation module, an adaptive particle swarm algorithm module, a speed outer loop PID module, and a current inner loop PID module.
[0009] Preferably, in the technical solution, the offshore electric surfboard power device module is generally an inductive BLDC or an inductive permanent magnet brushless DC motor.
[0010] Preferably, in the technical solution, the speed acquisition module is responsible for acquiring the current speed of the offshore electric surfboard power device.
[0011] Preferably, in the technical solution, the current acquisition module is responsible for collecting the bus current of the offshore electric surfboard power device.
[0012] Preferably, in the technical solution, the speed error calculation module calculates the current speed error value of the offshore electric surfboard by acquiring the current expected speed and the output value of the speed acquisition module.
[0013] Preferably, in the technical solution, the adaptive particle swarm algorithm module adaptively adjusts the size of the particle swarm inertia factor according to the current speed error input value and the speed error output value of the optimal solution of the swarm after the particle swarm iteration. When the particle swarm iteration effect is good, the inertia factor will be reduced to improve the local optimization ability of the particle swarm. When the particle swarm iteration effect is poor, the inertia factor will be increased to improve the global optimization ability of the particle swarm. Finally, according to the particle swarm formula and the adaptively changing inertia factor, the particle swarm iteration is completed, and the control parameters of the new speed outer loop PID module are output.
[0014] Preferably, in the technical solution, the speed outer loop PID module obtains the speed error value of the current offshore electric surfboard and the control parameters of the speed outer loop PID module through feedback from the speed error calculation module and the adaptive particle swarm algorithm module, and outputs the expected current value after PID calculation.
[0015] Preferably, in the technical solution, the current inner loop PID module obtains the error value of the current through the output values of the current acquisition module and the speed outer loop PID module, and outputs the current value to the offshore electric surfboard power device module after PID calculation, thereby controlling the overall smooth operation of the offshore electric surfboard.
[0016] Compared with the prior art, the present invention has the following advantages: (1) It solves the problem that after the traditional PID control method is designed, its parameter adjustment requires experience, and the parameter adjustment of the PID control method is difficult in the face of different equipment and working environments. (2) It solves the problem that the traditional PID control method cannot adjust the parameters in real time when facing the ever-changing marine environment, thereby affecting the safety of surfers. Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and cannot be used as a limitation of the present invention. For ordinary technicians in this field, it is possible to modify, replace or deform the technical solution adopted in the embodiment of the present invention without departing from it. However, these changes do not make the essence of the corresponding technical implementation plan deviate from the scope of the technical solution of the embodiment of the present invention, and they should all be included in the scope of the claims and specification of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of a control system model of an offshore electric surfboard of the present invention.
[0018] Figure 2 It is a schematic diagram of the structure of the adaptive particle swarm algorithm model of the present invention.
[0019] Figure 3 This is a schematic diagram of some core codes of the adaptive particle swarm algorithm of the present invention. DETAILED DESCRIPTION
[0020] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. The following embodiments are only a part of the embodiments of the present invention, which are used to more clearly illustrate the technical scheme of the present invention, and are therefore only used as examples. The embodiments obtained by other technical personnel in the field without performing innovative work all belong to the protection scope of the present invention. It should be noted that the academic or technical terms used in this application are all the usual meanings understood by those in the field.
[0021] An adaptive particle swarm control method for an offshore electric surfboard comprises: an offshore electric surfboard power device module, a speed acquisition module, a current acquisition module, a speed error calculation module, an adaptive particle swarm algorithm module, a speed outer loop PID module, and a current inner loop PID module, wherein the adaptive particle swarm control method comprises the following steps:
[0022] Step 1: Build a control system model for an offshore electric surfboard;
[0023] Step 2: Obtain the current speed value and current value of the offshore electric surfboard device module;
[0024] Step 3: Calculate the current speed error value;
[0025] Step 4: Construct an adaptive particle swarm algorithm model, input the speed error value into the adaptive particle swarm algorithm model, optimize the speed outer loop PID module parameters through continuous iterative calculation of the algorithm, and obtain the optimal value of the speed outer loop PID module parameters, which specifically includes the following steps:
[0026] S1. Randomly initialize N particles within the specified range and determine the position and speed of the initial particles, where the position of the particles represents the current three PID parameter values, namely, Kp, Ki, and Kd, and the speed represents the evolution direction of each particle;
[0027] S2. Taking the current particle position as the PID parameter, calculate the control quantity It according to formula (1), that is, the value of the output current inner loop obtained under the current parameters, and obtain the speed error value under the current parameters;
[0028]
[0029] In formula (1), It is the value output to the current inner loop, Kp, Ki, and Kd are the proportional gain, integral gain, and differential gain of the PID controller, respectively, and e(t) is the error between the expected speed value and the actual speed value;
[0030] S3. According to the speed error value obtained by the particle swarm after PID calculation, the individual optimal value Pb of each particle is obtained, that is, after each iteration of a particle, the particle position with the smallest speed error is recorded; the group optimal value Pj in the particle swarm is obtained, that is, after this iteration, the particle positions with the smallest speed error of all particles in the particle swarm are recorded;
[0031] S4. According to the two speed error values, that is, the error value Fc of the input speed outer loop PID module, the error value Fv obtained by the optimal value of the particle swarm iteration group is calculated according to formula (2). The specific steps are as follows: when Fc is greater than Fv, under the effect of the exponential function exp(-k) attenuated according to formula (2), the inertia factor w value becomes larger, thereby improving the global search ability of the particle swarm; when Fc is less than Fv, under the effect of the exponential function exp(-k) attenuated according to formula (2), the inertia factor w value becomes smaller, thereby improving the local optimization ability of the particle swarm, thereby realizing the adaptive adjustment of the particle swarm;
[0032]
[0033] S5. According to the particle swarm formula and the adaptively changing inertia factor, the particle position and velocity are updated according to formula (3); wherein, i is the number of each particle in the particle swarm, is the velocity of the kth generation particle of the particle number i, w is the adaptively transformed inertia factor (4), and the size of the inertia factor determines the optimization range of the particle swarm in this iteration; c1, c2 are acceleration constants; r1, r2 are random numbers between 0 and 1, which will change randomly in each iteration; is the position of the kth generation particle; Pb is the individual optimal value of each particle; Pj is the group optimal value in the particle swarm;
[0034]
[0035] S6. Determine whether the loop end condition is met. If it is met, the optimal value of the group in the last iteration is output as the parameter of the speed outer loop PID module;
[0036] Step 5: The speed outer loop PID module updates the PID control parameters according to the output value of the adaptive particle swarm algorithm module, calculates the output expected current value, and after calculation by the current inner loop PID module, outputs the current value to the offshore electric surfboard power device module, thereby realizing the overall closed-loop control of the offshore electric surfboard.
[0037] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and cannot be used as limitations of the present invention. For those of ordinary skill in the art, the technical solutions adopted in the embodiments of the present invention can be modified, replaced or deformed without departing from them. However, these changes do not make the essence of the corresponding technical implementation scheme depart from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and description of the present invention.
Claims
1. An adaptive particle swarm control method for an offshore electric surfboard, comprising: The offshore electric surfboard power device module, speed acquisition module, current acquisition module, speed error calculation module, adaptive particle swarm algorithm module, speed outer loop PID module, current inner loop PID module, characterized in that: the adaptive particle swarm control method comprises the following steps: Step 1: Build a control system model for an offshore electric surfboard; Step 2: Obtain the current speed value and current value of the offshore electric surfboard device module; Step 3: Calculate the current speed error value; Step 4: Construct an adaptive particle swarm algorithm model, input the speed error value into the adaptive particle swarm algorithm model, optimize the speed outer loop PID module parameters through continuous iterative calculation of the algorithm, and obtain the optimal value of the speed outer loop PID module parameters. The specific steps include: S1. Randomly initialize N particles within the specified range and determine the position and speed of the initial particles, where the position of the particles represents the current three PID parameter values, namely, Kp, Ki, and Kd, and the speed represents the evolution direction of each particle; S2. Taking the current particle position as the PID parameter, calculate the control quantity It according to formula (1), that is, the value of the output current inner loop obtained under the current parameters, and obtain the speed error value under the current parameters; In formula (1), It is the value output to the current inner loop, Kp, Ki, and Kd are the proportional gain, integral gain, and differential gain of the PID controller, respectively, and e(t) is the error between the expected speed value and the actual speed value; S3. According to the speed error value obtained by the particle swarm after PID calculation, the individual optimal value Pb of each particle is obtained, that is, after each iteration of a particle, the particle position with the smallest speed error is recorded; the group optimal value Pj in the particle swarm is obtained, that is, after this iteration, the particle positions with the smallest speed error of all particles in the particle swarm are recorded; S4. According to the two speed error values, that is, the error value Fc of the input speed outer loop PID module, the error value Fv obtained by the optimal value of the particle swarm iteration group is calculated according to formula (2). The specific steps are as follows: when Fc is greater than Fv, under the effect of the exponential function exp(-k) attenuated according to formula (2), the inertia factor w value becomes larger, thereby improving the global search ability of the particle swarm; when Fc is less than Fv, under the effect of the exponential function exp(-k) attenuated according to formula (2), the inertia factor w value becomes smaller, thereby improving the local optimization ability of the particle swarm, thereby realizing the adaptive adjustment of the particle swarm; S5. According to the particle swarm formula and the adaptively changing inertia factor, the particle position and velocity are updated according to formula (3); wherein, i is the number of each particle in the particle swarm, is the velocity of the kth generation particle of the particle number i, w is the adaptively transformed inertia factor (4), and the size of the inertia factor determines the optimization range of the particle swarm in this iteration; c1, c2 are acceleration constants; r1, r2 are random numbers between 0 and 1, which will change randomly in each iteration; is the position of the kth generation particle; Pb is the individual optimal value of each particle; Pj is the group optimal value in the particle swarm; S6. Determine whether the loop end condition is met. If it is met, the optimal value of the group in the last iteration is output as the parameter of the speed outer loop PID module; Step 5: The speed outer loop PID module updates the PID control parameters according to the output value of the adaptive particle swarm algorithm module, calculates the output expected current value, and after calculation by the current inner loop PID module, outputs the current value to the offshore electric surfboard power device module, thereby realizing the overall closed-loop control of the offshore electric surfboard.
