Intelligent speed control method, device and equipment for electric scooter and storage medium

By combining the multi-head time self-attention mechanism and the spatial cross-attention mechanism, the target speed sequence is generated, and combined with the robust extended state observer and adaptive PID control parameters, the problem of uneven speed control of electric scooters under complex road conditions is solved. , realizes high-precision speed control and safe and reliable system operation.

CN119408424AActive Publication Date: 2025-02-11SHENZHEN LEQI INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510022521.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-02-11
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

The existing electric scooter speed control system is difficult to accurately predict the cyclist's intentions under complex road conditions, the speed control is not smooth, and it cannot effectively integrate multi-source sensor data and environmental information. The system is difficult to respond to the cyclist's control needs, affecting the cycling experience and Security.

Method used

The multi-head temporal self-attention mechanism and spatial cross-attention mechanism are used to deeply mine the cycling historical data, extract the correlation between timing characteristics and spatial characteristics, and generate the target speed sequence through the multi-feature fusion module and the intention-inspiring control module, combining with Lu Rod extended state observer and adaptive PID control parameters for accurate speed control.

Benefits of technology

It significantly improves the observation accuracy and control accuracy of the system under complex operating conditions, ensures the accuracy of motor control and the safe and reliable operation of the system, and improves the riding experience and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119408424A_ABST
    Figure CN119408424A_ABST
Patent Text Reader

Abstract

The invention relates to an intelligent speed control method, device and equipment for an electric scooter and a storage medium. The method comprises the following steps: acquiring and filtering historical riding data of the electric scooter to obtain a time sequence characteristic matrix; constructing a multi-head time self-attention mechanism and a space cross attention mechanism to obtain a time feature vector and a space feature vector; inputting into a multi-feature fusion module for weighted fusion to obtain a fusion feature vector, and generating a target speed sequence through an intention heuristic control module; constructing a state observer to obtain a system state vector; solving and calculating an observer gain matrix through a linear matrix inequality, and constructing an outer loop speed controller and an inner loop current controller to obtain adaptive PID control parameters; and a PWM modulator is input to carry out motor control quantity calculation, a speed control execution instruction is obtained, and a motor driving signal is output. The implementation of the invention ensures the accuracy of motor control, and ensures the safe and reliable operation of the system under various working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent speed control, and in particular to an intelligent speed control method, device, equipment and storage medium for an electric scooter. Background Art

[0002] Traditional electric scooter speed control systems mainly use methods based on sliding mode observers and adaptive controllers. Although this method is simple and effective, it is difficult to accurately predict the rider's intentions under complex road conditions, which can easily lead to uneven speed control.

[0003] Current electric scooter speed control systems often ignore the correlation between temporal and spatial features when processing historical riding data, resulting in insufficiently accurate predictions of riding intentions. Particularly during speed changes, the inability to effectively integrate multi-source sensor data and environmental information makes it difficult for the system to promptly respond to the rider's control needs, impacting riding experience and safety. Furthermore, existing control methods are susceptible to performance degradation when faced with external disturbances such as changing road conditions and load fluctuations. Traditional PID control parameters are difficult to adaptively adjust based on actual operating conditions, resulting in reduced speed control accuracy, insufficient system robustness, and an inability to meet the intelligent control requirements of different scenarios. Summary of the Invention

[0004] The main purpose of the present invention is to provide an intelligent speed control method, device, equipment and storage medium for an electric scooter. The present invention ensures the accuracy of motor control and ensures the safe and reliable operation of the system under various working conditions.

[0005] To achieve the above objectives, the present invention provides an intelligent speed control method for an electric scooter, comprising the following steps: The riding history data of electric scooters is collected and filtered to obtain a time series feature matrix; Based on the temporal feature matrix, a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism are constructed to obtain a temporal feature vector and a spatial feature vector; Inputting the time feature vector and the spatial feature vector into a multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generating a target speed sequence through an intention-inspired control module based on the fused feature vector; Constructing a state observer for the target speed sequence to obtain a system state vector; Based on the system state vector, an observer gain matrix is ​​calculated by solving a linear matrix inequality, and an outer loop speed controller and an inner loop current controller are constructed to obtain adaptive PID control parameters; The adaptive PID control parameters are input into the PWM modulator to calculate the motor control amount, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction.

[0006] The present invention also provides an intelligent speed control device for an electric scooter, comprising: The acquisition module is used to collect and filter the riding history data of the electric scooter to obtain a time series feature matrix; A processing module is used to construct a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism based on the temporal feature matrix to obtain a temporal feature vector and a spatial feature vector; a fusion module, configured to input the time feature vector and the spatial feature vector into a multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generate a target speed sequence through an intention-inspired control module based on the fused feature vector; A construction module, configured to construct a state observer for the target speed sequence to obtain a system state vector; A solution module is used to calculate the observer gain matrix based on the system state vector by solving the linear matrix inequality, and to construct an outer loop speed controller and an inner loop current controller to obtain adaptive PID control parameters; The output module is used to input the adaptive PID control parameters into the PWM modulator to calculate the motor control amount, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction.

[0007] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0008] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0009] In summary, the technical solution provided by the present invention deeply mines the riding history data through the combination of multi-head temporal self-attention mechanism and spatial cross-attention mechanism, establishes the correlation between temporal features and spatial features, and effectively extracts the riding intention features; adopts the design of multi-feature fusion module and intention-inspired control module to achieve accurate prediction of riding intention, and generates a target speed sequence that meets the actual scene constraints through the cooperation of LSTM sequence predictor and scene adapter; based on the design of robust extended state observer and combined with the linear matrix inequality solution method, a state observation system with anti-interference ability is constructed, which improves the observation accuracy of the system under complex working conditions; through the cascade control structure of the outer loop speed controller and the inner loop current controller, adaptive adjustment of control parameters is achieved, and the SVPWM modulation strategy is adopted to ensure the accuracy of motor control; a complete protection mechanism is integrated, including current limiting, dead zone compensation and intermittent protection functions, to ensure the safe and reliable operation of the system under various working conditions, and significantly improve the overall performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 This is a schematic diagram of the steps of an intelligent speed control method for an electric scooter according to one embodiment of the present invention; Figure 2 This is a structural block diagram of an intelligent speed control device for an electric scooter according to one embodiment of the present invention; Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0011] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0012] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0013] Reference Figure 1 This embodiment provides an intelligent speed control method for an electric scooter, comprising the following steps: S1, collects and filters the riding history data of the electric scooter to obtain a time series feature matrix; Data from multiple key sensors is sampled and preprocessed. The data collected and processed include speed, acceleration, position, attitude, and road environment images. For electric scooter speed data, a speed sampler is used to obtain raw speed data. This raw speed data is processed using a digital low-pass filter to effectively reduce high-frequency noise, retaining only the low-frequency components in the data and producing relatively smooth speed time series data. Furthermore, Gaussian filtering is used to process the raw acceleration data collected by the electric scooter's accelerometer. Gaussian filtering is a weighted average-based method that smoothes the data using a Gaussian function. This method significantly reduces noise interference while preserving the data's key features. This filtering method is suitable for processing acceleration data, removing random noise and maintaining a high response speed even when acceleration data fluctuates significantly, resulting in acceleration time series data. For the electric scooter's location information, a GPS module is used to collect raw location data. Because GPS data is subject to various noise artifacts, such as errors caused by multipath and satellite signal obstruction, a Kalman filter is applied to the raw location data. Kalman filtering is a state estimation method that combines system models and sensor measurements to dynamically correct data in a recursive manner. Kalman filtering significantly reduces GPS data noise, improves the stability and accuracy of position data, and makes the electric scooter's position information more continuous and accurate in both temporal and spatial dimensions. To collect attitude information, the electric scooter is equipped with a gyroscope sensor to measure its attitude data. Gyroscopes are susceptible to temperature fluctuations, resulting in zero-drift errors and inaccurate attitude measurements. To eliminate this error, a temperature compensation model is used to correct the raw attitude data. By modeling the gyroscope's temperature characteristics, its measurements are adjusted in real time to eliminate zero-drift errors caused by temperature fluctuations, resulting in accurate and reliable attitude data. The electric scooter is also equipped with a camera to capture a sequence of images of the surrounding road environment. Image normalization is performed on the raw images, adjusting parameters such as brightness and contrast to ensure consistent features across images collected at different times and under different lighting conditions, improving the accuracy of subsequent visual feature extraction and analysis. Image normalization eliminates visual information deviations caused by varying lighting conditions, resulting in a sequence of road environment images. The velocity time series data, acceleration time series data, position data, posture data and road environment image sequence are time synchronized to obtain a complete time series feature matrix.

[0014] S2, constructs a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism based on the temporal feature matrix to obtain the temporal feature vector and the spatial feature vector; Specifically, a linear transformation is performed on the temporal feature matrix to convert the raw temporal features into feature representations suitable for the attention mechanism. This linear transformation yields eight independent sets of attention head features, each consisting of a query matrix (Query), a key matrix (Key), and a value matrix (Value). This linear transformation maps the raw features into a higher-dimensional space, facilitating the attention mechanism's computational processing. A scaled dot product operation is performed on each set of attention head features to calculate the degree of correlation between different features. The dot product between the query matrix and the key matrix is ​​calculated and scaled, and then a softmax function is applied to obtain the importance weight of each feature, forming an attention weight matrix. Based on the attention weight matrix, the corresponding value matrix is ​​weighted and summed to obtain eight independent sets of temporal correlation features. These capture the dependencies between e-scooters in different time segments, thereby extracting important temporal information about the scooter riding process. The eight sets of temporal correlation features are then concatenated, concatenating the outputs of all attention heads. These features are then mapped into a unified feature space using a linear transformation to yield a temporal feature vector. This temporal feature vector contains key features of the temporal information during the electric scooter's riding process. Simultaneously, the road environment image sequence features and riding posture features in the temporal feature matrix are processed to obtain spatial feature information. The road environment image sequence features undergo a first attention branch. In this attention branch, the road environment features serve as the query vector and the riding posture features serve as key-value pairs. An attention mechanism is used to extract the correlation between the road environment and the posture, obtaining feature information directly related to the riding environment and forming a road environment attention feature. This approach enables the model to rationally associate the scooter's riding posture with the current road environment characteristics, thereby capturing the interaction between scooter riding and the external environment. Simultaneously, a second attention branch is used to process the riding posture features. Using the riding posture features as the query vector and the road environment features as key-value pairs, an attention mechanism is used to obtain the riding posture attention feature. This allows the model to identify the dependency between riding posture and the road environment, helping to understand posture adjustments under different road conditions. This cross-processing attention mechanism fully captures the interactive characteristics of the electric scooter and its surroundings in the spatial dimension. The road environment attention features and riding posture attention features are concatenated to integrate the interrelationships between the road environment and riding posture into a single feature representation, forming a spatial interaction feature. The concatenated spatial interaction feature is linearly mapped into the target feature space to obtain the final spatial feature vector.

[0015] S3, input the time feature vector and the spatial feature vector into the multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generate a target speed sequence based on the fused feature vector through the intention-inspired control module; It should be noted that the temporal feature vector is input into the first-channel attention network to calculate feature importance and obtain the temporal feature weight coefficient. In the first-channel attention network, three fully-connected layers are used to transform and weight the features layer by layer. The first and second fully-connected layers both use the ReLU activation function, a nonlinear activation function that enables the network to better fit complex feature relationships. The third fully-connected layer uses the Sigmoid activation function, whose output range is 0 to 1. This normalizes feature importance and obtains the temporal feature weight coefficient suitable for feature weighting. Similarly, the spatial feature vector is input into the second-channel attention network to calculate the spatial feature importance weight coefficient. The second-channel attention network has the same structure as the first-channel attention network, consisting of three fully-connected layers. The first two layers use the ReLU activation function, and the last layer uses the Sigmoid activation function. The temporal feature weight coefficient is then added to the original temporal feature vector for feature weighting. Each feature is weighted and multiplied to obtain the weighted temporal feature. Similarly, the spatial feature weight coefficient is weighted with the spatial feature vector to obtain the weighted spatial feature. Feature weighting can highlight more important features in specific scenarios while reducing the impact of unimportant or noisy features, making the final fused features more representative and robust. The weighted temporal and spatial features are input into a fusion module consisting of a three-layer fully connected neural network for feature fusion. The three layers of this fully connected neural network have 256, 128, and 64 nodes, respectively. The decreasing number of nodes layer by layer achieves progressive feature compression and abstraction, extracting important information from high-dimensional features and generating a fused feature vector. The fused feature vector is then input into an LSTM sequence predictor to generate a speed sequence. This LSTM sequence predictor consists of two layers of LSTM units, each with 128 hidden nodes. LSTM (Long Short-Term Memory) is a recurrent neural network architecture capable of processing time series data. It possesses memory and forgetting mechanisms, making it suitable for processing feature data with long-term dependencies. The LSTM sequence predictor uses the fused feature vector to predict the future speed trends of electric scooters and generate an initial speed prediction sequence. The LSTM memory capacity captures the dynamic patterns of speed changes during scooter riding and makes reasonable predictions based on the fused features. The initial speed prediction sequence is input into the scene adapter for speed correction to generate a scene-constrained speed sequence. The scene adapter makes appropriate speed adjustments based on the current riding environment, such as slowing down on slopes and accelerating appropriately on flat roads. The scene adapter adapts the initial speed to different riding scenarios to ensure the safety and stability of the electric scooter in various riding environments. The scene-constrained speed sequence is then smoothed to reduce drastic speed fluctuations, resulting in the final target speed sequence.

[0016] S4, construct a state observer for the target speed sequence to obtain the system state vector; Specifically, the dynamic model of an electric scooter is discretized. The dynamic model of an electric scooter is described by a continuous physical system, involving factors such as speed, motor speed, control input, and external disturbances. The continuous dynamic model is converted into discrete state-space equations through numerical discretization. The discrete state-space equations contain the system state matrix, the control input matrix, and the disturbance matrix. These matrices describe the relationship between the system state evolution and the input and output at each discrete moment. Through discretization, the continuous control problem is converted into a discrete control problem suitable for implementation on a digital computer. Observability analysis is performed on the discrete state-space equations. Observability is a key concept in system control theory, used to determine whether the system's internal state can be fully reconstructed from its output. By calculating and analyzing the observability matrix of the discrete state-space equations, the observability of the system under given input and output conditions is assessed. If the system is observable, the internal state of the system is inferred from the output. Based on the observability matrix, a robust extended state observer is constructed to cope with system uncertainty and external disturbances. This robust extended state observer is constructed by designing an observer state equation that includes an observer gain term and a disturbance compensation term. The observer gain term adjusts the observer's sensitivity to error, while the disturbance compensation term offsets state estimation bias caused by external disturbances, thereby improving the robustness and accuracy of the observer. The error between the desired and actual speeds in the target speed sequence is calculated to obtain the speed observation error. The speed observation error reflects the deviation between the electric scooter's actual motion state and the desired target, providing information that aids the observer's state estimation and subsequent control. Furthermore, to account for the impact of load disturbances, a boundedness analysis is performed on the load disturbance, analyzing its amplitude and range to obtain disturbance boundary conditions. These disturbance boundary conditions provide the observer with a reasonable range for estimating disturbances, facilitating effective compensation during the observation process. The speed observation error and disturbance boundary conditions are input into the observer's state equation, and a state update calculation is performed to obtain the updated system state. During the state update process, the observer uses the speed observation error to correct the system state and the disturbance boundary conditions to compensate for the disturbance, achieving a more accurate estimate of the system state. The state update process is dynamic; over time, the observer continuously adjusts its estimate of the system state to ensure it remains consistent with the actual state. The updated system state also undergoes digital filtering to eliminate high-frequency noise and unnecessary fluctuations, making the system state smoother and more stable. This results in a filtered state. These filtered state variables are then combined to form the system state vector. This system state vector contains several key state components of the electric scooter, including the actual speed, motor speed, and load disturbance.The actual velocity component reflects the scooter's current speed, the motor speed component describes the motor's operating state, and the load disturbance component characterizes the impact of external loads on the system. By combining these components, the system state vector fully describes the current operating state of the electric scooter.

[0017] S5, based on the system state vector, the observer gain matrix is ​​calculated by solving the linear matrix inequality, and the outer loop speed controller and the inner loop current controller are constructed to obtain the adaptive PID control parameters; The system state vector is subjected to error dynamic modeling to obtain the error dynamic equation. This error dynamic equation describes the dynamic error evolution between the actual system state and the desired target state. Its form includes the observer gain matrix, the system state matrix, the observation matrix, and the disturbance matrix. The error dynamic equation is converted into a linear matrix inequality (LMI) form and solved to obtain the observer gain matrix. The linear matrix inequality is an optimization tool suitable for stability analysis and gain design in control systems. By converting the error dynamic equation into LMI form, system stability and controller gains are constrained, ensuring good dynamic response under various disturbances. The LMI solution process involves positive definite matrix variables and gain matrix variables. Through numerical solution, the observer gain matrix that minimizes the system error and maintains stability is determined. Pole placement is performed on the observer gain matrix to ensure system stability and fast response. This pole placement results in the system's characteristic equation, which describes the system's dynamic characteristics. Based on the system characteristic equation, adaptive gain calculation is performed on the velocity error signal to obtain the initial parameters of the velocity loop PID controller. These initial parameters, including proportional, integral, and differential gains, provide an initial control scheme for the speed controller, effectively regulating the speed error. The initial speed loop PID parameters are updated online using a sign function to obtain the outer-loop speed controller parameters. This online parameter update process includes updating the proportional, integral, and differential coefficients. During actual scooter operation, the controller gain parameters are dynamically adjusted based on the current speed error signal, enabling the PID controller to adapt to varying riding conditions. For example, during acceleration and deceleration, the controller automatically adjusts the proportional and integral coefficients to achieve smoother speed transitions, avoiding overshoot and oscillation, and ensuring stable operation of the scooter under various operating conditions. Using the outer-loop speed controller parameters as input, the motor current is transformed to obtain the d-axis and q-axis current components. The d-axis and q-axis current components represent the motor current distribution in the direct and quadrature directions, respectively. This coordinate transformation utilizes the Park transform, simplifying the complex three-phase AC current into a DC current in a two-axis coordinate system for easier control and calculation. Sliding mode control is performed on the d-axis and q-axis current components to obtain the inner-loop current controller parameters. Sliding mode control is a robust control method that maintains good control performance despite system uncertainties and disturbances. By implementing sliding mode control on the current, fast and accurate tracking of the motor current is achieved, enhancing the system's dynamic performance. The parameters of the outer-loop speed controller and the inner-loop current controller are hierarchically combined to obtain the final adaptive PID control parameters.This hierarchical combination ensures tight coupling between the speed and current loops. This allows the outer-loop speed controller to adjust the motor's reference current based on speed error, while the inner-loop current controller precisely controls the motor's drive current based on the reference current. This dual-loop architecture works in tandem, ensuring the entire control system maintains high responsiveness and stability in complex riding environments, enabling intelligent, adaptive regulation of the e-scooter's speed.

[0018] S6, inputting the adaptive PID control parameters into the PWM modulator to calculate the motor control quantity, obtaining the speed control execution instruction, and outputting the motor drive signal according to the speed control execution instruction.

[0019] Specifically, the current command in the adaptive PID control parameters is current-limited to obtain a limited current command. This current-limiting process limits the current command to within a range of plus or minus 10 times the rated current of the electric scooter motor. This effectively prevents damage to the motor and associated power electronics caused by control system malfunction or excessive current in extreme situations, thereby ensuring system safety and reliability. The limited current command is then transformed into a three-phase stationary coordinate system to obtain the three-phase current command. This is achieved using the inverse Park transform and inverse Clarke transform. The inverse Park transform converts the d-axis and q-axis current components back to a two-phase stationary coordinate system, while the inverse Clarke transform further converts the current in the two-phase stationary coordinate system into the three-phase stationary coordinate system, obtaining the three-phase current command required by the motor. This control command is converted into the actual three-phase AC current required by the motor, enabling effective motor control. The three-phase current command is then calculated using the SVPWM (space vector pulse width modulation) strategy to obtain the basic voltage vector action time series. SVPWM modulation is a motor control method that maximizes DC bus voltage utilization, improving motor efficiency and torque density. In SVPWM modulation, sector identification is performed. This involves determining the sector in which the voltage vector resides based on the current command. Vector synthesis then occurs, synthesizing the target voltage vector using adjacent basic voltage vectors. By calculating the action time of the basic voltage vectors, a time sequence is generated, which is used to determine the turn-on and turn-off times of each switch to generate the desired PWM signal. Based on the action time sequence of the basic voltage vectors, switching timing calculation is performed to determine the specific switching timings of the upper and lower bridge arms in the motor inverter. To prevent short circuits caused by simultaneous conduction of the upper and lower bridge arm switches, dead-time is inserted into the switching timings of the upper and lower bridge arms to produce dead-time-compensated PWM waveforms. Dead-time insertion creates a small time interval between switching between the upper and lower bridge arms, ensuring that the upper and lower switches in the same bridge arm are not simultaneously on, thus avoiding the risk of a DC bus short circuit. The dead-time-compensated PWM waveform is input into the MOS driver chip for level conversion to generate the drive level signal for the power transistors. The MOS driver chip converts the control signal to a level suitable for driving the MOSFET power transistor. This conversion process is critical, as the controller's output signal level is often insufficient to directly drive the power switching device. To ensure system reliability, the power transistor drive level signal is intermittently protected to produce a protected drive signal. Intermittent protection measures include overcurrent protection thresholds and overvoltage protection thresholds. These protections temporarily cut off the drive signal when the system current or voltage exceeds a set safety range, preventing device damage or system loss of control caused by excessive current or voltage. The protected drive signal is then output to the motor winding through a power amplifier circuit, forming the motor drive signal.The function of the power amplifier circuit is to amplify the drive signal to a level sufficient to drive the motor, thereby supplying power to the motor windings and generating drive torque.

[0020] In one example, the riding history data of an electric scooter is collected and filtered to obtain a time series feature matrix, including: The raw speed data collected by the speed sampler of the electric scooter is digitally low-pass filtered to obtain speed time series data; the raw acceleration data collected by the acceleration sensor of the electric scooter is Gaussian filtered to obtain acceleration time series data; the raw position data collected by the GPS module of the electric scooter is Kalman filtered to obtain position data; the raw attitude data collected by the gyroscope of the electric scooter is zero-drift error corrected using a temperature compensation model to obtain attitude data; the road environment image sequence collected by the camera of the electric scooter is image normalized to obtain a road environment image sequence; The speed time series data, acceleration time series data, position data, posture data and road environment image sequence are time synchronized to obtain a time series feature matrix.

[0021] In this example, the raw speed data collected by the speed sampler is digitally low-pass filtered to remove high-frequency noise from the signal and retain only the main low-frequency information to accurately reflect the actual speed changes of the scooter. The following filtering formula is used: ; in, Indicates the The filtered velocity data of time steps, For the The original velocity data collected in time steps, is the filter coefficient, and its value range is .coefficient Controls the smoothness of the filter, the larger the A larger value corresponds to a stronger smoothing effect, while a smaller The value retains more details of the speed change. The raw acceleration data collected by the acceleration sensor is processed to remove random noise. The Gaussian filter method is used. Gaussian filtering is a linear smoothing method that can well smooth the acceleration signal and remove sharp random noise. The formula of Gaussian filtering is: ; in, represents the filtered acceleration data, It is The raw acceleration data of sampling points, is the Gaussian weighting coefficient, which usually satisfies the Gaussian distribution: ; In the above formula, Controlling the width of the Gaussian filter determines the distribution range of the weighting coefficients. By using Gaussian filtering, smooth and accurate acceleration time series data is obtained, reducing measurement errors caused by external vibrations or environmental interference. For the original position data collected by the GPS module, since the GPS signal is easily affected by environmental factors (such as building obstruction, multipath effect, etc.), resulting in large errors in the measurement data, Kalman filtering is used to process the position data. Kalman filtering is a recursive estimation method that estimates a more accurate position state by combining the system model and measurement data. The state update equation of the Kalman filter is: ; ; in, It is in The prior state estimate at time t, is the updated state estimate, Indicates the The actual observation data at the time, is the observation matrix, is the Kalman gain, is the forecast error covariance matrix, is the covariance matrix of the observation noise. Through Kalman filtering, the difference between the GPS observation value and the predicted value is used to continuously correct the position state to obtain smoother and more accurate position data. For the original attitude data collected by the gyroscope, due to the zero drift error of the gyroscope, especially under large temperature changes, the error will significantly affect the accuracy of the attitude measurement. The original attitude data is corrected by the temperature compensation model to eliminate the influence of temperature on the measurement results. Assuming that the original attitude data is , the temperature influence function is , the corrected posture data is expressed as: ; in, It is a temperature-dependent function used to describe the variation of zero drift error with temperature. By calibrating the gyroscope, we can obtain The specific expression of is obtained, so that the posture can be effectively corrected at different temperatures and accurate posture data can be obtained. For the road environment image sequence collected by the camera, image normalization processing is performed to eliminate the impact of different lighting conditions on image quality, improve the image usability and the stability of feature extraction. Assume that the original image pixel value is , the normalized pixel value is , the normalized formula is: ; in, and are the minimum and maximum values ​​of all pixels in the image, respectively. By linearly transforming the pixel values ​​of the original image to the range of [0,1], the influence of illumination changes on the image can be effectively reduced, so that the image has consistent brightness and contrast under different illumination conditions. The speed time series data, acceleration time series data, position data, posture data and road environment image sequence are synchronized. Assume that the speed data time series is , the acceleration data time series is , the time series of location data is , the posture data time series is , the image sequence timestamp is , aligning data of different time scales to the same time axis through interpolation methods On the above, we get a unified time series feature matrix: ; in, Indicates time The temporal feature matrix at each moment includes various features such as speed, acceleration, position, posture, and image.

[0022] In one example, a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism are constructed based on the temporal feature matrix to obtain temporal feature vectors and spatial feature vectors, including: Perform a linear transformation on the time series feature matrix to obtain eight independent sets of attention head features. Each set of attention head features includes a query matrix, a key matrix, and a value matrix. Perform a scaled dot product operation on each set of attention head features to obtain the attention weight matrix, and weight the value matrix based on the attention weight matrix to obtain the temporal correlation feature; Perform feature concatenation and linear mapping on the eight sets of time series correlation features to obtain the time feature vector; The first attention branch processes the road environment image sequence features in the time series feature matrix to obtain road environment attention features. The first attention branch uses the road environment features as the query vector and the riding posture features as the key-value pairs. The second attention branch processes the riding posture features in the time series feature matrix to obtain the riding posture attention features. The second attention branch uses the riding posture features as query vectors and the road environment features as key-value pairs. The road environment attention features and riding posture attention features are spliced ​​to obtain spatial interaction features, and the spatial interaction features are linearly mapped to obtain spatial feature vectors.

[0023] In this example, a linear transformation is performed on the time series feature matrix to extract features of different dimensions and transform them into representations suitable for attention mechanism processing. Assume that the time series feature matrix is ​​represented as ,in represents the number of time steps, Represents the dimension of the feature. By performing linear transformation on the feature matrix, eight sets of independent attention head features are obtained. Each set of attention head features includes a query matrix (Query), a key matrix (Key), and a value matrix (Value). Perform three linear transformations respectively to obtain the query matrix , key matrix Sum Matrix : ; in, is the weight matrix of the linear transformation, is the corresponding bias vector, Representing the dimensions of each attention head, we get eight independent query, key, and value matrices, represented as 、 and , these matrices are used for subsequent attention calculations. A scaled dot product operation is performed on each set of attention head features to calculate the attention weight matrix. The formula for the scaled dot product operation is as follows: ; in, It is The attention weight matrix of the attention head is obtained by taking the dot product of the query matrix and the key matrix to get the degree of correlation between different time steps, and then dividing by Scaling is performed to reduce the impact of large numerical dot products on model training and prevent gradients from disappearing or exploding. The results are normalized by the softmax function to ensure that the sum of each row in the weight matrix is ​​1. Using the attention weight matrix Weight the value matrix to obtain the time series correlation features : ; in, It is The time-series correlation features of the attention heads are obtained. Through weighted summation, the features most relevant to the query position can be aggregated, so that the output of each time step contains the most relevant global information. The eight groups of time-series correlation features are concatenated, and then the final time feature vector is obtained through linear mapping. The formula for feature concatenation is: ; in, Indicates that the output features of the eight attention heads are concatenated in columns. and are the weight matrix and bias vector of the linear transformation respectively. Through linear mapping, the time feature vector Represents the multi-head attention aggregation result of the original time series features. At the same time, the road environment image sequence features and riding posture features in the time series feature matrix are processed to extract the correlation information in the spatial dimension. The road environment image sequence features are processed by the first attention branch to obtain the road environment attention features. In this attention branch, the road environment features are used as the query vector , and the riding posture features are used as key-value pairs The attention calculation formula is as follows: ; ; in, is the weight matrix of road environment attention, which represents the correlation between road environment features and riding posture features. is the road environment attention feature, which is obtained by weighted summation. Similarly, the riding posture feature is processed by the second attention branch to obtain the riding posture attention feature. The riding posture feature is used as the query vector , and the road environment features are used as key-value pairs The attention calculation formula is as follows: ; ; in, is the attention weight matrix between riding posture and road environment, It is the riding posture attention feature, which describes the relationship between riding posture and environmental information. and riding posture attention characteristics Perform feature splicing to obtain spatial interaction features. The formula for feature splicing is: ; in, This means that the road environment attention features and the riding posture attention features are concatenated in columns to obtain a spatial feature matrix containing the correlation information between the two. The concatenated spatial interaction features are linearly mapped to obtain the spatial feature vector: ; in, and It is the weight matrix and bias vector of the linear transformation. Through linear mapping, the spatial interaction features are mapped to a more compact feature space to obtain the final spatial feature vector .

[0024] In one example, the time feature vector and the spatial feature vector are input into a multi-feature fusion module for weighted fusion to obtain a fused feature vector. Based on the fused feature vector, the intention-inspired control module generates a target speed sequence, including: The time feature vector is input into the first channel attention network to calculate the feature importance and obtain the time feature weight coefficient. The first channel attention network consists of three fully connected layers. The first and second layers use the ReLU activation function, and the third layer uses the Sigmoid activation function. The spatial feature vector is input into the second channel attention network to calculate the feature importance and obtain the spatial feature weight coefficient. The structure of the second channel attention network is the same as that of the first channel attention network. Perform feature weighting processing on the time feature vector and the time feature weight coefficient to obtain weighted time features, and perform feature weighting processing on the space feature vector and the space feature weight coefficient to obtain weighted space features; The weighted temporal features and weighted spatial features are input into a three-layer fully connected neural network for feature fusion to obtain a fused feature vector. The number of nodes in the three layers of the fully connected neural network are 256, 128, and 64 respectively. The fused feature vector is input into the LSTM sequence predictor to generate the speed sequence and obtain the initial speed prediction sequence. The LSTM sequence predictor contains two layers of LSTM units, each layer contains 128 hidden nodes; The initial speed prediction sequence is input into the scene adapter for speed correction to obtain the scene constraint speed sequence, and the scene constraint speed sequence is speed smoothed to obtain the target speed sequence.

[0025] In this example, the time feature vector is input into the first channel attention network to calculate the importance of the time feature and obtain the time feature weight coefficient. The first channel attention network contains three fully connected layers. Through this network structure, the importance relationship between different time features can be effectively mined. Assume that the time feature vector is ,in represents the number of time steps, Represents the dimension of the feature. Time feature vector After the first fully connected layer, the linear transformation is performed, and the formula is as follows: ; in, is the first layer output feature matrix, is the weight matrix, is the bias term, is the dimension of the first layer's output features. The ReLU activation function is used to introduce nonlinearity, thereby improving the network's ability to learn complex feature relationships. Through the second fully connected layer: ; in, and are the weight matrix and bias term of the second layer, is the dimension of the second layer output feature. After the second layer, the output Pass through the third fully connected layer and apply the Sigmoid activation function to obtain the weight coefficient of the time feature: ; in, represents the weight coefficient of time feature, and are the weight matrix and bias term of the third layer respectively. The Sigmoid activation function limits the output to the range of [0,1] to indicate the importance of each temporal feature. Input to the second channel attention network for feature importance calculation to obtain the spatial feature weight coefficient. The structure of the second channel attention network is the same as the first channel attention network, consisting of three fully connected layers. The first two layers use the ReLU activation function, and the last layer uses the Sigmoid activation function. The specific formula is as follows: ; ; ; in, is the weight coefficient of spatial features, which indicates the importance of different spatial features in the overall feature fusion. and spatial feature weight coefficient , perform feature weighting on the time feature vector and the spatial feature vector respectively to obtain weighted time feature and weighted spatial feature. The weighted processing formula is as follows: ; in, represents the multiplication of corresponding elements (Hadamard product), is the weighted time feature, is the weighted spatial feature. Through this weighting method, the important features are effectively highlighted while the influence of unimportant features is weakened. and weighted spatial features Input into a feature fusion module containing a three-layer fully connected neural network to obtain a fused feature vector. Assume that the number of nodes in the three layers of the fully connected neural network are 256, 128, and 64 respectively, and perform the first layer full connection transformation: ; in, Indicates the splicing of temporal features and spatial features. is the weight matrix of the first layer, is the bias term. The ReLU activation function is used to improve the model's ability to fit nonlinear features. The calculations of the second and third layers are similar, respectively: ; ; in, 、 is the weight matrix and bias term of the second layer, 、 is the weight matrix and bias term of the third layer. The final fusion feature vector is , this fused feature vector contains the comprehensive information of time and space features. Input into the LSTM sequence predictor to generate the speed sequence to obtain the initial speed prediction sequence. LSTM (Long Short-Term Memory Network) is a recurrent neural network suitable for processing time series data and can capture the time dependency of data. The LSTM sequence predictor contains two layers of LSTM units, each layer contains 128 hidden nodes. Time steps, the state update formula of the first layer LSTM is as follows: ; in, and The first layer LSTM is at time step The hidden state and cell state, Represents the first layer LSTM unit. The state of the second layer LSTM is updated as follows: ; The output at each time step After a linear transformation, the initial velocity prediction value is generated : ; in, and are the weight matrix and bias term of the linear transformation, Indicates the The speed prediction value of each time step. , get the initial speed prediction sequence. The initial speed prediction sequence is input into the scene adapter for speed correction to obtain the scene constraint speed sequence. The role of the scene adapter is to make appropriate adjustments to the speed prediction according to the current riding scene (such as uphill, downhill, flat road, etc.) to ensure that the predicted speed sequence meets the requirements of the real physical scene. Let the initial speed prediction sequence be , the scene adapter is based on the scene parameters Correct the speed of each time step to get the scene constraint speed : ; in, represents the scene correction function, Contains scene information, such as slope, road friction coefficient, etc. The scene constraint speed sequence is smoothed to obtain the final target speed sequence. The purpose of speed smoothing is to reduce the sharp fluctuations in the speed sequence, thereby providing a more stable and comfortable riding experience. Suppose the scene constraint speed sequence is , target speed sequence Obtained by smoothing filtering, for example using the weighted moving average method: ; in, is the target velocity sequence at time step The value of Represents the length of the filter window, which is used to obtain the smoothed target velocity by averaging the velocity values ​​of the surrounding time steps.

[0026] In one example, a state observer is constructed for the target speed sequence to obtain a system state vector, including: The dynamic model of the electric scooter is discretized to obtain a discrete state space equation, which includes the system state matrix, control input matrix and disturbance matrix. Observability analysis is performed on the discrete state space equation to obtain the observability matrix. Based on the observability matrix, a robust extended state observer is constructed to obtain the observer state equation. The observer state equation includes the observer gain term and the disturbance compensation term. The error between the expected speed and the actual speed in the target speed sequence is calculated to obtain the speed observation error, and the boundedness of the load disturbance is analyzed to obtain the disturbance boundary condition; The speed observation error and disturbance boundary conditions are input into the observer state equation to perform state update calculation to obtain the updated system state, and the updated system state is digitally filtered to obtain the filtered state quantity; The filtered state quantities are combined to obtain a system state vector, which includes an actual speed component, a motor speed component, and a load disturbance component.

[0027] In this example, the dynamic model of an electric scooter is discretized to enable real-time control on a digital controller. The dynamic model of the electric scooter describes the state changes of the system, including factors such as position, velocity, motor speed, and control inputs. The model initially exists in a continuous form and is expressed using the state space equation: ; in, Indicates system status The time derivative, is the system state vector, is the control input, is an external disturbance, is the system state matrix, is the control input matrix, is the disturbance matrix. In order to realize control in digital system, the above continuous state space equation is discretized so as to describe the system in the form of discrete time steps. Let the sampling period be , through numerical integration (such as Euler method or Z transform, etc.), the continuous system model is converted into a discrete model. The state space equation after discretization is: ; in, Indicates in The system status at each sampling moment, Indicates the The control input at each moment, is an external disturbance, is the discrete system state matrix, and are the discrete control input matrix and the discrete disturbance matrix, which are calculated by numerical approximation methods. After obtaining the discrete state space equation, the observability of the system is analyzed to determine whether the internal state of the system can be inferred from the input and output information of the system. The observability of the discrete system is determined by constructing the observability matrix To verify, the formula is: ; in, is the output matrix of the system, describing the relationship between the system output and state. If the rank of the observable matrix is , then the system is observable, which means that the entire state of the system can be inferred through input and output data. Based on the observability matrix , a robust extended state observer is constructed to estimate the system state and resist the influence of external disturbances. The role of the extended state observer is to estimate the internal state of the system in real time by utilizing the input and output information of the system. The state equation of the extended state observer is: ; in, For the The estimated state value at the moment, is the observer gain matrix. By selecting a suitable gain matrix, the observer error is minimized. is the output of the system, is the estimated value of the disturbance. The observer gain matrix L is determined by the linear matrix inequality (LMI) solution method or the pole placement method to ensure that the system's observation error converges and has a certain robustness. The error between the expected speed and the actual speed in the target speed sequence is calculated to obtain the speed observation error. Assume that the target speed is , the actual speed is , velocity observation error for: ; Perform boundedness analysis on the load disturbance and obtain the disturbance boundary conditions. Assume that the load disturbance is , assuming that the perturbation satisfies the boundedness condition, that is: ; in, is the upper bound of the disturbance. Through boundedness analysis, a reasonable estimation range of the disturbance is provided for the observer, which enhances the observer's ability to compensate for unknown disturbances. and perturbation boundary conditions Input into the observer state equation for state update calculation to obtain the updated system state The updated state vector contains the latest estimate of the system dynamics, including speed, motor speed and other information. The updated system state is digitally filtered to obtain the filtered state quantity. Using a low-pass filter, the filtered state quantity Expressed as: ; in, is the filter coefficient, usually taken This filtering process effectively reduces the noise in the state estimation and obtains a smoother and more accurate state quantity. The filtered state quantities are combined to obtain the system state vector of the system. The system state vector contains multiple important state information of the electric scooter, including the actual speed component, the motor speed component and the load disturbance component. Assume that the system state vector is: ; in, represents the actual speed of the scooter, Indicates the motor speed, is the load disturbance.

[0028] In one example, the observer gain matrix is ​​calculated based on the system state vector by solving linear matrix inequalities, and an outer-loop speed controller and an inner-loop current controller are constructed to obtain adaptive PID control parameters, including: Perform error dynamic modeling on the system state vector to obtain the error dynamic equation, which includes the observer gain matrix, system state matrix, observation matrix and disturbance matrix; The error dynamic equation is converted into a linear matrix inequality form and solved to obtain the observer gain matrix. The linear matrix inequality contains positive definite matrix variables and gain matrix variables. Perform pole configuration on the observer gain matrix to obtain the system characteristic equation, and then perform adaptive gain calculation on the speed error signal based on the system characteristic equation to obtain the initial parameters of the speed loop PID. The initial parameters of the speed loop PID are updated online through the sign function to obtain the parameters of the outer loop speed controller. The online parameter update includes the update of the proportional coefficient, the integral coefficient and the differential coefficient. The outer loop speed controller parameters are used as input, coordinate transformation is performed on the motor current to obtain the d-axis current component and the q-axis current component, and sliding mode control calculation is performed on the d-axis current component and the q-axis current component to obtain the inner loop current controller parameters; The parameters of the outer loop speed controller and the inner loop current controller are hierarchically combined to obtain the adaptive PID control parameters.

[0029] In this example, the error dynamics modeling is performed on the system state vector to construct the error dynamics equation. The system state vector describes the current state information of the electric scooter, including variables such as speed and motor speed. Assume that the actual state of the system is , the estimated state of the observer is , the state error of the system is defined as: ; in, Indicates time To describe the dynamic behavior of the error, the original system state equation and the observer state equation are subtracted to obtain the error dynamic equation. Assume that the state equation of the system is: ; The state estimation equation of the observer is: ; in, is the observer gain matrix, is the output of the system, is the observation matrix, which describes the relationship between the output and the state. Subtracting these two equations, we get the error dynamic equation: ; In the above equation, Represents the state matrix of the error system, including the system state matrix and the observer gain matrix relationship, The influence of external disturbance on system error is analyzed and designed through the error dynamic equation, so that the error converges to zero, that is, an accurate estimation of the system state is achieved. In order to obtain a suitable observer gain matrix , the error dynamics equation is transformed into a linear matrix inequality (LMI) form for solution. LMI is used to describe the optimization problem of system stability and constraints. In order to make the error dynamics system asymptotically stable, a positive definite matrix is ​​solved and the observer gain matrix , so that the following inequality holds: ; in, is a positive definite matrix, representing the Lyapunov function of the system. By solving this LMI, we can find the appropriate gain matrix , so that the error dynamic system is stable and the error gradually converges to zero. Pole placement is performed to provide a basis for control system design. The purpose of pole placement is to select appropriate observer gains so that the closed-loop poles of the error dynamics system are located at specified positions, thereby meeting the response performance requirements of the system. Assume that the characteristic equation of the error dynamics system is: ; By configuring the poles, the closed-loop characteristic roots of the system are determined, thereby affecting the dynamic performance of the system, such as stability, response speed, etc. Based on the characteristic equation of the system, the speed error signal is adaptively calculated to obtain the initial parameters of the speed loop PID. These initial parameters include the proportional gain , integral gain and differential gain , they are initially set according to the error dynamic characteristics of the system to ensure that the controller has good response characteristics at startup. In order to adapt to different working conditions during operation, the speed loop PID initial parameters are updated online through the sign function to obtain the outer loop speed controller parameters. The online parameter update includes the adjustment of the proportional coefficient, integral coefficient and differential coefficient. The sign function is used to distinguish the sign of the error to dynamically adjust the controller gain. For example, assuming the current speed error is , judge the sign of the error through the sign function, and then adjust the PID parameters: ; ; ; in, is a sign function used to determine the sign of the error, 、 、 are the step sizes of gain adjustment respectively. In this way, adaptive adjustment of controller parameters is achieved, so that the controller can maintain good control effect under different working conditions. The outer loop speed controller parameters are used as input to perform coordinate transformation on the motor current to obtain the d-axis current component and the q-axis current component. The motor is controlled using the dq coordinate system to simplify the control process of the three-phase AC current. Assume that the three-phase current is , the three-phase current is converted to a two-phase stationary coordinate system through Clarke transformation and Park transformation ( coordinate system), and then transform to the rotated coordinate system ( Coordinate system): ; in, and are the d-axis current component and the q-axis current component, respectively. is the rotor position angle. The d-axis current is used to control the motor's magnetic field, while the q-axis current is used to control the motor's torque. Sliding mode control is performed on the d-axis and q-axis current components to obtain the inner loop current controller parameters. Sliding mode control is a robust control method that can cope with system uncertainties and external disturbances. Assume that the sliding mode surface is: ; in, and are the reference values ​​of d-axis and q-axis currents, respectively. and The sliding mode surface is designed to converge to zero by designing a suitable sliding mode control law, so that the actual current tracks the reference current. The sliding mode control law is designed as follows: ; in, and are the control inputs for the d-axis and q-axis respectively, The sliding mode gain is represented by a sign function, and the sliding mode surface is adjusted to ensure fast current tracking performance. The parameters of the outer-loop speed controller and the inner-loop current controller are hierarchically combined to obtain the adaptive PID control parameters. The outer-loop speed controller is used to control the scooter's speed to minimize speed error, while the inner-loop current controller is used to precisely control the motor current so that the torque generated by the motor meets the speed requirements of the outer loop. This dual-loop control structure enables the system to simultaneously meet the requirements of fast speed response and precise current control, thereby achieving intelligent speed regulation for the electric scooter.

[0030] In one example, the adaptive PID control parameters are input into the PWM modulator to calculate the motor control quantity, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction, including: The current command in the adaptive PID control parameter is current limited to obtain a limited current command. The current limiting process limits the current command to within a range of plus or minus 10 times the rated current of the electric scooter motor; Performing three-phase stationary coordinate system transformation on the limiting current command to obtain the three-phase current command, the three-phase stationary coordinate system transformation adopts inverse Park transformation and inverse Clarke transformation; The SVPWM modulation strategy is calculated for the three-phase current command to obtain the basic voltage vector action time series. The SVPWM modulation strategy includes sector discrimination and vector synthesis. The switching timing is calculated based on the basic voltage vector action time sequence to obtain the upper and lower bridge arm switching timings, and the dead time is inserted into the upper and lower bridge arm switching timings to obtain the PWM waveform after dead time compensation; The PWM waveform after dead-zone compensation is input into the MOS driver chip for level conversion to obtain a power tube drive level signal, and the power tube drive level signal is intermittently protected to obtain a protected drive signal. The intermittent protection includes an overcurrent protection threshold and an overvoltage protection threshold; The protected driving signal is output to the motor winding through the power amplifier circuit to obtain the motor driving signal.

[0031] In this example, the current command output by the adaptive PID controller is limited to ensure system safety and stable operation of the motor. The current command is limited to the rated current range of the electric scooter motor to avoid motor overload or damage to other power electronic devices due to excessive controller output. Assume that the rated current of the motor is , the current limit range is . Assume the current command is , current instruction after limiting Expressed as: ; Through the limiting process, the current command is ensured not to exceed the physical limit of the system, protecting the motor and other power electronic devices. The current command after limiting is transformed into a three-phase stationary coordinate system to obtain a three-phase current command. This process includes inverse Park transformation and inverse Clarke transformation. Axis and The rotating coordinate system of the axis is converted back to the two-phase stationary coordinate system , the formula used is: ; in, and They are Axis and Shaft current component, is the rotation angle of the motor rotor, and They are the current components in the two-phase stationary coordinate system. Use the inverse Clarke transformation to convert the current components in the two-phase stationary coordinate system into three-phase AC current instructions: ; in, is the three-phase current instruction. Through these two steps of coordinate transformation, the limited Axis and The shaft current command is converted into a three-phase AC current command for controlling the three-phase winding of the motor. The SVPWM (space vector pulse width modulation) modulation strategy is calculated for the three-phase current command to generate a voltage vector for driving the motor. SVPWM is an effective motor control method that converts the three-phase current command into a suitable switching control signal so that the motor can obtain the desired output. First, sector discrimination is performed, that is, the sector where the voltage vector is located is determined based on the current current command. Space vector modulation divides the space into six sectors, each sector corresponding to a different voltage vector combination. Assume that the spatial position corresponding to the current command is in the first sectors, the vector synthesis is performed through the adjacent basic voltage vectors. Assume that the basic voltage vector is The corresponding action times are , then the vector synthesis is performed using the following formula: ; in, is the reference voltage vector, is the modulation period, is the action time of the basic voltage vector, and the desired output voltage is obtained by adjusting the action time of each basic voltage vector. Based on the basic voltage vector action time sequence, the switching timing calculation is performed to obtain the switching timing of the upper and lower bridge arms. The motor drive adopts inverter control, and the desired output voltage is achieved by controlling the switching state of each bridge arm. In the switching timing calculation, it is ensured that the upper and lower tubes of the same bridge arm are not turned on at the same time to avoid the situation of DC bus short circuit. In order to ensure safety, the dead time insertion processing is performed on the switching timing of the upper and lower bridge arms to obtain the PWM waveform after dead time compensation. Assume that the dead time is , then after the upper tube is turned off, the delay Then turn on the lower tube, and vice versa, to ensure that the upper and lower tubes of the same bridge arm are not turned on at the same time. The PWM waveform after dead zone compensation is input into the MOS driver chip for level conversion to obtain the power tube drive level signal. The function of the MOS driver chip is to increase the level of the PWM control signal to a level that can drive the power MOSFET, because the logic level output by the controller is usually not enough to directly drive the power switching device. In order to ensure the safety of the system, the power tube drive level signal is intermittently protected to obtain a protected drive signal. Intermittent protection includes overcurrent protection threshold and overvoltage protection threshold. When it is detected that the current or voltage exceeds the set safety range, the drive signal will be temporarily cut off to prevent damage to the power device or system out of control. The protected drive signal is output to the three-phase winding of the motor through the power amplifier circuit to obtain the motor drive signal. The function of the power amplifier circuit is to amplify the power of the drive signal to a level sufficient to drive the motor, and to realize the rotation of the motor by controlling the current of the three-phase winding. Assume that the three-phase currents are ,These currents pass through the three-phase windings of the motor, generating a rotating magnetic field, which drives the rotor of the motor to rotate and generates power to drive the electric scooter.

[0032] Reference Figure 2 This embodiment provides an intelligent speed control device for an electric scooter, comprising: Acquisition module 1 is used to collect and filter the riding history data of the electric scooter to obtain a time series feature matrix; Processing module 2 is used to construct a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism based on the temporal feature matrix to obtain a temporal feature vector and a spatial feature vector; Fusion module 3 is used to input the time feature vector and the spatial feature vector into the multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generate a target speed sequence through the intention-inspired control module based on the fused feature vector; Construction module 4 is used to construct a state observer for the target speed sequence to obtain the system state vector; Solving module 5, for calculating the observer gain matrix by solving the linear matrix inequality based on the system state vector, and constructing the outer loop speed controller and the inner loop current controller to obtain the adaptive PID control parameters; The output module 6 is used to input the adaptive PID control parameters into the PWM modulator to calculate the motor control quantity, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction.

[0033] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0034] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, memory, display screen, input device, network interface and database connected via a system bus. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above method is implemented.

[0035] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0036] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-described method when executed by a processor. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0037] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media provided herein and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM.

[0038] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, apparatus, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, apparatus, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, apparatus, article, or method comprising the element.

[0039] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An intelligent speed control method for an electric scooter, characterized in that: The following steps are involved: The riding history data of the electric scooter is collected and filtered to obtain a time series feature matrix; Based on the time series feature matrix, a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism are constructed to obtain a temporal feature vector and a spatial feature vector; Inputting the time feature vector and the space feature vector into a multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generating a target speed sequence through an intention-inspired control module based on the fused feature vector; Constructing a state observer for the target speed sequence to obtain a system state vector; Based on the system state vector, an observer gain matrix is ​​calculated by solving a linear matrix inequality, and an outer loop speed controller and an inner loop current controller are constructed to obtain adaptive PID control parameters; The adaptive PID control parameters are input into the PWM modulator to calculate the motor control amount, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction.

2. The electric scooter intelligent speed control method according to claim 1, characterized in that: The riding history data of the electric scooter is collected and filtered to obtain a time series feature matrix, including: The original speed data collected by the speed sampler of the electric scooter is digitally low-pass filtered to obtain speed time series data; the original acceleration data collected by the acceleration sensor of the electric scooter is Gaussian filtered to obtain acceleration time series data; the original position data collected by the GPS module of the electric scooter is Kalman filtered to obtain position data; the original attitude data collected by the gyroscope of the electric scooter is zero-drift error corrected through a temperature compensation model to obtain attitude data; the road environment image sequence collected by the camera of the electric scooter is image normalized to obtain a road environment image sequence; The speed time series data, the acceleration time series data, the position data, the posture data and the road environment image sequence are time synchronized to obtain a time series feature matrix.

3. The electric scooter intelligent speed control method according to claim 2, characterized in that: The multi-head temporal self-attention mechanism and the spatial cross-attention mechanism are constructed based on the temporal feature matrix to obtain the temporal feature vector and the spatial feature vector, including: Performing a linear transformation on the time series feature matrix to obtain eight sets of independent attention head features, each set of attention head features includes a query matrix, a key matrix, and a value matrix; Performing a scaled dot product operation on each group of the attention head features to obtain an attention weight matrix, and weighting the value matrix based on the attention weight matrix to obtain a temporal correlation feature; Perform feature concatenation and linear mapping on eight groups of time series related features to obtain a time feature vector; Performing first attention branch processing on the road environment image sequence features in the time series feature matrix to obtain road environment attention features, wherein the first attention branch uses the road environment features as query vectors and riding posture features as key-value pairs; Performing a second attention branch processing on the riding posture features in the time series feature matrix to obtain a riding posture attention feature, wherein the second attention branch uses the riding posture feature as a query vector and uses the road environment feature as a key-value pair; The road environment attention feature and the riding posture attention feature are subjected to feature splicing processing to obtain a spatial interaction feature, and the spatial interaction feature is subjected to linear mapping processing to obtain a spatial feature vector.

4. The electric scooter intelligent speed control method according to claim 3, characterized in that: The step of inputting the time feature vector and the space feature vector into a multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generating a target speed sequence through an intention-inspired control module based on the fused feature vector includes: Inputting the time feature vector into the first channel attention network to calculate the feature importance and obtain the time feature weight coefficient, wherein the first channel attention network comprises three fully connected layers, the first and second layers use the ReLU activation function, and the third layer uses the Sigmoid activation function; Inputting the spatial feature vector into a second channel attention network to calculate feature importance, and obtaining a spatial feature weight coefficient, wherein the structure of the second channel attention network is the same as that of the first channel attention network; Performing feature weighting processing on the time feature vector and the time feature weight coefficient to obtain a weighted time feature, and performing feature weighting processing on the space feature vector and the space feature weight coefficient to obtain a weighted space feature; Inputting the weighted time feature and the weighted space feature into a three-layer fully connected neural network for feature fusion to obtain a fused feature vector, wherein the number of nodes in the three layers of the fully connected neural network is 256, 128, and 64 respectively; Inputting the fused feature vector into an LSTM sequence predictor to generate a speed sequence to obtain an initial speed prediction sequence, wherein the LSTM sequence predictor comprises two layers of LSTM units, each layer comprising 128 hidden nodes; The initial speed prediction sequence is input into the scene adapter for speed correction to obtain a scene constraint speed sequence, and the scene constraint speed sequence is subjected to speed smoothing to obtain a target speed sequence.

5. The electric scooter intelligent speed control method according to claim 4, characterized in that: The state observer is constructed for the target speed sequence to obtain a system state vector, including: Discretizing the dynamic model of the electric scooter to obtain a discrete state space equation, wherein the discrete state space equation includes a system state matrix, a control input matrix, and a disturbance matrix; Performing observability analysis on the discrete state space equation to obtain an observable matrix, and constructing a robust extended state observer based on the observable matrix to obtain an observer state equation, wherein the observer state equation includes an observer gain term and a disturbance compensation term; Performing error calculation on the expected speed and the actual speed in the target speed sequence to obtain the speed observation error, and performing boundedness analysis on the load disturbance to obtain the disturbance boundary condition; Inputting the speed observation error and the disturbance boundary condition into the observer state equation to perform state update calculation to obtain an updated system state, and digitally filtering the updated system state to obtain a filtered state quantity; The filtered state quantities are combined to obtain a system state vector, wherein the system state vector includes an actual speed component, a motor speed component, and a load disturbance component.

6. The electric scooter intelligent speed control method according to claim 5, characterized in that: The observer gain matrix is ​​calculated by solving the linear matrix inequality based on the system state vector, and an outer loop speed controller and an inner loop current controller are constructed to obtain adaptive PID control parameters, including: Performing error dynamic modeling on the system state vector to obtain an error dynamic equation, wherein the error dynamic equation includes an observer gain matrix, a system state matrix, an observation matrix, and a disturbance matrix; The error dynamic equation is converted into a linear matrix inequality form for solving to obtain an observer gain matrix, wherein the linear matrix inequality includes positive definite matrix variables and gain matrix variables; Performing pole configuration on the observer gain matrix to obtain a system characteristic equation, and performing adaptive gain calculation on the speed error signal based on the system characteristic equation to obtain initial parameters of the speed loop PID; The speed loop PID initial parameters are updated online through a sign function to obtain the outer loop speed controller parameters, wherein the online parameter update includes a proportional coefficient update, an integral coefficient update, and a differential coefficient update; Taking the outer loop speed controller parameters as input, performing coordinate transformation processing on the motor current to obtain a d-axis current component and a q-axis current component, and performing sliding mode control calculation on the d-axis current component and the q-axis current component to obtain an inner loop current controller parameter; The outer loop speed controller parameters and the inner loop current controller parameters are hierarchically combined to obtain adaptive PID control parameters.

7. The electric scooter intelligent speed control method according to claim 6, characterized in that: The step of inputting the adaptive PID control parameter into a PWM modulator to calculate the motor control amount, obtaining a speed control execution instruction, and outputting a motor drive signal according to the speed control execution instruction comprises: Performing current limiting on the current command in the adaptive PID control parameter to obtain a limited current command, wherein the current limiting process limits the current command to within a range of plus or minus 10 times the rated current of the electric scooter motor; Performing a three-phase stationary coordinate system transformation process on the amplitude limiting current instruction to obtain a three-phase current instruction, wherein the three-phase stationary coordinate system transformation adopts an inverse Park transformation and an inverse Clarke transformation; Performing SVPWM modulation strategy calculation on the three-phase current command to obtain a basic voltage vector action time series, wherein the SVPWM modulation strategy includes sector discrimination and vector synthesis; Performing switch timing calculation based on the basic voltage vector action time sequence to obtain upper and lower bridge arm switch timings, and performing dead time insertion processing on the upper and lower bridge arm switch timings to obtain a PWM waveform after dead time compensation; Input the dead zone compensated PWM waveform into the MOS driver chip for level conversion to obtain a power tube drive level signal, and perform intermittent protection on the power tube drive level signal to obtain a protected drive signal, wherein the intermittent protection includes an overcurrent protection threshold and an overvoltage protection threshold; The protected driving signal is output to the motor winding through a power amplifier circuit to obtain a motor driving signal.

8. An intelligent speed control device for an electric scooter, characterized in that: For implementing the steps of the method according to any one of claims 1 to 7, the device comprises: The acquisition module is used to collect and filter the riding history data of the electric scooter to obtain a time series feature matrix; A processing module, used to construct a multi-head temporal self-attention mechanism and a spatial cross-attention mechanism based on the temporal feature matrix to obtain a temporal feature vector and a spatial feature vector; A fusion module, used for inputting the time feature vector and the space feature vector into a multi-feature fusion module for weighted fusion to obtain a fused feature vector, and generating a target speed sequence through an intention-inspired control module based on the fused feature vector; A construction module, used for constructing a state observer for the target speed sequence to obtain a system state vector; A solution module is used to calculate the observer gain matrix based on the system state vector by solving the linear matrix inequality, and to construct an outer loop speed controller and an inner loop current controller to obtain adaptive PID control parameters; The output module is used to input the adaptive PID control parameters into the PWM modulator to calculate the motor control quantity, obtain the speed control execution instruction, and output the motor drive signal according to the speed control execution instruction.

9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Electric scooter speed self-adaptive control system and method

    CN116985803A

  • Vehicle motion control method, device and equipment and storage medium

    CN117533335A

  • Multi-time scale traffic flow speed prediction method based on vehicle-road cloud cooperation

    CN118447684A

  • Intelligent storage method and device based on cloud warehouse

    CN119027031A

Cited By

  • Method and system for generating navigation path of robot

    CN120008616A

  • Mining intrinsically safe digital monitoring device

    CN120302182A