A Method for Optimizing Terminal Sliding Mode Controller Parameters Based on a Multi-Strategy Improved Crayfish Algorithm
Abstract
:1. Introduction
2. The Mathematical Model of Ship Motion
2.1. Build a Mathematical Model of the Ship’s Motion
2.2. The “Xin Hong Zhuan” Vessel of Dalian Maritime University
3. Sliding Mode Control Theory and Terminal Sliding Mode Controller Design
3.1. Sliding Mode Control
3.2. Terminal Sliding Mode Control
3.3. Terminal Sliding Mode Controller Design
4. Crayfish Optimization Algorithm
Algorithmic Principle
5. Improvement Scheme for the Crayfish Algorithm
5.1. Introduction to Strategy
5.1.1. Principles of the Subtraction Averaging Algorithm
- Initialization: Define a set of initial parameter values based on preliminary estimates or experience.
- Difference Calculation: In each iteration, calculate the difference between the current parameter values and the target values. These target values are usually theoretically optimal values or reference values set by external standards.
- Adjustment: Based on the calculated difference, subtract a proportional amount of the difference from the current parameter values. This proportion is typically a pre-set factor used to control the adjustment magnitude. The subtraction operation moves the parameter values towards the target values.
- Averaging: Perform averaging on the adjusted values to reduce the sharp fluctuations that may result from single adjustments. By averaging multiple adjusted values, the adjustment process becomes smoother and reduces instability caused by excessive single adjustments.
- Iteration: Repeat the above steps—difference calculation, adjustment, and averaging—until the parameter values converge to the desired precision level or meet stopping criteria. Stopping criteria may include reaching the maximum number of iterations or the change magnitude falling below a certain threshold.
5.1.2. Levy Flight
5.1.3. Sparrow Search Algorithm
- Abstracted Biological Characteristics:
- Producers: High-energy magpies that provide information about foraging areas and evaluate food sources based on individual health values.
- Alarm Signals: When magpies detect predators, they start calling out as an alarm signal. If the alarm level exceeds a safety threshold, producers guide all joiners to a safe area.
- Role Transition: Any magpie searching for better food sources can become a producer, but the ratio of producers to joiners remains constant within the population.
- Energy Levels: High-energy magpies act as producers, while hungry joiners may fly to other areas in search of more energy.
- Foraging Behavior: Joiners follow producers to find food, and some joiners may monitor producers to compete for food and improve their own foraging efficiency.
- Safety Behavior: Magpies on the edge of the flock move quickly to a safe area upon detecting danger, while those in the center move randomly to stay close to other magpies.
- Algorithm Steps:
- Initialization: Randomly generate a group of magpie individuals, each representing a potential solution, and initialize the positions of scouting and foraging magpies.
- Scouting Magpies Search: Scouting magpies perform random walks in the search space to discover new food sources (candidate optimal solutions).
- Foraging Magpies Search: Foraging magpies perform local searches around the food sources discovered by scouting magpies to find better solutions.
- Position Update: Update the positions of magpie individuals based on the search results of scouting and foraging magpies and update the global best solution.
- Iteration: Repeat the scouting and foraging processes until stopping conditions are met (such as reaching the maximum number of iterations or achieving the desired optimization precision).
5.2. Algorithm Improvement
5.2.1. Subtraction Averaging Algorithm
5.2.2. Levy Flight Strategy
- Levy Flight Factor Selection:Here, represents a perturbation factor vector based on the Levy distribution, and is a vector of ones with dimension dim.
- Handling Small Food SizesWhen the food size is too small, the crayfish moves directly towards the food and consumes it. The original algorithm’s Formula 5 is updated as follows:
- Handling Large Food Sizes : when the food size is too large, the crayfish feeding Formula 6 is updated as follows:
5.2.3. Sparrow Search Position Update Strategy
- Judgment Formula:rand < STFirst, generate a random number ‘rand’. If this random number is less than the threshold ST, then apply the Sparrow Search Position Update Strategy.
- Update Formula:
5.3. Algorithm Flow
- Initialize the algorithm parameters: set the number of iterations T, the number of populations, the number of variables dim, and the upper and lower boundaries L and H. Initialize the population position X, calculate the initial fitness value, and determine the initial global optimal solution and the best fitness.
- Enter the main loop: the number of iterations starts from 1 until T is reached.
- Update temperature and learning factor: in each iteration, randomly generate the temperature temp and update the learning factor C according to the current iteration number.
- Calculate food location: calculate food location based on the current optimal solution.
- Population position update:If temperature temp > 30, enter the heat avoidance phase:randomly choose a probability of 0.5 to update the location.If not entering the heat avoidance phase, choose with probability 0.5 to enter the competitive phase or the improved subtractive averaging algorithm strategy.If temperature temp ≤ 30, enter the foraging phase:introduce a Levy Flight strategy to perturb the current position, selecting with probability 0.5 to use.Calculate p-value and adjust population position by determining food size based on p-value.
- Introduction of sparrow search strategy: introduce the position update strategy of sparrow search for some individuals to enhance the global exploration ability.
- Boundary processing: ensure that the updated population position is within the upper and lower boundaries.
- Fitness value update: calculate the fitness value of the updated population and update the global optimal solution and the current optimal solution.
- Record the current optimal solution and fitness value: record the global optimal solution and fitness value of the current iteration.
- Check the termination condition: if the iteration number reaches the maximum, output the optimal solution, otherwise continue iteration.
6. Algorithm Performance Testing
6.1. Algorithm Performance Testing Numerical Experiments
6.1.1. Algorithm Parameterization and Evaluation Metrics
6.1.2. Comparative Analysis with Other Intelligent Algorithms
7. Parameter Optimization of Terminal Sliding Film Controller Based on JLSCOA
7.1. Fitness Function
7.2. Simulation Experiment and Result Analysis
7.2.1. Simulation Experiment Parameters
7.2.2. Simulation Experiment Results
8. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Shengyan, H.; Zhongqing, C.; Shengwei, Y. PID Parameter Optimization Based on Flower Pollination Algorithm. Comput. Eng. Appl. 2016, 52, 59–62. Available online: http://cea.ceaj.org/EN/Y2016/V52/I17/59 (accessed on 7 September 2022).
- Lianqiang, Z.; Dongfeng, W. PID Parameter Optimization Based on Improved Crowd Search Algorithm. Comput. Eng. Des. 2016, 37, 3389–3393. [Google Scholar]
- Zifa, L.; Wei, Z.; Zeli, W. Optimization Layout of Urban Electric Vehicle Charging Stations Based on Quantum Particle Swarm Optimization Algorithm. Trans. China Electrotech. Soc. 2012, 32, 39–45. [Google Scholar]
- Tang, Y.Q.; Li, C.H.; Song, Y.F.; Chen, C.; Cao, B. Adaptive mutation sparrow search optimization algorithm. J. Beijing Univ. Aeronaut. Astronaut. 2023, 49, 681–692. [Google Scholar] [CrossRef]
- Hua, F.; Hao, L. Improved Sparrow Search Algorithm with Multi-Strategy Fusion and Its Application. Control. Decis. 2022, 37, 87–96. [Google Scholar] [CrossRef]
- Mao, Q.; Zhang, Q. Improved Sparrow Search Algorithm with Cauchy Mutation and Reverse Learning. Comput. Sci. Explor. 2021, 15, 1155–1164. [Google Scholar] [CrossRef]
- Xiao, Z.; Liu, S. Elite Reverse Golden Sine Whale Optimization Algorithm and Its Engineering Optimization Study. Acta Electron. Sin. 2019, 47, 2177–2186. [Google Scholar] [CrossRef]
- Wei, Z.; He, Z.; Wu, X.; Zhang, Q. Power Positioning System Control Study of “Intelligent Research and Internship Vessel” Based on Terminal Sliding Mode. Appl. Sci. 2024, 14, 808. [Google Scholar] [CrossRef]
- Balchen, J.G.; Jenssen, N.A.; Sælid, S. Dynamic positioning using Kalman filtering and optimal control//IFAC/IFIP. In Proceedings of the Symposium on Automation in Offshore Oil Field Operation, Bergen, Norway, 14–17 June 1976; pp. 183–186. [Google Scholar]
- Lin, J. Research on Ship Power Positioning Control and Thrust Distribution. Master’s Thesis, Dalian Maritime University, Dalian China, 2021. [Google Scholar]
- Jia, H.; Rao, H.; Wen, C.; Mirjalili, S. Crayfish optimization algorithm. Artif. Intell. Rev. 2023, 56, 1919–1979. [Google Scholar] [CrossRef]
- Dehghani, M.; Montazeri, Z.; Trojovská, E.; Trojovský, P. Coati Optimization Algorithm A new bio-inspired metaheuristic algorithm for solving optimization problems. Knowl. Based Syst. 2023, 259, 110011. [Google Scholar] [CrossRef]
- Seyedali, M.; Andrew, L. The Whale Optimization Algorithm. Adv. Eng. Softw. 2016, 95, 51–67. [Google Scholar]
- Guang-chi, X.; Da-Wei, Z.; Kai-Wei, Z.; Jing-hua, G. Multi-agent chaos particle swarm optimization algorithm of thrust allocation for dynamic positioning vessels. In Proceedings of the 2015 34th Chinese Control Conference (CCC 2015), Hangzhou, China, 27–30 July 2015; pp. 2389–2396. [Google Scholar]
Parameter | Numeric Value |
---|---|
Ship length L/m | 69.213 m |
Ship width B/m | 10.90 m |
Draft dm/m | 3.5 m |
Weight load m/kg | 1500 t |
Displacement ▽ | 1450 t |
Design speed Vd | 18.0 kn |
Function Name | Displayed Formula | Search Scope | Theoretical Optimum | Typology |
---|---|---|---|---|
Sphere | [−100,100] | 0 | single-peak | |
Schwefel 2.22 | [−10,10] | 0 | single-peak | |
Schwefel 1.2 | [−100,100] | 0 | single-peak | |
Schwefel 2.21 | [−100,100] | 0 | single-peak | |
Rosenbrock | [−30,30] | 0 | single-peak | |
Step | [−100,100] | 0 | single-peak | |
Quartic | [1.28,1.28] | 0 | multi-peak | |
Schwefel 2.26 | [−500,500] | multi-peak | ||
Rastrigin | [−5.12,5.12] | 0 | multi-peak | |
Ackley | [−32,32] | 0 | multi-peak | |
Griewank | [−600,600] | 0 | multi-peak | |
Penalized 1 | [−50,50] | 0 | multi-peak |
Parameter | Number of Populations N | Search for Spatial Dimensions D | Maximum Number of Iterations T |
---|---|---|---|
Valid values | 30 | 30 | 500 |
Performance Metrics | Algorithm | f1(x) | f2(x) | f3(x) | f4(x) | f5(x) | f6(x) |
---|---|---|---|---|---|---|---|
Optimum | COA | 0 | 0 | 0 | 0 | 5.25605 × 10−09 | 0.10871 |
WOA | 8.50257 × 10−87 | 7.47364 × 10−59 | 6761.220766 | 1.642895293 | 27.1083091 | 0.141216573 | |
SSA | 0 | 0 | 4.2629 × 10−237 | 4.3666 × 10−148 | 6.68587 × 10−09 | 8.93154 × 10−10 | |
JLSCOA | 0 | 0 | 0 | 0 | 2.2812 × 10−09 | 0.0094413 | |
Worst | COA | 0 | 0 | 0 | 0 | 6.09458 × 10−09 | 1.7939 |
WOA | 2.23548 × 10−72 | 6.67916 × 10−49 | 75797.29137 | 89.18939869 | 28.7686977 | 0.948474117 | |
SSA | 5.92226 × 10−22 | 4.53043 × 10−11 | 5.21338 × 10−17 | 8.41712 × 10−19 | 0.000149284 | 1.01405 × 10−06 | |
JLSCOA | 0 | 0 | 0 | 0 | 0.000863092 | 1.4276 | |
average value | COA | 0 | 0 | 0 | 0 | 5.7863 × 10−09 | 0.84324 |
WOA | 1.29475 × 10−73 | 3.42109 × 10−50 | 45402.5462 | 50.80711054 | 28.02334327 | 0.383599175 | |
SSA | 3.00327 × 10−23 | 2.60023 × 10−12 | 2.70494 × 10−18 | 4.24065 × 10−20 | 1.84811 × 10−05 | 1.69285 × 10−07 | |
JLSCOA | 0 | 0 | 0 | 0 | 7.42772 × 10−05 | 0.51545 | |
standard deviation | COA | 0 | 0 | 0 | 0 | 0.215647 | 0.38492 |
WOA | 4.99888 × 10−73 | 1.49193× 10−49 | 15559.61654 | 29.66776591 | 0.44926532 | 0.217242445 | |
SSA | 1.3234 × 10−22 | 1.00854 × 10−11 | 1.16385 × 10−17 | 1.88139 × 10−19 | 4.1603 × 10−05 | 2.31107 × 10−07 | |
JLSCOA | 0 | 0 | 0 | 0 | 0.000192936 | 0.32162 |
Performance Metrics | Algorithm | f7(x) | f8(x) | f9(x) | f10(x) | f11(x) | f12(x) |
---|---|---|---|---|---|---|---|
Optimum | COA | 5.3372 × 10−06 | 0 | 8.88178 × 10−16 | 0 | 0.017523 | 1.3716 |
WOA | 0.000141843 | 0 | 8.88178 × 10−16 | 0 | 0.006018538 | 0.138338868 | |
SSA | 0.000148498 | 0 | 8.88178 × 10−16 | 0 | 3.52005 × 10−13 | 8.91756 × 10−10 | |
JLSCOA | 1.0804 × 10−06 | 0 | 8.88178 × 10−16 | 0 | 0.00029373 | 0.30306 | |
Worst | COA | 0.00026533 | 0 | 8.88178 × 10−16 | 0 | 0.070164 | 2.7724 |
WOA | 0.014814868 | 1.13687 × 10−13 | 7.99361 × 10−15 | 0.10806285 | 5.024915638 | 1.059936774 | |
SSA | 0.001858923 | 3.97904 × 10−13 | 2.22045 × 10−14 | 0 | 6.28509 × 10−08 | 4.30752 × 10−06 | |
JLSCOA | 0.00031593 | 0 | 8.88178 × 10−16 | 0 | 0.041731 | 2.9686 | |
average value | COA | 7.1152 × 10−05 | 0 | 8.88178 × 10−16 | 0 | 0.03922 | 2.2403 |
WOA | 0.00264973 | 5.68434 × 10−15 | 3.90799 × 10−15 | 0.005403142 | 0.271157034 | 0.550541975 | |
SSA | 0.000673495 | 1.98952 × 10−14 | 2.13163 × 10−15 | 0 | 1.13735 × 10−08 | 4.26727 × 10−07 | |
JLSCOA | 7.188 × 10−05 | 0 | 8.88178 × 10−16 | 0 | 0.013921 | 1.2916 | |
standard deviation | COA | 5.9868 × 10−05 | 0 | 0 | 0 | 0.016068 | 0.31585 |
WOA | 0.003484452 | 2.54211 × 10−14 | 2.08595 × 10−15 | 0.024163588 | 1.11896887 | 0.289743143 | |
SSA | 0.000547679 | 8.8974 × 10−14 | 4.79079 × 10−15 | 0 | 1.77165 × 10−08 | 9.75527 × 10−07 | |
JLSCOA | 7.3469 × 10−05 | 0 | 0 | 0 | 0.010383 | 0.8121 |
Algorithm | λ | δ | Fitness Value |
---|---|---|---|
COA | 97.38 | 139.39 | 71.99 |
JLSCOA | 165.42 | 499.75 | 69.73 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wei, Z.; He, Z.; Yang, F.; Sun, B. A Method for Optimizing Terminal Sliding Mode Controller Parameters Based on a Multi-Strategy Improved Crayfish Algorithm. Appl. Sci. 2024, 14, 8085. https://doi.org/10.3390/app14178085
Wei Z, He Z, Yang F, Sun B. A Method for Optimizing Terminal Sliding Mode Controller Parameters Based on a Multi-Strategy Improved Crayfish Algorithm. Applied Sciences. 2024; 14(17):8085. https://doi.org/10.3390/app14178085
Chicago/Turabian StyleWei, Zhenghao, Zhibin He, Fumiao Yang, and Bin Sun. 2024. "A Method for Optimizing Terminal Sliding Mode Controller Parameters Based on a Multi-Strategy Improved Crayfish Algorithm" Applied Sciences 14, no. 17: 8085. https://doi.org/10.3390/app14178085