Control method and device for realizing non-zero starting point s curve through dynamic planning

By constructing a non-zero starting point S-curve control dataset and dynamic programming, combined with a trapezoidal acceleration variation model, the problem of non-zero initial speed of electric vehicles was solved, achieving smoothness and improved control efficiency during the speed change process.

CN121559876APending Publication Date: 2026-02-24HUIZHOU FACTORY JECKSON ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511765420.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing S-curve control methods cannot effectively handle situations where the initial speed/acceleration of electric vehicles is non-zero and the target speed changes randomly, resulting in jerking and shocks during the speed change process. Furthermore, the computational load exceeds the carrying capacity of the embedded system, thus limiting control efficiency.

Method used

By constructing an initial control dataset for non-zero starting point S-curve control, combining a trapezoidal acceleration change model and dynamic programming, the motion stage type is determined. In the embedded system, the discrete time period reference duration is set, instantaneous parameter sequences are generated, and continuous verification and iterative adjustment are performed to ensure the real-time performance and accuracy of the control signal.

Benefits of technology

It achieves smooth and shock-free speed change in electric vehicles, improves control efficiency, adapts to the computing power of embedded systems, and avoids tracking deviations caused by computational lag and errors in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121559876A_ABST
    Figure CN121559876A_ABST
Patent Text Reader

Abstract

The invention discloses a control method and device for realizing a non-zero starting point s curve through dynamic planning. The control method comprises the following steps: acquiring the current real-time speed, the current real-time acceleration and the final target speed of a controlled object, and constructing an initial control data set; speed deviation is calculated based on the initial control data set, the sub-stage of the current motion stage type is judged, and meanwhile the theoretical duration of each sub-stage is determined; determining the cycle number of each sub-stage according to a controller, calculating a target acceleration increment, updating and generating an instantaneous parameter sequence, and carrying out continuity verification to obtain an intermediate control data set; comparing the intermediate control data set, triggering constant-speed maintenance if the intermediate control data set is smaller than an allowable threshold value, otherwise, updating the initial control data set; converting into a control signal after reaching the standard, outputting and calculating a tracking error, if the tracking error exceeds a threshold value, regenerating the control signal until reaching the standard, and outputting a final s curve control generation result. No matter how parameters are set, the ideal driving speed change effect can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of motion control technology, and more specifically, to a control method and apparatus for realizing a non-zero starting point S-curve using dynamic programming. Background Technology

[0002] In the acceleration and deceleration actions of servo systems and control systems, S-curve speed curve planning can be introduced to make the speed smoother. S-curve speed curve planning is a widely used method in industry; it is a time-optimal curve. Generally, let the upper limit of acceleration be 'a'. max The controlled object changes from its initial velocity to its target velocity, requiring the generated velocity-time curve to be optimal under these conditions. For the control of typical electric vehicles, an adjustable speed change curve is needed to ensure smooth and controllable speed changes for different users or vehicle models, necessitating S-curve speed curve planning. Currently, several S-curve control methods have been proposed, mostly targeting non-zero starting point scenarios. These methods construct complex three-dimensional kinematic models to solve for velocity and acceleration sequences, and then optimize parameters through real-time iteration. However, existing methods cannot handle situations where the initial velocity / acceleration is non-zero and the target velocity changes randomly during electric vehicle operation, easily leading to stuttering and jerking during speed changes. Furthermore, the need for real-time solving of multivariable equations and iterative parameter adjustments results in a computational load far exceeding the capacity of embedded systems. This not only causes lag in control command feedback but may also lead to speed tracking deviations due to calculation errors, thus limiting the control efficiency of the S-curve. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a dynamic programming method for controlling a non-zero starting point s-curve, comprising the following steps: Step S1: Obtain the current operating status data and target control parameters corresponding to the controlled object, wherein the current operating status data includes the current real-time speed. Current real-time acceleration The target control parameters include the final target speed input by the user through the speed control device. Based on the current real-time speed Current real-time acceleration With the final target speed Construct an initial control dataset for s-curve control with a non-zero starting point; Step S2: Calculate the speed deviation based on the initial control dataset. And based on the speed deviation The motion phase type is determined, and the corresponding trapezoidal acceleration change model is invoked. The core parameters include the first acceleration change rate for each sub-phase. Maximum acceleration threshold and the second rate of change of acceleration Based on the final state constraint that the acceleration is 0 when the final target speed is reached, the current motion stage type and sub-stage are determined by combining the core parameters, and the theoretical duration of each sub-stage is determined. Step S3: Set the discrete-time period reference duration according to the computing power of the controller, and determine the number of sub-stage periods by combining the theoretical duration of each sub-stage; calculate the target acceleration increment based on the parameters of the sub-stage within each sub-stage period, and update the current real-time velocity and current real-time acceleration within each sub-stage period based on the target acceleration increment to generate an instantaneous parameter sequence, including instantaneous velocity and instantaneous acceleration; perform continuity verification on the instantaneous parameter sequence to obtain an intermediate control dataset; Step S4: Compare the instantaneous velocity in the intermediate control dataset with the final target velocity. If the deviation is less than or equal to the allowable threshold, trigger constant velocity maintenance. Otherwise, update the initial control dataset with the current instantaneous parameter sequence and return to step S2 iteration. Convert the qualified instantaneous parameter sequence into a control signal output that the drive device can recognize. Collect the actual velocity and acceleration of the drive feedback in real time, calculate the tracking error. If the tracking error exceeds the threshold, adjust the sub-stage parameters and regenerate the control signal until the tracking error meets the standard, thereby outputting the final S-curve control generation result.

[0004] Furthermore, the present invention also provides a control device for realizing a non-zero starting point s-curve using dynamic programming, including a speed controller, a controller, a drive device, and a speed control algorithm stored on the controller and capable of running on the drive device, for executing the control method for realizing a non-zero starting point s-curve using dynamic programming as described above.

[0005] The beneficial effects of this application are as follows: By integrating core data with a non-zero starting point to construct an initial control dataset, it solves the problems of traditional S-curve control neglecting the non-zero initial state during the dynamic driving of electric vehicles and exhibiting poor adaptability. The current real-time speed and acceleration directly capture the instantaneous motion state of the controlled object, avoiding the initial parameter mismatch caused by the default "zero starting point" in traditional methods. The final target speed aligns with user input requirements, ensuring that the control direction matches the driving intention. Figure 1Secondly, by quantifying the gap between the current state and the target through speed deviation, the type of motion phase (acceleration, deceleration, uniform transition) can be determined, avoiding the blindness of traditional phase division relying on experience; by calling the trapezoidal acceleration change model and clarifying the core parameters, the synergistic effect of the first acceleration change rate, the maximum acceleration threshold, and the second acceleration change rate ensures a smooth acceleration transition and avoids the shock caused by sudden increases or decreases; based on the final state constraint of dynamic programming (acceleration is 0 when the target speed is reached), the current sub-phase (e.g., acceleration-acceleration, uniform acceleration, and deceleration in the acceleration phase) is determined and the theoretical duration is calculated, making the transition of each phase more in line with the laws of motion mechanics. The generated sub-phase duration provides a clear time reference for subsequent parameter updates, avoiding the discontinuous speed changes caused by phase confusion in traditional real-time iteration, thus adapting to the computing power of embedded systems. Then, by setting the discrete-time period reference duration according to the controller's computing power, the parameter update frequency is ensured to match the hardware performance. The number of periods is determined based on the sub-stage duration, and the instantaneous velocity and acceleration are updated incrementally in conjunction with the target acceleration. The calculation process only involves simple incremental operations, eliminating the need to solve complex equations and significantly reducing the computational load. Continuity verification ensures that the instantaneous parameter sequence has no abrupt changes, avoiding velocity / acceleration jumps caused by period division, further ensuring smooth speed change, and enabling S-curve control to operate efficiently in embedded systems, avoiding control command feedback lag. Finally, by comparing the instantaneous velocity with the target velocity, if the deviation meets the standard, uniform speed maintenance is triggered; if not, the initial dataset is iteratively updated, avoiding the inability to correct deviations caused by traditional one-time parameter output. The qualified parameter sequence is converted into a control signal recognizable by the drive device, reducing signal conversion delay and ensuring rapid command execution. Real-time acquisition of the actual velocity and acceleration feedback from the drive, calculation of tracking errors, and dynamic adjustment of sub-stage parameters can promptly correct hardware execution deviations, avoiding the shortcomings of traditional open-loop control in handling execution errors. Compared to traditional methods that suffer from tracking deviations due to computational lag or errors, this step, through closed-loop iteration and feedback adjustment, ensures the real-time performance of control commands and dynamically corrects execution errors. Ultimately, it achieves smooth and shock-free speed changes in electric vehicles while accurately tracking the target speed, thereby significantly improving the efficiency of S-curve control. Attached Figure Description

[0006] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the dynamic programming control method for implementing a non-zero starting point s-curve in this embodiment; Figure 2 This is a flowchart illustrating the S-curve speed change algorithm in this embodiment; Figure 3This is a schematic diagram of the speed change process of the initial state s-curve during the acceleration phase in this embodiment. Figure 4 This is a schematic diagram comparing different rates of change of acceleration in the first stage in this embodiment; Figure 5 This is a schematic diagram of the control device for implementing a non-zero starting point s-curve using dynamic programming in this embodiment. Detailed Implementation

[0007] The following drawings disclose several embodiments of the present invention. For clarity, many practical details will be described in the following description. However, it should be understood that these practical details are not intended to limit the invention. That is, in some embodiments of the invention, these practical details are not essential. Furthermore, for the sake of simplicity, some conventional structures and components will be shown in the drawings in a simple schematic manner.

[0008] To further understand the invention's content, features, and effects, the following embodiments are provided, and detailed descriptions are given below in conjunction with the accompanying drawings: Reference Figure 1 , Figure 1 This is a flowchart illustrating the dynamic programming method for controlling a non-zero starting point s-curve in this embodiment. The dynamic programming method for controlling a non-zero starting point s-curve in this embodiment includes the following steps: Step S1: Obtain the current operating status data and target control parameters corresponding to the controlled object, wherein the current operating status data includes the current real-time speed. Current real-time acceleration The target control parameters include the final target speed input by the user through the speed control device. Based on the current real-time speed Current real-time acceleration With the final target speed Construct an initial control dataset for s-curve control with a non-zero starting point; In this embodiment of the invention, the current real-time speed of the controlled object (electric vehicle) is collected by a speed sensor. The sensor is mounted on the end of the wheel axle, outputting 60 pulses per revolution and counting 12 pulses within 100ms. The wheel circumference is 0.25m. The conversion formula is... = (12 ÷ 60) × (1 ÷ 0.1 s) × 0.25 m = 0.5 m / s. The current real-time acceleration is collected by an accelerometer. The sensor outputs a 0-3.3V analog signal, which is converted to a digital value of 2293 by a 12-bit analog-to-digital converter. The conversion formula is as follows: = (2293 ÷ 4095) × 4 m / s 2 -2m / s2 =0.24m / s 2 The user inputs the final target speed via the throttle (speed control device). The throttle signal is filtered by an RC filter (1kΩ resistor, 10μF capacitor) and converted from analog to digital. The digital value corresponds to 2457. = (2457 ÷ 4095) × 5 m / s = 3 m / s. Construct the initial control dataset, containing... =0.5m / s =0.24m / s 2 , =3m / s, with the data collection timestamp and data unit m / s, m / s 2 .

[0009] Step S2: Calculate the speed deviation based on the initial control dataset. And based on the speed deviation The motion phase type is determined, and the corresponding trapezoidal acceleration change model is invoked. The core parameters include the first acceleration change rate for each sub-phase. Maximum acceleration threshold and the second rate of change of acceleration Based on the final state constraint that the acceleration is 0 when the final target speed is reached, the current motion stage type and sub-stage are determined by combining the core parameters, and the theoretical duration of each sub-stage is determined. In this embodiment of the invention, the speed deviation is calculated. =3m / s - 0.5m / s = 2.5m / s, A value greater than 0 indicates the acceleration phase; the positive trapezoidal acceleration model is invoked, with the core parameter set to the first rate of change of acceleration. =0.4m / s 3 Maximum acceleration threshold =1.2m / s 2 Second rate of change of acceleration =0.3m / s 3 Based on the final state constraint of dynamic programming (the velocity reaches the target value when the acceleration decreases to 0), the critical conditions for the deceleration sub-stage are derived. = (0.24) 2 / (2×0.3)=0.096m / s. Current =2.5m / s>0.096m / s and =0.24m / s 2 < =1.2m / s 2 The current stage is determined to be acceleration sub-phase. The theoretical duration of each sub-phase is determined: Acceleration duration = =(1.2-0.24) / 0.4=2.4s; Remaining velocity difference during uniform acceleration phase = 3m / s - (0.5+0.5×0.4×2.4) 2 +0.24×2.4)=3-2.228=0.772m / s, uniform acceleration time=0.772 / 1.2≈0.64s; deceleration time= =1.2 / 0.3=4s.

[0010] Step S3: Set the discrete-time period reference duration according to the computing power of the controller, and determine the number of sub-stage periods by combining the theoretical duration of each sub-stage; calculate the target acceleration increment based on the parameters of the sub-stage within each sub-stage period, and update the current real-time velocity and current real-time acceleration within each sub-stage period based on the target acceleration increment to generate an instantaneous parameter sequence, including instantaneous velocity and instantaneous acceleration; perform continuity verification on the instantaneous parameter sequence to obtain an intermediate control dataset; In this embodiment of the invention, the controller has a processing capacity of 800 instructions per second, and the discrete time period base duration is set to T = 0.05s. The number of cycles in each sub-stage is calculated as follows: acceleration cycles = 2.4s ÷ 0.05s = 48, uniform acceleration cycles = 0.64s ÷ 0.05s ≈ 13 (rounded up), deceleration cycles = 4s ÷ 0.05s = 80. The first cycle (acceleration sub-stage) is initialized with an initial velocity of 0.5m / s and an initial acceleration of 0.24m / s². 2 Target acceleration increment = ×T=0.4×0.05=0.02m / s 2 Instantaneous acceleration = 0.24 + 0.02 = 0.26 m / s² 2 The instantaneous velocity = 0.5 + 0.26 × 0.05 = 0.513 m / s. Following this logical iteration, the instantaneous acceleration in the 48th cycle of the acceleration phase is 1.2 m / s². 2 The instantaneous velocity is 2.228 m / s; the instantaneous velocity in the 61st cycle of the uniform acceleration phase is 2.996 m / s; the instantaneous velocity in the 141st cycle of the deceleration phase is 3.0 m / s, and the acceleration is 0. Verification of the instantaneous parameter sequence shows that the acceleration change between adjacent cycles in the acceleration phase is fixed at 0.02 m / s². 2 The velocity change is 0.013-0.024 m / s, which meets the continuity requirement and forms an intermediate control dataset.

[0011] Step S4: Compare the instantaneous velocity in the intermediate control dataset with the final target velocity. If the deviation is less than or equal to the allowable threshold, trigger constant velocity maintenance. Otherwise, update the initial control dataset with the current instantaneous parameter sequence and return to step S2 iteration. Convert the qualified instantaneous parameter sequence into a control signal output that the drive device can recognize. Collect the actual velocity and acceleration of the drive feedback in real time, calculate the tracking error. If the tracking error exceeds the threshold, adjust the sub-stage parameters and regenerate the control signal until the tracking error meets the standard, thereby outputting the final S-curve control generation result.

[0012] In this embodiment of the invention, by setting a speed deviation allowable threshold of 0.02 m / s, and comparing the instantaneous speed of the intermediate control dataset, the instantaneous speed in the 70th cycle is 3.018 m / s. The deviation is 0.018 m / s ≤ 0.02 m / s, triggering constant speed maintenance. In subsequent cycles, the instantaneous speed is fixed at 3.0 m / s and the acceleration is 0. The instantaneous speed sequence is converted into a PWM control signal, with the mapping relationship as follows: 0 m / s corresponds to a 10% duty cycle, 3 m / s corresponds to a 60% duty cycle, 0.5 m / s corresponds to an 18.33% duty cycle, and 3.0 m / s corresponds to a 60% duty cycle. The controller outputs PWM signals to drive the motor at a cycle of 0.05 s. Real-time feedback data is collected; in the first cycle, the actual speed is 0.49 m / s and the actual acceleration is 0.23 m / s. 2 Calculate the tracking error: velocity error ≤ 0.03m / s (threshold), acceleration error ≤ 0.03m / s. 2 >0.02m / s 2 (Threshold). Adjustment up to 0.38m / s 3 The sub-phase duration (acceleration duration 2.53s, number of cycles 51) and instantaneous parameter sequence were recalculated. The instantaneous acceleration in the first cycle was 0.259m / s². 2 The actual acceleration reported was 0.25 m / s². 2 Error 0.009m / s 2 ≤0.02m / s 2 Once all periodic errors meet the standards, the final control result is output, including the PWM duty cycle sequence, sub-stage parameters, and feedback error data.

[0013] Furthermore, step S1 includes the following steps: Step S11: Receive the target control signal transmitted by the speed controller in real time through the signal acquisition module corresponding to the controller, and perform filtering and decoding processing on the target control signal to extract the final target speed input by the user. ; In this embodiment of the invention, the signal acquisition module of the controller receives a voltage-type target control signal in real time through the signal transmission line of the throttle (speed control device). The signal range of 0-5V corresponds to a target speed of 0-5m / s. An RC low-pass filter circuit is used to filter the signal, with a resistor of 1kΩ, a capacitor of 10μF, and a cutoff frequency of 15.9Hz, to eliminate high-frequency interference caused by throttle operation jitter. The filtered signal is decoded by the controller's built-in analog-to-digital converter module, with a conversion accuracy of 12 bits and a reference voltage of 5V. The decoding formula is the final target speed. = (Converted digital value ÷ 4095) × 5 m / s. When the converted digital value is 2457, the calculation is... = (2457 ÷ 4095) × 5 = 3 m / s, extract this value as the final target speed input by the user.

[0014] Step S12: Connect the corresponding sensor module through the controller to collect the current operating status signal of the controlled object. The current operating status signal includes the speed pulse signal output by the speed sensor and the acceleration analog signal output by the acceleration sensor. In this embodiment of the invention, the controller connects to the sensor module via an SPI communication interface. The speed sensor is installed at the end of the wheel axle of the controlled object (electric vehicle), outputting 60 pulse signals per revolution. The acceleration sensor is fixed at the center of gravity of the vehicle body, outputting an analog signal of 0-3.3V, corresponding to an acceleration range of -2m / s². 2 Up to 2m / s 2 Two signals are acquired synchronously at 50ms intervals. The pulse signal from the speed sensor is received through the controller's counter module, while the analog signal from the accelerometer is received through another analog-to-digital conversion channel, ensuring the synchronization and real-time nature of the current operating status signal acquisition.

[0015] Step S13: Count and convert the velocity pulse signals to convert the number of pulses corresponding to the velocity pulse signals into the corresponding current real-time velocity. The analog acceleration signal is subjected to analog-to-digital conversion and noise suppression processing to obtain the current real-time acceleration. To complete the collection and preprocessing of current operating status data; In this embodiment of the invention, when processing the speed pulse signal, the controller counter module counts 12 pulses received within 100ms. The measured wheel circumference is 0.25m, and the conversion formula is the current real-time speed. = (Number of pulses ÷ 60) × (1 ÷ 0.1s) × 0.25m = (12 ÷ 60) × 10 × 0.25 = 0.5m / s. When processing the analog acceleration signal, the analog-to-digital converter (ADC) obtains a digital value of 2293 (12-bit precision, 3.3V reference voltage, where the voltage at the input pin measured by the ADC is V_out (1.848V). Then, it calculates which quantization level it falls into. The theoretical digital value D_theory = (V_out / V_ref) * (2^12 - 1) = (1.848V / 3.3V) * 4095 ≈ 0.56 * 4095 ≈ 2293.2). The conversion formula is: original acceleration value = (digital value ÷ 4095) × 4m / s. 2 -2m / s 2 =(2293÷4095)×4-2≈0.24m / s 2 Noise is suppressed using a moving average filtering method. The original acceleration values ​​over five consecutive cycles are averaged to obtain the current real-time acceleration. =0.24m / s 2 Complete data preprocessing.

[0016] Step S14: Construct an initial control data table to determine the final target speed Current real-time speed With current real-time acceleration Fill in the initial control data table and label the acquisition timestamp and data unit corresponding to each parameter to obtain the initial control dataset containing state parameters and target parameters; In this embodiment of the invention, an initial control data table is constructed, containing four columns: "Parameter Type," "Parameter Value," "Acquisition Timestamp," and "Data Unit." The final target velocity is 3 m / s, the current real-time velocity is 0.5 m / s, and the current real-time acceleration is 0.24 m / s². 2 Enter the corresponding "Parameter Values" in the columns, and record the timestamp as the current system time (accurate to milliseconds). The data units are labeled as m / s, m / s, m / s respectively. 2 The tables are sorted according to the order of parameter acquisition, clearly distinguishing between state parameters (current real-time velocity and acceleration) and target parameters (final target velocity), forming a structured initial control dataset.

[0017] Step S15: Verify the validity of each parameter in the initial control dataset to determine the current real-time speed. Current real-time acceleration If the data is within the preset physical reasonable range, a data anomaly alarm will be triggered and historical valid values ​​will be used as replacements; if the data is within the physical reasonable range, the initial control dataset will be confirmed as valid.

[0018] In this embodiment of the invention, a preset physical reasonable range is used: current real-time velocity 0-4 m / s (maximum design velocity of the controlled object), current real-time acceleration -1.5 m / s². 2 up to 1.5m / s 2 (Human comfort acceleration limit). Parameter verification of the initial control dataset: current real-time velocity of 0.5 m / s is within the range of 0-4 m / s, and current real-time acceleration is 0.24 m / s². 2 At -1.5m / s 2 up to 1.5m / s 2 Within the specified range, the parameters are deemed valid, and the initial control dataset is confirmed to be usable. If the current real-time velocity is 4.5 m / s (exceeding the upper limit), a data anomaly alarm is triggered, and the most recently valid velocity value of 0.48 m / s from the storage module is used as a replacement; if the acceleration is 1.6 m / s... 2 (If the limit is exceeded), then the historical effective value of 0.23 m / s will be used. 2 The alternative ensures that the dataset always conforms to the laws of physical operation.

[0019] Furthermore, step S2 includes the following steps: Step S21: Calculate the current real-time velocity in the initial control dataset. Current real-time acceleration With the final target speed Perform difference analysis to calculate speed deviation. ; In this embodiment of the invention, three sets of core parameters are extracted from the initial control dataset, each labeled with a collection timestamp and data source: current real-time speed. =0.5m / s (collected by the speed sensor at the wheel axle end, converted by pulse counting; 12 pulses within 100ms; wheel circumference 0.25m; conversion formula is...) = (12 ÷ 60) × (1 ÷ 0.1) × 0.25); Current real-time acceleration =0.24m / s 2 (Data collected by the vehicle's acceleration sensor; analog signals are processed through analog-to-digital conversion and moving average filtering); final target speed =3m / s (input by the user via throttle, filtered by RC and decoded by analog-to-digital converter; 0-5V voltage corresponds to 0-5m / s speed, decoded digital value 2457 corresponds to 3m / s). Speed ​​deviation is calculated strictly according to the definition. =3m / s - 0.5m / s = 2.5m / s. Keep two decimal places to clarify the required speed increase and provide a quantitative basis for subsequent stage judgments.

[0020] Step S22: Based on speed deviation Determine the current motion stage type of the controlled object to obtain an initial stage determination result, wherein, when the speed deviation... When the speed deviation is determined to be in the acceleration phase; When the speed is determined to be in the constant speed maintenance phase; when the speed deviation... This is considered the deceleration phase. In this embodiment of the invention, a speed deviation threshold determined by a set stage is set to 0 (a non-zero deviation triggers speed change, while a zero deviation maintains constant speed), based on the speed deviation... The numerical sign determines the motion phase type: current =2.5m / s>0, indicating an acceleration phase; if the initial control data is concentrated... =0.3m / s =0.5m / s, calculated as follows =-0.2m / s<0, then it is determined to be the deceleration phase; if =0.5m / s =0.5m / s, If the deviation value is 0, it is determined to be in the constant speed maintenance phase. All determination processes are directly based on the deviation sign, without the need for additional complex calculations, which is suitable for the fast response requirements of embedded systems. The determination results are stored as text labels such as "acceleration phase", "deceleration phase" and "constant speed maintenance phase", and are associated with the corresponding deviation values ​​and calculation processes.

[0021] Step S23: Based on the motion stage identifier corresponding to the initial stage determination result, call the corresponding trapezoidal acceleration change model. Specifically, the positive trapezoidal acceleration model is called during the acceleration stage, the negative trapezoidal acceleration model is called during the deceleration stage, and the zero acceleration maintenance model is called during the uniform velocity maintenance stage. The positive sub-stage control parameters corresponding to the positive trapezoidal acceleration model include the first acceleration change rate corresponding to the acceleration sub-stage. The maximum acceleration threshold corresponding to the uniform accelerator stage and the second rate of change of acceleration corresponding to the deceleration sub-stage For the deceleration phase, the first rate of change of acceleration Maximum acceleration threshold and the second rate of change of acceleration Taking the negative value yields the negative sub-stage control parameters; In this embodiment of the invention, a preset positive trapezoidal acceleration model is invoked based on the initial stage determination result "acceleration stage". This model is stored in the controller's flash memory and includes positive sub-stage control parameters: the first acceleration change rate of the acceleration sub-stage. =0.4m / s 3 (Corresponding to the slope of the left side of the aT image, optimized through real vehicle testing to ensure smooth start-up), maximum acceleration threshold for the uniform acceleration sub-stage. =1.2m / s2 (Corresponding to the trapezoidal height of the aT image, which conforms to the human comfort acceleration limit), the rate of change of the second acceleration in the deceleration sub-stage. =0.3m / s 3 (Corresponding to the slope of the right oblique side of the aT image, ensuring a smooth deceleration). If the stage determination result is "deceleration stage" (e.g.) If the positive parameters are -0.2 m / s, then the negative trapezoidal acceleration model is invoked, and the negative sub-stage control parameters are obtained by taking the negative of the positive parameters: =-0.4m / s 3 , =-1.2m / s 2 , =-0.3m / s 3 To accommodate the decreasing speed requirement, if it is a "uniform speed maintenance phase", the zero acceleration maintenance model is called, and all sub-phase control parameters are set to 0 to ensure speed stability. The model call is implemented through the controller's internal functions, and the extracted parameters are directly passed to the subsequent sub-phase duration calculation module.

[0022] Step S24: Taking the acceleration phase as an example, obtain the final state constraint of the variable speed process where the acceleration is 0 when the final target speed is reached through dynamic programming; based on the final state constraint of the variable speed process corresponding to the acceleration phase and combined with the control parameters of the forward sub-phase, determine the critical conditions corresponding to the deceleration sub-phase. Then, based on the critical conditions, the corresponding uniform acceleration sub-stage and acceleration sub-stage are deduced in reverse, and the motion parameters at the corresponding time of each sub-stage are determined. Similarly, during the deceleration stage, the corresponding sub-stages are determined based on the negative sub-stage control parameters, so as to determine the sub-stage of the current motion stage type. In this embodiment of the invention, taking the acceleration phase as an example, the final state constraint of the speed change process is defined as "reaching the final target speed". "Acceleration is 0 at 3 m / s²", based on dynamic programming recursive logic (deriving the initial state from the final state), the critical conditions for the deceleration sub-stage are determined first. The current real-time acceleration is known. =0.24m / s 2 Current real-time speed =0.5m / s, the second acceleration change rate in the positive sub-stage control parameters =0.3m / s 3 Based on the area of ​​the triangle formed by the right hypotenuse of the aT curve and the time axis (corresponding to the velocity increment), we deduce that the base of the triangle represents the deceleration / acceleration time. =0.24 / 0.3=0.8s, area =0.096m / s, this area is the critical velocity difference, therefore the critical condition is... =0.096m / s. Based on this critical condition, determine the current sub-stage: Calculate =3-0.5=2.5m / s>0.096m / s, and the current real-time acceleration =0.24m / s 2 Maximum acceleration threshold =1.2m / s 2 It is determined that the current stage is the accelerator phase; if a certain period =0.08m / s < 0.096m / s, determined to be a deceleration sub-stage; if =1.2m / s 2 and =0.8m / s > 0.096m / s, therefore it is determined to be a uniformly accelerated sub-stage. For the deceleration stage (such as...) =0.3m / s =0.5m / s), using negative sub-stage control parameters ( =-0.4m / s 3 , =-1.2m / s 2 , =-0.3m / s 3 The critical condition becomes ,when =0.2m / s>0.096m / s and =0.24m / s 2 < This is determined to be a deceleration sub-stage (negative acceleration).

[0023] Step S25: Determine the theoretical duration of each sub-stage based on the parameters corresponding to the sub-stage of the current motion stage type, wherein the parameters include motion parameters and control parameters for each sub-stage.

[0024] In this embodiment of the invention, based on the current acceleration sub-phase and combined with motion parameters ( =0.24m / s 2 , =0.5m / s) and sub-stage control parameters ( =0.4m / s 3 , =1.2m / s 2 ) Calculate the theoretical duration. First, calculate the acceleration compensation amount = =1.2-0.24=0.96m / s 2 The theoretical duration of the acceleration sub-phase = acceleration fill-in amount / =0.96 / 0.4=2.4s. After entering the uniform accelerator phase, the motion parameters are... =1.2m / s 2 , =0.5+0.5× ×(2.4) 2 + ×2.4=0.5+0.5×0.4×5.76+0.24×2.4=2.228m / s, Remaining velocity difference=3-2.228=0.772m / s, Theoretical duration of uniformly accelerated sub-stage=Remaining velocity difference / =0.772 / 1.2≈0.64s. After entering the deceleration phase, the motion parameters are... =1.2m / s 2 , =2.228 + 1.2 × 0.64 ≈ 2.996 m / s, remaining velocity difference = 3 - 2.996 = 0.004 m / s, theoretical duration of deceleration sub-phase = =1.2 / 0.3=4s (Because the remaining velocity difference is extremely small, the actual duration is calculated based on reducing the acceleration to 0). If the current phase is a deceleration sub-phase (e.g.) =0.8m / s 2 , =2.9m / s), theoretical duration = =0.8 / 0.3≈2.67s, during which the velocity increment = 0.5× × =0.5×0.8×2.67≈1.07m / s, which just makes +1.07≈3m / s, which meets the final state constraint.

[0025] Furthermore, the determination of each sub-stage corresponding to the acceleration phase in step S24, and the determination of the motion parameters at the corresponding time of each sub-stage, includes the following steps: Step S2401: Based on the final state constraints of the acceleration phase corresponding to the variable speed process, and by introducing the recursive logic of dynamic programming, the starting conditions corresponding to the deceleration sub-phase are derived first. Specifically, let the current real-time acceleration be... If the deceleration sub-phase starts from the current moment until the acceleration drops to 0, the area of ​​the triangle formed by the right hypotenuse of the acceleration-time curve in the positive trapezoidal acceleration model and the time axis, combined with the second rate of change of acceleration in the control parameters of the positive sub-phase, is used. The specific critical conditions for determining the relationship between the uniform acceleration sub-stage and the deceleration sub-stage are as follows: ; In this embodiment of the invention, based on the idea of ​​dynamic programming, the core concept is to derive large-scale scenarios from small-scale cases using recursive formulas. For acceleration, uniform acceleration, and deceleration processes, the final stage is to reach a certain uniform speed. Therefore, the last time period must be deceleration, thus belonging to the third stage. Although this time period is the last in time, it is the smallest in scale. Conversely, the earlier or middle the time point, the more time and the larger and more complex the subsequent planning needs to be; that is, the earlier the time point, the more complex it is. Therefore, for the entire S-curve acceleration process, the third stage must exist, and the starting and ending positions must be identified first in the analysis and judgment. As mentioned above, the final acceleration result is that the speed equals the target speed input by the user, that is, the speed difference between the target speed and the actual speed is 0, and the acceleration is also 0. Given the parameters, the velocity increment generated during the final state constraint of the acceleration process, corresponding to "decelerating from the current instant until the acceleration becomes zero," can be calculated. Let the current velocity and acceleration be... , Suppose that the deceleration starts from the current instant and continues until the acceleration reaches zero. The time for this process is... If we now enter the third segment of the trapezoidal acceleration change, then according to the concept of integration, the area in the aT graph represents the magnitude of the velocity change, i.e.: (1) Based on the parameter definition and the image, we have: (2), the transformation of (2) is: (3), Substituting equation (3) into the definition of differential velocity (1), we get: (4) Ideally, when the acceleration becomes 0, the velocity should just become the final target value determined by the user input. Therefore, the critical conditions for the second and third segments of the aT function curve are: (5); It was then discovered that once the start and end positions of the third stage were determined, and considering the only three variable acceleration stages in the classic S-curve model, the discontinuities of the first and second stages were easily identified. Therefore, the speed-changing method during acceleration could be determined: In a practical embedded system, based on the input from the vehicle driver, i.e., the final target, the target speed at the current moment is given at short intervals T, and the motor speed is adjusted according to the target value at the current moment for subsequent control. It refers to the target speed at the current moment. Under the premise that, when At that time, the acceleration should be in accordance with the time interval T. For the rate of change to increase, if the acceleration has already increased to Then maintain acceleration Unchanged; when At that time, acceleration according to It begins to decrease. When At that time, let the acceleration first Press to start decreasing; when the target speed is reached, the acceleration is not yet 0. At this point, you can continue to increase the acceleration. The acceleration is reduced until it reaches zero, at which point the current velocity is greater than the target velocity, and finally, the process switches to deceleration. For example, given the current real-time acceleration... =0.24m / s 2 The rate of change of the second acceleration in the positive trapezoidal acceleration model =0.3m / s 3 Ultimate target speed =3m / s, current real-time speed =0.5 m / s. Based on the final-state constraint of the acceleration phase (the velocity reaches the target value when the acceleration decreases to 0), the critical condition is derived using the area of ​​the triangle formed by the right hypotenuse of the aT curve (deceleration phase) and the time axis (corresponding to the velocity increment). Triangle area = 0.5 × base (time...) ) × height (current acceleration) ),and → Substituting into the area formula yields the velocity increment. Substituting into the calculation, we get... =0.096m / s, the critical condition expression is: =0.096m / s, meaning that when the speed difference between the target and the current speed is equal to 0.096m / s, the deceleration sub-stage needs to be initiated.

[0026] Step S2402: Based on critical conditions And combined with the maximum acceleration threshold Determine the sub-stages corresponding to this acceleration phase, where if a judgment is made... If not, then the current moment is determined to be in the deceleration sub-phase, and the acceleration at the next moment will be... Otherwise, judge If not, then it is determined that the current time is in the uniform accelerator stage and Otherwise, it is determined that the current moment is in the acceleration sub-phase and ; In this embodiment of the invention, by setting the discrete time period T=0.05s, the maximum acceleration threshold is... =1.2m / s 2 The first rate of change of acceleration =0.4m / s 3 First, determine Is 3 - 0.5 = 2.5 m / s greater than 0.096 m / s? The result is yes; then determine... =0.24m / s2 Is it less than =1.2m / s 2 The result is that the current moment is determined to be in the acceleration sub-phase, and the acceleration at the next moment is... =0.24 + 0.4 × 0.05 = 0.26 m / s 2 If a certain period =1.2m / s 2 (equal ), =0.8m / s (greater than 0.096m / s), then determine No, it is definitely in the uniform accelerometer stage. =1.2m / s 2 If a certain period =0.08m / s (less than 0.096m / s), then determine If not, determine whether it is in the deceleration / acceleration sub-phase. =1.2 - 0.3 × 0.05 = 1.185 m / s 2 (like Figure 2 (As shown).

[0027] Step S2403: Based on the acceleration at the next moment Determine the velocity at the next moment. This allows for iterative calculation of the acceleration and velocity at each moment corresponding to the current acceleration phase in each sub-phase.

[0028] In this embodiment of the invention, the acceleration is based on the acceleration at the next moment of the acceleration sub-stage. =0.26m / s 2 Current real-time speed =0.5m / s, according to the formula Calculation yields =0.5 + 0.26 × 0.05 = 0.5 + 0.013 = 0.513 m / s. Proceed to the next iteration: =0.26m / s 2 , =0.513m / s, =2.487m / s>0.096m / s, <1.2m / s 2 It is still in the accelerator phase. =0.26 + 0.4 × 0.05 = 0.28 m / s 2 , =0.513 + 0.28 × 0.05 = 0.513 + 0.014 = 0.527 m / s. Continue iterating until... =1.2m / s 2 That is, from a = 0.24 m / s2 Increased to 1.2 m / s 2 , need Δa=0.96m / s 2 Increase of 0.02 m / s per cycle 2 It requires 48 cycles, a(48) = 0.24 + 0.4 × 0.05 × 47 = 0.24 + 0.94 = 1.18 m / s 2 a(49) = 1.22 m / s 2 (Exceeding the threshold, take 1.2m / s) 2 V(49) = 0.5 + (0.24 + 1.2) × 48 × 0.05 ÷ 2 = 0.5 + 1.44 × 1.2 = 0.5 + 1.728 = 2.228 m / s. Subsequently, it enters the uniform accelerator stage, where a remains at 1.2 m / s. 2 V increases by 0.06 m / s per cycle, until... When the speed is ≤0.096m / s, the system transitions to a deceleration / acceleration sub-stage and completes parameter iteration for each sub-stage.

[0029] Similarly, the critical condition corresponding to the deceleration phase is: And the corresponding speed is .

[0030] Furthermore, taking the acceleration phase as an example, the determination of the theoretical duration of each sub-phase based on the parameters corresponding to the sub-phase in which the current motion phase type is located in step S25 includes the following steps: Step S251: Extract the first acceleration change rate corresponding to the acceleration sub-stage, the maximum acceleration threshold corresponding to the uniform acceleration sub-stage, and the second acceleration change rate corresponding to the deceleration sub-stage from the control parameters of each sub-stage in the acceleration stage. At the same time, obtain the current real-time acceleration and velocity deviation from the motion parameters. Calculate the acceleration compensation amount based on the difference between the maximum acceleration threshold and the current real-time acceleration. This acceleration compensation amount is used to characterize the acceleration gap required for the current real-time acceleration to reach the maximum acceleration threshold. In this embodiment of the invention, the first acceleration change rate of the acceleration sub-stage is extracted from the control parameters of the acceleration sub-stage. =0.4m / s 3 Maximum acceleration threshold of uniform accelerator stage =1.2m / s 2 The rate of change of the second acceleration in the deceleration sub-stage =0.3m / s 3 Obtain the current real-time acceleration from the motion parameters. =0.24m / s 2 Speed ​​deviation =3m / s - 0.5m / s = 2.5m / s. The acceleration compensation is calculated based on the difference between the maximum acceleration threshold and the current real-time acceleration. The formula is: Acceleration Compensation = =1.2m / s 2 -0.24m / s 2 =0.96m / s 2 This value accurately represents the current real-time acceleration that needs to be supplemented by 0.96 m / s². 2 Only then can the maximum acceleration threshold be reached, and the acceleration gap that needs to be filled in the acceleration sub-stage be clearly identified.

[0031] Step S252: By introducing the real-time load characteristic data corresponding to the controlled object and mapping to generate the load coefficient, a load-acceleration change rate correction model is constructed. The first acceleration change rate is input into the load-acceleration change rate correction model, and the actual acceleration change rate after load correction is output. Specifically, the actual acceleration change rate = the first acceleration change rate × (1 - load coefficient). In this embodiment of the invention, the real-time operating current of the drive motor of the controlled object (electric vehicle) is obtained as 8.4A through the controller current acquisition interface. The rated current of the motor is 10A. The real-time load current ratio is calculated as 8.4A ÷ 10A = 0.84. A preset load-impedance mapping library (established experimentally and storing the correspondence between different load current ratios and impedances) is called to obtain the real-time load impedance as 18.6Ω. Based on Ohm's law, the load power loss is calculated as: real-time load impedance × (real-time load current ratio × rated current). 2 =18.6Ω×(0.84×10A) 2 =18.6×70.56=1312.416W. Combining this with the theoretical drive power of the motor (1500W), the load factor is mapped to =1-((theoretical drive power - load power loss)×mechanical transmission efficiency÷theoretical drive power). Given a mechanical transmission efficiency of 0.85, the calculated load factor is =1-((1500-1312.416)×0.85÷1500)=1-(187.584×0.85÷1500)=1-0.106=0.894. A load-acceleration rate of change correction model is constructed, with the fixed formula being: actual acceleration rate of change = first acceleration rate of change × (1-load factor). Substituting the data, the actual acceleration rate of change is 0.4m / s². 3 ×(1-0.894)=0.4×0.106=0.0424m / s 3 This completes the load correction for the first rate of change of acceleration.

[0032] Step S253: Calculate the basic theoretical duration of the acceleration sub-stage based on the acceleration compensation amount and the actual rate of change of acceleration = acceleration compensation amount / actual rate of change of acceleration. Then, combine the velocity deviation to decompose the velocity increment that the acceleration sub-stage needs to cover, and generate the duration correction coefficient of the acceleration sub-stage through the derivative relationship between the velocity increment and the actual rate of change of acceleration. Multiply the basic theoretical duration by the duration correction coefficient to obtain the theoretical duration of the acceleration sub-stage. If the current real-time acceleration has reached the maximum acceleration threshold, set it to 0; wherein, the velocity increment = 0.5 × first rate of change of acceleration × basic theoretical duration. 2 +Current real-time acceleration × Basic theoretical duration; In this embodiment of the invention, the acceleration compensation amount is 0.96 m / s. 2 The actual rate of change of acceleration is 0.0424 m / s². 3 The theoretical duration of the acceleration sub-phase is calculated using the formula: theoretical duration t_base = acceleration compensation ÷ actual rate of change of acceleration = 0.96 ÷ 0.0424 ≈ 22.64 s. Combining this with a velocity deviation of 2.5 m / s, the velocity increment ΔV1 is calculated using the formula: 0.5 × first rate of change of acceleration × t_base. 2 +Current real-time acceleration × t_base, substituting the data, we get ΔV1 = 0.5 × 0.4 × (22.64) 2 +0.24×22.64=0.2×512.5696+5.4336≈102.5139+5.4336≈107.9475m / s (Because the actual rate of change of acceleration is minimally affected by the load, the velocity increment is much larger than the velocity deviation, requiring correction using the derivative relationship). The derivative relationship between the velocity increment and the actual rate of change of acceleration is used (the derivative is twice the actual rate of change of acceleration, i.e., 0.0848m / s). 3 The duration correction factor is generated as follows: Correction factor = √(Velocity deviation ÷ ΔV1) = √(2.5 ÷ 107.9475) ≈ √0.02316 ≈ 0.1522. Multiplying the basic theoretical duration by the duration correction factor, the theoretical duration = 22.64 × 0.1522 ≈ 3.44s. If the current real-time acceleration has reached 1.2 m / s²... 2 If the theoretical duration is set to 0, then there is no need to enter the accelerator phase.

[0033] Step S254: Subtract the velocity increment covered by the acceleration sub-stage from the velocity deviation to obtain the remaining velocity increment to be covered by the uniform acceleration sub-stage. If the remaining velocity increment is greater than 0, generate the load-acceleration attenuation coefficient by combining the maximum acceleration threshold and real-time load characteristic data, and calculate the actual effective maximum acceleration = maximum acceleration threshold × load-acceleration attenuation coefficient. Then, derive the theoretical duration of the uniform acceleration sub-stage through the integral relationship between the remaining velocity increment and the actual effective maximum acceleration. If the remaining velocity increment is less than or equal to 0, set it to 0. In this embodiment of the invention, given a known velocity deviation ΔV = 2.5 m / s, the velocity increment ΔV1 covered by the acceleration sub-stage is calculated as 0.5 × the first acceleration rate of change × (theoretical duration). 2 +Current real-time acceleration × Theoretical duration = 0.5 × 0.4 × (3.44) 2 +0.24×3.44=0.2×11.8336+0.8256≈2.3667+0.8256≈3.1923m / s (Since ΔV1 is greater than ΔV, it is corrected to ΔV1=2.5m / s×0.8=2.0m / s, based on the 80% deviation threshold when the velocity increment exceeds the deviation). Subtracting this increment from the velocity deviation, the remaining velocity increment = 2.5m / s-2.0m / s=0.5m / s>0. Combined with the maximum acceleration threshold... =1.2m / s 2 The load-acceleration attenuation coefficient is generated by calling real-time load characteristic data (drive motor operating current 8.4A, load impedance 18.6Ω): Load-acceleration attenuation coefficient = (theoretical drive power - load power loss) × mechanical transmission efficiency ÷ theoretical drive power = (1500 - 1312.416) × 0.85 ÷ 1500 ≈ 0.106. The actual effective maximum acceleration is calculated to be 1.2 m / s². 2 ×0.106≈0.1272m / s 2 The duration is derived using the integral relationship (velocity increment during uniform acceleration = actual effective maximum acceleration × theoretical duration): The theoretical duration t2 = remaining velocity increment ÷ actual effective maximum acceleration = 0.5 m / s ÷ 0.1272 m / s² 2 ≈3.93s. If the remaining velocity increment is ≤0 (e.g., when ΔV1=2.6m / s), then the theoretical duration is directly set to 0, and there is no need to enter the uniform accelerator stage.

[0034] Step S255: Extract the second acceleration change rate corresponding to the deceleration sub-stage, and combine it with the predicted acceleration after the uniform acceleration sub-stage ends. Specifically, it is the current real-time acceleration + actual acceleration change rate × theoretical duration of the acceleration sub-stage. Calculate the acceleration decay amount by comparing the difference with the target acceleration. Determine the velocity reduction to be covered by the deceleration sub-stage based on the final target velocity and the predicted velocity after the uniform acceleration sub-stage ends. Generate two candidate values ​​for the deceleration duration by using the ratio of acceleration decay to the second acceleration change rate and the integral relationship between velocity reduction and predicted acceleration. Take the larger of the two values ​​as the theoretical duration of the deceleration sub-stage. In this embodiment of the invention, the second acceleration change rate of the deceleration sub-stage is extracted. =0.3m / s 3 The predicted acceleration after the acceleration sub-phase ends = current real-time acceleration + actual rate of change of acceleration × theoretical duration of acceleration = 0.24 m / s² 2 +0.0424m / s 3 ×3.44s≈0.24+0.145≈0.385m / s 2 The target acceleration is 0 (deceleration to uniform speed), and the calculated acceleration decay is 0.385 m / s². 2 -0 = 0.385 m / s 2 The predicted velocity after the acceleration sub-stage ends = current real-time velocity + ΔV1 = 0.5 m / s + 2.0 m / s = 2.5 m / s. The predicted velocity after the uniform acceleration sub-stage ends = 2.5 m / s + actual effective maximum acceleration × t2 = 2.5 + 0.1272 × 3.93 ≈ 2.5 + 0.50 ≈ 3.0 m / s (consistent with the final target velocity). Therefore, the velocity reduction to be covered by the deceleration sub-stage = 3.0 m / s - 3.0 m / s = 0 m / s (corrected to 0.05 m / s to ensure a smooth transition). Generate candidate values ​​for deceleration duration: Candidate value 1 = acceleration decay ÷ =0.385÷0.3≈1.28s; Candidate value 2 = velocity reduction ÷ (predicted acceleration ÷ 2) = 0.05÷(0.385÷2)≈0.05÷0.1925≈0.26s. Take the larger value of 1.28s as the theoretical duration of the deceleration sub-stage to ensure that both acceleration and velocity can smoothly decay to the target value.

[0035] Step S256: Integrate the theoretical durations corresponding to the acceleration phase, uniform acceleration phase, and deceleration phase.

[0036] In this embodiment of the invention, the theoretical duration of each sub-stage is integrated: the acceleration sub-stage is 3.44s (parameter based on the actual rate of change of acceleration of 0.0424m / s²). 3 Acceleration compensation amount: 0.96 m / s²2 The uniform acceleration phase lasts 3.93 s (parameters based on actual effective maximum acceleration of 0.1272 m / s²). 2 (Remaining velocity increment 0.5 m / s), deceleration phase 1.28 s (parameters based on acceleration decay 0.385 m / s²). 2 (Velocity reduction 0.05 m / s). The total acceleration time is calculated as 3.44 s + 3.93 s + 1.28 s ≈ 8.65 s. The calculation sources of the core parameters for each sub-stage are marked (e.g., the actual rate of change of acceleration comes from the load coefficient correction, and the actual effective maximum acceleration comes from the load-acceleration attenuation coefficient calculation), forming a complete sub-stage duration allocation scheme for the acceleration phase, providing a time dimension basis for subsequent discrete periodic control.

[0037] The deceleration phase is similar to that described above, and will not be repeated here.

[0038] Furthermore, the step S253, which involves generating the duration correction coefficient for the acceleration sub-stage using the derivative relationship between the velocity increment and the actual rate of change of acceleration, includes the following steps: The real-time velocity change curve in the acceleration sub-stage is obtained by the signal sampling module corresponding to the controller. Specifically, it is generated by fitting the actual acceleration change rate of continuous cycles, and the first derivative of the real-time velocity change curve is obtained based on the velocity increment to obtain the actual velocity change rate sequence. In this embodiment of the invention, the actual acceleration of the acceleration sub-stage is collected by the signal sampling module of the controller at a period of 0.05s (data for the first 10 cycles: 0.24, 0.26, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42 m / s²). 2 Based on the actual rate of change of acceleration of 0.0424 m / s² 3 The real-time velocity change curve is fitted using the formula v(t) = 0.5 + 0.24t + 0.5 × 0.0424t. 2 (t unit: s). Calculate the velocity increments for consecutive periods (e.g., Δv = 0.513 - 0.5 = 0.013 m / s for period 1-2, Δv = 0.527 - 0.513 = 0.014 m / s for period 2-3), and obtain the actual velocity change rate sequence by taking the first derivative of the real-time velocity change curve (0.013 / 0.05 = 0.26, 0.014 / 0.05 = 0.28, ..., 0.42 m / s). 2 The sequence is consistent with the actual acceleration sequence, verifying the validity of the data.

[0039] Furthermore, a theoretical acceleration change curve is constructed based on the actual acceleration change rate, and the theoretical acceleration change curve is integrated over time to obtain the theoretical velocity change rate. Then, the theoretical velocity change rate is compared with the actual velocity change rate sequence, the percentage deviation between the two is calculated, and a velocity change rate deviation coefficient is generated. In this embodiment of the invention, a theoretical acceleration change curve a(t) = 0.24 + 0.0424t is constructed based on the actual acceleration change rate of 0.0424 m / s³. Integrating this curve over time yields the theoretical velocity change rate v'(t) = a(t) = 0.24 + 0.0424t (where v' = 0.2421 m / s³ at t = 0.05 s). 2 At t=0.1s, v'=0.2442m / s 2 The theoretical rate of change of velocity is compared with the actual rate of change of velocity sequence (0.26, 0.28 m / s²), and the deviation percentage is calculated: the deviation percentage of the first period = |0.26-0.2421| / 0.2421×100%≈7.39%, the deviation percentage of the second period ≈14.62%, and the average value of 11.01% is taken as the deviation coefficient of the rate of change of velocity.

[0040] Furthermore, by introducing the transmission system response characteristic data corresponding to the controlled object, specifically obtained through phase difference analysis between the control signal and the feedback speed, a response delay-correction factor mapping model is constructed. The speed change rate deviation coefficient is input into the response delay-correction factor mapping model, and the basic correction factor is output. The specific mapping logic is that the basic correction factor increases linearly with the increase of the speed change rate deviation coefficient. In this embodiment of the invention, the waveforms of the control signal (PWM duty cycle) and the feedback speed are acquired using an oscilloscope, and the phase difference is measured to be 0.02s (transmission system response delay). A response delay-correction factor mapping model is established: a delay of 0.01s corresponds to a correction factor of 1.05, 0.02s corresponds to 1.10, and 0.03s corresponds to 1.15. The linear interpolation relationship is correction factor = 1.0 + 5 × delay time. The speed change rate deviation coefficient of 11.01% is input into the model, and the mapping logic is that the correction factor increases by 0.01 for every 1% increase in the deviation coefficient. The basic correction factor is calculated as 1.0 + 11.01 × 0.01 = 1.1101.

[0041] Furthermore, the velocity increment is segmented into low, medium, and high speed segments according to the velocity range, and the derivative of the actual acceleration rate of change is extracted for different speed segments. The sign of the derivative of the actual acceleration rate of change is used to determine the increasing or decreasing characteristics of the actual acceleration rate of change, and segmented characteristic coefficients are generated. Then, the segmented characteristic coefficients are multiplied by the basic correction factor to obtain the segmented correction factor. In this embodiment of the invention, the acceleration sub-stage velocity increment of 2.0 m / s is divided into three intervals: low (0-0.5 m / s), medium (0.5-1.5 m / s), and high (1.5-2.0 m / s). The derivative of the actual rate of change of acceleration for each interval is calculated: derivative for the low-speed interval = 0.0424 m / s. 3 (Positive, increasing), derivative in the medium speed range = 0.0424 m / s 3 (Positive, increasing), derivative of high-speed segment = 0.0420 m / s 3 (Positive, increasing), generating segmented characteristic coefficients (low speed 1.0, medium speed 1.0, high speed 0.99). Multiplying the segmented characteristic coefficients by the basic correction factor 1.1101, we get segmented correction factors (1.1101, 1.1101, 1.0990).

[0042] Furthermore, the proportion of the velocity increment of each velocity segment to the total velocity increment is calculated, and this proportion is multiplied and summed with the corresponding segment correction factor to obtain the comprehensive correction coefficient. The comprehensive correction coefficient is then fine-tuned by combining the basic theoretical duration corresponding to the acceleration sub-stage with the corresponding time dimension weight to generate the duration correction coefficient of the acceleration sub-stage.

[0043] In this embodiment of the invention, the incremental percentage of each speed segment is calculated as follows: low speed segment 0.5 / 2.0 = 25%, medium speed segment 1.0 / 2.0 = 50%, and high speed segment 0.5 / 2.0 = 25%. The sum of these products yields a comprehensive correction coefficient = 25% × 1.1101 + 50% × 1.1101 + 25% × 1.0990 ≈ 0.2775 + 0.5551 + 0.2748 ≈ 1.1074. The basic theoretical duration of the acceleration phase is 22.64 seconds, with a time dimension weight of 0.01 (the weight decreases by 0.0005 for every 1 second increase in duration). After fine-tuning, the duration correction coefficient = 1.1074 - (22.64 - 20) × 0.0005 ≈ 1.1074 - 0.0132 ≈ 1.0942, which is ultimately used to correct the basic theoretical duration.

[0044] Furthermore, the step S254, which involves combining the maximum acceleration threshold with real-time load characteristic data to generate the load-acceleration attenuation coefficient, includes the following steps: The controller acquires the real-time operating current signal corresponding to the drive device through the current acquisition interface. After filtering and denoising the real-time operating current signal, the real-time load current ratio is calculated in combination with the rated current parameter of the drive device. At the same time, the real-time load current ratio is used as the initial load characterization parameter. In this embodiment of the invention, the real-time operating current signal is acquired through the current acquisition interface of the controller via a sampling resistor connected in series in the power supply circuit of the drive device (motor). The sampling resistor has a resistance of 0.1Ω, and the output voltage signal ranges from 0 to 0.5V. An RC filter circuit (resistor 1kΩ, capacitor 22μF) is used to filter the voltage signal to eliminate current fluctuation noise. Then, the voltage signal is converted into a digital quantity through an analog-to-digital converter module (12-bit precision, 5V reference voltage). When the converted digital quantity is 819, the real-time operating current is calculated as follows: (digital quantity ÷ 4095) × 5V ÷ 0.1Ω = (819 ÷ 4095) × 50 ≈ 10A (drive device rated current 10A). The real-time load current ratio is calculated as 10A ÷ 10A = 1.0, and this ratio is used as the initial load characterization parameter.

[0045] Furthermore, the load-impedance mapping library of the controlled object is called. This library is pre-established based on impedance test data under different loads. The initial load characterization parameters are input into the load-impedance mapping library to output the corresponding real-time load impedance value. Then, based on Ohm's law of the circuit, the load power loss = real-time load impedance value × initial load characterization parameter 2 is derived. The load power loss is used to quantify the degree of consumption of the corresponding drive energy of the controller on the corresponding drive device by the load, and load energy consumption parameters are generated. In this embodiment of the invention, a preset load-impedance mapping library is invoked. This library, established experimentally, stores the correspondence between different load current ratios and impedances (e.g., 0.8 corresponds to 18Ω, 0.9 corresponds to 18.5Ω, and 1.0 corresponds to 19Ω). The initial load characterization parameter of 1.0 is input into the library, and the real-time load impedance value of 19Ω is output. Based on Ohm's law for circuits, load power loss = real-time load impedance value × (initial load characterization parameter × rated current). 2 =19Ω×(1.0×10A) 2 =19×100=1900W, this value quantifies the degree of energy consumption of the drive and generates load energy consumption parameters.

[0046] Furthermore, the theoretical driving power corresponding to the maximum acceleration threshold is extracted from the trapezoidal acceleration change model as follows: maximum acceleration threshold × controlled object mass × preset speed benchmark. The difference between the theoretical driving power and the load energy consumption parameters is calculated to obtain the effective driving power margin. In this embodiment of the invention, the maximum acceleration threshold of 1.2 m / s² is extracted from the trapezoidal acceleration variation model. 2 The controlled object (electric vehicle) has a measured mass of 1000 kg, and the preset speed reference is 5 m / s (corresponding to the vehicle's commonly used speed range). The theoretical driving power = maximum acceleration threshold × controlled object mass × preset speed reference = 1.2 m / s² 2×1000kg×5m / s=6000W. Calculating the difference between the theoretical drive power and the load energy consumption parameter, the effective drive power margin = 6000W - 1900W = 4100W. This value reflects the power available for drive acceleration after deducting load consumption.

[0047] Furthermore, by introducing the mechanical transmission efficiency data of the controlled object, and performing transmission power fitting calculation and normalization on the effective driving power margin based on the mechanical transmission efficiency data, normalized power parameters are obtained; then, the normalized power parameters are nonlinearly transformed by the arctangent function to generate the preliminary attenuation coefficient. In this embodiment of the invention, the mechanical transmission efficiency of the controlled object is experimentally determined to be 0.85 (combined efficiency of gearbox and drive shaft). Based on this efficiency, the effective drive power margin is fitted and calculated. Fitted power = effective drive power margin × mechanical transmission efficiency = 4100W × 0.85 = 3485W. The fitted power is normalized. Normalized power parameter = fitted power ÷ theoretical drive power = 3485W ÷ 6000W ≈ 0.5808. Nonlinear transformation is performed using the arctangent function (y = arctan(πx)). The initial attenuation coefficient = arctan(π × 0.5808) ≈ arctan(1.825) ≈ 1.07 rad (when converting to coefficients, take 1.07 ÷ 1.57 ≈ 0.682, since π / 2 ≈ 1.57 corresponds to a full power coefficient of 1.0).

[0048] Furthermore, real-time temperature data of the controlled object is acquired, and the real-time temperature data is converted into a temperature correction factor based on the real-time load characteristic data. At the same time, the initial attenuation coefficient is multiplied by the temperature correction factor to generate the load-acceleration attenuation coefficient.

[0049] In this embodiment of the invention, real-time temperature data is collected by a temperature sensor installed on the housing of the drive device. The sensor outputs an analog signal ranging from 0 to 3.3V, corresponding to temperatures from -40℃ to 125℃. The real-time temperature is calculated via analog-to-digital conversion (2048 digital inputs) as (2048 ÷ 4095) × 165℃ - 40℃ ≈ 82.5℃ - 40℃ = 42.5℃. Based on real-time load characteristic data (load current percentage 1.0), a temperature-correction factor mapping relationship is established (e.g., 40℃ corresponds to 1.0, 50℃ to 0.98, and 60℃ to 0.96). Through linear interpolation, the temperature correction factor corresponding to 42.5℃ is calculated as 1.0 - (42.5 - 40) × 0.002 = 0.995. Multiplying the initial attenuation coefficient 0.682 by the temperature correction factor 0.995, the load-acceleration attenuation coefficient is approximately 0.682 × 0.995 ≈ 0.679.

[0050] Furthermore, step S3 includes the following steps: Step S31: Based on the dynamic programming algorithm, set the discrete time period base duration according to the computing power of the controller and the response requirements of the controlled object. Calculate the number of discrete time periods contained in each sub-stage based on the theoretical duration of each sub-stage in the sub-stage duration = theoretical duration of each sub-stage / discrete time period base duration, and round it down. In this embodiment of the invention, the controller has a processing capacity of 800 commands per second, and the actual measured response delay of the controlled object (electric vehicle) is 0.02s. The discrete time period base duration is set to T=0.05s (balancing computational efficiency and response accuracy). Based on the sub-stage duration: the theoretical duration of the acceleration sub-stage is 2.4s, the uniform acceleration sub-stage is 0.64s, and the deceleration sub-stage is 4s. The number of cycles for each sub-stage is calculated as follows: number of acceleration cycles = 2.4 ÷ 0.05 = 48 (integer, no need to round); number of uniform acceleration cycles = 0.64 ÷ 0.05 = 12.8 → rounded up to 13 (to ensure complete coverage of the remaining speed difference); number of deceleration cycles = 4 ÷ 0.05 = 80 (integer). The total number of cycles = 48 + 13 + 80 = 141. The cycle range of each sub-stage is defined (1-48 for acceleration, 49-61 for uniform acceleration, and 62-141 for deceleration).

[0051] Step S32: Initialize the state parameters corresponding to the current discrete time period, so that the current real-time velocity in the initial control dataset is set as the initial velocity of the period and the current real-time acceleration is set as the initial acceleration of the period; for the first discrete time period, determine the sub-stage to which it belongs and extract the sub-stage control parameters corresponding to the sub-stage; calculate the target acceleration increment according to the sub-stage type, specifically, the acceleration increment of the acceleration sub-stage = the first acceleration change rate × the discrete time period reference duration; the acceleration increment of the uniform acceleration sub-stage = 0; the acceleration increment of the deceleration sub-stage = the second acceleration change rate × the discrete time period reference duration or the negative second acceleration change rate × the discrete time period reference duration; In this embodiment of the invention, the state parameters for the first cycle (number 1) are initialized as follows: initial cycle velocity = current real-time velocity in the initial control dataset (0.5 m / s), initial cycle acceleration = current real-time acceleration (0.24 m / s). 2 Determine that the current cycle belongs to an acceleration sub-stage, and extract the corresponding sub-stage control parameter: the first acceleration rate of change. =0.4m / s 3 Maximum acceleration threshold =1.2m / s 2 Calculate the target acceleration increment = =0.4 × 0.05 = 0.02 m / s 2If it is a uniform acceleration phase (e.g., period 49), the target acceleration increment = 0; if it is a deceleration phase (e.g., period 62), the target acceleration increment = the second acceleration rate of change. =0.3 × 0.05 = 0.015 m / s 2 (Take the negative value during the deceleration phase, i.e., -0.015m / s) 2 ).

[0052] Step S33: Calculate the instantaneous acceleration of the current cycle = initial acceleration of the cycle + target acceleration increment; impose a threshold limit on the instantaneous acceleration to ensure that it does not exceed the maximum acceleration threshold or is lower than the negative maximum acceleration threshold; then calculate the instantaneous velocity of the current cycle = initial velocity of the cycle + instantaneous acceleration × discrete time period reference duration; In this embodiment of the invention, the instantaneous acceleration of the first cycle = initial acceleration of the cycle + target acceleration increment = 0.24 + 0.02 = 0.26 m / s² 2 This value is less than =1.2m / s 2 No threshold limit is required. Instantaneous velocity is calculated as: Initial velocity of the period + Instantaneous acceleration × T = 0.5 + 0.26 × 0.05 = 0.5 + 0.013 = 0.513 m / s. Period 49 (uniform acceleration sub-stage): Initial acceleration of the period = 1.2 m / s² 2 (Instantaneous acceleration with period 48), target acceleration increment = 0, instantaneous acceleration = 1.2 + 0 = 1.2 m / s² 2 (equal (Meets the threshold requirement), instantaneous velocity = 2.228 + 1.2 × 0.05 = 2.228 + 0.06 = 2.288 m / s. Period 62 (deceleration sub-stage): initial acceleration of the period = 1.2 m / s² 2 The target acceleration increment is 0.015 m / s². 2 Instantaneous acceleration = 1.2 + 0.015 = 1.215 m / s² 2 (overtake The speed limit is 1.2 m / s. 2 Instantaneous velocity = 2.996 + 1.2 × 0.05 = 2.996 + 0.06 = 3.056 m / s (subsequently gradually reduced to 3 m / s).

[0053] Step S34: Associate and store the instantaneous velocity and instantaneous acceleration of the current cycle with the cycle number and the sub-stage identifier to form an instantaneous parameter record; use the instantaneous velocity and instantaneous acceleration of the current cycle as the initial velocity and initial acceleration of the next cycle, and repeat steps S32-S33 until the discrete time cycle calculation of all sub-stages is completed to obtain the instantaneous velocity sequence and instantaneous acceleration sequence containing all cycles; In this embodiment of the invention, the instantaneous velocity of the first cycle is 0.513 m / s and the instantaneous acceleration is 0.26 m / s². 2 Associated with cycle number 1 and sub-stage identifier "acceleration", this data is stored in the controller's parameter buffer, forming the first instantaneous parameter record. The instantaneous velocity of this cycle, 0.513 m / s, is set as the initial velocity for the second cycle, and the instantaneous acceleration is 0.26 m / s². 2 Set the initial acceleration for the second cycle and repeat steps S32-S33: the target acceleration increment for the second cycle remains 0.02 m / s². 2 Instantaneous acceleration = 0.26 + 0.02 = 0.28 m / s² 2 The instantaneous velocity = 0.513 + 0.28 × 0.05 = 0.527 m / s, and is stored in associated period number 2. This logic is iterated until 141 periods are completed, generating an instantaneous velocity sequence (0.5 → 0.513 → … → 3.0 → 3.0) and an instantaneous acceleration sequence (0.24 → 0.26 → … → 0) containing 141 data points.

[0054] Step S35: Perform continuity verification on the instantaneous velocity sequence and instantaneous acceleration sequence, and determine whether the velocity change and acceleration change in adjacent time periods meet the sub-stage control parameter requirements of the trapezoidal acceleration change model. If they meet the requirements, use the instantaneous velocity sequence and instantaneous acceleration sequence as intermediate control datasets. If they do not meet the requirements, readjust the upper limit of the acceleration change rate or the maximum acceleration threshold in the sub-stage control parameters, return to step S33 to recalculate the instantaneous parameters for the discrete time period, until an intermediate control dataset that meets the continuity requirements is obtained.

[0055] In this embodiment of the invention, a continuity verification standard is set: the change in acceleration between adjacent periods in the acceleration sub-stage is fixed at 0.02 m / s². 2 The velocity change ranges from 0.013 m / s to 0.024 m / s; during the uniform acceleration phase, the acceleration change between adjacent periods is 0, and the velocity change is fixed at 0.06 m / s; during the deceleration phase, the acceleration change between adjacent periods is fixed at 0.015 m / s. 2 The velocity change gradually decreases from 0.06 m / s to 0. Verification cycle 1-2: Acceleration change 0.02 m / s² 2 (Compliant), velocity change 0.013 m / s (Compliant); Period 48-49: acceleration change = 1.2 - 1.18 = 0.02 m / s 2(Acceleration transitioning to uniform acceleration, transition allowed), velocity change = 2.288 - 2.228 = 0.06 m / s (compliant); Periods 61-62: Acceleration change = 1.2 - 1.2 = 0 (uniform acceleration transitioning to deceleration, compliant), velocity change = 3.056 - 2.996 = 0.06 m / s (compliant). All adjacent period changes meet the model requirements, the sequence is determined to be continuous, and it is used as the intermediate control dataset; if the acceleration change in a certain period is 0.03 m / s... 2 (Exceeding 0.02m / s 2 If so, adjust up to 0.38m / s 3 (Increment = 0.38 × 0.05 = 0.019 m / s) 2 Then return to step S33 to recalculate.

[0056] Furthermore, step S4 includes the following steps: Based on the instantaneous velocity sequence in the intermediate control dataset, the deviation from the final target velocity is iteratively judged. If the instantaneous velocity in a certain discrete time period reaches or approaches the final target velocity, the constant velocity maintenance judgment is triggered; if it does not reach the target velocity, the dynamic programming recursive logic continues, using the instantaneous velocity and instantaneous acceleration of the current period as the new initial state data, and returns to steps S2-S3 to re-perform the stage judgment and parameter calculation until the s-curve parameter sequence containing the complete speed change process is obtained. In this embodiment of the invention, by extracting the instantaneous velocity sequence (a total of 141 data points, gradually increasing from 0.5 m / s to 3.056 m / s and then decreasing to 3.0 m / s) from the intermediate control dataset, a velocity deviation allowable threshold of 0.02 m / s is set (i.e., when the deviation between the instantaneous velocity and the final target velocity of 3 m / s is ≤0.02 m / s, uniform speed maintenance is triggered). Deviation is judged cycle by cycle: in cycle 62, the instantaneous velocity is 3.056 m / s, the deviation is 0.056 m / s > 0.02 m / s, and no trigger is made; in cycle 70, the instantaneous velocity is 3.018 m / s, the deviation is 0.018 m / s ≤ 0.02 m / s, and uniform speed maintenance is triggered. In subsequent cycles (71-141), the instantaneous velocity is fixed at 3.0 m / s, and the acceleration is 0. If, in a certain scenario, the user adjusts the target velocity to 3.5 m / s midway (at cycle 50), the instantaneous velocity at cycle 50 is 2.5 m / s, and the acceleration is 1.2 m / s. 2 The deviation is 3.5 - 2.5 = 1.0 m / s > 0.02 m / s, therefore the target was not achieved. This is based on the instantaneous velocity of 2.5 m / s and acceleration of 1.2 m / s². 2As new initial state data, return to step S2 to re-determine the stage (still the acceleration stage), and in step S3 recalculate the number of cycles (acceleration cycle number 0, uniform acceleration cycle number = (3.5-2.5) / 1.2÷0.05≈16.67→17, deceleration cycle number = 1.2 / 0.3÷0.05=80), generating a new instantaneous parameter sequence.

[0057] Furthermore, the instantaneous velocity sequence in the S-curve parameter sequence is converted into a control signal recognizable by the drive device. The control signal includes a pulse width modulation signal or an analog voltage signal. The control signal is output to the drive device to drive the controlled object to run according to the S-curve parameter sequence. At the same time, feedback data from the drive device is collected in real time. The feedback data includes the actual running speed and the actual running acceleration to obtain a control effect feedback dataset. In this embodiment of the invention, the instantaneous velocity sequence (0.5→0.513→…→3.0→3.0) in the S-curve parameter sequence is converted into a PWM control signal recognizable by the drive device (motor), establishing a speed-PWM duty cycle mapping relationship: 0 m / s corresponds to a duty cycle of 10% (motor idle speed), and 3 m / s corresponds to a duty cycle of 60%. The linear interpolation formula is duty cycle = 10% + (instantaneous velocity / 3 m / s) × 50%. For example, an instantaneous velocity of 0.5 m / s corresponds to a duty cycle of 10% + (0.5 / 3) × 50% ≈ 18.33%, and 3.0 m / s corresponds to 60%. The controller updates the duty cycle periodically (0.05 s) through the PWM output module to drive the motor. Simultaneously, the actual running speed is obtained through a speed sensor (collected once per cycle), and the actual running acceleration is obtained through an acceleration sensor. For example, in cycle 1, the actual speed is 0.49 m / s and the actual acceleration is 0.23 m / s. 2 The actual velocity during period 2 is 0.51 m / s, and the actual acceleration is 0.25 m / s². 2 These data are numbered and linked according to a period to form a control effect feedback dataset.

[0058] Furthermore, a deviation analysis is performed on the actual running speed and actual running acceleration in the control effect feedback dataset and the instantaneous speed and instantaneous acceleration in the S-curve parameter sequence to calculate the tracking error, which includes speed tracking error and acceleration tracking error. Based on the tracking error, it is determined whether the S-curve parameter sequence needs to be corrected. If the tracking error is greater than the preset error threshold, the sub-stage control parameters in the trapezoidal acceleration change model are adjusted, and the process returns to step S2 to regenerate the sub-stage duration. If the tracking error is less than or equal to the error threshold, the current S-curve control is confirmed to be effective, and the final S-curve control generation result is output.

[0059] In this embodiment of the invention, tracking error thresholds are set as follows: velocity tracking error ≤ 0.03 m / s, acceleration tracking error ≤ 0.02 m / s. 2 Calculate the errors for each cycle: Cycle 1 velocity tracking error = |0.49 - 0.513| = 0.023 m / s ≤ 0.03 m / s, acceleration tracking error = |0.23 - 0.26| = 0.03 m / s 2 >0.02m / s 2 (Exceeded threshold). Analysis of the error cause: The rate of change of acceleration was too high. Adjust the first rate of change of acceleration in the trapezoidal acceleration change model. From 0.4 m / s 3 Reduced to 0.38 m / s 3 Return to step S2 to recalculate the sub-stage duration (acceleration duration = 0.96 / 0.38 ≈ 2.53s, number of cycles = 2.53 / 0.05 ≈ 51), and in step S3, regenerate the instantaneous parameter sequence (acceleration increment for cycle 1 = 0.38 × 0.05 = 0.019 m / s²). 2 Instantaneous acceleration 0.259 m / s² 2 After restarting, the actual acceleration during cycle 1 was 0.25 m / s². 2 The error is |0.25 - 0.259| = 0.009 m / s 2 ≤0.02m / s 2 Once all periodic errors meet the standards, the current S-curve control is confirmed to be effective, and the final control result (including PWM duty cycle sequence, sub-stage parameters, and feedback error data) is output.

[0060] For example, taking the process of accelerating from an initial state of 0.4 and a velocity of 0.5 to a target velocity of 3 as an example, an image was created (e.g.) Figure 3 (As shown). Because the initial acceleration and velocity can be arbitrarily chosen within a reasonable range, changing the target value at any moment during the acceleration change process will also produce a similar curve, ensuring that the velocity-time function graph at any moment is smooth, i.e., continuously differentiable. Square dots mark the boundary points between segments one and two, and between segments two and three. Different parameters will produce different graphs. For example, increasing or decreasing... This will cause the tilt of the first segment (the image to the left of the first point) to become steeper or gentler. Simultaneously, the maximum acceleration corresponding to the second segment... And the steepness of the third section Unaffected, meaning that the three speed-changing processes can be adjusted independently without affecting the main parameter values ​​or the steepness of the image; only the duration of the second segment will change.

[0061] Alternatively, taking another acceleration process as an example, and simultaneously... By reducing these parameters while keeping all other parameters unchanged, we can obtain an S-shaped VT shift curve with a slower shift in the first stage, such as... Figure 4 The curve in the lower middle section. As can be seen from the graph, it takes longer to reach the target speed V=3, which is as expected. Regarding the three parameters of the S-curve speed change algorithm: , , In the graph, this corresponds to the slopes of the two hypotenuses of the trapezoid's at-value and the height of the trapezoid. The vt graph is essentially an integral of the at-value graph. It's easy to see that for any trapezoid, regardless of the slopes of the left and right sides and the height of the trapezoid, a unique trapezoid can be drawn, and its corresponding piecewise function is a continuous linear function, therefore it is integrable. Therefore, the vt function and its graph must exist, i.e., it has three parameters: , , In mathematical and algorithmic terms, the parameter can take any positive value. Only in practical applications will the range of parameter values ​​be limited based on specific needs.

[0062] Furthermore, the present invention also provides a control device for dynamically programming to realize a non-zero starting point s-curve, such as... Figure 5 As shown, it includes a speed control device 100, a controller 200, a drive device 300, and a speed control algorithm stored on the controller 200 and capable of running on the drive device 300, used to execute the dynamic programming control method described above to realize a non-zero starting point s-curve.

[0063] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A dynamic programming method for controlling a non-zero starting point s-curve, characterized in that, Includes the following steps: Step S1: Obtain the current operating status data and target control parameters corresponding to the controlled object, wherein the current operating status data includes the current real-time speed. Current real-time acceleration The target control parameters include the final target speed input by the user through the speed control device. Based on the current real-time speed Current real-time acceleration With the final target speed Construct an initial control dataset for s-curve control with a non-zero starting point; Step S2: Calculate the speed deviation based on the initial control dataset. And based on the speed deviation The motion phase type is determined, and the corresponding trapezoidal acceleration change model is invoked. The core parameters include the first acceleration change rate for each sub-phase. Maximum acceleration threshold and the second rate of change of acceleration Based on the final state constraint that the acceleration is 0 when the final target speed is reached, the current motion stage type and sub-stage are determined by combining the core parameters, and the theoretical duration of each sub-stage is determined. Step S3: Set the discrete time period reference duration according to the computing power of the controller, and determine the number of sub-stage periods in combination with the theoretical duration of each sub-stage; calculate the target acceleration increment based on the parameters of the sub-stage within each sub-stage period, and update the current real-time velocity and current real-time acceleration within each sub-stage period based on the target acceleration increment to generate an instantaneous parameter sequence, including instantaneous velocity and instantaneous acceleration; The continuity of the instantaneous parameter sequence is verified to obtain the intermediate control dataset; Step S4: Compare the instantaneous velocity in the intermediate control dataset with the final target velocity. If the deviation is less than or equal to the allowable threshold, trigger constant velocity maintenance. Otherwise, update the initial control dataset with the current instantaneous parameter sequence and return to step S2 iteration. Convert the qualified instantaneous parameter sequence into a control signal output that the drive device can recognize. Collect the actual velocity and acceleration of the drive feedback in real time, calculate the tracking error. If the tracking error exceeds the threshold, adjust the sub-stage parameters and regenerate the control signal until the tracking error meets the standard, thereby outputting the final S-curve control generation result.

2. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Receive the target control signal transmitted by the speed controller in real time through the signal acquisition module corresponding to the controller, and perform filtering and decoding processing on the target control signal to extract the final target speed input by the user. ; Step S12: Connect the corresponding sensor module through the controller to collect the current operating status signal of the controlled object. The current operating status signal includes the speed pulse signal output by the speed sensor and the acceleration analog signal output by the acceleration sensor. Step S13: Count and convert the velocity pulse signals to convert the number of pulses corresponding to the velocity pulse signals into the corresponding current real-time velocity. The analog acceleration signal is subjected to analog-to-digital conversion and noise suppression processing to obtain the current real-time acceleration. To complete the collection and preprocessing of current operating status data; Step S14: Construct an initial control data table to determine the final target speed Current real-time speed With current real-time acceleration Fill in the initial control data table and label the acquisition timestamp and data unit corresponding to each parameter to obtain the initial control dataset containing state parameters and target parameters; Step S15: Verify the validity of each parameter in the initial control dataset to determine the current real-time speed. Current real-time acceleration If the data is within the preset physical reasonable range, a data anomaly alarm will be triggered and historical valid values ​​will be used as replacements; if the data is within the physical reasonable range, the initial control dataset will be confirmed as valid.

3. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 1, characterized in that, Step S2 includes the following steps: Step S21: Calculate the current real-time velocity in the initial control dataset. Current real-time acceleration With the final target speed Perform difference analysis to calculate speed deviation. ; Step S22: Based on speed deviation Determine the current motion stage type of the controlled object to obtain an initial stage determination result, wherein, when the speed deviation... When the speed deviation is determined to be in the acceleration phase; When the speed is determined to be in the constant speed maintenance phase; when the speed deviation... This is determined to be the deceleration phase; Step S23: Based on the motion stage identifier corresponding to the initial stage determination result, call the corresponding trapezoidal acceleration change model. Specifically, the positive trapezoidal acceleration model is called during the acceleration stage, the negative trapezoidal acceleration model is called during the deceleration stage, and the zero acceleration maintenance model is called during the uniform velocity maintenance stage. The positive sub-stage control parameters corresponding to the positive trapezoidal acceleration model include the first acceleration change rate corresponding to the acceleration sub-stage. The maximum acceleration threshold corresponding to the uniform accelerator stage and the second rate of change of acceleration corresponding to the deceleration sub-stage For the deceleration phase, the first rate of change of acceleration is... Maximum acceleration threshold and the second rate of change of acceleration Taking the negative value yields the negative sub-stage control parameters; Step S24: Taking the acceleration phase as an example, obtain the final state constraint of the variable speed process where the acceleration is 0 when the final target speed is reached through dynamic programming; based on the final state constraint of the variable speed process corresponding to the acceleration phase and combined with the control parameters of the forward sub-phase, determine the critical conditions corresponding to the deceleration sub-phase. Then, based on the critical conditions, the corresponding uniform acceleration sub-stage and acceleration sub-stage are deduced in reverse, and the motion parameters at the corresponding time of each sub-stage are determined. Similarly, during the deceleration stage, the corresponding sub-stages are determined based on the negative sub-stage control parameters, so as to determine the sub-stage of the current motion stage type. Step S25: Determine the theoretical duration of each sub-stage based on the parameters corresponding to the sub-stage of the current motion stage type, wherein the parameters include motion parameters and control parameters for each sub-stage.

4. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 3, characterized in that, The acceleration phase described in step S24, which determines the corresponding sub-phases and the motion parameters at the corresponding time of each sub-phase, includes the following steps: Step S2401: Based on the final state constraints of the acceleration phase corresponding to the variable speed process, and by introducing the recursive logic of dynamic programming, the starting conditions corresponding to the deceleration sub-phase are derived first. Specifically, let the current real-time acceleration be... If the deceleration sub-phase starts from the current moment until the acceleration drops to 0, the area of ​​the triangle formed by the right hypotenuse of the acceleration-time curve in the positive trapezoidal acceleration model and the time axis, combined with the second rate of change of acceleration in the control parameters of the positive sub-phase, is used. The specific critical conditions for determining the relationship between the uniform acceleration sub-stage and the deceleration sub-stage are as follows: ; Step S2402: Based on critical conditions And combined with the maximum acceleration threshold Determine the sub-stages corresponding to this acceleration phase, where if a judgment is made... If not, then the current moment is determined to be in the deceleration sub-phase, and the acceleration at the next moment will be... Otherwise, judge If not, then it is determined that the current time is in the uniform accelerator stage and Otherwise, it is determined that the current moment is in the acceleration sub-phase and ; Step S2403: Based on the acceleration at the next moment Determine the velocity at the next moment. This allows for iterative calculation of the acceleration and velocity at each moment corresponding to the current acceleration phase in each sub-phase.

5. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 3, characterized in that, Taking the acceleration phase as an example, the determination of the theoretical duration of each sub-phase based on the parameters corresponding to the sub-phase in which the current motion phase type is located in step S25 includes the following steps: Step S251: Extract the first acceleration change rate corresponding to the acceleration sub-stage, the maximum acceleration threshold corresponding to the uniform acceleration sub-stage, and the second acceleration change rate corresponding to the deceleration sub-stage from the control parameters of each sub-stage in the acceleration stage. At the same time, obtain the current real-time acceleration and velocity deviation from the motion parameters. Calculate the acceleration compensation amount based on the difference between the maximum acceleration threshold and the current real-time acceleration. This acceleration compensation amount is used to characterize the acceleration gap required for the current real-time acceleration to reach the maximum acceleration threshold. Step S252: By introducing the real-time load characteristic data corresponding to the controlled object and mapping to generate the load coefficient, a load-acceleration change rate correction model is constructed. The first acceleration change rate is input into the load-acceleration change rate correction model, and the actual acceleration change rate after load correction is output. Specifically, the actual acceleration change rate = the first acceleration change rate × (1 - load coefficient). Step S253: Calculate the basic theoretical duration of the acceleration sub-stage based on the acceleration compensation amount and the actual rate of change of acceleration = acceleration compensation amount / actual rate of change of acceleration. Then, combine the velocity deviation to decompose the velocity increment that the acceleration sub-stage needs to cover, and generate the duration correction coefficient of the acceleration sub-stage through the derivative relationship between the velocity increment and the actual rate of change of acceleration. Multiply the basic theoretical duration by the duration correction coefficient to obtain the theoretical duration of the acceleration sub-stage. If the current real-time acceleration has reached the maximum acceleration threshold, set it to 0; where the velocity increment = 0.5 × first rate of change of acceleration × basic theoretical duration. 2 +Current real-time acceleration × Basic theoretical duration; Step S254: Subtract the velocity increment covered by the acceleration sub-stage from the velocity deviation to obtain the remaining velocity increment to be covered by the uniform acceleration sub-stage. If the remaining velocity increment is greater than 0, generate the load-acceleration attenuation coefficient by combining the maximum acceleration threshold and real-time load characteristic data, and calculate the actual effective maximum acceleration = maximum acceleration threshold × load-acceleration attenuation coefficient. Then, derive the theoretical duration of the uniform acceleration sub-stage through the integral relationship between the remaining velocity increment and the actual effective maximum acceleration. If the remaining velocity increment is less than or equal to 0, set it to 0. Step S255: Extract the second acceleration change rate corresponding to the deceleration sub-stage, and combine it with the predicted acceleration after the uniform acceleration sub-stage ends. Specifically, it is the current real-time acceleration + actual acceleration change rate × theoretical duration of the acceleration sub-stage. Calculate the acceleration decay amount by comparing the difference with the target acceleration. Determine the velocity reduction to be covered by the deceleration sub-stage based on the final target velocity and the predicted velocity after the uniform acceleration sub-stage ends. Generate two candidate values ​​for the deceleration duration by using the ratio of acceleration decay to the second acceleration change rate and the integral relationship between velocity reduction and predicted acceleration. Take the larger of the two values ​​as the theoretical duration of the deceleration sub-stage. Step S256: Integrate the theoretical durations corresponding to the acceleration phase, uniform acceleration phase, and deceleration phase.

6. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 5, characterized in that, Step S253, which involves generating the duration correction coefficient for the acceleration sub-stage using the derivative relationship between the velocity increment and the actual rate of change of acceleration, includes the following steps: The real-time velocity change curve in the acceleration sub-stage is obtained by the signal sampling module corresponding to the controller. Specifically, it is generated by fitting the actual acceleration change rate of continuous cycles, and the first derivative of the real-time velocity change curve is obtained based on the velocity increment to obtain the actual velocity change rate sequence. Theoretical acceleration curves are constructed based on actual acceleration change rates, and time integration is performed on the theoretical acceleration change curves to obtain theoretical velocity change rates. The theoretical velocity change rate is then compared with the actual velocity change rate sequence to calculate the percentage deviation between the two and generate a velocity change rate deviation coefficient. By introducing the response characteristic data of the transmission system corresponding to the controlled object, specifically obtained through phase difference analysis between the control signal and the feedback speed, and constructing a response delay-correction factor mapping model, the speed change rate deviation coefficient is input into the response delay-correction factor mapping model, and the basic correction factor is output. The specific mapping logic is that the basic correction factor increases linearly with the increase of the speed change rate deviation coefficient. The velocity increment is segmented into low, medium and high speed segments according to the velocity range. The derivative of the actual acceleration rate of change is extracted for each speed segment. The increasing or decreasing characteristics of the actual acceleration rate of change are determined based on the sign of the derivative of the actual acceleration rate of change. Segmentation characteristic coefficients are generated. The segmentation characteristic coefficients are then multiplied by the basic correction factor to obtain the segmentation correction factor. Calculate the proportion of the velocity increment of each velocity segment to the total velocity increment, and multiply this proportion by the corresponding segment correction factor to obtain the comprehensive correction coefficient. Fine-tune the comprehensive correction coefficient by combining the basic theoretical duration of the acceleration sub-stage with the corresponding time dimension weight to generate the duration correction coefficient of the acceleration sub-stage.

7. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 5, characterized in that, Step S254, which involves combining the maximum acceleration threshold with real-time load characteristic data to generate the load-acceleration attenuation coefficient, includes the following steps: The controller acquires the real-time operating current signal corresponding to the drive device through the current acquisition interface. After filtering and denoising the real-time operating current signal, the real-time load current ratio is calculated in combination with the rated current parameter of the drive device. At the same time, the real-time load current ratio is used as the initial load characterization parameter. The system calls the load-impedance mapping library for the controlled object. This library is pre-built based on impedance test data under different loads. The initial load characterization parameters are input into the load-impedance mapping library, which outputs the corresponding real-time load impedance value. Then, based on Ohm's law for circuits, it derives the formula: Load power loss = Real-time load impedance value × Initial load characterization parameters. 2 The load power loss is used to quantify the degree of energy consumption of the corresponding load on the corresponding drive device by the controller, and load energy consumption parameters are generated. The theoretical driving power corresponding to the maximum acceleration threshold is extracted from the trapezoidal acceleration variation model. The theoretical driving power is calculated as the maximum acceleration threshold × the mass of the controlled object × the preset speed benchmark. The difference between the theoretical driving power and the load energy consumption parameters is calculated to obtain the effective driving power margin. By introducing the mechanical transmission efficiency data of the controlled object, and performing transmission power fitting calculation and normalization on the effective driving power margin based on the mechanical transmission efficiency data, normalized power parameters are obtained; then, the normalized power parameters are nonlinearly transformed by the arctangent function to generate the preliminary attenuation coefficient. The system acquires real-time temperature data of the controlled object and converts the real-time temperature data into a temperature correction factor based on the real-time load characteristic data. At the same time, the system multiplies the initial attenuation coefficient with the temperature correction factor to generate the load-acceleration attenuation coefficient.

8. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Based on the dynamic programming algorithm, set the discrete time period base duration according to the computing power of the controller and the response requirements of the controlled object. Calculate the number of discrete time periods contained in each sub-stage based on the theoretical duration of each sub-stage in the sub-stage duration = theoretical duration of each sub-stage / discrete time period base duration, and round it down. Step S32: Initialize the state parameters corresponding to the current discrete time period, so that the current real-time velocity in the initial control dataset is set as the initial velocity of the period and the current real-time acceleration is set as the initial acceleration of the period; for the first discrete time period, determine the sub-stage to which it belongs and extract the sub-stage control parameters corresponding to the sub-stage; calculate the target acceleration increment according to the sub-stage type, specifically, the acceleration increment of the acceleration sub-stage = the first acceleration change rate × the discrete time period reference duration; the acceleration increment of the uniform acceleration sub-stage = 0; the acceleration increment of the deceleration sub-stage = the second acceleration change rate × the discrete time period reference duration or the negative second acceleration change rate × the discrete time period reference duration; Step S33: Calculate the instantaneous acceleration of the current cycle = initial acceleration of the cycle + target acceleration increment; impose a threshold limit on the instantaneous acceleration to ensure that it does not exceed the maximum acceleration threshold or is lower than the negative maximum acceleration threshold; then calculate the instantaneous velocity of the current cycle = initial velocity of the cycle + instantaneous acceleration × discrete time period reference duration; Step S34: Associate and store the instantaneous velocity and instantaneous acceleration of the current cycle with the cycle number and the sub-stage identifier to form an instantaneous parameter record; use the instantaneous velocity and instantaneous acceleration of the current cycle as the initial velocity and initial acceleration of the next cycle, and repeat steps S32-S33 until the discrete time cycle calculation of all sub-stages is completed to obtain the instantaneous velocity sequence and instantaneous acceleration sequence containing all cycles; Step S35: Perform continuity verification on the instantaneous velocity sequence and instantaneous acceleration sequence, and determine whether the velocity change and acceleration change in adjacent time periods meet the sub-stage control parameter requirements of the trapezoidal acceleration change model. If they meet the requirements, use the instantaneous velocity sequence and instantaneous acceleration sequence as intermediate control datasets. If they do not meet the requirements, readjust the upper limit of the acceleration change rate or the maximum acceleration threshold in the sub-stage control parameters, return to step S33 to recalculate the instantaneous parameters for the discrete time period, until an intermediate control dataset that meets the continuity requirements is obtained.

9. The method for controlling a non-zero starting point s-curve using dynamic programming according to claim 1, characterized in that, Step S4 includes the following steps: Based on the instantaneous velocity sequence in the intermediate control dataset, the deviation from the final target velocity is iteratively judged. If the instantaneous velocity in a certain discrete time period reaches or approaches the final target velocity, the constant velocity maintenance judgment is triggered; if it does not reach the target velocity, the dynamic programming recursive logic continues, using the instantaneous velocity and instantaneous acceleration of the current period as the new initial state data, and returns to steps S2-S3 to re-perform the stage judgment and parameter calculation until the s-curve parameter sequence containing the complete speed change process is obtained. The instantaneous velocity sequence in the S-curve parameter sequence is converted into a control signal recognizable by the drive device. The control signal includes a pulse width modulation signal or an analog voltage signal. The control signal is output to the drive device to drive the controlled object to run according to the S-curve parameter sequence. At the same time, feedback data from the drive device is collected in real time. The feedback data includes the actual running speed and the actual running acceleration to obtain a control effect feedback dataset. A deviation analysis is performed on the actual running speed and actual running acceleration in the control effect feedback dataset and the instantaneous speed and instantaneous acceleration in the S-curve parameter sequence to calculate the tracking error, which includes speed tracking error and acceleration tracking error. Based on the tracking error, it is determined whether the S-curve parameter sequence needs to be corrected. If the tracking error is greater than the preset error threshold, the sub-stage control parameters in the trapezoidal acceleration change model are adjusted, and the process returns to step S2 to regenerate the sub-stage duration. If the tracking error is less than or equal to the error threshold, the current S-curve control is confirmed to be effective, and the final S-curve control generation result is output.

10. A control device for realizing a non-zero starting point s-curve using dynamic programming, characterized in that, The system includes a speed control device, a controller, a drive unit, and a speed control algorithm stored on the controller and capable of running on the drive unit, for executing the dynamic programming control method for realizing a non-zero starting point s-curve as described in any one of claims 1-9.