Ship propulsion motor rotating speed control method based on long short-term memory network
Through the LSTM-based ship propulsion motor speed control method, the model is trained using historical data and the speed is adjusted in real time, the problem of adaptive adjustment in traditional methods is solved, and the control accuracy and stability are improved.
Patent Information
- Application Number
- CN202510527214.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-11
AI Technical Summary
The traditional method of speed control of ship propulsion motors mainly relies on PID controllers, and cannot adaptively adjust based on real-time data, making it difficult to achieve global optimal control.
The speed control method of ship propulsion motor based on long and short-term memory network (LSTM) is adopted. By collecting historical data for preprocessing and training of LSTM models, the propulsion motor operation parameters are collected in real time, and the LSTM model is used to generate optimal control instructions to adjust the speed.
It improves the accuracy, stability and adaptability of the speed control of ship propulsion motors, and realizes adaptive adjustment based on real-time data.
Smart Images

Figure CN120288224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship propulsion control, and specifically to a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network. Background Technique
[0002] Some ships are equipped with two power engines, a steam turbine and a propulsion motor. The steam turbine is the main power, and the propulsion motor is the auxiliary power. When switching from the main power to the auxiliary power, it is necessary to increase the rotational speed of the propulsion motor to be close to that of the main power before the switch can start.
[0003] Traditional methods for controlling the rotational speed of ship propulsion motors mainly rely on PID controllers, which cannot perform adaptive adjustment based on real-time data and are difficult to achieve global optimal control. Therefore, a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network is proposed to solve the above problems. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] Aiming at the deficiencies of the prior art, the present invention provides a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network, which has the advantages of self-adaptive adjustment of the rotational speed of the propulsion motor, etc., and solves the problem that traditional methods for controlling the rotational speed of ship propulsion motors mainly rely on PID controllers and cannot perform adaptive adjustment based on real-time data.
[0006] (2) Technical Solutions
[0007] To achieve the above purpose of self-adaptive adjustment of the rotational speed of the propulsion motor, the present invention provides the following technical solutions: A method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network, including the following steps:
[0008] S1. Collect historical data during the operation of the ship for a period of time, perform preprocessing on the historical data and persist it in the database;
[0009] S2. Read the historical data in the database and train the long short-term memory network LSTM model;
[0010] S3. Use sensors to collect the operating parameters of the propulsion motor in real time and convert the operating parameters into the input parameter format of the LSTM model;
[0011] S4. Input the converted operating parameters of the propulsion motor into the trained LSTM model to obtain the predicted target rotational speed Goal of the propulsion motor rpm ;
[0012] S5. According to the target rotational speed Goal output by the LSTM model rpm, adjust the operating parameters of the propulsion motor so that its speed gradually approaches the steam turbine speed.
[0013] Preferably, the preprocessing of the historical data in step S1 further includes the following sub-steps:
[0014] S1.1. Traverse all the historical data. Each piece of historical data includes the current value I_O of the propulsion motor, the frequency H z _O, the steam turbine speed GT rpm _O and the propulsion motor speed EM rpm _O. Respectively, count the minimum value, maximum value and average value of the current value I_O, the frequency H z _O, the steam turbine speed GT rpm _O and the propulsion motor speed EM rpm _O in the historical data;
[0015] S1.2. Process the missing values and outliers for each piece of historical data traversed;
[0016] S1.3. Perform min-max normalization processing on the value distribution of the current value I_O, the frequency H z _O, the steam turbine speed GT rpm _O and the propulsion motor speed EM rpm _O data points in the historical data respectively:
[0017]
[0018] where χ' is the value of the data point after normalization, χ is the original value of the data point, χ min and χ max are the minimum value and maximum value of the data point respectively.
[0019] Preferably, step S2 further includes the following sub-steps:
[0020] S2.1. Connect to the database, execute the SQL query statement, and obtain the data set D,
[0021] D = {[I_O1, H z _O1, GT rpm _O1, EM rpm _O1],
[0022] [I_O2, H z _O2, GT rpm _O2, EM rpm _O2], ···,};
[0023] S2.2. Convert the data set D into a time series data set D LSTM ;
[0024] S2.3. Divide the time series dataset D LSTM into a training set D train and a validation set D val ;
[0025] S2.4. Construct an LSTM model;
[0026] S2.5. Define the rotational speed difference loss L diff , the rotational speed change rate loss L change and the total loss function L total , to measure the gap between the predicted value and the true value of the model;
[0027] S2.6. Use the training set D train to train the LSTM model and obtain the total loss function L train of the training set D total ;
[0028] S2.7. Use the validation set D val to evaluate the performance of the LSTM model, perform hyperparameter tuning, and optimize the performance of the LSTM model.
[0029] Preferably, the step S2.2 further includes the following sub-steps:
[0030] S2.2.1. Define the time window length T, which represents the number of time steps input into the LSTM model each time;
[0031] S2.2.2. Construct the input sequence X input and the target Y target :
[0032] Input sequence X input : For each time point t, select the data of the first T time points as the input
[0033] X input ={[I_O t-T+1 ,H z _O t-T+1 ,GT rpm _O t-T+1 ,EM rpm _O t-T+1 ,···,
[0034] [I_O t ,H z _O t ,GT rpm _O t ,EM rpm _O t}
[0035] Target Y target: Select the rotational speed EM of the propulsion motor at the current time point t rpm _O t as the target value:
[0036] Y target = EM rpm _O t ;
[0037] S2.2.3. Generate the time series dataset D LSTM :
[0038] D LSTM = {(X input (T), Y target (T)),
[0039] (X input (T + 1), Y target (T + 1)), ···,}.
[0040] Preferably, step S2.3 further includes the following sub - steps:
[0041] S2.3.1. Use the SHUFFLE() function to shuffle the order of elements in the time series dataset D LSTM to obtain the shuffled dataset D LSTM ':
[0042] D LSTM ' = SHUFFLE(D LSTM );
[0043] S2.3.2. Obtain the size of the dataset D LSTM ' as n, and calculate the number of datasets n train of the training set D val and the validation set D train according to the set training set ratio α and validation set ratio β: val :
[0044]
[0045] n val = n - n train ;
[0046] S2.3.3. Obtain the training set D train and the validation set D val :
[0047] D train = {(X input (T), Y target (T)),
[0048] , ···, (X input (n train),Y target (n train ))}
[0049] D val ={(X input (n train +1),Y target (n train +1)),
[0050] ,···,(X input (n val ),Y target (n val ))}.
[0051] Preferably, the step S2.5 further includes the following sub-steps:
[0052] S2.5.1. The time series dataset D LSTM Motor speed EM over a period of time rpm _O and turbine speed GT rpm The difference between _O is defined as the speed difference loss L diff :
[0053] Δ diff =丨EM rpm _O t -GT rpm _O t 丨
[0054]
[0055] S2.5.2. The time series dataset D LSTM Motor speed EM over a period of time rpm _O rate of change is defined as the speed change rate loss L change :
[0056] Δ change =GT rpm _O t -GT rpm _O t-1 丨
[0057]
[0058] S2.5.3. respectively, the speed difference loss L diff The speed change rate loss L change Introducing weights ω1 and ω2, we get L total :
[0059] L total =ω1·L diff +ω2·L change .
[0060] Preferably, step S2.7 further includes the following sub-steps:
[0061] S2.7.1. Input the validation set D val into the LSTM model to obtain the rotational speed difference loss Val diff on the validation set, the rotational speed change rate loss Val change and the total loss function Val total of the validation set, and calculate the loss function difference C
[0062] C = Val total - L total ;
[0063] S2.7.2. Construct a historical database, which stores the historical rotational speed difference loss His diff , the historical rotational speed change rate loss His change , the historical loss function difference His c , the historical learning rate His η , the historical maximum number of iterations His Ε ;
[0064] S2.7.3. Use the Euclidean distance to calculate the score of each historical data:
[0065] Distance calculation formula:
[0066]
[0067] where i is the i-th data in the historical database, ω3, ω4, and ω5 are weight coefficients used to adjust the importance of different loss terms, and ω3 > ω4 > ω5, ω3 + ω4 + ω5 = 1;
[0068] S2.7.4. Sort the historical data according to the scores, select the historical data with the highest score, and replace the learning rate η and the maximum number of iterations Ε hyperparameters of the LSTM model with the historical learning rate His η and the historical maximum number of iterations His Ε ; 0
[0069] S2.7.5. Judge the magnitude of the values of the rotational speed difference loss Val diff and the rotational speed change rate loss Val change :
[0070] When Val diff > Val change , then increase ω2, i.e., ω2 = ω2 + δ;
[0071] When Val diff < Val change, then increase ω1, i.e., ω1 = ω1 + δ, where δ is the weight adjustment threshold.
[0072] Preferably, step S3 further includes the following sub-steps:
[0073] S3.1. Use a Hall current sensor to collect the current value I_N of the propulsion motor, use a frequency converter to collect the frequency H z _N of the propulsion motor, use a speed sensor to collect the steam turbine speed GT rpm _N and the propulsion motor speed EM rpm _N;
[0074] S3.2. Normalize the collected current value I_N, frequency H z _N, steam turbine speed GT rpm _N and the propulsion motor speed EM rpm _N;
[0075] S3.3. Put the normalized operating parameters into the empty matrix γ. The shape of γ is (T, N),
[0076] where N is the current value I_N, frequency H z _N, steam turbine speed GT rpm _N and the propulsion motor speed EM rpm _N.
[0077] Preferably, step S5 further includes the following sub-steps:
[0078] S5.1. Define the frequency adjustment amount Δ hf of the propulsion motor and the current adjustment amount Δ i ;
[0079] S5.2. Calculate the speed error e t between the propulsion motor and the steam turbine:
[0080] e t = Goal rpm - EM rpm _N;
[0081] S5.3. Judge the magnitude of the speed error |e t | and the error threshold e y . If |e t | < e y , no processing is required, otherwise go to S5.4;
[0082] S5.4. Calculate the frequency adjustment amount Δ hf . The frequency adjustment amount where p is the number of pole pairs of the propulsion motor, and calculate the current adjustment amount Δ i . The current adjustment amount where k t is the torque constant of the motor;
[0083] S5.5. The propulsion motor adjusts the operating parameters according to the frequency adjustment amount Δ hf and the current adjustment amount Δ i for operation parameter adjustment.
[0084] (III) Beneficial effects
[0085] Compared with the prior art, the present invention provides a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network, having the following beneficial effects:
[0086] The method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network collects key parameters such as the current value, frequency, steam turbine rotational speed, and propulsion motor rotational speed of the propulsion motor in real time, models the dynamic characteristics of the system using an LSTM model, and combines an optimization algorithm to generate an optimal control instruction, improving the accuracy, stability, and adaptability of the rotational speed control of the ship propulsion motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 is a schematic flow chart of a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network proposed by the present invention;
[0088] Figure 2 is a schematic flow chart of training a long short-term memory network LSTM model for a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network proposed by the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0089] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the embodiments of the present invention. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0090] Please refer to Figure 1-2 , a method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network, comprising the following steps:
[0091] S1. Collect historical data during the operation of the ship for a period of time, preprocess the historical data, and persist it in the database;
[0092] S2. Read the historical data in the database and train a long short-term memory network LSTM model;
[0093] S3. Use sensors to collect the operating parameters of the propulsion motor in real time and convert the operating parameters into the input parameter format of the LSTM model;
[0094] S4. Input the converted operating parameters of the propulsion motor into the trained LSTM model to obtain the predicted target speed Goal of the propulsion motor rpm ;
[0095] S5. According to the target speed Goal output by the LSTM model rpm , adjust the operating parameters of the propulsion motor to make its speed gradually approach the steam turbine speed.
[0096] In this embodiment, the preprocessing of the historical data in step S1 further includes the following sub-steps:
[0097] S1.1. Traverse all historical data. Each piece of historical data includes the current value I_O, frequency H z _O, steam turbine speed GT rpm _O, and propulsion motor speed EM rpm _O. Respectively, count the minimum value, maximum value, and average value of the current value I_O, frequency H z _O, steam turbine speed GT rpm _O, and propulsion motor speed EM rpm _O in the historical data;
[0098] S1.2. Process the missing values and outliers in each piece of historical data traversed;
[0099] Missing value processing: When any value of the current value I_O and frequency H z _O data points is empty, then delete the current piece of historical data. When any value or all values of the steam turbine speed GT rpm _O and propulsion motor speed EM rpm _O data points are empty, fill the average value of the steam turbine speed GT rpm _O and propulsion motor speed EM rpm _O to the empty value.
[0100] Outlier processing: Calculate the Z-score of each data point in the current historical data. When |Z|>3, it is considered that the data point is an outlier, and fill the average value of the data point to the outlier. The Z-score formula is as follows:
[0101]
[0102] Among them, χ is the data point, μ is the average value of the data point, and σ is the standard deviation of the data point.
[0103] S1.3. According to the current value I_O, frequency H z _O, steam turbine speed GT rpm _O, and propulsion motor speed EM rpmPerform min-max normalization on the value distributions of _O data points respectively:
[0104]
[0105] Among them, χ' is the value of the data point after normalization, χ is the original value of the data point, χ min and χ max are the minimum and maximum values of the data point respectively.
[0106] In this embodiment, step S2 further includes the following sub-steps:
[0107] S2.1. Connect to the database, execute the SQL query statement, and obtain the data set D,
[0108] D = {[I_O1, H z _O1, GT rpm _O1, EM rpm _O1],
[0109] [I_O2, H z _O2, GT rpm _O2, EM rpm _O2], ···,};
[0110] S2.2. Convert the data set D into a time series data set D suitable for the LSTM model LSTM ;
[0111] S2.3. Divide the time series data set D LSTM into a training set D train and a validation set D val ;
[0112] S2.4. Build an LSTM model;
[0113] Input layer: Receive the input sequence X input , with shape (T, d), where T is the time window length and d is the feature dimension (the dimension of the feature vector at each time point, i.e., the current value I_O, frequency H z _O, turbine speed GT rpm _O, and propulsion motor speed EM rpm _O), and at this time d is 4;
[0114] LSTM layer: Consists of multiple hidden units. Set the number of hidden units to h. After the input sequence X input passes through the LSTM layer, the output hidden state is H(t), with dimension h. The calculation formula of the LSTM layer is as follows:
[0115] H(t) = LSTM(X input ; w h ; bh );
[0116] where w h and b h are the weight matrix and bias vector of the LSTM layer respectively,
[0117] LSTM(·) represents the calculation process of LSTM, including the calculation of the forget gate, input gate, cell state update, and output gate;
[0118] Output layer: A single neuron that outputs the predicted target rotational speed Goal rpm , and the calculation formula is as follows:
[0119] Goal rpm = ω o H(t) + b o
[0120] where ω o and b o are the weight and bias vector of the output layer respectively, and H(t) is the hidden state of the LSTM layer at the last time step;
[0121] Activation function: Use a linear activation function.
[0122] S2.5. Define the rotational speed difference loss L diff , the rotational speed change rate loss L change and the total loss function L total to measure the gap between the predicted value and the true value of the model;
[0123] S2.6. Use the training set D train to train the LSTM model and obtain the total loss function L train of the training set D total ;
[0124] S2.6.1. Define the hyperparameters during the training process:
[0125] Learning rate η: Controls the step size of parameter update;
[0126] Batch size Β: The number of samples used in each training;
[0127] Maximum number of iterations Ε: The maximum number of training epochs;
[0128] S2.6.2. Divide the training set D train into multiple small batches according to the batch size Β;
[0129] S2.6.3. For each batch of the training set D train , output the predicted target rotational speed Goal rpm , and for each batch of the training set D trainAs the time series dataset D LSTM Calculate the loss function L train , and through each loss function L train Calculate the total loss function L total :
[0130]
[0131] S2.7. Use the validation set D val Evaluate the performance of the LSTM model, perform hyperparameter tuning, and optimize the performance of the LSTM model.
[0132] In this embodiment, step S2.2 further includes the following sub-steps:
[0133] S2.2.1. Define the time window length T, which represents the number of time steps input to the LSTM model each time;
[0134] S2.2.2. Construct the input sequence X input and the target Y target :
[0135] The input sequence X input : For each time point t, select the data of the first T time points as the input
[0136] X input ={[I_O t-T+1 ,H z _O t-T+1 ,GT rpm _O t-T+1 ,EM rpm _O t-T+1 ,···,
[0137] [I_O t ,H z _O t ,GT rpm _O t ,EM rpm _O t}
[0138] The target Y target : Select the propulsion motor speed EM rpm _O t at the current time point t as the target value:
[0139] Y target =EM rpm _O t ;
[0140] S2.2.3. Generate the time series dataset D LSTM :
[0141] DLSTM ={(X input (T), Y target (T)),
[0142] (X input (T + 1), Y target (T + 1)), ···,}。
[0143] In this embodiment, step S2.3 further includes the following sub-steps:
[0144] S2.3.1. Use the SHUFFLE() function to shuffle the order of elements in the time-series dataset D LSTM to obtain the shuffled dataset D LSTM ':
[0145] D LSTM ' = SHUFFLE(D LSTM );
[0146] S2.3.2. Obtain the size of the dataset D LSTM ' as n, and calculate the number of datasets n train of the training set D val and the validation set D train and n val according to the set training set ratio α and validation set ratio β:
[0147]
[0148] n val = n - n train ;
[0149] S2.3.3. Obtain the training set D train and the validation set D val :
[0150] D train ={(X input (T), Y target (T)),
[0151] ···, (X input (n train ), Y target (n train ))}
[0152] D val ={(X input (n train + 1), Y target (n train + 1)),
[0153] ···, (X input (n val),Y target (n val ))}.
[0154] In this embodiment, step S2.5 also includes the following sub-steps:
[0155] S2.5.1. The time series dataset D LSTM Motor speed EM over a period of time rpm _O and turbine speed GT rpm The difference between _O is defined as the speed difference loss L diff :
[0156] Δ diff =丨EM rpm _O t -GT rpm _O t 丨
[0157]
[0158] S2.5.2. The time series dataset D LSTM Motor speed EM over a period of time rpm _O rate of change is defined as the speed change rate loss L change :
[0159] Δ change =GT rpm _O t -GT rpm _O t-1 丨
[0160]
[0161] S2.5.3. respectively, the speed difference loss L diff and speed change rate loss L change Introducing weights ω1 and ω2, we get L total :
[0162] L total =ω1·L diff +ω2·L change .
[0163] In this embodiment, step S2.7 also includes the following sub-steps:
[0164] S2.7.1. Set the validation set D val Input into the LSTM model to obtain the speed difference loss Val on the validation set diff , speed change rate loss Val change And the total loss function Val of the validation set total , calculate the loss function difference C
[0165] C = Val total -L total ;
[0166] S2.7.2. Build a historical database, which stores the historical rotational speed difference loss His diff , the historical rotational speed change rate loss His change , the historical loss function difference His c , the historical learning rate His η , the historical maximum number of iterations His Ε ;
[0167] S2.7.3. Calculate the score of each historical data using the Euclidean distance:
[0168] Distance calculation formula:
[0169]
[0170] where i is the i-th data in the historical database, ω3, ω4, and ω5 are weight coefficients used to adjust the importance of different loss terms, and ω3 > ω4 > ω5, ω3 + ω4 + ω5 = 1;
[0171] S2.7.4. Sort the historical data according to the scores, select the historical data with the highest score, and use the historical learning rate His η , the historical maximum number of iterations His Ε to replace the learning rate η and the maximum number of iterations Ε hyperparameters of the LSTM model; 0
[0172] S2.7.5. Judge the magnitude of the rotational speed difference loss Val diff and the rotational speed change rate loss Val change values:
[0173] When Val diff > Val change , then increase ω2, i.e., ω2 = ω2 + δ;
[0174] When Val diff < Val change , then increase ω1, i.e., ω1 = ω1 + δ, where δ is the weight adjustment threshold.
[0175] In this embodiment, step S3 further includes the following sub-steps:
[0176] S3.1. Use a Hall current sensor to collect the current value I_N of the propulsion motor, use a frequency converter to collect the frequency H z _N of the propulsion motor, use a rotational speed sensor to collect the steam turbine rotational speed GT rpm _N and the propulsion motor rotational speed EMrpm _N;
[0177] S3.2. Normalize the collected current value \(I_N\), frequency \(H\) z _N, steam turbine speed \(GT\) rpm _N and propulsion motor speed \(EM\) rpm _N;
[0178] S3.3. Put the normalized operating parameters into an empty matrix \(\gamma\) with a shape of \((T, N)\),
[0179] where \(N\) is the current value \(I_N\), frequency \(H\) z _N, steam turbine speed \(GT\) rpm _N and propulsion motor speed \(EM\) rpm _N.
[0180] In this embodiment, step S5 further includes the following sub-steps:
[0181] S5.1. Define the frequency adjustment amount \(\Delta\) hf of the propulsion motor and the current adjustment amount \(\Delta\) i ;
[0182] S5.2. Calculate the speed error \(e\) between the propulsion motor and the steam turbine t :
[0183] \(e\) t = Goal rpm - EM rpm _N;
[0184] S5.3. Judge the magnitude of the speed error \(|e|\) t | and the error threshold \(e\) y . If \(|e|\) t < e y , no processing is required; otherwise, go to S5.4;
[0185] S5.4. Calculate the frequency adjustment amount \(\Delta\) hf , where the frequency adjustment amount where \(p\) is the number of pole pairs of the propulsion motor, and calculate the current adjustment amount \(\Delta\) i , where the current adjustment amount where \(k\) t is the torque constant of the motor;
[0186] S5.5. The propulsion motor adjusts the operating parameters according to the frequency adjustment amount \(\Delta\) hf and the current adjustment amount \(\Delta\) i .
[0187] The beneficial effects of the present invention are as follows: The ship propulsion motor speed control method based on the long short-term memory network collects key parameters such as the current value, frequency, steam turbine speed, and propulsion motor speed of the propulsion motor in real time, uses the LSTM model to model the dynamic characteristics of the system, and combines an optimization algorithm to generate an optimal control instruction, improving the accuracy, stability, and adaptability of the ship propulsion motor speed control.
[0188] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network, characterized in that, Including the following steps: S1. Collect historical data during the operation of the ship over a period of time, preprocess the historical data, and persist it into the database; S2. Read the historical data in the database and train the long short-term memory network (LSTM) model; S3. Use sensors to collect the operating parameters of the propulsion motor in real time and convert the operating parameters into the input parameter format of the LSTM model; S4. Input the converted propulsion motor operating parameters into the trained LSTM model to obtain the predicted target speed Goal of the propulsion motor rpm ; S5. Adjust the operating parameters of the propulsion motor according to the target speed Goal output by the LSTM model so that its speed gradually approaches the steam turbine speed. rpm 2. The rotational speed control method of a ship propulsion motor based on a long short-term memory network according to claim 1, wherein The preprocessing of the historical data in step S1 further includes the following sub-steps: S1.
1. Traverse all historical data, and each piece of historical data includes the current value I_O, frequency H z _O of the propulsion motor, the steam turbine speed GT rpm _O, and the propulsion motor speed EM rpm _O. Respectively, count the minimum value, maximum value, and average value of the current value I_O, frequency H z _O, the steam turbine speed GT rpm _O, and the propulsion motor speed EM rpm _O in the historical data; S1.
2. Process the missing values and outliers for each piece of historical data retrieved; S1.
3. Perform min-max normalization on the value distributions of the data points of the current value I_O, frequency H z _O, turbine speed GT rpm _O, and propulsion motor speed EM rpm _O respectively: where χ' is the value of the data point after normalization, χ is the original value of the data point, χ min and χ max are the minimum and maximum values of the data point, respectively.
3. The speed control method of a ship propulsion motor based on a long short-term memory network according to claim 2, characterized in that, Step S2 further includes the following sub-steps: S2.
1. Connect to the database, execute the SQL query statement to obtain the data set D; D = {[I_O1, H z _O1, GT rpm _O1, EM rpm _O1], [I_O2,H z _O2,GT rpm _O2,EM rpm _O2],···,}; S2.
2. Convert the dataset D into a time series dataset D suitable for the LSTM model LSTM ; S2.
3. Divide the time series dataset D LSTM into a training set D train and a validation set D val ; S2.
4. Construct the LSTM model; S2.
5. Define the rotational speed difference loss L diff , the rotational speed change rate loss L change and the total loss function L total , to measure the gap between the model prediction value and the true value; S2.
6. Use the training set D train Train the LSTM model to obtain the total loss function L of the training set D train ; total ; S2.
7. Use the validation set D val Evaluate the performance of the LSTM model, perform hyperparameter tuning, and optimize the performance of the LSTM model.
4. The rotational speed control method of a ship propulsion motor based on a long short-term memory network according to claim 3, wherein Step S2.2 further includes the following sub-steps: S2.2.
1. Define the time window length T, representing the number of time steps input into the LSTM model each time; S2.2.
2. Construct the input sequence X input and the target Y target : Input sequence X input : For each time point t, select the data of the first T time points as the input X input = {[I_O t-T+1 , H z _O t-T+1 , GT rpm _O t-T+1 , EM rpm _O t-T+1 , ···, [I_O t , H z _O t , GT rpm _O t , EM rpm _O t} Target Y target : Select the propulsion motor speed EM at the current time point t rpm _O t as the target value: Y target = EM rpm _O t ; S2.2.
3. Generate the time series dataset D LSTM : D LSTM = {(X input (T), Y target (T))} (X input (T + 1), Y target (T + 1)), ···,}。 5. A method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network according to claim 3, characterized in that, Step S2.3 further includes the following sub-steps: S2.3.
1. Use the SHUFFLE() function to shuffle the elements in the time series dataset D LSTM to obtain the shuffled dataset D LSTM ': D LSTM ' = SHUFFLE(D LSTM ); S2.3.
2. Obtain the dataset D LSTM ' has a size of n. According to the set training set ratio α and validation set ratio β, calculate the number of datasets n train of the training set D val and the validation set D train and n val : n val = n - n train ; S2.3.
3. Obtain the training set D train and the validation set D val : D train = {(X input (T), Y target (T)), ···,(X input (n train ),Y target (n train ))} D val = {(X input (n train + 1), Y target (n train + 1)), ···,(X input (n val ),Y target (n val ))}。 6. The rotational speed control method for a ship propulsion motor based on a long short-term memory network according to claim 3, wherein Step S2.5 further includes the following sub-steps: S2.5.
1. Define the time-series dataset D LSTM The motor speed EM rpm _O within a period of time and the steam turbine speed GT rpm _O difference as the speed difference loss L diff : Δ diff = |EM rpm _O t -GT rpm _O t | S2.5.
2. Define the change rate L of the motor speed EM LSTM over a period of time as the loss of the change rate of the rotational speed rpm _O, denoted as change : Δ change = |GT rpm _O t - GT rpm _O t-1 | S2.5.
3. Respectively for the rotational speed difference loss L diff and the rotational speed change rate loss L change Introduce weights ω1 and ω2 to obtain L total : L total = ω1·L diff + ω2·L change .
7. A rotational speed control method for a ship propulsion motor based on a long short-term memory network according to claim 6, characterized in that Step S2.7 further includes the following sub-steps: S2.7.
1. Input the validation set D val into the LSTM model to obtain the rotational speed difference loss Val diff on the validation set, the rotational speed change rate loss Val change and the total loss function Val total of the validation set, and calculate the loss function difference C C = Val total -L total ; S2.7.
2. Build a historical database, which stores the historical rotational speed difference loss His diff , the historical rotational speed change rate loss His change , the historical loss function difference His c , the historical learning rate His η , the historical maximum number of iterations His Ε ; S2.7.
3. Calculate the score for each piece of historical data using the Euclidean distance: Distance calculation formula: where i is the i-th piece of data in the historical database, ω3, ω4, and ω5 are weight coefficients used to adjust the importance of different loss terms, and ω3 > ω4 > ω5, ω3 + ω4 + ω5 = 1; S2.7.
4. Sort the historical data according to the scores, select the historical data with the highest score, and replace the historical learning rate His η and the historical maximum number of iterations His Ε in the hyperparameters of the learning rate η and the maximum number of iterations Ε of the LSTM model; 0 S2.7.
5. Determine the rotational speed difference loss Val diff and the rotational speed change rate loss Val change in terms of value magnitude: When Val diff > Val change , then increase ω2, i.e., ω2 = ω2 + δ; When Val diff <Val change , then increase ω1, that is, ω1 = ω1 + δ, where δ is the weight adjustment threshold.
8. A method for controlling the rotational speed of a ship propulsion motor based on a long short-term memory network according to claim 1, characterized in that, Step S3 further includes the following sub-steps: S3.
1. Use a Hall current sensor to collect the current value I_N of the propulsion motor, use a frequency converter to collect the frequency H of the propulsion motor, use a speed sensor to collect the steam turbine speed GT z _N, and use a speed sensor to collect the propulsion motor speed EM rpm _N; rpm _N; S3.
2. Normalize the collected current value I_N, frequency H z _N, steam turbine speed GT rpm _N, and propulsion motor speed EM rpm _N; S3.
3. Put the normalized operating parameters into the empty matrix γ, and the shape of γ is (T, N); Among them, N is the current value I_N, the frequency H z _N, the steam turbine speed GT rpm _N and the propulsion motor speed EM rpm _N.
9. A speed control method for a ship propulsion motor based on a long short-term memory network according to claim 8, characterized in that Step S5 further includes the following sub-steps: S5.
1. Define the frequency adjustment amount Δ of the propulsion motor hf and the current adjustment amount Δ i ; S5.
2. Calculate the rotational speed error e between the propulsion motor and the steam turbine t : e t = Goal rpm - EM rpm _N; S5.
3. Determine the rotational speed error |e t | and the error threshold e y in terms of magnitude. If |e t | < e y , no processing is required; otherwise, proceed to S5.4; S5.
4. Calculate the frequency adjustment amount Δ hf , the frequency adjustment amount where p is the number of pole pairs of the propulsion motor, calculate the current adjustment amount Δ i , the current adjustment amount where k t is the torque constant of the motor; S5.
5. The propulsion motor adjusts the operating parameters according to the frequency adjustment amount Δ hf and the current adjustment amount Δ i
Citation Information
Cited By
Intelligent ship rotating speed prediction method based on multi-source data fusion and machine learning
CN121302190A