Ship model reverse spiral test method and system based on PID fuzzy control
Through the PID fuzzy control method, the rudder angle control signal is calculated in real time and the reverse spiral test of the ship model is automatically adjusted, which solves the water dependence and manual steering accuracy problems in traditional spiral tests, and achieves efficient and accurate reverse spiral tests.
Patent Information
- Application Number
- CN202510725517.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-22
AI Technical Summary
The traditional spiral test method requires large areas of water and long time, and manual steering is difficult to achieve precise control at small rudder angles, resulting in inefficient testing.
Using a method based on PID fuzzy control, the ship model position and angular velocity are obtained in real time, and the PID parameters are dynamically adjusted by using the fuzzy controller to calculate the rudder angle control signal to realize automated inverse spiral tests.
It improves the test accuracy and efficiency, reduces dependence on large waters, avoids the inaccuracy of manual steering, shortens the test cycle, and enhances the adaptability and stability of the system.
Smart Images

Figure CN120353120A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship maneuverability research and control, and particularly to a ship model inverse spiral test method and system based on PID fuzzy control. Background Art
[0002] In the research of ship maneuverability, the spiral test is a commonly used method to evaluate the performance of a ship through multiple small rudder angle turning motions. However, this method has significant drawbacks: firstly, when performing small rudder angle operations, a large water area is required to accommodate the turning circle of the model ship; secondly, since the process of entering the steady turning state is relatively slow, the entire test process takes a long time, especially for ships with a large open water time (T value), such as supertankers. The spiral test requires a long test time and a large test area, and is often limited by the area of the water tank during free self-propelled model tests and cannot be carried out. Therefore, although the spiral test results can better characterize the maneuverability of a ship, due to the above drawbacks, the traditional spiral test method is greatly limited in practical applications.
[0003] To overcome these challenges, the inverse spiral test has been proposed as an alternative. The inverse spiral test measures a series of preset turning angular velocity values and uses manual steering or autopilot to keep the ship in a steady turn at each angular velocity value, thus shortening the test time and reducing the need for a large water area. The parameters measured in the inverse spiral test are the same as those in the spiral test, and the expression methods of the test results are the same. It's just that for ships without straight-line motion stability, the curves of the inverse spiral test and the spiral test are slightly different.
[0004] Currently, when using a free self-propelled model to conduct a spiral test through manual steering, as the rudder angle gets smaller, the turning circle diameter of the model increases, and the test water tank scale limits the small rudder angle turning test; while in the inverse spiral test, the given initial angular velocity and the rudder angle required to find and maintain this angular velocity to enter a steady turn are obtained through manual steering, and when the angular velocity is small, the corresponding rudder angle is difficult to achieve through manual steering.
[0005] Based on the above challenges, it is particularly important to develop a ship model inverse spiral test method and system based on PID fuzzy control. This method aims to improve the test accuracy, reduce the dependence on large water areas, and effectively solve the limitations brought by traditional manual steering. Summary of the Invention
[0006] To solve the problems existing in the current ship model inverse spiral test process, such as the difficulty of finding the required rudder angle by manual steering when the target angular velocity is small and the low test efficiency, the present invention provides a ship model inverse spiral test method based on PID fuzzy control, which effectively reduces the difficulty of manually finding the rudder angle required for the target angular velocity, reduces the manual parameter adjustment cost, and significantly improves the test efficiency. The present invention also provides a ship model inverse spiral test system based on PID fuzzy control.
[0007] The technical solution of the present invention is as follows:
[0008] A ship model inverse spiral test method based on a PID fuzzy control device, characterized by comprising the following steps:
[0009] Step of calculating angular velocity error and error change rate: The current position coordinates of the ship model are obtained in real time through the GPS installed on the ship model, and the actual rotational angular velocity of the ship model is obtained in real time through the gyroscope installed on the ship model; Based on the current position coordinates of the ship model and using the inverse spiral trajectory equation, the expected rotational angular velocity of the ship model at each moment is calculated; According to the expected rotational angular velocity and the actual rotational angular velocity, the angular velocity error at each moment is calculated, and according to the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS, the error change rate at each moment is calculated;
[0010] Step of calculating updated PID parameters: The angular velocity error and the error change rate are input into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters; Then, according to the adjustment value and the preset initial value of the PID parameters, the updated PID parameters are calculated; The PID parameters include a proportionality coefficient, an integral coefficient, and a differential coefficient;
[0011] Step of calculating rudder angle control signal: Based on the angular velocity error and using the updated proportionality coefficient, the proportional control output is calculated, based on the angular velocity error and using the updated integral coefficient, the integral control output is calculated, and based on the error change rate and using the updated differential coefficient, the differential control output is calculated; According to the proportional control output, the integral control output, and the differential control output, the rudder angle control signal at each moment is calculated;
[0012] Step of adjusting rotational angular velocity: The calculated rudder angle control signal at each moment is sent to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, so as to adjust the rotational angular velocity of the ship model in real time, making the motion trajectory of the ship model approach the inverse spiral to complete the inverse spiral test of the ship model.
[0013] Preferably, in the step of calculating the rudder angle control signal, the external interference data is also measured in real time by an environmental sensor installed on the ship model. According to the measured external interference data and through the feedforward controller in the PID fuzzy control device, the feedforward compensation rudder angle at each moment is calculated, and the rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model;
[0014] Furthermore, in the step of adjusting the rotational angular velocity, the updated rudder angle control signal at each moment is sent to the rudder actuator of the ship model, and the rudder actuator drives the rudder blade to rotate by a corresponding angle according to the updated rudder angle control signal at each moment, so as to change the hydrodynamic moment received by the ship model.
[0015] Preferably, in the step of calculating the angular velocity error and the error change rate, calculating the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation specifically includes:
[0016] Calculate the instantaneous radius according to the current position coordinates of the ship model and the pre-set inverse spiral center coordinates, then calculate the expected angle at each moment according to the instantaneous radius and using the inverse spiral trajectory equation, calculate the expected rotational angular velocity at the current moment according to the current moment and the expected angle at the previous moment of the current moment, and further obtain the expected rotational angular velocity at each moment.
[0017] Preferably, the environmental sensor includes a Doppler current meter and a micro-wave radar; the external interference data includes water flow and wave-making resistance.
[0018] Preferably, in the step of calculating the angular velocity error and the error change rate, the data obtained by the GPS and the gyroscope are also subjected to low-pass filtering processing to reduce noise interference.
[0019] A ship model inverse spiral test system based on PID fuzzy control, characterized by comprising an angular velocity error and error change rate calculation module, an updated PID parameter calculation module, a rudder angle control signal calculation module, and a rotational angular velocity adjustment module that are connected in sequence,
[0020] The angular velocity error and error change rate calculation module obtains the current position coordinates of the ship model in real time through the GPS installed on the ship model, and obtains the actual rotational angular velocity of the ship model in real time through the gyroscope installed on the ship model; calculates the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation; calculates the angular velocity error at each moment according to the expected rotational angular velocity and the actual rotational angular velocity, and calculates the error change rate at each moment according to the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS;
[0021] The updated PID parameter calculation module inputs the angular velocity error and the error change rate into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and by using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters. Then, the updated PID parameters are calculated based on the adjustment value and the preset initial values of the PID parameters. The PID parameters include the proportional coefficient, the integral coefficient, and the differential coefficient.
[0022] The rudder angle control signal calculation module calculates the proportional control output based on the angular velocity error and by using the updated proportional coefficient, calculates the integral control output based on the angular velocity error and by using the updated integral coefficient, and calculates the differential control output based on the error change rate and by using the updated differential coefficient. The rudder angle control signal at each moment is calculated according to the proportional control output, the integral control output, and the differential control output.
[0023] The rotational angular velocity adjustment module sends the calculated rudder angle control signal at each moment to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, so as to adjust the rotational angular velocity of the ship model in real time, make the movement track of the ship model approach the inverse spiral, and complete the inverse spiral test of the ship model.
[0024] Preferably, the PID fuzzy control device further includes a feedforward controller. In the rudder angle control signal calculation module, the external interference data is also measured in real time by an environmental sensor installed on the ship model. The feedforward compensation rudder angle at each moment is calculated according to the measured external interference data and through the feedforward controller. The rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model.
[0025] The rotational angular velocity adjustment module sends the updated rudder angle control signal at each moment to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the updated rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model.
[0026] Preferably, in the angular velocity error and error change rate calculation module, calculating the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and by using the inverse spiral trajectory equation specifically includes:
[0027] Calculating the instantaneous radius according to the current position coordinates of the ship model and the preset inverse spiral center coordinates, then calculating the expected angle at each moment according to the instantaneous radius and by using the inverse spiral trajectory equation, calculating the expected rotational angular velocity at the current moment according to the current moment and the expected angle at the previous moment of the current moment, and further obtaining the expected rotational angular velocity at each moment.
[0028] Preferably, the environmental sensor includes a Doppler current meter and a micro wave radar; the external interference data includes water flow and wave-making resistance.
[0029] Preferably, in the angular velocity error and error change rate calculation module, the data obtained by the GPS and the gyroscope are also subjected to low-pass filtering to reduce noise interference.
[0030] The beneficial effects of the present invention are as follows:
[0031] A method for ship model inverse spiral test based on PID fuzzy control provided by the present invention first obtains the current position coordinates of the ship model in real time through GPS, and obtains the actual rotational angular velocity of the ship model in real time through a gyroscope. Based on the current position coordinates of the ship model and using the inverse spiral trajectory equation, the expected rotational angular velocity of the ship model at each moment is accurately calculated, which helps to reduce error accumulation and thus improve the control accuracy of the entire system. Then, according to the expected rotational angular velocity and the actual rotational angular velocity, a specific calculation method is used to calculate the angular velocity error and the error change rate at each moment, ensuring the effectiveness and accuracy of subsequent control. Then, the angular velocity error and the error change rate are input into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and using the fuzzy logic algorithm, outputs the adjusted value of the PID parameters, and then calculates the updated PID parameters according to the adjusted value and the preset initial value of the PID parameters. By dynamically adjusting the PID parameters of the PID controller through the fuzzy logic algorithm (such as increasing the proportional coefficient when the error is large to accelerate the response), the control performance is effectively improved, such as shortening the adjustment time, reducing the overshoot, and improving the stability, adapting to different working conditions and environmental changes, and avoiding the inaccuracy of manual steering at small rudder angles, enabling the ship model to efficiently complete the test in a limited water tank, effectively solving the problems of the traditional method requiring a large water area due to slow rotation at small rudder angles and the parameter curing problem of traditional PID in the inverse spiral test. Then, based on the angular velocity error and the error change rate, a specific calculation method is used to calculate the integral control output, the derivative control output, and the differential control output respectively, and then the rudder angle control signal at each moment is calculated. By comprehensively considering the control outputs of the three aspects of proportional, integral, and derivative, the accurate calculation of the rudder angle control signal is realized, ensuring that the ship model moves along the expected trajectory. Finally, the calculated rudder angle control signal at each moment is sent to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal to change the hydrodynamic moment received by the ship model, thereby adjusting the rotational angular velocity of the ship model, making the movement trajectory of the ship model approach the inverse spiral, so as to complete the inverse spiral test of the ship model. By accurately controlling the action of the steering gear, the rotational angular velocity of the ship model can be effectively adjusted, making its movement trajectory gradually approach the ideal inverse spiral shape, ensuring that the movement of the ship model during the inverse spiral test meets the design requirements, and improving the reliability and accuracy of the test results.
[0032] The present invention collects the actual turning angular velocity of the ship model in real time through a gyroscope, forms an angular velocity error with the desired turning angular velocity, and dynamically calculates a rudder angle control signal based on the angular velocity error, forming a closed-loop feedback control of measurement - calculation - control, completely getting rid of manual intervention; the fuzzy controller automatically adjusts the PID parameters according to the angular velocity error and the error change rate. For example, when the angular velocity error is large, the proportional coefficient is increased for quick response; when there is a steady-state error, the error is eliminated through the integral coefficient; when the angular velocity changes violently, overshoot is suppressed through the differential coefficient. Through the adaptive parameter adjustment ability, the turning angular velocity of the ship model can quickly converge to the target value without manual repeated trial and error. Through the automation and intelligence characteristics of the PID fuzzy control, the empirical trial-and-error mode of manual steering is transformed into a model-driven + real-time optimization mode, which not only breaks through the accuracy bottleneck of rudder angle control at low angular velocities, but also significantly shortens the test cycle through efficient closed-loop control, fundamentally solving the core defects of the prior art and having significant technological progress and industrial application value.
[0033] Furthermore, the PID fuzzy control device further includes a feedforward controller. In the rudder angle control signal calculation step, the external interference data is also measured in real time by an environmental sensor installed on the ship model, and the feedforward compensation rudder angle at each moment is calculated through the feedforward controller according to the measured external interference data. The rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the final rudder angle control signal, that is, the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model. Furthermore, the updated rudder angle control signal at each moment is used as the basis for calculation in the subsequent turning angular velocity adjustment step. By combining the strong adaptability of the fuzzy PID feedback control and the disturbance prediction ability of the feedforward control, the response speed and stability of the system are significantly improved. By compensating for the interference in advance through the feedforward control, the error accumulation problem caused by delay in traditional feedback control is effectively reduced, and the course-keeping ability and dynamic tracking performance of the ship model in a complex marine environment are enhanced, enabling the ship model to still maintain good maneuverability and navigation safety in the face of sudden disturbances.
[0034] Further, in the calculation steps of the angular velocity error and the error change rate, calculating the expected turning angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation specifically includes: calculating the instantaneous radius according to the current position coordinates of the ship model and the preset inverse spiral center coordinates, then calculating the expected angle at each moment according to the instantaneous radius and using the inverse spiral trajectory equation, calculating the expected turning angular velocity at the current moment according to the current moment and the expected angles of the previous moment of the current moment, and further obtaining the expected turning angular velocity at each moment. By introducing the inverse spiral trajectory planning, the ship model can achieve smooth transition during the turning or path tracking process, avoiding the sudden changes and discontinuity problems existing in the traditional straight line or circular arc paths; at the same time, dynamically calculating the expected angular velocity based on the real-time position improves the accuracy and response performance of the path tracking, enhances the adaptability of the system to complex trajectories; in addition, this calculation method helps to improve the accuracy of the error and its change rate, thereby optimizing the controller output, enabling the ship model to maintain good tracking stability and control robustness in different motion states.
[0035] Further, in the calculation steps of the angular velocity error and the error change rate, the data obtained by the GPS and gyroscope sensors are also subjected to low-pass filtering to reduce noise interference. By filtering the original sensor data, the high-frequency noise and sudden measurement errors are effectively suppressed, improving the stability and reliability of the angle and angular velocity information, thereby ensuring the accuracy of the calculation of the error and its change rate, and avoiding misjudgment and control chattering phenomena caused by sensor noise. Especially in complex water areas or bad weather conditions, the filtering process can significantly enhance the adaptability of the system to external interference, providing a more accurate and stable input signal for the subsequent fuzzy PID control, and further improving the smoothness and tracking performance of the ship model heading control.
[0036] The present invention realizes the high-precision inverse spiral trajectory tracking of the ship model in the restricted water area through multi-sensor fusion, fuzzy logic dynamic parameter adjustment and closed-loop control, overcoming the problems of inaccurate manual steering and long test time under small rudder angles. The PID fuzzy control device combines the accuracy and stability of the PID controller and the flexibility and adaptability of the fuzzy controller to complex nonlinear systems. In many complex industrial processes and control systems, such as chemical process control, robot control, intelligent transportation systems, etc., the dynamic characteristics of the system are often nonlinear, time-varying, and uncertain. The PID fuzzy control can better cope with these complex situations, improve the control performance of the system by dynamically adjusting the PID parameters, such as shortening the adjustment time, reducing the overshoot, and improving the stability, etc. Conducting inverse spiral tests based on the PID fuzzy control device can reduce the difficulty of finding the required rudder angle of the target angular velocity manually, while reducing the manual parameter adjustment cost, improving the test efficiency, and effectively improving the control performance, and being able to adapt to different working conditions and environmental changes.
[0037] The present invention also relates to a ship model inverse spiral test system based on a PID fuzzy control device. This system corresponds to the above-mentioned ship model inverse spiral test method based on a PID fuzzy control device, and can be understood as a system for implementing the above-mentioned ship model inverse spiral test method based on a PID fuzzy control device. It includes an angular velocity error and error change rate calculation module, an updated PID parameter calculation module, a rudder angle control signal calculation module, and a rotary angular velocity adjustment module that are connected in sequence. Each module works in coordination with each other. Through multi-sensor fusion, fuzzy logic dynamic parameter adjustment, and closed-loop control, high-precision inverse spiral trajectory tracking of the ship model in restricted waters is achieved, overcoming the problems of inaccurate manual steering and long test time under small rudder angles, effectively reducing the difficulty of finding the rudder angle required for the target angular velocity manually, while reducing the manual parameter adjustment cost and improving the test efficiency. Brief Description of the Drawings
[0038] Figure 1 It is a flowchart of the ship model inverse spiral test method based on PID fuzzy control of the present invention.
[0039] Figure 2 It is a schematic diagram of the ship model inverse spiral test - angular velocity tracking curve of the present invention.
[0040] Figure 3 It is a schematic diagram of the ship model inverse spiral test - rudder angle change curve of the present invention. Detailed Embodiments
[0041] The present invention will be described below with reference to the accompanying drawings.
[0042] The present invention relates to a ship model inverse spiral test method based on PID fuzzy control. When conducting a small angular velocity inverse spiral test, a target angular velocity is input into the control system. According to the transfer function between the ship model angular velocity and the rudder angle, the proportional coefficient K p , integral coefficient K i , and differential coefficient K d are automatically adjusted through PID fuzzy control to obtain the rudder angle required for the target angular velocity, thereby completing the inverse spiral test. The flowchart of this method is as Figure 1 shown, and successively includes the following steps:
[0043] 1. Angular velocity error and error change rate calculation step: The current position coordinates of the ship model are obtained in real time through a GPS installed on the ship model, and the actual rotary angular velocity of the ship model is obtained in real time through a gyroscope installed on the ship model; based on the current position coordinates of the ship model and using the inverse spiral trajectory equation, the expected rotary angular velocity of the ship model at each moment is calculated; the angular velocity error at each moment is calculated according to the expected rotary angular velocity and the actual rotary angular velocity, and the error change rate at each moment is calculated according to the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS.
[0044] Specifically, first, the current position coordinates (x t , y t ) of the ship model are obtained in real time through the GPS installed on the ship model, and the actual rotational angular velocity γ(t) of the ship model is obtained in real time through the gyroscope installed on the ship model. As feedback signals, the data obtained by the GPS and the gyroscope can also be subjected to low-pass filtering to reduce noise interference; and a fixed point is pre-calibrated as the inverse spiral center in the test pool or simulation environment, and the inverse spiral center coordinates are determined through measurement or drawings; according to the current position coordinates (x t , y t ) of the ship model and the pre-set inverse spiral center coordinates (x c , y c ), the instantaneous radius r t is calculated, and the calculation is carried out according to the following formula:
[0045]
[0046] Then, according to the instantaneous radius and using the inverse spiral trajectory equation r = a / θ, the expected angle θ t at each moment is calculated, and the calculation is carried out according to the following formula:
[0047]
[0048] As Figure 2 shown, then, according to the expected angle at the current moment and the previous moment of the current moment, the expected rotational angular velocity at the current moment is calculated, and thus the expected rotational angular velocity γ desired that the ship should have at each moment is obtained. The expected rotational angular velocity is the target value of PID control, abbreviated as the expected angular velocity, as Figure 2 shown by the dashed line. Figure 2 The solid line shown in is the actual rotational angular velocity, abbreviated as the actual angular velocity. Then, according to the expected rotational angular velocity γ desired and the actual rotational angular velocity γ(t), the angular velocity error e(t) at each moment is calculated, and the calculation is carried out according to the following formula:
[0049] e(t) = γ desired - γ(t)(3)
[0050] Finally, according to the angular velocity error at the current moment and the previous moment of the current moment, and the sampling time interval of the GPS (for example, 0.1 s), the error change rate δe(t) at each moment is calculated.
[0051] II. Steps for calculating updated PID parameters: Input the angular velocity error and the error change rate into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and by using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters; then calculate the updated PID parameters based on the adjustment value and the preset initial value of the PID parameters; the PID parameters include the proportional coefficient, the integral coefficient, and the derivative coefficient.
[0052] Specifically, the PID fuzzy control device is a control device that combines a fuzzy controller and a PID controller. Its basic idea is to dynamically adjust the PID parameters of the PID controller by using the fuzzy logic algorithm, that is, the proportional coefficient K p , the integral coefficient K i and the derivative coefficient K d . The basic principle of the PID controller is as follows:
[0053] 1) Proportional (P) control: The output of the proportional control is proportional to the angular velocity error. In the ship model inverse spiral test, the error refers to the difference between the actual turning angular velocity of the ship model and the desired turning angular velocity (calculated according to the inverse spiral trajectory). The proportional coefficient K p determines the intensity of the control action. When an error occurs, the proportional control will immediately generate a rudder angle correction amount proportional to the error, causing the turning angular velocity of the ship model to change in the direction of reducing the error. For example, if the actual turning angular velocity is less than the desired turning angular velocity, the proportional control will increase the rudder angle to make the ship model rotate faster.
[0054] 2) Integral (I) control: The output of the integral control is proportional to the integral of the angular velocity error. Its main function is to eliminate the steady-state error. During the movement of the ship model, due to various factors (such as the nonlinearity of hydrodynamic forces, model errors, etc.), there may still be a certain turning angular velocity error in the steady state of the ship model. The integral control will accumulate the error. As time goes by, even a very small error, the integral term will continue to increase, thus generating a continuous rudder angle correction amount until the steady-state error is zero. For example, if there is always a small turning angular velocity error in the ship model, the integral control will gradually increase the rudder angle until this error is eliminated.
[0055] 3) Derivative (D) control: The output of the derivative control is proportional to the error change rate. It is mainly used to predict the change trend of the error, so as to carry out control in advance. In the ship model inverse spiral test, when the turning angular velocity of the ship model changes too fast, the derivative control will generate a rudder angle correction amount opposite to the angular velocity change rate to suppress the excessive change of the angular velocity and make the movement of the ship model more stable. For example, when the turning angular velocity of the ship model increases sharply, the derivative control will reduce the rudder angle to prevent the ship model from rotating excessively.
[0056] Therefore, first, the angular velocity error e(t) and the error change rate δe(t) are input into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device in real time according to the angular velocity error and the error change rate and by using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters, that is, δK p 、δK i and δK d . Then, according to the adjustment value and the preset initial values of the PID parameters (i.e., K p0 、K i0 and K d0 ), the updated PID parameters are calculated, that is, the updated proportionality coefficient K pn 、the integral coefficient K in and the differential coefficient K dn are calculated respectively, and the update is performed according to the following formula: K pn =δK p +K p0 , K in =δK i +K i0 , K dn =δK d +K d0 . Among them, K p0 、K i0 and K d0 are the initial parameters of the PID controller, and the initial parameters (the initial values of the PID parameters) are preset according to the dynamic model of the ship model.
[0057] III. Rudder angle control signal calculation steps: Based on the angular velocity error, the proportional control output is calculated by using the updated proportionality coefficient, the integral control output is calculated by using the updated integral coefficient based on the angular velocity error, and the derivative control output is calculated by using the updated differential coefficient based on the error change rate; the rudder angle control signal at each moment is calculated according to the proportional control output, the integral control output, and the derivative control output.
[0058] Specifically, this step can also be understood as the PID control calculation step. First is the proportional term calculation: Through the PID controller in the PID fuzzy control device, the proportional control output is calculated based on the angular velocity error e(t) and by using the updated proportionality coefficient, and the calculation is performed according to the following formula:
[0059] u p (t)=K pn ·e(t)(4)
[0060] Next is the integral term calculation: The integral control output is calculated based on the angular velocity error e(t) and by using the updated integral coefficient, and the calculation is performed according to the following formula:
[0061]
[0062] Among them, an integral limit is usually set for the integral term to prevent integral saturation.
[0063] Then there is the calculation of the derivative term: Based on the rate of change of the error and using the updated derivative coefficient, the derivative control output is calculated, and the calculation is carried out according to the following formula:
[0064]
[0065] In practical applications, the derivative term usually uses the first-order difference for approximate calculation to avoid the amplification of noise.
[0066] Finally, the proportional control output, the integral control output, and the derivative control output are added together to calculate the rudder angle control signal at each moment. The change of the rudder angle with time is as Figure 3 shown, and the calculation is carried out according to the following formula:
[0067] u(t) = u p (t) + u i (t) + u d (t) (7)
[0068] During the ship model inverse spiral test, the PID controller is used to calculate the rudder angle δ according to the angular velocity error, so that the angular velocity of the ship model is stabilized at the target angular velocity γ0. In addition, the self-tuning process of the PID controller can be optimized according to the spiral test data to improve the accuracy of the inverse spiral test.
[0069] Furthermore, in the calculation steps of the rudder angle control signal, the external interference data (such as water flow, wave-making resistance, etc.) are also measured in real time by the environmental sensors (such as Doppler current meters, micro-wave radars, etc.) installed on the ship model. According to the measured external interference data, the feedforward compensation rudder angle at each moment is calculated by the feedforward controller in the PID fuzzy control device, and the rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model.
[0070] IV. Steps for adjusting the angular velocity of rotation: The motion state of the ship model is mainly described by its position, velocity, and angular velocity of rotation. The angular velocity of rotation is the speed at which the ship model rotates around the vertical axis, and it is closely related to the rudder angle. By controlling the rudder angle, the hydrodynamic moment acting on the ship model can be changed, thereby adjusting the angular velocity of rotation. Therefore, the calculated rudder angle control signal at each moment is sent to the rudder actuator of the ship model. The rudder actuator drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment acting on the ship model, thereby adjusting the angular velocity of rotation of the ship model in real time, making the motion trajectory of the ship model approach an inverse spiral. This process is continuously cycled during the test. According to the real-time feedback of the angular velocity of rotation of the ship model, the rudder angle is continuously adjusted until the test ends, and the inverse spiral test of the ship model is completed.
[0071] The present invention also relates to a ship model inverse spiral test system based on PID fuzzy control. This ship model inverse spiral test system based on PID fuzzy control corresponds to the above-mentioned ship model inverse spiral test method based on PID fuzzy control, and can also be understood as a system for implementing the above-mentioned ship model inverse spiral test method based on PID fuzzy control. The system includes an angular velocity error and error change rate calculation module, an updated PID parameter calculation module, a rudder angle control signal calculation module, and an angular velocity of rotation adjustment module that are connected in sequence. Specifically,
[0072] The angular velocity error and error change rate calculation module obtains the current position coordinates of the ship model in real time through the GPS installed on the ship model, and obtains the actual angular velocity of rotation of the ship model in real time through the gyroscope installed on the ship model. Based on the current position coordinates of the ship model, the expected angular velocity of rotation of the ship model at each moment is calculated using the inverse spiral trajectory equation. The angular velocity error at each moment is calculated based on the expected angular velocity of rotation and the actual angular velocity of rotation, and the error change rate at each moment is calculated based on the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS.
[0073] The updated PID parameter calculation module inputs the angular velocity error and error change rate into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and error change rate and using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters. Then, the updated PID parameters are calculated based on the adjustment value and the preset initial value of the PID parameters. The PID parameters include a proportionality coefficient, an integral coefficient, and a derivative coefficient.
[0074] The rudder angle control signal calculation module calculates the proportional control output based on the angular velocity error and using the updated proportional coefficient, calculates the integral control output based on the angular velocity error and using the updated integral coefficient, and calculates the derivative control output based on the error change rate and using the updated derivative coefficient; calculates the rudder angle control signal at each moment according to the proportional control output, the integral control output, and the derivative control output;
[0075] The rotational angular velocity adjustment module sends the calculated rudder angle control signal at each moment to the rudder actuator of the ship model, and the rudder actuator drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, so as to adjust the rotational angular velocity of the ship model in real time, making the motion trajectory of the ship model approach an inverse spiral to complete the inverse spiral test of the ship model.
[0076] Preferably, the PID fuzzy control device further includes a feedforward controller. In the rudder angle control signal calculation module, the external interference data is also measured in real time by an environmental sensor installed on the ship model, and the feedforward compensation rudder angle at each moment is calculated according to the measured external interference data and through the feedforward controller. The rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the final rudder angle control signal, that is, the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the motion of the ship model; the rotational angular velocity adjustment module sends the updated rudder angle control signal at each moment to the rudder actuator of the ship model, and the rudder actuator drives the rudder blade to rotate by a corresponding angle according to the updated rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, so as to adjust the rotational angular velocity of the ship model in real time, making the motion trajectory of the ship model approach an inverse spiral to complete the inverse spiral test of the ship model.
[0077] Preferably, in the angular velocity error and error change rate calculation module, calculating the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation specifically includes:
[0078] Calculating the instantaneous radius according to the current position coordinates of the ship model and the preset inverse spiral center coordinates, then calculating the expected angle at each moment according to the instantaneous radius and using the inverse spiral trajectory equation, calculating the expected rotational angular velocity at the current moment according to the current moment and the expected angle at the previous moment of the current moment, and further obtaining the expected rotational angular velocity at each moment.
[0079] Preferably, the environmental sensor includes a Doppler current meter and a micro wave radar; the external interference data includes water flow and wave-making resistance.
[0080] Preferably, in the angular velocity error and error change rate calculation module, the data obtained by the GPS and the gyroscope are also subjected to low-pass filtering processing to reduce noise interference.
[0081] The present invention provides an objective and scientific method and system for ship model reverse spiral test based on PID fuzzy control. Through multi-sensor fusion, fuzzy logic dynamic parameter adjustment and closed-loop control, high-precision reverse spiral trajectory tracking of the ship model in restricted waters is achieved, overcoming the problems of inaccurate manual steering and long test time under small rudder angles, effectively reducing the difficulty of finding the rudder angle required for the target angular velocity manually, reducing the manual parameter adjustment cost at the same time, and improving the test efficiency.
[0082] It should be noted that the above specific embodiments can enable those skilled in the art to understand the present invention more comprehensively, but do not limit the present invention in any way. Therefore, although this specification has described the present invention in detail with reference to the drawings and embodiments, those skilled in the art should understand that the present invention can still be modified or equivalently replaced. In short, all technical solutions and their improvements that do not depart from the spirit and scope of the present invention should be covered by the protection scope of the patent of the present invention.
Claims
1. A method for ship model inverse spiral test based on a PID fuzzy control device, characterized in that, It includes the following steps: Steps for calculating angular velocity error and error change rate: Obtain the current position coordinates of the ship model in real time through the GPS installed on the ship model, and obtain the actual rotational angular velocity of the ship model in real time through the gyroscope installed on the ship model; Calculate the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation; Calculate the angular velocity error at each moment according to the expected rotational angular velocity and the actual rotational angular velocity, and calculate the error change rate at each moment according to the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS; Steps for calculating updated PID parameters: Input the angular velocity error and the error change rate into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters; Then calculate the updated PID parameters according to the adjustment value and the preset initial value of the PID parameters; The PID parameters include a proportionality coefficient, an integral coefficient, and a differential coefficient; Steps for calculating rudder angle control signal: Calculate the proportional control output based on the angular velocity error and using the updated proportionality coefficient, calculate the integral control output based on the angular velocity error and using the updated integral coefficient, and calculate the differential control output based on the error change rate and using the updated differential coefficient; Calculate the rudder angle control signal at each moment according to the proportional control output, the integral control output, and the differential control output; Steps for adjusting rotational angular velocity: Send the calculated rudder angle control signal at each moment to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, so as to adjust the rotational angular velocity of the ship model in real time, making the movement trajectory of the ship model approach the inverse spiral to complete the inverse spiral test of the ship model.
2. The method for the reverse spiral test of the ship model based on the PID fuzzy controller according to claim 1, wherein In the steps for calculating the rudder angle control signal, the external interference data is also measured in real time through the environmental sensor installed on the ship model. According to the measured external interference data, the feedforward compensation rudder angle at each moment is calculated through the feedforward controller in the PID fuzzy control device, and the rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model; Furthermore, the steps for adjusting the rotational angular velocity are to send the updated rudder angle control signal at each moment to the steering gear of the ship model, and the steering gear drives the rudder blade to rotate by a corresponding angle according to the updated rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model.
3. The method for the inverse spiral test of a ship model based on a PID fuzzy controller according to claim 1 or 2, characterized in that, In the steps for calculating the angular velocity error and the error change rate, calculating the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation specifically includes: Calculate the instantaneous radius based on the current position coordinates of the ship model and the pre-set inverse spiral center coordinates, and then calculate the expected angle at each moment using the inverse spiral trajectory equation. Calculate the expected angular velocity of rotation at the current moment based on the current moment and the expected angles at the previous moment of the current moment, thereby obtaining the expected angular velocity of rotation at each moment.
4. The method for the reverse spiral test of a ship model based on a PID fuzzy controller according to claim 2, wherein, The environmental sensor includes a Doppler current meter and a micro wave radar; the external interference data includes water flow and wave-making resistance.
5. The method for the inverse spiral test of a ship model based on a PID fuzzy controller according to claim 1, wherein In the step of calculating the angular velocity error and the error change rate, the data obtained by the GPS and the gyroscope are also subjected to low-pass filtering processing to reduce noise interference.
6. A ship model inverse spiral test system based on PID fuzzy control, characterized in that, It includes an angular velocity error and error change rate calculation module, an updated PID parameter calculation module, a rudder angle control signal calculation module, and a rotational angular velocity adjustment module connected in sequence. The angular velocity error and error change rate calculation module obtains the current position coordinates of the ship model in real time through the GPS installed on the ship model, and obtains the actual rotational angular velocity of the ship model in real time through the gyroscope installed on the ship model; calculates the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation; calculates the angular velocity error at each moment based on the expected rotational angular velocity and the actual rotational angular velocity, and calculates the error change rate at each moment based on the angular velocity error at the current moment and the previous moment of the current moment, as well as the sampling time interval of the GPS. The updated PID parameter calculation module inputs the angular velocity error and the error change rate into the fuzzy controller in the PID fuzzy control device. The fuzzy controller dynamically adjusts the PID parameters of the PID controller in the PID fuzzy control device according to the angular velocity error and the error change rate and using the fuzzy logic algorithm, and outputs the adjustment value of the PID parameters; then calculates the updated PID parameters based on the adjustment value and the preset initial value of the PID parameters; the PID parameters include a proportionality coefficient, an integral coefficient, and a differential coefficient. The rudder angle control signal calculation module calculates the proportional control output based on the angular velocity error and using the updated proportionality coefficient, calculates the integral control output based on the angular velocity error and using the updated integral coefficient, and calculates the derivative control output based on the error change rate and using the updated differential coefficient; calculates the rudder angle control signal at each moment according to the proportional control output, the integral control output, and the derivative control output. The rotational angular velocity adjustment module sends the calculated rudder angle control signal at each moment to the steering gear of the ship model. The steering gear drives the rudder blade to rotate by a corresponding angle according to the rudder angle control signal at each moment to change the hydrodynamic moment received by the ship model, thereby adjusting the rotational angular velocity of the ship model in real time, making the motion trajectory of the ship model approach the inverse spiral, so as to complete the inverse spiral test of the ship model.
7. The ship model inverse spiral test system based on a PID fuzzy controller according to claim 6, characterized in that, The PID fuzzy control device further includes a feedforward controller. In the rudder angle control signal calculation module, the external interference data is also measured in real time by an environmental sensor installed on the ship model. According to the measured external interference data and through the feedforward controller, the feedforward compensation rudder angle at each moment is calculated. The rudder angle control signal at each moment is added to the feedforward compensation rudder angle to obtain the updated rudder angle control signal at each moment, so as to reduce the influence of external interference on the movement of the ship model; The rotational angular velocity adjustment module sends the updated rudder angle control signal at each moment to the rudder actuator of the ship model, and the rudder actuator drives the rudder blade to rotate by a corresponding angle according to the updated rudder angle control signal at each moment, so as to change the hydrodynamic moment received by the ship model.
8. The ship model inverse spiral test system based on a PID fuzzy controller according to claim 6 or 7, characterized in that, In the angular velocity error and error change rate calculation module, calculating the expected rotational angular velocity of the ship model at each moment based on the current position coordinates of the ship model and using the inverse spiral trajectory equation specifically includes: Calculating the instantaneous radius according to the current position coordinates of the ship model and the preset inverse spiral center coordinates, then calculating the expected angle at each moment according to the instantaneous radius and using the inverse spiral trajectory equation, and calculating the expected rotational angular velocity at the current moment according to the current moment and the expected angle at the previous moment of the current moment, so as to obtain the expected rotational angular velocity at each moment.
9. The ship model inverse spiral test system based on a PID fuzzy controller according to claim 7, characterized in that, The environmental sensor includes a Doppler current meter and a micro wave radar; the external interference data includes water flow and wave-making resistance.
10. The ship model inverse spiral test system based on a PID fuzzy controller according to claim 6, characterized in that, In the angular velocity error and error change rate calculation module, the data obtained by the GPS and the gyroscope are also subjected to low-pass filtering processing to reduce noise interference.
