Engine control methods, power systems, devices, equipment, and storage media

By switching to stall control mode and applying holding current to lock the crankshaft position when the engine meets specific conditions, the problem of crankshaft position drift when the engine stops in a hot state is solved, improving the smoothness of the starting process and noise control performance.

CN123064590APending Publication Date: 2026-11-10CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611315332.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

When the engine is stopped while it is warm, the crankshaft position is prone to drift, resulting in high starting resistance and significant vibration, which affects the smoothness of the vehicle's start-stop and NVH performance.

Method used

When the engine meets certain conditions, it switches to stall control mode and uses a generator to apply a holding current to lock the crankshaft position and prevent crankshaft position drift.

Benefits of technology

It improves the repeatability of the crankshaft stop position, enhances the smoothness of the start-up process and noise control performance, and improves the control reliability and user experience of the engine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123064590A_ABST
    Figure CN123064590A_ABST
Patent Text Reader

Abstract

This application discloses an engine control method, power system, device, equipment, and storage medium, belonging to the field of engine technology. The technical solution provided by the embodiments of this application, by switching to a stall control mode and applying a holding current to lock the crankshaft position when the engine meets specific conditions, prevents crankshaft position drift. This has the advantages of preventing crankshaft position drift after shutdown, improving the repeatability accuracy of the crankshaft shutdown position, and improving the smoothness and noise control performance of subsequent startup processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of engine technology, and in particular to an engine control method, power system, device, equipment, and storage medium. Background Technology

[0002] Hybrid vehicles rely heavily on frequent engine start-stop cycles to reduce fuel consumption and emissions. When the engine stops, a generator is used to pull the engine crankshaft to the target crankshaft stop position to improve vibration and noise performance during restart.

[0003] However, when the engine is stopped while still warm, the expansion pressure of the residual gas in the cylinders pushes the piston, causing the crankshaft to drift or reverse after reaching the target crankshaft stopping position. This results in poor consistency in the crankshaft stopping position and a risk of hardware damage. Upon restarting, the uncertain crankshaft position requires extensive phase alignment, leading to high starting resistance, significant impact and vibration, affecting the smoothness of the vehicle's start-stop operation and NVH (Noise, Vibration, Harshness) quality. Summary of the Invention

[0004] This application provides an engine control method, power system, device, equipment, and storage medium, which can improve the engine control effect. The technical solution is as follows: On the one hand, an engine control method is provided, the method comprising: Upon receiving an engine shutdown command, in response to the engine meeting a first preset condition, the generator connected to the crankshaft of the engine is switched to stall control mode. In the stall control mode, based on the electrical angle of the generator and the engine operating parameters at the time of control mode switching, a holding current is applied to the generator to keep the crankshaft locked in the current position.

[0005] On one hand, an engine control device is provided, the device comprising: The switching module is used to switch the generator connected to the crankshaft of the engine to stall control mode in response to the engine meeting a first preset condition after receiving an engine shutdown command. An application module is used to apply a holding current to the generator based on the generator's electrical angle and engine operating parameters at the time of the control mode switch in the stall control mode, so as to keep the crankshaft locked in the current position.

[0006] On the one hand, a power system is provided, which includes an engine, a generator, and a controller; The generator is mechanically connected to the crankshaft of the engine, and the generator is configured to apply torque to the crankshaft during engine shutdown to control the position of the crankshaft; The controller is configured to execute the control method for the engine.

[0007] On one hand, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, the computer program being loaded and executed by the one or more processors to implement the engine control method.

[0008] On one hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the engine control method.

[0009] On one hand, a computer program product or computer program is provided, which includes program code stored in a computer-readable storage medium. A processor of an electronic device reads the program code from the computer-readable storage medium and executes the program code, causing the electronic device to perform the aforementioned engine control method.

[0010] The technical solution provided by the embodiments of this application prevents crankshaft position drift by switching to stall control mode and applying holding current to lock the crankshaft position when the engine meets specific conditions. It has the advantages of preventing crankshaft position drift after shutdown, improving the repeatability accuracy of crankshaft shutdown position, and improving the smoothness and noise control performance of subsequent start-up process. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram of the implementation environment of an engine control method provided in an embodiment of this application; Figure 2 This is a flowchart of an engine control method provided in an embodiment of this application; Figure 3 This is a flowchart of another engine control method provided in an embodiment of this application; Figure 4 This is a flowchart of another engine control method provided in the embodiments of this application; Figure 5 This is a flowchart of another engine control method provided in the embodiments of this application; Figure 6 This is a flowchart of another engine control method provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of a power system provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an engine control device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0014] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor are there any restrictions on quantity or execution order.

[0015] In related technologies, when an engine is stopped while warm, the expansion pressure of residual gas in the cylinders acts on the piston, causing the crankshaft to drift or reverse after reaching the target crankshaft stopping position. This phenomenon makes it difficult to maintain consistent crankshaft stopping position and induces abnormal stress on hardware components. Furthermore, due to the uncertainty of the crankshaft position, a large-scale phase alignment operation is required during subsequent starting, thereby increasing starting resistance, generating impacts and vibrations, and affecting start-stop smoothness, noise, vibration, and acoustic roughness quality.

[0016] For example, in urban road conditions with frequent start-stop cycles, the engine enters the shutdown phase after high-temperature operation. The expansion pressure of the gas inside the cylinder pushes the piston, causing the crankshaft to be dragged to the target crankshaft shutdown position and then undergo a slight displacement. This displacement causes the actual position of the crankshaft to exceed the preset error range, requiring phase readjustment upon startup. In this scenario, increased starting resistance is detected, vibration and noise signals are collected, and transmission system components bear additional mechanical loads.

[0017] If the above issues are not resolved, inconsistent crankshaft stop positions will cause phase alignment operations to be repeatedly performed with each start-up. This repetitive operation prolongs start-up response time and increases mechanical stress on powertrain components. Furthermore, impact loads increase the risk of premature failure of the crankshaft position sensor and flywheel ring gear, thereby reducing the stability of noise, vibration, and acoustic roughness performance, and affecting overall vehicle reliability.

[0018] Based on this, the technical solution provided in the embodiments of this application is proposed.

[0019] Figure 1 This is a schematic diagram illustrating the implementation environment of an engine control method provided in this application embodiment. See also... Figure 1 This implementation environment may include a vehicle controller 101, an engine controller 102, and a generator controller 103. The vehicle controller 101 is communicatively connected to both the engine controller 102 and the generator controller 103, meaning they can exchange data. The engine controller 102 controls the engine, and the generator controller controls the generator. A controllable connection exists between the generator and the engine; that is, the engines can be mechanically connected or disconnected. In some embodiments, the generator is a P1 motor, located at the rear end of the engine and connected to the engine's crankshaft.

[0020] Figure 2 This is a flowchart of an engine control method provided in an embodiment of this application. See also... Figure 2 Taking the vehicle controller as the executing entity as an example, the method includes: 201. Upon receiving an engine shutdown command, in response to the engine meeting the first preset condition, the vehicle controller switches the generator connected to the crankshaft of the engine to stall control mode.

[0021] Here, "engine" refers to an internal combustion engine, which generates power by burning fuel to drive vehicles or other mechanical equipment. In hybrid vehicles, the engine and generator work together to optimize fuel efficiency and emissions. In this embodiment, "generator" refers to a motor connected to the engine's crankshaft. It can either convert mechanical energy into electrical energy as a generator or convert electrical energy into mechanical energy as an electric motor, thereby driving or assisting in driving the engine's crankshaft rotation. The first preset condition refers to a set of conditions that the engine must meet to enter a specific control phase, including at least one of the following: the engine speed is below a preset lock-up speed threshold, and the engine's crankshaft is within a preset error range of the target crankshaft stop position. This first preset condition is used to determine whether the engine is close to a stop state and is ready to lock the crankshaft stop position. The preset lock-up speed threshold is a pre-set upper limit value for engine speed. When the engine speed is below this preset lock-up speed threshold, it indicates that the engine is running at low speed or is about to stop, suitable for subsequent crankshaft stop position control operations. The crankshaft position refers to the rotational angle of the engine's crankshaft, reflecting the specific position of the piston within the cylinder. The target crankshaft stopping position refers to the specific angular position at which the crankshaft is expected to ultimately stop when the engine is stopped. Selecting a target crankshaft stopping position is typically to optimize engine restart performance, such as reducing starting resistance, vibration, and noise. The preset error range refers to an allowable deviation interval set around the target crankshaft stopping position. When the crankshaft position falls within this deviation range, it is considered sufficiently close to the target crankshaft stopping position, and the next locking operation can proceed.

[0022] 202. In this stall control mode, the vehicle controller applies a holding current to the generator based on the generator's electrical angle and engine operating parameters at the time of control mode switching, so as to keep the crankshaft locked in the current position.

[0023] In this context, "locked rotor control mode" refers to a special operating mode of the generator. In this mode, the generator is controlled to generate a specific magnetic field force, thereby applying a radial holding force to the engine crankshaft to lock it in its current position without generating rotational torque. The electrical angle refers to the electrical angle of the generator's rotor magnetic field relative to the stator windings; this angle is a key parameter for current vector control. Engine operating parameters include at least one of the engine's crankshaft stop position and the engine's cylinder pressure. The holding current is a special current applied to the generator in locked rotor control mode. The electrical angle is the rotational angle of the generator rotor magnetic field relative to the stator windings, and its ratio to the mechanical angle of the rotor's physical rotation is equal to the number of pole pairs of the generator; that is, the electrical angle equals the product of the mechanical angle and the number of pole pairs. This holding current is designed to primarily generate a radial holding force to fix the crankshaft in its current position while avoiding the generation of torque that drives the crankshaft to rotate. The radial holding force is a magnetic field force perpendicular to the rotor's rotation direction. In stall control mode, radial holding force is used to firmly hold or lock the generator rotor (and consequently the engine crankshaft) in a specific position, preventing it from drifting due to external disturbances. Torque refers to the force that causes an object to rotate; in engine control, torque is a key physical quantity driving crankshaft rotation. In stall control mode, it is necessary to avoid generating torque that drives crankshaft rotation to achieve stable crankshaft locking. In the embodiments of this application, the crankshaft stopping position is the target crankshaft stopping position or the current position of the crankshaft.

[0024] The technical solution provided by the embodiments of this application prevents crankshaft position drift by switching to stall control mode and applying holding current to lock the crankshaft position when the engine meets specific conditions. It has the advantages of preventing crankshaft position drift after shutdown, improving the repeatability accuracy of crankshaft shutdown position, and improving the smoothness and noise control performance of subsequent start-up process.

[0025] It should be noted that, in the embodiments of this application, the engine fixed-position shutdown control includes four stages: speed control stage, torque control stage, angle control stage, and stall control stage. The technical solution provided in the embodiments of this application will provide a detailed explanation of each of these four stages. Steps 201-202 above are a simplified explanation of the stall control stage. The following will provide a clearer explanation of the stall control stage with some examples. See [link to relevant documentation]. Figure 3 Taking the vehicle controller as the executing entity as an example, the method includes: 301. After receiving the engine stop command, the vehicle controller determines whether the engine meets the first preset condition.

[0026] The first preset condition is set to at least one of the following: the engine speed is lower than a preset lock-up speed threshold, and the engine crankshaft is within a preset error range of the target crankshaft stop position. For example, the engine speed can be monitored in real time by a speed sensor mounted on the engine, and the current angular position of the crankshaft can be obtained by a crankshaft position sensor. The generator controller compares the obtained speed with the preset lock-up speed threshold, and simultaneously compares the crankshaft position with the target crankshaft stop position and its preset error range. The first preset condition is determined to be met only when the speed is lower than the preset lock-up speed threshold and the crankshaft position is within the preset error range of the target crankshaft stop position. Alternatively, a fixed time interval can be set to periodically collect the engine speed and crankshaft position, and then determine the first preset condition.

[0027] 302. When the engine meets the first preset condition, the vehicle controller switches the generator connected to the crankshaft of the engine to the stall control mode and obtains the electrical angle of the generator at the moment of control mode switching.

[0028] When the vehicle controller determines that the first preset condition is met, it sends a command to the generator controller to switch from the current position control mode (e.g., a mode previously used to drag the crankshaft to near the target crankshaft stop position) to a stall control mode. Upon completion of the mode switch, the generator controller reads or calculates the electrical angle of the generator and provides this electrical angle to the subsequent control logic. For example, the generator controller can have a built-in electrical angle sensor, from which the electrical angle is obtained after receiving the mode switch command. Alternatively, the electrical angle can also be obtained by analyzing and calculating the voltage and current of the generator windings; this embodiment does not limit this approach.

[0029] 303. In the stall control mode, the vehicle controller determines a first current component of the holding current based on the electrical angle, the crankshaft stop position of the engine, and the engine cylinder pressure, the first current component being used to generate a radial holding force that locks the crankshaft in the current position.

[0030] Here, the crankshaft stopping position refers to the target crankshaft stopping position or the current position of the crankshaft, and the engine cylinder pressure refers to the pressure inside the engine cylinder. The first current component is a component of the holding current used to generate the radial holding force that locks the crankshaft in its current position. The radial holding force is the force generated by the interaction of the magnetic fields between the stator and rotor of the motor, and its direction is perpendicular to the rotor's rotation axis, capable of fixing the rotor (i.e., the crankshaft) in a specific position. This first current component can be determined in various ways. For example, the required current amplitude can be calculated using a preset lookup table or mathematical model based on the target crankshaft stopping position and the magnetic circuit characteristics of the generator; or, the required current amplitude can be calculated using a preset lookup table or mathematical model based on the engine cylinder pressure and the generator's magnetic circuit characteristics; or, the required current amplitude can be calculated using a preset lookup table or mathematical model based on the crankshaft stopping position, engine cylinder pressure, and the generator's magnetic circuit characteristics. The application direction of the first current component can be aligned with the direction of the generator's magnetic field or a specific magnetic axis to maximize the effect of the radial force.

[0031] In one possible implementation, the vehicle controller determines the current value of the first current component based on at least one of the engine crankshaft stop position and the engine cylinder pressure. The vehicle controller determines the application direction of the first current component based on the electrical angle. The vehicle controller then determines the first current component based on both the current value and the application direction.

[0032] Determining the value of the first current component based on the crankshaft stopping position refers to calculating or finding the required magnitude of the first current component based on the specific position where the engine crankshaft is expected to stop or its current position. For example, different crankshaft stopping positions may correspond to different cylinder compression states or mechanical resistances, thus requiring different magnitudes of radial holding force to maintain crankshaft stability. Determining the value of the first current component based on the engine cylinder pressure refers to calculating or finding the required magnitude of the first current component based on the cylinder compression state or mechanical resistance. The value of this first current component can be pre-calibrated experimentally to establish a mapping relationship between the crankshaft stopping position and the required current value, or between the engine cylinder pressure and the required current value, or between the crankshaft stopping position and the engine cylinder pressure and the required current value, and stored in a lookup table; alternatively, the required current value can be calculated in real time based on the mechanical characteristics (such as cylinder pressure, friction, etc.) at the crankshaft stopping position by establishing a physical model of the engine, or the required current value can be calculated using the engine cylinder pressure through the physical model. Determining the application direction of the first current component based on electrical angles refers to using the real-time electrical angle information of the generator rotor to determine the direction of action of the first current component in the generator stator coordinate system. Electrical angles directly reflect the position of the rotor magnetic poles relative to the stator windings, thus indicating the direction of the magnetic field that generates pure radial force without torque. For example, this application direction can be set to be consistent with the generator's D-axis direction, which is typically aligned with the rotor flux linkage direction. Applying current in the D-axis direction primarily generates magnetic force rather than torque. Alternatively, to compensate for factors such as response delay, the D-axis direction can be offset by a preset angle to ensure that the actual applied current direction aligns with the desired radial force direction. Determining the first current component based on the current value and application direction means combining the determined current magnitude and application direction to form a complete current vector. This current vector represents the current component that should be applied to the generator at a specific electrical angle to generate the required radial holding force at the target crankshaft stop position. For example, the current value and application direction can be converted into D-axis and Q-axis current components, where the D-axis current component is mainly used to generate the magnetic field, and the Q-axis current component is mainly used to generate torque. By controlling the D-axis current component, radial holding force can be generated.

[0033] By refining the determination process of the first current component of the holding current into independent and accurate determination of the current value and the direction of application through the above-described implementation, the applied radial holding force can be matched with the actual requirements of the engine in the crankshaft stop position or the engine cylinder pressure. Furthermore, the direction of the first current component can be aligned with the rotor flux direction, thereby minimizing the generation of unwanted drive torque. This improves the accuracy and stability of the crankshaft locking in the current position, prevents minor crankshaft rotation in the stop state, and thus enhances the reliability of engine stop control and the user experience.

[0034] To provide a clearer explanation of the above embodiments, the following description is divided into several parts.

[0035] Part 1: The vehicle controller determines the current value of the first current component based on the crankshaft's stopping position.

[0036] In one possible implementation, the vehicle controller acquires a first correspondence between at least one of the crankshaft stop position and the engine cylinder pressure and the holding current. Based on the crankshaft stop position and the engine cylinder pressure and the first correspondence, the current value of the first current component is determined.

[0037] Specifically, obtaining the first correspondence between the crankshaft stop position and the holding current refers to establishing a mapping relationship between a specific crankshaft stop position and the holding current value required to be applied at that specific crankshaft stop position or the current position of the crankshaft. Obtaining the first correspondence between the engine cylinder pressure and the holding current refers to establishing a mapping relationship between the engine cylinder pressure and the holding current value required to be applied at that engine cylinder pressure.

[0038] The first correspondence can be obtained through prior experimental testing, simulation modeling, or accumulation of empirical data, and is typically stored in the vehicle controller in the form of a lookup table, mathematical function, or parametric curve. The purpose of the first correspondence is to provide direct, verified holding current reference values ​​for different crankshaft stop positions or different engine cylinder pressures, ensuring sufficient radial holding force is generated when the engine stops. Determining the current value of the first current component based on at least one of the crankshaft stop position and engine cylinder pressure, and the first correspondence, means using the established first correspondence to directly look up or calculate the corresponding current value of the first current component based on at least one of the crankshaft stop position and engine cylinder pressure. For example, if the first correspondence is a lookup table, the corresponding current value is looked up in the table based on at least one of the crankshaft stop position and engine cylinder pressure; if it is a function, at least one of the crankshaft stop position and engine cylinder pressure is substituted into the function for calculation.

[0039] By determining the value of the first current component through the correspondence between the direct crankshaft stop position and at least one of the engine cylinder pressure and the holding current, the applied holding current can generate a radial holding force that locks the crankshaft in its current position after the engine meets the first preset condition and enters the stall control mode. This avoids locking instability or unnecessary energy loss due to improper current values, thereby improving the accuracy and reliability of engine stop control.

[0040] For example, when determining the current value of the first current component, the vehicle controller pre-stores a lookup table that records multiple typical crankshaft stopping positions (e.g., crankshaft angles of 0 degrees, 90 degrees, 180 degrees, 270 degrees, etc.) and their corresponding holding current values. Alternatively, the lookup table records multiple typical engine cylinder pressures and their corresponding holding current values. Once the crankshaft stopping position is determined, for example, a crankshaft stopping position of 90 degrees, the vehicle controller queries the lookup table to obtain the holding current value corresponding to 90 degrees and uses it as the current value of the first current component.

[0041] The following describes another implementation of the first part described above.

[0042] In one possible implementation, the vehicle controller acquires a second correspondence between at least one of the crankshaft stop position and the engine cylinder pressure and the required torque. Based on the crankshaft stop position and the engine cylinder pressure, and the second correspondence, the vehicle controller determines the required torque. Based on the required torque, the vehicle controller determines the current value of the first current component through a torque-current conversion relationship.

[0043] The first step, obtaining the second correspondence between the crankshaft stopping position and the required torque, refers to establishing a mapping relationship between a specific crankshaft stopping position and the required torque to keep the crankshaft stationary at that specific stopping position. The second correspondence between the engine cylinder pressure and the required torque refers to establishing a mapping relationship between the engine cylinder pressure and the required torque to keep the crankshaft stationary at that engine cylinder pressure. This second correspondence can also be obtained through experiments, simulations, or experience, and stored in the form of lookup tables, mathematical functions, or parametric curves. Its purpose is to provide an indirect method for determining the current value; that is, first determine the torque required to keep the crankshaft stationary, and then convert it into current. Determining the required torque based on the crankshaft stopping position and the second correspondence means using the established second correspondence to look up or calculate the required torque to keep the crankshaft stationary at that position, based on the crankshaft stopping position. Similarly, determining the required torque based on the engine cylinder pressure and the second correspondence means using the established second correspondence to look up or calculate the required torque to keep the crankshaft stationary at that engine cylinder pressure, based on the engine cylinder pressure. Based on the required torque, the current value of the first current component is determined through the torque-current conversion relationship. This refers to the mapping relationship between the current value required to generate a specific torque using a generator. This mapping relationship is related to the electromagnetic characteristics and winding parameters of the generator, and can be obtained through the generator's mathematical model or experimental calibration. This process converts the previously determined required torque into the current value that the generator actually needs to apply, thereby obtaining the current value of the first current component.

[0044] By employing the above-described implementation method, the current value of the first current component is determined by combining the correspondence between at least one of the crankshaft stop position and the engine cylinder pressure with the required torque, along with the torque-current conversion relationship. This ensures that after the engine meets the first preset condition and enters the stall control mode, the applied holding current can generate a radial holding force that locks the crankshaft in its current position. This avoids locking instability or unnecessary energy loss due to improper current values, thereby improving the accuracy and reliability of engine stop control.

[0045] For example, the vehicle controller pre-stores another lookup table that records multiple typical crankshaft stop positions and their corresponding required torque values; alternatively, the lookup table records multiple typical engine cylinder pressures and their corresponding required torque values; or, the lookup table records multiple typical engine cylinder pressures and their corresponding required torque values. Taking a lookup based on crankshaft stop position as an example, once the crankshaft stop position is determined, for example, at 90 degrees, the vehicle controller queries this lookup table to obtain the required torque value corresponding to 90 degrees. The vehicle controller uses the generator's torque-to-current conversion relationship (e.g., a linear function or another lookup table) to convert this required torque value into the current value of the required first current component. For example, if the required torque is X N·m, and the torque-to-current conversion relationship indicates that each Y ampere of current produces Z N·m of torque, the current value of the first current component can be calculated.

[0046] The second part involves the vehicle controller determining the direction of application of the first current component based on the electrical angle.

[0047] In one possible implementation, the vehicle controller determines the D-axis direction of the generator based on the electrical angle. The vehicle controller then determines this D-axis direction as the application direction of the first current component.

[0048] Determining the D-axis direction of the generator based on this electrical angle means that, in generator control, the D-axis direction in the synchronous rotating coordinate system is determined by acquiring the rotor's electrical angle in real time. The D-axis is typically aligned with the magnetic flux linkage direction of the rotor's permanent magnets, and accurate determination of the D-axis direction is fundamental to achieving field-oriented control. Setting this D-axis direction as the application direction of the first current component means that this current component is primarily used to generate a magnetic field aligned with the rotor's magnetic flux linkage direction, thereby generating a radial holding force, while generating little or no torque to drive the crankshaft. This is because the D-axis direction represents the direction of the rotor's magnetic flux linkage; applying the first current component to the D-axis direction maximizes the radial magnetic attraction force, thereby locking the crankshaft in its current position while minimizing the rotational torque on the crankshaft.

[0049] Through the above implementation method, the application direction of the first current component of the holding current can be controlled during engine shutdown lock-up. By aligning the first current component with the D-axis direction of the generator, the radial holding force can be applied to the crankshaft efficiently and accurately, thereby achieving stable torque-free crankshaft lock-up. This improves the reliability and accuracy of engine shutdown lock-up, avoiding lock-up instability or accidental rotation caused by current direction deviation.

[0050] For example, when determining the direction of application of the first current component, the electrical angle of the generator can be obtained by a high-precision rotary transformer or photoelectric encoder mounted on the generator rotor. This electrical angle directly reflects the position of the rotor magnetic poles relative to the stator windings. Based on this electrical angle, the vehicle controller calculates the D-axis direction of the generator. For example, in a permanent magnet synchronous generator, the D-axis is aligned with the north pole direction of the rotor permanent magnet, and the vehicle controller uses the calculated D-axis direction as the direction of application of the first current component.

[0051] The following describes another implementation of the first part described above.

[0052] In one possible implementation, the vehicle controller determines the D-axis direction of the generator based on the electrical angle. The vehicle controller then offsets this D-axis direction by a preset angle to obtain a shifted D-axis direction, which is used to compensate for directional deviations caused by the generator's response delay. This shifted D-axis direction is then determined as the application direction of the first current component.

[0053] Offsetting the D-axis direction by a preset angle to obtain the offset D-axis direction is for fine-tuning the D-axis direction to optimize control performance or compensate for inherent system characteristics. This preset angle compensates for directional deviations caused by the generator's response delay. This is because there is a time delay between the controller issuing a command and the generator actually generating the corresponding current. This delay may cause the actual applied current direction to lag behind the rotor's real-time D-axis direction. By introducing a preset angle for compensation, the current direction can be aligned with the rotor's D-axis direction in real time or reach an optimal relative position.

[0054] Through the above implementation method, the application direction of the first current component of the holding current can be more accurately controlled during engine shutdown lock-up. By aligning the first current component with the D-axis direction of the generator, and further compensating for directional deviations caused by system response delays through a preset angle, the radial holding force can be applied to the crankshaft efficiently and accurately, thereby achieving stable torque-free crankshaft lock-up. This improves the reliability and accuracy of engine shutdown lock-up, avoiding lock-up instability or accidental rotation caused by current direction deviations.

[0055] For example, to compensate for the inherent response delay of the control system (such as the current controller or inverter), the D-axis direction is offset by a preset angle before determining it as the application direction of the first current component. For instance, a preset angle corresponding to the generator response delay can be determined through experimental calibration or system modeling. This preset angle can be a fixed value or a value dynamically adjusted based on the generator's operating conditions (such as temperature and voltage). For example, if the system response delay causes the current direction to lag by 5 electrical angles, the D-axis direction can be shifted forward by 5 electrical angles to obtain an offset D-axis direction. The vehicle controller uses this offset D-axis direction as the application direction of the first current component. In this way, when the current is actually applied to the generator, its direction is aligned with the real-time D-axis direction of the rotor, thereby ensuring the effective application of the radial holding force.

[0056] 304. The vehicle controller adjusts the value of the second current component of the holding current to zero. This second current component is used to ensure that no torque is generated to drive the crankshaft to rotate.

[0057] The second current component is the Q-axis current, which is a component of the holding current used to ensure that no torque is generated to drive the crankshaft. In a permanent magnet synchronous motor, the driving torque is mainly generated by the quadrature-axis current (Q-axis current). Therefore, to ensure that no driving torque is generated, this second current component is usually designed to not generate or cancel any torque component. This can be achieved by setting the amplitude of this current component to zero or making its direction orthogonal to the direction of the magnetic field that generates the torque. For example, in the DQ coordinate system, the Q-axis current component can be set to zero to eliminate the generation of torque.

[0058] By employing step 304 above, the second current component is ensured to prevent the generation of torque that drives the crankshaft rotation when a holding current is applied to the generator to lock the crankshaft. This improves the accuracy and reliability of the engine's crankshaft stopping position control, avoids crankshaft position drift or instability caused by unnecessary torque, and thus ensures that the engine's crankshaft can stably remain in its current position.

[0059] 305. The vehicle controller applies a holding current to the generator based on the first current component and the second current component. The holding current is used to generate a radial holding force that locks the crankshaft in the current position without generating torque that drives the crankshaft to rotate.

[0060] In this process, applying a holding current to the generator, based on the first and second current components, involves synthesizing the independently determined first and second current components and applying this synthesis as the final holding current to the generator. In vector control strategies, this typically means mapping the first and second current components to D-axis and Q-axis current commands, respectively, and then converting these DQ-axis current commands into three-phase AC current commands via an inverse Park transformation. These three-phase current commands then drive the generator windings through the inverter, generating the required magnetic field and force within the generator to lock the crankshaft. This synthesis method allows the functions of the two current components to operate simultaneously and independently.

[0061] In one possible implementation, the vehicle controller acquires the stall control execution time. During this stall control execution time, the vehicle controller continuously applies the holding current to the generator based on the first current component and the second current component. If the continuous application time of the holding current exceeds the stall control execution time, the vehicle controller stops applying the holding current to the generator.

[0062] The lock-up control execution time refers to determining the duration for which the generator needs to apply holding current to lock the crankshaft. This execution time is a crucial parameter ensuring the crankshaft remains stably in the target crankshaft stop position while avoiding unnecessary energy consumption and component overheating. This lock-up control execution time can be pre-calibrated or calculated using a lookup table or empirical formula stored in the control unit, based on factors such as engine type, target crankshaft stop position, and ambient temperature. The vehicle controller can then query or calculate this time during operation. Alternatively, the vehicle controller can dynamically monitor certain engine status parameters, such as cylinder pressure decay, and estimate the required lock-up control execution time based on this real-time data to ensure that the holding current application only stops after the cylinder pressure has fully released. During this lock-up control execution time, based on the first and second current components, the holding current is continuously applied to the generator. This means that after determining the lock-up control execution time, the vehicle controller (generator controller) will continuously apply the previously calculated holding current to the generator during this time period. The vehicle controller can control the inverter via pulse width modulation (PWM) signals to convert direct current (DC) to alternating current (AC) and supply power to the stator windings of the generator with specific amplitude and phase, thereby generating the required holding current. During this process, the vehicle controller continuously monitors the current feedback and performs closed-loop regulation to ensure that the actual applied current matches the target holding current. Alternatively, a direct torque control (DTC) strategy can be employed. By controlling the generator's flux linkage and torque, a current component with zero torque but radial holding force is continuously output during the stall control execution time to achieve stable crankshaft locking. If the duration of the holding current application exceeds the stall control execution time, the application of the holding current to the generator is stopped. Specifically, when the actual application duration of the holding current is detected to have reached the preset stall control execution time, power supply to the generator is terminated, thus stopping the application of the holding current. An internal timer can be set within the vehicle controller (generator controller) to start timing from the beginning of the holding current application. When the timer value reaches or exceeds the stall control execution time, the vehicle controller issues a command to cut off or significantly reduce the current output to the generator. Alternatively, through a state machine or event-driven mechanism, when the event "stalled control execution time has expired" is triggered, the system will switch from the stall control mode to other modes (e.g., complete power-off mode or low-power standby mode), thereby stopping the application of holding current.

[0063] The above implementation method allows for control over the duration of the holding current application, avoiding energy waste and generator overheating caused by prolonged holding current operation. Simultaneously, it ensures the holding current operates effectively for a sufficiently long time, enabling the engine crankshaft to be stably and reliably locked in the target crankshaft shutdown position, thus improving the accuracy and reliability of engine shutdown control. This refined management of the holding current application duration enhances energy efficiency and component durability while guaranteeing effective engine shutdown.

[0064] To provide a clearer explanation of the above implementation methods, the method for obtaining the stall control execution time in the above implementation methods will be described below.

[0065] In one possible implementation, the vehicle controller obtains a third correspondence between the crankshaft stop position and the stall control execution time. Based on the target crankshaft stop position and the third correspondence, the vehicle controller determines the stall control execution time. Alternatively, the vehicle controller obtains the cylinder pressure decay time corresponding to the target crankshaft stop position, which is the time required for the cylinder pressure to decay from its current value to a preset pressure threshold after the engine stops at the target crankshaft stop position. Based on the cylinder pressure decay time, the vehicle controller determines the stall control execution time.

[0066] The acquisition of the third correspondence between crankshaft stopping position and stall control execution time refers to establishing a mapping relationship between the target crankshaft stopping position and the stall control execution time. This third correspondence can be obtained in advance through experimental calibration, simulation modeling, or empirical summarization. For example, it can be stored as a lookup table containing recommended stall control execution times for different target crankshaft stopping positions; or it can be a mathematical function model that calculates the corresponding stall control execution time based on the input target crankshaft stopping position. Determining the stall control execution time based on the target crankshaft stopping position and this third correspondence means using the established third correspondence to calculate or query the appropriate stall control execution time according to the current or preset target crankshaft stopping position. For example, if the third correspondence is a lookup table, the corresponding execution time will be searched in the table based on the current target crankshaft stopping position; if it is a function model, the target crankshaft stopping position will be used as an input parameter to calculate the stall control execution time. Obtaining the cylinder pressure decay time corresponding to the target crankshaft stop position refers to the time required for the cylinder pressure to decay from its current value to a preset pressure threshold after the engine stops at a specific target crankshaft stop position. The cylinder pressure decay time is determined by the engine's internal physical characteristics and is related to factors such as cylinder sealing, volume, and temperature. It can be obtained through pre-tested experiments, engine model simulation calculations, or estimation using real-time sensor data combined with predictive algorithms. Determining the stall control execution time based on this cylinder pressure decay time means using the obtained cylinder pressure decay time as the primary basis for setting the stall control execution time. For example, the cylinder pressure decay time can be directly used as the stall control execution time to ensure that the lockout is released only after the cylinder pressure has sufficiently decayed and the engine's internal resistance has decreased; alternatively, a safety margin can be added or appropriate adjustments made based on actual needs to further optimize the control effect.

[0067] Through the above implementation methods, the determination of the stall control execution time is no longer a fixed value, but can be dynamically adjusted according to the specific crankshaft shutdown position or internal physical state of the engine. This makes the duration of current application more accurate and reasonable. On the one hand, by utilizing the third correspondence between the crankshaft shutdown position and the stall control execution time, customized locking times are provided for the characteristics of different crankshaft shutdown positions (e.g., cylinder pressure, friction, etc. at different positions), avoiding unnecessary long-term current application, thereby reducing energy consumption and the thermal load on the generator and related controllers. On the other hand, by determining the execution time by obtaining the cylinder pressure decay time corresponding to the target crankshaft shutdown position, the crankshaft can be reliably locked when the cylinder pressure has not decayed sufficiently and the internal resistance of the engine is still relatively high, preventing the crankshaft from rotating unexpectedly due to cylinder pressure during shutdown, thus improving the stability and safety of the engine shutdown process. Both of these methods improve the intelligence level and energy-saving effect of engine shutdown control, while ensuring the reliability of crankshaft locking.

[0068] For example, the vehicle controller determines the duration of the holding current application. One specific implementation is as follows: the vehicle controller pre-stores a two-dimensional lookup table as a third correspondence. The horizontal axis of this lookup table can represent different target crankshaft stop positions (e.g., a specific range of crankshaft angles), and the vertical axis stores the recommended stall control execution time corresponding to these crankshaft stop positions. When the engine needs to stop at a certain target crankshaft stop position, the vehicle controller queries the lookup table to obtain the stall control execution time corresponding to that target crankshaft stop position. For example, if the target crankshaft stop position is near top dead center, the lookup table may give an execution time of 500 milliseconds; if the target crankshaft stop position is at the end of the compression stroke, it may give an execution time of 800 milliseconds. As another specific implementation, the vehicle controller estimates the cylinder pressure decay time corresponding to the target crankshaft stop position in real time or through a preset model. For example, after the engine stops at a target crankshaft stop position, the vehicle controller estimates the time required for the cylinder pressure to decay from the current value to a preset pressure threshold (e.g., 0.1 MPa) based on parameters such as cylinder volume and temperature at that position, combined with a preset cylinder pressure decay model. If the estimated cylinder pressure decay time is 600 milliseconds, the vehicle controller sets the stall control execution time to 600 milliseconds, or adds a small safety margin, such as setting it to 650 milliseconds. After determining the stall control execution time, the generator will continuously apply holding current until the stall control execution time ends, thereby keeping the crankshaft locked until the cylinder pressure has fully decayed.

[0069] Optionally, the following steps may also be performed during the engine shutdown control process.

[0070] In one possible implementation, in response to the engine crankshaft position exceeding the preset error range of the target crankshaft stop position, the vehicle controller switches the generator from the stall control mode to the angle control mode to re-drag the crankshaft to the target crankshaft stop position.

[0071] The crankshaft position of the engine is acquired by the vehicle controller. Acquiring the crankshaft position involves real-time monitoring of the crankshaft's rotation angle or position information, which is fundamental for determining whether the crankshaft has deviated from the target crankshaft stop position. This crankshaft position can be directly measured by a crankshaft position sensor (e.g., Hall effect sensor, magnetoresistive sensor, or photoelectric encoder) mounted on the engine crankshaft, and the measured signal is transmitted to the vehicle controller. Alternatively, the crankshaft position can be indirectly acquired through the generator's own rotor position sensor (e.g., rotary transformer, absolute encoder), as the generator rotor and engine crankshaft are typically rigidly connected, and a fixed correspondence exists between their positions. When the crankshaft position exceeds a preset error range for the target crankshaft stop position, it is used to detect whether the crankshaft has deviated from the allowable crankshaft stop position range. The vehicle controller continuously compares the currently acquired crankshaft position with the preset target crankshaft stop position and calculates the deviation between them. If the absolute value of this deviation is greater than the preset error range, the condition is considered met. Alternatively, an upper and lower limit can be set, which is the target crankshaft stopping position plus or minus a preset error range. If the current crankshaft position is not within this range, the condition is met. Switching the generator from stall control mode to angle control mode means that when the crankshaft deviates from the target crankshaft stopping position, the generator's control strategy needs to be changed from a simple hold mode to an active adjustment mode. Stall control mode is mainly used to maintain the crankshaft position, while angle control mode is used to drive the rotor (and crankshaft) to a specific angular position. After receiving a signal that the crankshaft position exceeds the limit, the mode switching logic inside the vehicle controller will shut down the current output of the stall control mode and activate the control algorithm of the angle control mode, such as a PID controller or other closed-loop control algorithm, to control the target electrical angle as input. Mode switching can also be implemented through software flags or state machines. When the switching conditions are met, the vehicle controller loads and executes the parameters and control laws required for the angle control mode, while stopping the operation of the stall control mode. The purpose of switching to angle control mode is to reposition the crankshaft back to the target crankshaft stopping position. This involves actively controlling the generator to produce torque, thus re-driving the deviated crankshaft back to the intended stopping position. In angle control mode, the vehicle controller calculates the required torque command based on the deviation between the current crankshaft position and the target crankshaft stopping position. It then drives the generator to produce the corresponding electromagnetic torque via the current controller, thereby dragging the crankshaft to the target position. Alternatively, a position closed-loop control strategy can be used. This converts the target crankshaft stopping position into a target electrical angle. Then, by comparing the deviation between the actual electrical angle and the target electrical angle, a control signal is generated to adjust the generator current, causing it to produce torque and thus returning the crankshaft to the target crankshaft stopping position.

[0072] Through the above implementation method, after the engine enters the stall control mode and a holding current is applied, it can cope with situations where the crankshaft position deviates from the target crankshaft stop position due to external interference or system errors. When the crankshaft position exceeds the preset error range, it can detect this in time and automatically switch the generator from the stall control mode to the angle control mode, thereby actively dragging the crankshaft back to the target crankshaft stop position.

[0073] For example, after the engine enters stall control mode, the vehicle controller acquires the engine's crankshaft position every 10 milliseconds via the crankshaft position sensor. With the target crankshaft stop position at 15 degrees after top dead center (TDC) and a preset error range of ±2 degrees, if the vehicle controller detects that the current crankshaft position is 18 degrees after TDC, exceeding the 15±2 degree range, it will trigger a mode switch. At this time, the vehicle controller stops the holding current output in stall control mode and activates angle control mode. In angle control mode, the vehicle controller converts the target crankshaft stop position (15 degrees after TDC) into the corresponding target electrical angle, such as 120 degrees. The vehicle controller then calculates the required torque command using a PID controller based on the deviation between the current generator's actual electrical angle (e.g., acquired via the generator rotor position sensor) and the target electrical angle.

[0074] Optionally, during the execution of steps 301-305 above, step 306 may be triggered. In this application, step 306 is described as being executed after step 305. Other execution times will not be described separately.

[0075] 306. In response to receiving an engine start command, the vehicle controller switches the generator from the stall control mode to the speed control mode.

[0076] During the transition from the stall control mode to the speed control mode, the output torque of the generator is sloped to ensure a smooth transition of the engine speed to the target starting speed. The engine start command is a signal issued by the driver (e.g., by pressing the start button) or by the vehicle controller based on specific operating conditions (e.g., automatic start-stop function), requesting the engine to start. This engine start command can be an electrical signal transmitted via the vehicle's communication bus (such as the CAN bus) or a direct hardwired signal. The vehicle controller monitors these signals and triggers subsequent control logic upon detecting a valid start command. Switching the generator from the stall control mode to the speed control mode means that the vehicle controller changes the generator's operating state based on the received engine start command. In stall control mode, the generator primarily generates radial holding force to lock the crankshaft; after switching to speed control mode, the generator outputs drive torque according to the set target speed to start the engine and accelerate it to the target starting speed. This mode switching is typically implemented by the software logic within the generator controller or the engine controller (ECU). Slope limiting of the generator's output torque refers to limiting the rate of change of the generator's output torque over time, i.e., limiting the absolute value of the torque change rate. This ensures that the torque does not jump instantaneously from one value to another, but changes at a controlled, gradual rate of increase or decrease. Slope limiting can be achieved by: processing the target torque through a limiting integrator to ensure its output value changes at a rate not exceeding a preset slope; or filtering the torque command through a low-pass filter to achieve a smooth torque transition, with the filter constant adjusted according to the desired slope limiting effect. The purpose of slope limiting is to smoothly transition the engine speed to the target starting speed. By limiting the rate of torque change, sudden increases or decreases in engine speed can be avoided, thereby improving start-up smoothness, reducing shocks and vibrations, and enhancing driving comfort. The target starting speed is typically the lowest speed at which the engine can operate stably, such as idle speed.

[0077] Through the above implementation method, when the engine switches from stall control mode to speed control mode for starting, the output torque of the generator is limited by a slope, avoiding sudden changes in torque. This allows the engine speed to smoothly transition from the locked state to the target starting speed, reducing shock and vibration during the starting process, thereby improving the engine's starting quality and ride comfort. Compared to the severe shaking that may result from directly switching modes, this improves the smoothness and stability of the engine starting process.

[0078] To provide a clearer explanation of the above embodiments, the following describes the method of limiting the slope of the generator's output torque during the switching from the stall control mode to the speed control mode.

[0079] In one possible implementation, the vehicle controller determines a torque change rate limit. During the transition from the stall control mode to the speed control mode, the vehicle controller, based on the torque change rate limit, controls the generator's output torque to transition from the current torque to the target torque.

[0080] The determination of the torque change rate limit aims to set the maximum allowable change in generator output torque per unit time. Its function is to prevent sudden torque changes during mode switching, thereby avoiding impact on engine mechanical components or system instability. One implementation method is to calculate a fixed torque change rate limit through experimental calibration or empirical formulas based on parameters such as engine type, rated power, starting characteristics, and generator response speed. Another implementation method is to dynamically adjust the torque change rate limit based on the current engine operating status, such as engine coolant temperature, ambient temperature, and battery charge, to adapt to different operating conditions. For example, a smaller change rate limit can be used in low-temperature environments to protect components. Controlling the transition of generator output torque from the current torque to the target torque describes the specific adjustment method of generator output torque during mode switching. Its function is to ensure a smooth change in torque, thereby achieving a smooth transition in engine speed. One implementation method is to use a ramp function to process the torque command. That is, upon receiving the target torque command, the torque is not immediately set to the target value, but rather gradually increased or decreased according to a predetermined torque change rate limit until the target torque is reached. Another approach is to use a proportional-integral-derivative (PID) controller or other advanced control algorithms to take the torque change rate limit as a constraint condition for the controller, calculate and output the torque command that meets the limit in real time, so as to achieve a smooth transition from the current torque to the target torque.

[0081] Through the above implementation method, when the engine switches from stall control mode to speed control mode to start the engine, instantaneous changes in generator output torque can be avoided. By determining and applying a torque change rate limit, the generator output torque can transition from the current value to the target torque in a controlled and gradual manner. This reduces the mechanical shocks and vibrations that the engine may suffer during startup, protects the critical components of the engine and generator, and extends their service life. At the same time, this smooth torque transition also ensures a stable increase in engine speed, improves the comfort and reliability of starting, and avoids starting failures or unstable phenomena caused by excessive torque fluctuations.

[0082] For example, in response to an engine start command, the vehicle controller reads a torque change rate limit from a preset parameter table or calculates it based on the current operating conditions, for example, setting it to 10 Nm / s. At the instant the generator switches from stall control mode to speed control mode, its output torque may be zero. The vehicle controller will calculate a target start torque in speed control mode, for example, 50 Nm. Instead of setting the torque command to 50 Nm, the vehicle controller will gradually increase the torque command at a rate of 10 Nm / s. This means that at the end of the first second, the torque command will reach 10 Nm; at the end of the second second, it will reach 20 Nm, and so on, until at the end of the fifth second, the torque command reaches the target value of 50 Nm. During this process, the vehicle controller continuously sends updated torque commands to the generator, ensuring that the actual output torque of the generator strictly follows this ramp-up curve, thereby achieving a smooth increase in engine speed.

[0083] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0084] Steps 301-306 above provide a detailed explanation of the stall control phase. The following section describes the angle control phase, which executes timings prior to and adjacent to the stall control phase. See [link to relevant documentation]. Figure 4 Taking the vehicle controller as the executing entity as an example, the following steps can also be performed before step 301 above.

[0085] 401. Upon receiving an engine shutdown command, in response to the engine meeting a second preset condition, the vehicle controller switches the generator to angle control mode. The second preset condition is that the engine speed is lower than a preset angle control speed threshold.

[0086] The second preset condition serves as the basis for judgment, specifically whether the engine speed is below a preset angle control speed threshold. This angle control speed threshold can be set based on factors such as engine type, size, inertia, and desired shutdown smoothness. For example, it can be set as the highest engine speed at which precise angle control is possible, or as an upper speed limit to ensure a safe switch to angle control mode. This judgment prevents direct entry into angle control mode when the engine speed is too high, thus ensuring control stability and safety. When the engine speed meets the second preset condition, i.e., the speed has dropped to a range suitable for precise angle control, the vehicle controller smoothly switches the generator's operating mode from the current mode (e.g., speed control mode or torque control mode) to angle control mode. Angle control mode is a mode that controls the generator rotor angle. By controlling the generator's current or voltage, it generates specific electromagnetic torque, thereby driving or braking the engine crankshaft to rotate it to the desired angular position. Switching to angle control mode is a crucial step in achieving precise shutdown positioning, providing the foundation for subsequent closed-loop control.

[0087] 402. In this angle control mode, the vehicle controller uses closed-loop angle position control to drag the crankshaft of the engine to the target crankshaft stop position.

[0088] In this process, after the generator enters angle control mode, the vehicle controller initiates closed-loop angle position control. This closed-loop control monitors the deviation between the engine crankshaft's current position (usually obtained via a crankshaft position sensor) and a preset target crankshaft stop position in real time, and calculates the required control quantity (such as the generator's output torque or current command) based on this deviation. The vehicle controller applies this control quantity to the generator, causing it to produce the corresponding torque, thereby driving the engine crankshaft to move towards the target crankshaft stop position. The key feature of closed-loop control is its feedback mechanism, which continuously corrects deviations, ensuring that the crankshaft is precisely and smoothly dragged to the target crankshaft stop position and remains stable in the vicinity of this position. This dragging process is typically gradual to avoid shocks and vibrations.

[0089] In one possible implementation, when the generator is switched to the angle control mode, the vehicle controller acquires the crankshaft position of the engine and the current electrical angle of the generator, where a fourth correspondence exists between the crankshaft position and the electrical angle. Based on this fourth correspondence and the target crankshaft stop position, the vehicle controller determines the target electrical angle. Based on the target electrical angle, the vehicle controller uses closed-loop control of the angle position to drag the crankshaft of the engine to the target crankshaft stop position.

[0090] There is a fourth correspondence between crankshaft position and electrical angle. This fourth correspondence refers to a fixed or calculable mapping relationship between the mechanical angle of the engine crankshaft and the electrical angle of the generator rotor. This fourth correspondence is typically determined by the mechanical connection method between the engine and generator, such as gear ratio or direct coupling, and the number of pole pairs of the generator. This fourth correspondence can be pre-stored in the controller through experimental calibration, theoretical calculation, or table lookup for real-time querying or calculation during control. The target crankshaft stopping position refers to the specific angular position at which the engine crankshaft is expected to stop, usually set to optimize the next engine start, reduce starting resistance, or meet emission requirements. Determining the target electrical angle aims to convert the engine's mechanical target crankshaft stopping position into a recognizable and executable electrical angle command. One implementation is to directly substitute the target crankshaft stopping position into the pre-established fourth correspondence to calculate the corresponding generator electrical angle. Another implementation is to find the target electrical angle matching the target crankshaft stopping position by consulting a mapping table stored in the controller, which records the association between different crankshaft positions and corresponding electrical angles. This angle position closed-loop control is a feedback control strategy. Its core idea is to continuously monitor the actual electrical angle of the generator and compare it with a predetermined target electrical angle. Based on the deviation between the two, a control command is generated to drive the generator to produce corresponding torque, thereby gradually bringing the actual electrical angle of the generator, and consequently the crankshaft position of the engine, closer to the target electrical angle. This control can be implemented using a proportional-integral-derivative (PID) controller, where the PID parameters are tuned to ensure control stability, response speed, and accuracy. Alternatively, more advanced control algorithms, such as model predictive control (MPC) or sliding mode control, can be used to handle nonlinearities or external disturbances. Dragging the engine crankshaft to the target crankshaft stopping position refers to actively and smoothly changing the rotational position of the engine crankshaft using the controlled torque generated by the generator, moving it from its current position to the preset target crankshaft stopping position.

[0091] Through the above implementation method, when the engine speed is low, the real-time position of the engine crankshaft and the current electrical angle of the generator can be obtained. Based on the fourth correspondence between the two, the mechanical target crankshaft stopping position of the engine is accurately converted into a target electrical angle that the generator can execute. On this basis, using angle position closed-loop control, the generator can generate appropriate torque to smoothly and accurately drag the engine crankshaft to the preset target crankshaft stopping position. This solves the problem that it is difficult to achieve precise crankshaft stopping at low speeds by controlling only speed or torque, improves the control accuracy and reliability of the engine crankshaft stopping position, and provides a more accurate and stable initial state for subsequent engine start-up or stall operations, thereby optimizing the overall engine operating efficiency and user experience.

[0092] To provide a clearer explanation of the above embodiments, the method for determining the target electrical angle in the above embodiments will be described below.

[0093] In one possible implementation, the vehicle controller acquires a first preset position and a second preset position, which are the boundaries of the crankshaft position range corresponding to the target crankshaft stop position. Based on the relationship between the crankshaft position and the first and second preset positions, the vehicle controller determines the target electrical angle.

[0094] The first and second preset positions are two boundary values ​​used to define the crankshaft position range corresponding to the target crankshaft stop position. These two preset positions can be pre-set based on factors such as the engine's mechanical characteristics, optimal starting point, or cylinder pressure decay characteristics. For example, they can be two specific angular values ​​within one revolution of the engine's crankshaft. By defining such a range, a certain tolerance range can be provided for the target crankshaft stop position, rather than a strictly single precise point, thereby improving control flexibility and practical operability. Determining the target electrical angle based on the relationship between the crankshaft position and the first and second preset positions involves comparing the currently detected engine crankshaft position with the preset first and second preset positions. This comparison operation can determine whether the current crankshaft position is before, within, or after the target range. Different strategies can be used to calculate the target electrical angle depending on the positional relationship. For example, if the crankshaft position is outside the target range, the target electrical angle is calculated to guide the generator to generate a torque to drag the crankshaft into the target range; if the crankshaft position is already within the target range, the target electrical angle may be calculated to fine-tune the crankshaft to a specific point within the range, or maintain its current position. This dynamic, position-relationship-based determination method makes the calculation of target electrical angles more intelligent and adaptable.

[0095] The first and second preset positions are explained below. Taking a four-cylinder engine as an example, the engine will rotate two revolutions (720°) when the engine completes one cycle of four strokes.

[0096] 1. First preset position (90°, first rotation (0°~360°)): Cylinder 1: The piston moves from top dead center to bottom dead center, and is in the middle of the intake stroke; Cylinder 4: The piston moves from top dead center to bottom dead center: it is in the middle of the power stroke; Cylinder 2: The piston moves from bottom dead center to top dead center: it is in the middle of the compression stroke; Cylinder 3: The piston moves from bottom dead center to top dead center: it is in the middle of the exhaust stroke.

[0097] 2. First preset position (450°, second circle (360°~720°)): Cylinder 1: The piston moves from top dead center to bottom dead center: it is in the middle of the power stroke; Cylinder 4: The piston moves from top dead center to bottom dead center: it is in the middle of the intake stroke; Cylinder 2: The piston moves from bottom dead center to top dead center: it is in the middle of the exhaust stroke; Cylinder 3: The piston moves from bottom dead center to top dead center, and is in the middle of the compression stroke.

[0098] 3. Second preset position (270°, first rotation (0°~360°)): Cylinder 1: The piston moves from bottom dead center to top dead center: it is in the middle of the exhaust stroke; Cylinder 4: The piston moves from bottom dead center to top dead center: it is in the middle of the compression stroke; Cylinder 2: The piston moves from top dead center to bottom dead center: it is in the middle of the intake stroke; Cylinder 3: The piston moves from top dead center to bottom dead center, and is in the middle of the power stroke.

[0099] 4. Second preset position (630°, second circle (360°~720°)): Cylinder 1: The piston moves from bottom dead center to top dead center: it is in the middle of the compression stroke; Cylinder 4: The piston moves from bottom dead center to top dead center: it is in the middle of the exhaust stroke; Cylinder 2: The piston moves from top dead center to bottom dead center: it is in the middle of the power stroke; Cylinder 3: The piston moves from top dead center to bottom dead center: it is in the middle of the intake stroke.

[0100] Through the above implementation method, after the engine enters the angle control mode, the target electrical angle can be dynamically determined by clearly defining the crankshaft position interval boundaries of the target crankshaft stop position and based on the size relationship between the current crankshaft position and these boundaries. This method avoids the problems of inaccurate control or difficulty in actual operation that may result from relying on a single target point, and improves the flexibility and accuracy of target electrical angle determination. Therefore, the generator can more accurately drag the engine crankshaft to the desired crankshaft stop position interval through angle position closed-loop control, thereby improving the accuracy and robustness of engine stop control and providing a more reliable basis for subsequent stall control mode or engine start-up.

[0101] To provide a clearer explanation of the above embodiments, the method for determining the target electrical angle based on the size relationship between the crankshaft position and the first preset position and the second preset position in the above embodiments will be described below.

[0102] In one possible implementation, when the crankshaft position is less than or equal to the first preset position, the vehicle controller determines the target electrical angle based on the difference between the first preset position and the crankshaft position, the number of pole pairs of the generator, and the electrical angle corresponding to each unit tooth. When the crankshaft position is greater than the second preset position, the vehicle controller determines the target electrical angle based on the difference between the crankshaft position and the second preset position, the first preset position, the number of pole pairs, and the electrical angle corresponding to each unit tooth. When the crankshaft position is greater than the first preset position and less than the second preset position, the vehicle controller determines the target electrical angle based on the difference between the second preset position and the crankshaft position, the number of pole pairs, and the electrical angle corresponding to each unit tooth.

[0103] When the crankshaft position is less than or equal to the first preset position, it indicates that the crankshaft is currently at or before a starting boundary of the target crankshaft stop position range. In this case, the required mechanical angle to be dragged needs to be calculated based on the difference between the first preset position and the crankshaft position. The number of pole pairs of the generator determines the conversion ratio between the generator's mechanical angle and electrical angle. For example, a generator with N pole pairs has N electrical cycles corresponding to 360 degrees of mechanical rotation. The electrical angle corresponding to a unit tooth refers to the generator's electrical angle corresponding to each unit tooth rotation of the crankshaft (e.g., the minimum mechanical angle increment detected by the crankshaft position sensor). This electrical angle corresponding to a unit tooth is usually pre-calibrated or calculated and used to convert the change in the crankshaft's mechanical position into a change in the generator's electrical angle. By combining the above parameters, the target electrical angle that the generator needs to reach can be determined to drag the crankshaft from its current position to the target crankshaft stop position range. When the crankshaft position is greater than the second preset position, it indicates that the crankshaft has crossed the end boundary of the target crankshaft stop position range. At this point, since the engine cannot rotate in reverse, the mechanical angle required to continue forward dragging needs to be calculated based on the difference between the crankshaft position and the second preset position. Simultaneously, the first preset position serves as a reference point for calculating the target electrical angle, ensuring that the calculated target electrical angle can pull the crankshaft back to the target crankshaft stopping position range. The number of pole pairs and the electrical angle per unit tooth of the generator are also key parameters for converting mechanical angles to electrical angles. In this way, even if the crankshaft exceeds the target range, a suitable target electrical angle can be calculated, guiding the crankshaft to complete one revolution and return to its original position. When the engine crankshaft position is greater than the first preset position and less than the second preset position, it indicates that the crankshaft is already within the preset range of the target crankshaft stopping position. In this case, the mechanical angle requiring fine-tuning needs to be calculated based on the difference between the second preset position and the crankshaft position. The role of the number of pole pairs and the electrical angle per unit tooth of the generator here is to ensure that the fine-tuned mechanical angle is converted into the generator's electrical angle, thereby achieving precise adjustment of the crankshaft position and ultimately stopping it at the target crankshaft stopping position. This calculation method helps to achieve more precise positioning after the crankshaft enters the target range, reducing oscillation and improving stopping accuracy.

[0104] Through the above implementation method, after the engine enters the angle control mode, the target electrical angle of the generator can be calculated based on the relative relationship between the current position of the crankshaft and the boundary (first preset position and second preset position) of the target crankshaft stop position interval. This segmented calculation method ensures that regardless of whether the crankshaft is located before, after, or within the target interval, an accurate target electrical angle that can guide the crankshaft to move to the target crankshaft stop position can be determined based on the precise mechanical position difference, the number of pole pairs of the generator, and the electrical angle corresponding to a unit tooth. This improves the accuracy and efficiency of the angle position closed-loop control, avoids crankshaft position oscillation or low dragging efficiency caused by inaccurate calculation of the target electrical angle, and thus enables the engine crankshaft to be dragged and stopped more smoothly and accurately at the preset target crankshaft stop position, improving the reliability of engine stop control and user experience.

[0105] To provide a clearer explanation of the above embodiments, the following description is divided into several parts.

[0106] The first part describes how the vehicle controller determines the target electrical angle based on the difference between the first preset position and the crankshaft position, the number of pole pairs of the generator, and the electrical angle corresponding to a unit tooth.

[0107] In one possible implementation, the vehicle controller determines a first compensation difference based on the difference between the first preset position and the crankshaft position, and a first compensation value. This first compensation value is used to compensate for crankshaft position deviation caused by communication delay. The vehicle controller then determines a first angle increment based on the first compensation difference, the number of pole pairs, and the electrical angle corresponding to the unit tooth. Finally, the vehicle controller determines the target electrical angle based on the current electrical angle and the first angle increment.

[0108] The first compensation value is used to correct for the lag in crankshaft position information caused by delays in internal system communication links or sensor data transmission. In practical applications, the data collected by the crankshaft position sensor needs to be processed and transmitted by the controller. This process introduces a time delay, causing the crankshaft position received by the controller to be not the real-time physical position. The first compensation value can be a pre-calibrated fixed value, for example, the average delay determined through experimental testing under specific communication conditions and converted into the corresponding crankshaft angle deviation; or it can be a dynamically adjusted value, for example, estimated and adjusted based on real-time communication load, data transmission rate, or system response time. This first compensation difference is the result of correcting the original difference between the first preset position and the crankshaft position, combined with the first compensation value. Its purpose is to provide a reference value that is closer to the actual physical deviation, thereby providing a more accurate input for subsequent target electrical angle calculations. For example, when communication delays cause lag in the crankshaft position reading, the actual crankshaft may have exceeded the position shown by the reading. In this case, by subtracting or adding a compensation value, a more realistic deviation between the current position and the target position can be obtained. The number of pole pairs in a generator is an inherent property of its design, representing the number of magnetic pole pairs on the generator rotor. It plays a role in converting mechanical angles (such as crankshaft angles) into electrical angles, as one mechanical cycle corresponds to multiple electrical cycles. For example, a two-pole-pole generator has a mechanical rotation of 360 degrees corresponding to an electrical rotation of 720 degrees; while a four-pole-pole generator has a mechanical rotation of 360 degrees corresponding to an electrical rotation of 1440 degrees. The electrical angle per unit tooth represents the electrical angle amount corresponding to each mechanical tooth (or the smallest mechanical angle unit) rotated by the generator rotor. This unit tooth electrical angle is used to precisely map minute changes in mechanical position to changes in electrical angle. The first angle increment is calculated based on the corrected first compensation difference, the number of pole pairs in the generator, and the unit tooth electrical angle. Its function is to quantify the electrical angle difference between the current crankshaft position and the target crankshaft stop position, providing a basis for subsequent adjustments to the current electrical angle to achieve the target electrical angle. For example, it might indicate how many electrical angles need to be added or subtracted from the current electrical angle to move the crankshaft to the desired crankshaft stop position. The current electrical angle refers to the real-time electrical phase angle of the generator rotor when the target electrical angle is calculated. It is typically detected in real-time by a rotary encoder or position sensor inside the generator and fed back to the controller. For example, it can be the angle between the rotor magnetic field direction and a reference axis of the stator winding. The target electrical angle is the electrical phase angle that the angular position closed-loop control system expects the generator rotor to ultimately reach; it directly corresponds to the target crankshaft stopping position where the engine crankshaft needs to stop. For example, when the crankshaft needs to stop at a certain top dead center or bottom dead center, there will be a specific electrical angle corresponding to it.

[0109] Through the above implementation method, when the crankshaft position of the engine is less than or equal to a first preset position, the crankshaft position deviation caused by communication delay can be compensated when determining the target electrical angle. By introducing a first compensation value to correct the crankshaft position difference, the calculated first compensation difference more accurately reflects the deviation between the actual physical position of the crankshaft and the target crankshaft stopping position. Based on this, the first angle increment is determined by combining the number of pole pairs of the generator and the electrical angle corresponding to a unit tooth, and the target electrical angle is finally obtained, thereby improving the accuracy and stability of the angle position closed-loop control. This avoids inaccurate crankshaft positioning or control system oscillation caused by communication delay, allowing the engine crankshaft to be dragged to the target crankshaft stopping position more accurately and smoothly, providing a reliable foundation for subsequent stall control mode.

[0110] For example, during engine angle control, the vehicle controller receives a crankshaft position report of X degrees from the crankshaft position sensor, while the first preset position is Y degrees, resulting in an initial crankshaft position difference of YX. To compensate for communication delay, the vehicle controller pre-calibrates a first compensation value. For instance, if the communication delay causes the crankshaft position reading to lag by Z degrees, the first compensation difference will be calculated as (YX) + Z. This means that if the crankshaft position reading lags, the actual crankshaft position may be closer to the first preset position than the reported position, or may have already exceeded it. By adding the compensation value Z, a compensation difference closer to the actual physical deviation can be obtained. The vehicle controller obtains the number of pole pairs of the generator, for example, P pairs, and the electrical angle per unit tooth, for example, E degrees / tooth. Based on this first compensation difference, the number of pole pairs P, and the electrical angle per unit tooth E, a first angle increment is calculated. For example, the first angle increment can be calculated using the formula (first compensation difference / mechanical angle unit) × (electrical angle / mechanical angle) × number of pole pairs. The vehicle controller adds this calculated first angle increment to the current real-time electrical angle of the generator (e.g., the current electrical angle measured by a Hall sensor or encoder) to obtain the final target electrical angle. For example, if the current electrical angle is A degrees and the first angle increment is ΔA degrees, then the target electrical angle is A+ΔA degrees.

[0111] The second part describes how the vehicle controller determines the target electrical angle based on the difference between the crankshaft position and the second preset position, the first preset position, the number of pole pairs, and the electrical angle corresponding to the unit tooth.

[0112] In one possible implementation, the vehicle controller determines a second compensation difference based on the difference between the crankshaft position and the second preset position, the first preset position, and a second compensation value. This second compensation value is used to compensate for crankshaft position deviation caused by communication delay. The vehicle controller determines a second angle increment based on the second compensation difference, the number of pole pairs, and the electrical angle corresponding to the unit tooth. The vehicle controller determines the target electrical angle based on the current electrical angle and the second angle increment.

[0113] The second compensation value is used to correct the crankshaft position data deviation caused by communication delay. This second compensation value can be obtained in advance through experimental testing or system simulation. For example, under different communication delay conditions, the actual deviation of the crankshaft position can be measured or calculated and stored as a lookup table or fitting function. During runtime, it can be dynamically queried or calculated based on the actual communication delay. Alternatively, the average communication delay can be estimated based on factors such as the characteristics of the communication protocol, data transmission rate, and controller processing cycle, and a fixed compensation value can be set accordingly. The second compensation difference is the effective crankshaft position difference used for subsequent calculation of the angle increment after considering communication delay compensation. The second compensation difference is obtained by mathematically operating on the difference between the original crankshaft position and the second preset position, combined with the first preset position and the second compensation value. For example, it can be (crankshaft position - second preset position) plus or minus the second compensation value, depending on the direction of the deviation and the definition of the compensation value. To further improve accuracy, the second compensation difference can also be processed by weighted averaging or filtering. The second angle increment is calculated based on the second compensation difference, the number of pole pairs of the generator, and the electrical angle corresponding to a unit tooth. It represents the amount that needs to be increased or decreased from the current electrical angle. The second angle increment converts the mechanical change in crankshaft position into a corresponding change in generator electrical angle. This can be obtained by proportionally calculating the second compensation difference with the number of pole pairs and the electrical angle corresponding to a unit tooth, or by consulting a preset conversion coefficient or mapping table. The current electrical angle is the actual electrical angle of the generator at a given moment. It can be obtained in real-time by position sensors such as rotary encoders and Hall sensors inside the generator, or estimated using a sensorless control algorithm based on electrical parameters such as generator voltage and current.

[0114] Through the above implementation method, when the crankshaft position of the engine is greater than the second preset position, a second compensation value is introduced to compensate for the crankshaft position deviation caused by communication delay, making the calculation of the second compensation difference and the second angle increment more accurate. This allows the determined target electrical angle to more accurately reflect the actual position requirements of the engine crankshaft, thereby improving the accuracy and stability of the angle position closed-loop control. The engine crankshaft can be more accurately dragged to the target crankshaft stopping position, improving the reliability and efficiency of engine stopping control.

[0115] For example, during engine shutdown, the crankshaft position is detected as 305 degrees, while the second preset position is 300 degrees and the first preset position is 290 degrees. At this time, the crankshaft position is greater than the second preset position. To compensate for communication delay, the vehicle controller determines a second compensation value of -0.5 mechanical angles based on a preset compensation strategy (e.g., indicating that due to communication delay, the actual crankshaft position is 0.5 degrees ahead of the received data). Based on this, the second compensation difference is calculated as (305 degrees - 300 degrees) + (-0.5 degrees) = 4.5 degrees. If the generator has 4 pole pairs, the electrical angle per tooth is 60 degrees, and it is known that each mechanical degree corresponds to X electrical degrees, then the second angle increment can be calculated as 4.5 × X electrical degrees. If the current generator electrical angle is 120 degrees, then the final target electrical angle will be 120 degrees + the second angle increment.

[0116] The third part describes how the vehicle controller determines the target electrical angle based on the difference between the second preset position and the crankshaft position, the number of pole pairs, and the electrical angle corresponding to the unit tooth.

[0117] In one possible implementation, the vehicle controller determines a third compensation difference based on the difference between the second preset position and the crankshaft position, and a third compensation value. This third compensation value is used to compensate for crankshaft position deviation caused by communication delay. The vehicle controller determines a third angle increment based on the third compensation difference, the number of pole pairs, and the electrical angle corresponding to the unit tooth. The vehicle controller determines the target electrical angle based on the current electrical angle and the third angle increment.

[0118] The difference between the second preset position and the crankshaft position refers to the relative displacement of the current crankshaft position relative to the second preset position, reflecting the mechanical angle that the crankshaft needs to adjust. This can be obtained through direct subtraction. The third compensation value is used to offset or correct crankshaft position measurement deviations caused by communication delays. Communication delays may cause the crankshaft position information received by the system to lag behind the actual physical position of the crankshaft. The third compensation value can be a fixed value determined in advance through experiments or simulations, or it can be dynamically calculated based on real-time communication delays or obtained from a preset lookup table. Its purpose is to make the crankshaft position information used in subsequent calculations closer to the true value, thereby improving control accuracy. The third compensation difference is the result of further correction based on the original difference between the second preset position and the crankshaft position, combined with the third compensation value. It represents a more accurate relative displacement of the crankshaft relative to the second preset position after communication delay compensation. The third angle increment is calculated based on the third compensation difference, the number of pole pairs of the generator, and the electrical angle corresponding to a unit tooth. It represents the electrical angle change required to move the crankshaft from its current (compensated) position to the target crankshaft stop position. The current electrical angle is the real-time electrical angle of the generator at the moment of calculating the target electrical angle. It can be obtained in real time through sensors inside the generator and serves as the starting reference point for determining the target electrical angle.

[0119] Through the above implementation method, when the engine crankshaft is between the first preset position and the second preset position, a third compensation value is introduced to correct the crankshaft position deviation caused by communication delay, so that the calculated third compensation difference can more accurately reflect the actual position of the crankshaft. Based on this, combined with the number of pole pairs of the generator and the electrical angle corresponding to each tooth, the third angle increment can be determined, and a highly accurate target electrical angle can be obtained. This improves the accuracy of the angle position closed-loop control, ensuring that the engine crankshaft can be dragged and locked in the target crankshaft stopping position, thereby improving the accuracy and reliability of engine stopping positioning, avoiding positioning errors caused by communication delay, and thus optimizing the engine's starting and stopping performance.

[0120] For example, when the engine crankshaft position is between a first preset position and a second preset position, the vehicle controller obtains the current crankshaft position and calculates the difference between it and the second preset position. For instance, if the second preset position is 180 degrees and the current crankshaft position is 170 degrees, the difference is 10 degrees. Considering that communication delays may cause the actual crankshaft position to lag behind the reported position by 2 degrees, a third compensation value, such as 2 degrees, can be set. Applying this third compensation value to the original difference, the third compensation difference is 10 degrees + 2 degrees = 12 degrees. If the number of pole pairs of the generator is 4, and the electrical angle corresponding to each tooth is 10 electrical degrees / mechanical degrees, then the third angle increment can be calculated as 12 degrees (third compensation difference) multiplied by 4 (number of pole pairs) and then multiplied by 10 (electrical angle corresponding to each tooth), which is 480 electrical degrees. If the current electrical angle of the generator is 300 electrical degrees, then the target electrical angle will be determined as 300 electrical degrees + 480 electrical degrees = 780 electrical degrees. The third compensation value can be obtained through pre-calibration, for example, by measuring communication delay under different communication loads and temperature conditions, and establishing a lookup table or fitting function to dynamically provide the compensation value.

[0121] Optionally, after determining the target electrical angle through the above embodiments, the following steps can also be performed.

[0122] In one possible implementation, the vehicle controller acquires the electrical angle deviation between the target electrical angle and the current electrical angle. If the electrical angle deviation is less than a preset electrical angle threshold and the engine speed is greater than a preset speed threshold, the vehicle controller increases the target electrical angle by a preset electrical angle amount, which is the electrical angle corresponding to a mechanical half-turn or a mechanical full-turn.

[0123] The electrical angle deviation between the target electrical angle and the current electrical angle is calculated by comparing the set target electrical angle with the electrical angle currently detected by the generator. This electrical angle deviation reflects the degree of deviation between the generator rotor's current position and the desired target position. This electrical angle deviation can be obtained in two ways: one is by using a position sensor such as a rotary transformer or Hall effect sensor installed on the generator to detect the generator rotor position in real time, converting it into the current electrical angle, and then comparing it with the target electrical angle set internally by the vehicle controller to calculate the deviation. Another method is for the vehicle controller to estimate the current electrical angle in real time using an observer or estimation algorithm based on the generator's current, voltage, and motor model, and then calculate the difference with the target electrical angle. An electrical angle deviation less than a preset electrical angle threshold means that when the absolute value of the calculated electrical angle deviation is lower than a preset threshold used to judge the proximity of the position, the current position is considered very close to the target position. This preset electrical angle threshold can be empirically set based on the engine's mechanical precision requirements, the control system's response characteristics, and the required stopping accuracy. Furthermore, the preset electrical angle threshold can be optimized through extensive experimental testing and data analysis on different engine types and application scenarios to determine an optimal value that balances control accuracy and system stability. The engine speed exceeding the preset speed threshold means that when the actual engine speed is higher than a pre-set limit value used to determine whether the engine still has significant kinetic energy, it is considered that the engine has not completely stopped. This preset speed threshold can be set according to the engine's inertial characteristics, the control system's response speed, and safety operation requirements; for example, it can be set to tens of revolutions per minute. Simultaneously, this preset speed threshold can also be determined through in-depth analysis of the engine's operating characteristics and combined with actual test data to determine a suitable speed value that effectively distinguishes between low-speed engine operation and the state of impending shutdown. Increasing the target electrical angle by a preset electrical angle amount means, when the above two conditions are met (small electrical angle deviation and still relatively high speed), adjusting the original target electrical angle by a fixed amount to advance it forward. This operation aims to provide a new, farther driving target for the angle position closed-loop control, avoiding instability or local optima due to small deviations and residual kinetic energy when approaching the target position. The preset electrical angle value, corresponding to a mechanical half-turn or a mechanical full-turn, means that the increased electrical angle value is equal to the electrical angle value corresponding to a mechanical half-turn (180-degree mechanical angle) or a mechanical full-turn (360-degree mechanical angle) of the generator rotor. For a synchronous generator with P pole pairs, the electrical angle corresponding to a mechanical half-turn is P multiplied by 180 degrees, and the electrical angle corresponding to a mechanical full-turn is P multiplied by 360 degrees.Such an increment is chosen to ensure that the adjustment of the target electrical angle can guide the crankshaft across one or more magnetic pole pairs, thereby avoiding staying in unstable magnetic pole positions or local optima, and enabling the engine to be continuously driven to the final crankshaft stop position.

[0124] Optionally, the following steps can also be performed during the determination of the target electrical angle.

[0125] In one possible implementation, the vehicle controller acquires the feedforward torque via a load observer that monitors the deviation between the generator's actual and estimated rotational speeds. The vehicle controller calculates the feedback torque using a position closed-loop method based on the accumulated electrical angle and the target electrical angle. Based on the feedforward torque and the feedback torque, the vehicle controller determines the generator's output torque and limits any negative torque in the output torque to zero.

[0126] The load observer is an algorithm module used to estimate external disturbances or loads on the system. Its function is to acquire information about the external load acting on the generator in real-time or near real-time, such as engine friction and compression, by observing the deviation between the actual and estimated speeds of the generator. This load observer can be implemented using various techniques, such as a Kalman filter-based observer that estimates the load by modeling the system state and measurement noise; or a Luenberger observer-based method that estimates the load torque by designing a suitable gain matrix to make the observer state asymptotically converge to the actual state. Feedforward torque is a torque component pre-applied to the generator based on the load information acquired by the load observer. Its function is to compensate for known or estimable external loads in advance, thereby reducing the burden on the position closed-loop controller and improving response speed and control accuracy. Feedforward torque can be directly calculated from the load estimate output by the load observer, for example, through a lookup table method or model-based calculation, converting the estimated load into the required torque command. The cumulative electrical angle refers to the total rotational angle of the generator rotor relative to a reference point. It is typically obtained by integrating the generator speed or by direct measurement using a high-precision angle sensor (such as a rotary transformer or photoelectric encoder). It reflects the current actual position of the generator rotor and is a key feedback quantity used in position closed-loop control for comparison with the target electrical angle. The target electrical angle is the ideal angle that the generator rotor should reach, determined based on the engine's target crankshaft stop position and the correspondence between the crankshaft position and the electrical angle. It is the setpoint for the angle-position closed-loop control, and the vehicle controller will strive to make the cumulative electrical angle approach this target value. Position closed-loop control is a control strategy that compares the deviation between the actual position (cumulative electrical angle) and the desired position (target electrical angle), and generates a control quantity based on this deviation to drive the system, thereby reducing or eliminating position errors. Common implementation methods include proportional-integral-derivative (PID) controllers, which optimize control performance by adjusting the proportional, integral, and derivative gains; or state feedback controllers, which calculate the control input by feeding back system state variables. Feedback torque is the torque component calculated by the position closed-loop controller based on the deviation between the accumulated electrical angle and the target electrical angle. Its function is to correct the deviation between the system's current position and the target position, causing the generator rotor to gradually approach the target electrical angle. The calculation method of feedback torque depends on the position closed-loop control algorithm used. For example, in PID control, feedback torque is the sum of the proportional, integral, and derivative terms. The generator's output torque is the actual torque ultimately applied to the engine's crankshaft. It is determined by both feedforward torque and feedback torque, where feedforward torque is used to compensate for known loads, and feedback torque is used to correct position errors. By appropriately combining these two torques, precise and smooth driving of the engine's crankshaft can be achieved.Limiting the negative torque in the output torque to zero means that after determining the generator's output torque, if the calculated torque is negative (i.e., attempting to generate torque for reverse rotation), it is forcibly set to zero. The purpose of this limitation is to ensure that the generator only generates positive driving torque, avoiding unnecessary reverse braking or reverse rotation during driving, thereby improving control efficiency, preventing energy loss, and ensuring that the crankshaft always moves unidirectionally towards the target crankshaft stopping position. This can be achieved through simple conditional checks and assignment operations on the calculated torque value in the software.

[0127] Through the above implementation method, when the engine is in angle control mode, the feedforward torque obtained by the load observer can pre-compensate for the engine's dynamic load, such as cylinder compression resistance, thereby improving the response speed and accuracy of position closed-loop control. Combining the accumulated electrical angle with the target electrical angle for position closed-loop control can correct crankshaft position deviation. More importantly, by limiting the negative torque in the generator's output torque to zero, it ensures that the generator only generates positive drag torque, avoiding unnecessary reverse braking or reverse rotation during dragging, thus preventing engine failure and ensuring that the engine crankshaft can be dragged smoothly, efficiently, and accurately to the target crankshaft stopping position. This solves the problems of insufficient accuracy, response lag, and reverse torque interference that may result from relying solely on simple position closed-loop control.

[0128] For example, in angle control mode, the vehicle controller uses a load observer based on an extended Kalman filter to estimate the engine's load torque in real time, such as cylinder compression torque and friction torque. This load observer estimates the external load by monitoring parameters such as generator current, voltage, and speed, and combining this with models of the generator and engine. Based on the estimated load torque output by this load observer, the vehicle controller can consult a preset torque compensation table or calculate the corresponding feedforward torque command through a model. Simultaneously, the generator's cumulative electrical angle can be acquired in real time using a high-resolution rotary transformer or photoelectric encoder and used as input to the position closed-loop controller. This position closed-loop controller can be an optimized PID controller, whose input is the error between the target electrical angle and the cumulative electrical angle, and whose output is the feedback torque. The vehicle controller superimposes the feedforward torque and the feedback torque to obtain the generator's total output torque command. Before sending this total output torque command to the generator drive, a simple process is performed: if the calculated total output torque is negative, it is forced to zero to ensure that the generator only generates positive driving torque. For example, if the calculated torque is -5 Nm, then the actual applied torque is 0 Nm; if the calculated torque is 10 Nm, then the actual applied torque is 10 Nm.

[0129] Optionally, the following steps can also be performed during the angular position closed-loop control process.

[0130] In one possible implementation, the vehicle controller determines a positive torque limit based on the engine's coolant temperature and the altitude of the environment. During the closed-loop control of this angular position, the vehicle controller limits the generator's output torque based on this positive torque limit.

[0131] Engine coolant temperature refers to the temperature of the engine coolant, a parameter reflecting the engine's operating state and directly affecting the friction, lubrication, and mechanical strength of internal engine components. For example, excessively low coolant temperature may lead to insufficient rigidity of engine components, while excessively high temperature may cause overheating damage. Therefore, when controlling engine torque, appropriate adjustments need to be made based on coolant temperature to protect the engine. Engine coolant temperature can be obtained through real-time measurement by a temperature sensor installed in the engine cooling system or estimated using a temperature model within the engine controller. Altitude refers to the engine's current operating location relative to sea level. Altitude affects air density, which in turn affects the engine's intake air volume and combustion efficiency. In high-altitude areas, the air is thin, reducing the engine's actual output power and its torque-bearing capacity. Therefore, the torque applied to the generator needs to be differentiated under different altitude conditions. Altitude can be obtained through the vehicle's built-in Global Positioning System (GPS) module or by measuring and converting ambient air pressure using a barometric pressure sensor. The positive torque limit refers to the upper limit of the maximum positive torque (i.e., the torque that drives the crankshaft to rotate to the target crankshaft stop position) that the generator can apply to the engine during the angular position closed-loop control process. The positive torque limit is set to protect the engine and generator, preventing damage to mechanical components or system instability due to excessive torque output. The positive torque limit can be determined based on a pre-calibrated data table (e.g., a multidimensional lookup table with water temperature and altitude as inputs) or dynamically generated through real-time calculations based on the engine's physical model and empirical formulas. Limiting the generator's output torque means comparing the torque calculated by the angular position closed-loop control algorithm with the pre-determined positive torque limit, ensuring that the actual applied torque does not exceed this limit. This is typically achieved by setting a saturation circuit at the output of the vehicle controller; when the calculated torque is greater than the limit, the actual output torque is truncated to the limit; when the calculated torque is less than the positive torque limit, the calculated value is output. The aim is to ensure that the crankshaft can be effectively driven while avoiding engine overload.

[0132] Through the above implementation method, when the engine performs closed-loop angular position control to drag the crankshaft to the target crankshaft stopping position, the upper limit of the generator output torque can be dynamically adjusted according to the engine's actual operating environment (such as water temperature and altitude). This avoids the risk of impact or damage to engine mechanical components caused by applying excessive torque under adverse operating conditions (such as low temperature or high altitude), thereby protecting the engine, extending its service life, and improving the smoothness and reliability of the shutdown process. At the same time, under favorable operating conditions, greater torque can be applied, thereby improving the efficiency of dragging the crankshaft to the target crankshaft stopping position.

[0133] Optionally, the following steps can also be performed during the angular position closed-loop control process.

[0134] In one possible implementation, during the closed-loop control of the angle position, if the engine speed exceeds the sum of the preset angle control speed threshold and the speed hysteresis threshold, the closed-loop control of the angle position is exited, and the engine speed is reduced again, while the number of angle control operations is accumulated. If the number of angle control operations exceeds the preset number threshold, the current crankshaft stop position control is terminated.

[0135] The preset angle control speed threshold is the upper limit of the speed at which the angle control mode is entered, while the speed hysteresis threshold is an additional speed value used to provide a buffer when judging the exit condition, avoiding frequent switching of control modes when the speed fluctuates around the threshold, thereby enhancing the stability of the control system. For example, the exit condition can be determined by monitoring the engine speed sensor signal in real time and comparing it with the sum of the preset angle control speed threshold and the speed hysteresis threshold. Once the condition is met, the vehicle controller stops the output of the angle position closed-loop control and prepares to switch to other control strategies. Reducing the engine speed means that after exiting the angle position closed-loop control, measures are taken to reduce the engine speed to a range suitable for angle control or other low-speed control. This allows the engine to re-enter or maintain a state suitable for precise position control. For example, other control modes, such as speed control mode or torque control mode, can be switched to actively apply negative torque to reduce the speed. Simultaneously, the vehicle controller maintains a counter to record the number of times the angle position closed-loop control is exited due to excessive speed. This counter increments each time the exit condition is met. For example, this can be achieved using a software counter, incrementing the counter variable each time the exit condition is met. Terminating the crankshaft stop position control if the number of angle control attempts exceeds a preset threshold means that if multiple attempts at closed-loop angle position control are made but forced to exit due to excessive engine speed, and the accumulated number of angle control attempts exceeds a preset maximum allowable number of attempts, the current attempt to stop the crankshaft at the target position will be abandoned. This avoids getting stuck in an infinite loop, saves energy, and prevents prolonged periods in an uncertain state. For example, when the number of angle control attempts reaches or exceeds the preset threshold, a termination signal is issued, stopping all operations related to crankshaft stop position control, and possibly entering a default stop state or alarm state.

[0136] Through the above implementation methods, when the engine speed unexpectedly increases during the closed-loop control of the angular position, the unsuitable control mode can be exited in a timely manner, avoiding control instability or ineffectiveness due to excessive speed. Simultaneously, by reducing the speed again and accumulating the control attempts, strategic retries can be performed, improving the success rate and robustness of crankshaft stop position control. When multiple attempts fail to drag the crankshaft to the target crankshaft stop position, the current control can be terminated promptly, avoiding unnecessary resource consumption and prolonged indeterminate system states, thereby ensuring the smoothness, reliability, and efficiency of the engine shutdown process.

[0137] Optionally, the following steps can also be performed during the angular position closed-loop control process.

[0138] In one possible implementation, in this angle control mode, in response to receiving an engine start command, the vehicle controller exits the angle control mode and switches the generator to a speed control mode. During the switching of the generator to the speed control mode, the vehicle controller applies a slope limit to the generator's output torque.

[0139] The engine start command can originate from various sources. For example, it could be a signal from the driver via the ignition switch or start button, an automatic start signal triggered by the vehicle's start-stop system based on specific operating conditions (such as the driver releasing the brake pedal), or a command from the remote start system. Its function is to act as a trigger condition, indicating a transition from the current stop / hold state to the start state. Exiting the angle control mode means ceasing the execution of the current angle position closed-loop control strategy, no longer attempting to hold or drag the crankshaft to the target crankshaft stop position. This typically means releasing specific control over the generator current, so that it no longer aims to maintain the angle. Switching the generator to speed control mode means changing the generator's control strategy from angle control mode to a mode aimed at controlling engine speed. In speed control mode, the generator will adjust its output torque according to the set target speed through a closed-loop control algorithm to drive the engine to reach and maintain the required start speed. Limiting the output torque of the generator means limiting the rate of change of the generator's output torque during the transition from angle control mode to speed control mode. This means that the increase or decrease in the generator's output torque cannot exceed a preset maximum rate of change. For example, if the target starting torque is large, the full torque will not be applied immediately, but rather allowed to gradually increase over a certain period of time. This limitation can be achieved by introducing a slope limiter into the control algorithm, which ensures that the change in torque command within each control cycle does not exceed a preset value.

[0140] Through the above implementation method, when the engine receives a start command while in angle control mode, a smooth switch of the generator control mode can be achieved, limiting instantaneous changes in output torque. This reduces the mechanical shock that the engine may suffer during startup, protecting the durability of the engine and transmission system. Simultaneously, this smooth torque output avoids any jerking sensation during vehicle startup, improving the ride comfort for the driver and passengers, and making the engine startup process more stable and reliable.

[0141] Through the aforementioned implementation steps 401-402, during the engine shutdown process, a step is introduced whereby, when the engine speed is lower than a preset angle control speed threshold, the generator is switched to angle control mode, and the crankshaft is dragged to the target crankshaft shutdown position through closed-loop angle position control. This allows the crankshaft to be guided more accurately and smoothly to the preset error range of the target crankshaft shutdown position before the engine enters the final stall control mode, further reducing the engine speed. This preparatory angle control stage solves the problem of unstable shutdown or inaccurate positioning that may occur when directly entering stall control at high engine speeds or when the crankshaft position is far from the target crankshaft shutdown position. Therefore, the accuracy and smoothness of engine shutdown positioning are improved, and the impact and vibration of the engine during shutdown are reduced, thereby improving the user experience and the lifespan of engine components.

[0142] Steps 401-402 above provide a detailed explanation of the angle control stage. The following section describes the torque control stage, which is executed before and adjacent to the angle control stage. See [link to relevant documentation]. Figure 5 Taking the vehicle controller as the executing entity as an example, the following steps can be performed before step 401 above.

[0143] 501. Upon receiving an engine shutdown command, in response to the engine meeting a third preset condition, the vehicle controller switches the generator to torque control mode. The third preset condition is that the engine speed is lower than a preset torque control speed threshold.

[0144] The third preset condition is the basis for determining whether to enter torque control mode, and its core lies in whether the engine speed is lower than the preset torque control speed threshold. The preset torque control speed threshold is a pre-set speed value used to define the starting speed range from which torque control mode is more suitable and efficient. This preset torque control speed threshold can be calibrated based on the specific engine model, performance parameters, operating conditions, and requirements for smooth shutdown. For example, it can be determined based on the engine's idle speed, inertia characteristics, or empirical data to ensure that below the preset torque control speed threshold, torque control can effectively and smoothly reduce engine speed, avoiding unnecessary vibration or shock. When the engine speed meets the third preset condition, the generator's operating mode is switched from the current control mode (e.g., speed control mode) to torque control mode. This mode switching can be managed through the state machine logic within the vehicle controller or achieved by adjusting the input parameters and output commands of the control algorithm. In torque control mode, the generator's control objective changes from maintaining or changing the speed to outputting a specific torque, thereby providing controlled braking or driving force to the engine.

[0145] 502. In this torque control mode, the vehicle controller controls the output torque of the generator based on a preset target torque to reduce the engine speed and limit the negative torque of the generator to zero.

[0146] In torque control mode, the vehicle controller instructs the generator to output a corresponding torque based on a preset target torque. This preset target torque is typically a negative value (braking torque), and its magnitude can be a fixed value or dynamically adjusted according to the engine's current speed, temperature, and other operating conditions. By controlling the generator to output braking torque that matches the preset target torque, a deceleration effect can be applied to the engine, causing its speed to continuously decrease. For example, technologies such as current closed-loop control or field-oriented control can be used to convert the target torque into a corresponding current command, thereby driving the generator to produce the required braking torque. Negative torque refers to the torque that drives the engine to rotate, while positive torque refers to the torque that brakes the engine. Limiting the generator's negative torque to zero means that in torque control mode, the generator is only allowed to generate braking torque and will not generate any torque that drives the engine to rotate in the opposite direction. This limitation can be achieved by setting a lower limit value (e.g., zero) for torque output in the torque control algorithm, or by forcibly correcting the calculated torque command to zero if it is negative.

[0147] In steps 501-502 above, an intermediate control stage is introduced before determining whether the engine meets the second preset condition. Specifically, when the engine speed continuously decreases from a higher speed control stage and reaches a third preset condition below the preset torque control speed threshold, the vehicle controller smoothly switches the generator's operating mode from the previous mode (e.g., speed control mode) to torque control mode. In torque control mode, the vehicle controller controls the generator to output braking torque based on a preset target torque to further reduce the engine speed. A key control strategy in this process is to strictly limit the generator's negative torque to zero, ensuring that the generator only provides braking and does not generate any torque that drives the engine to rotate in the opposite direction. By introducing this torque control stage, a smoother and more controlled deceleration process is provided before the engine speed drops to a suitable level for angle control. This allows the engine to enter the subsequent angle control mode in a better state, thereby improving the smoothness, comfort, and control accuracy of the entire shutdown process, and reducing the control difficulty and system response requirements of the subsequent angle control stage.

[0148] Through steps 501-502 above, a smoother and more controlled decrease in engine speed can be achieved. This avoids the instability or shock problems that may occur if angle control is directly entered when the engine speed is relatively high, and provides better initial conditions for subsequent angle positioning. Therefore, the entire engine shutdown process will be smoother and more comfortable, and the accuracy and reliability of shutdown positioning will be improved.

[0149] For example, in torque control mode, the vehicle controller controls the generator output based on a preset target torque (e.g., -25 Nm, representing a reverse braking torque of 25 Nm). To achieve this target torque, the vehicle controller calculates the corresponding D-axis and Q-axis current commands using a field-oriented control (FOC) algorithm and drives the inverter to apply these currents to the generator. During the generation or execution of the torque command, a limiter is set to ensure that any calculated drive torque is forcibly corrected to zero, thus guaranteeing that the generator only provides braking. In this way, the engine speed continues to decrease smoothly until it reaches a suitable speed range for entering angle control mode.

[0150] To provide a clearer explanation of the above embodiments, the method for determining the preset target torque involved in the above embodiments will be described below.

[0151] In one possible implementation, the vehicle controller determines the preset target torque based on the engine's water temperature and the altitude of the surrounding environment.

[0152] Changes in water temperature affect internal engine friction, lubricant viscosity, and combustion efficiency, thus influencing the torque required at specific engine speeds. For example, in low-temperature environments, engine friction is typically higher, potentially requiring greater negative torque to effectively reduce engine speed. Altitude variations lead to changes in atmospheric pressure and air density, affecting engine intake and combustion efficiency. At high altitudes, the thin air reduces engine output power, altering the negative torque characteristics required to reduce speed in torque control mode. Determining the preset target torque involves calculating or finding the target torque value to be applied to the generator in torque control mode based on specific input parameters. This process aims to ensure the generator can effectively reduce engine speed with appropriate negative torque while avoiding unnecessary energy loss or engine impact. Determination methods may include, but are not limited to, real-time calculations based on pre-established mathematical models or accessing a multidimensional lookup table (LUT) stored in the controller.

[0153] Through the above implementation methods, the preset target torque is no longer a static, fixed value, but can dynamically adapt to changes in engine coolant temperature and altitude. This allows the negative torque applied by the generator in torque control mode to better match the actual operating conditions of the engine and the environment, avoiding problems of excessive or insufficient torque due to changes in operating conditions. For example, under conditions where engine resistance or performance changes, such as low temperature or high altitude, the target torque can be automatically adjusted, thereby enabling the engine speed to decrease smoothly and efficiently, improving the accuracy and robustness of torque control, while optimizing energy consumption and avoiding unnecessary shocks or insufficient control.

[0154] Optionally, in torque control mode, the following steps can also be performed.

[0155] In one possible implementation, in the torque control mode, if the engine speed is greater than the sum of the preset torque control speed threshold and the speed hysteresis threshold, the vehicle controller exits the torque control mode and reduces the engine speed again.

[0156] The speed hysteresis threshold is an additional speed value introduced to prevent frequent control mode switching due to measurement errors or system fluctuations when the engine speed approaches the preset torque control speed threshold. Exiting the torque control mode means that when an abnormal increase in engine speed is detected and the exit condition is met, the current torque control strategy will be terminated, and the generator will no longer output the preset target torque. Reducing the engine speed again means that after exiting the torque control mode, measures need to be taken to reduce the engine speed again to return it to the expected shutdown procedure. This may involve reassessing the current engine state and selecting an appropriate control strategy based on the new state.

[0157] Through the above implementation method, when the engine is in torque control mode, if the engine speed unexpectedly increases due to external factors or transient operating conditions and exceeds the preset torque control speed threshold, the system can promptly and stably exit torque control mode and take measures to reduce the engine speed again. This mode switching mechanism with hysteresis avoids frequent switching of control modes caused by small fluctuations near the speed critical point, improving the robustness and stability of the control system. Simultaneously, it ensures a rapid response and correction when the engine speed abnormally increases, keeping the engine always on a controlled deceleration and shutdown path, thereby improving the reliability and safety of the engine shutdown process.

[0158] Optionally, in torque control mode, the following steps can also be performed.

[0159] In one possible implementation, in this torque control mode, in response to receiving an engine start command, the vehicle controller exits the torque control mode and switches the generator to a speed control mode. During the switching process, the vehicle controller applies a slope limit to the generator's output torque.

[0160] Exiting the torque control mode means ceasing the execution of the control strategies and algorithms set in that mode. Specifically, it will no longer adjust the generator's output torque based on a preset target torque, nor will it execute the strategy of limiting negative torque to zero. This operation typically involves updating the control system's internal state machine to transition it from torque control mode. Switching the generator to speed control mode means adjusting the generator's control target from output torque to engine speed. In speed control mode, the generator adjusts its output torque according to a set target speed (e.g., a preset speed required to start the engine) to make the actual engine speed approach the target speed. This is usually achieved by activating a new control algorithm, such as a speed closed-loop controller, which dynamically adjusts the generator's torque output based on speed errors. Slope limiting the generator's output torque means constraining the rate of change of the generator's output torque during the switch from torque control mode to speed control mode. This means the generator's output torque cannot jump instantaneously from one value to another, but rather transitions gradually at a preset maximum rate of change. For example, if the torque needs to change from negative to positive, slope limiting ensures that the torque changes with a smooth ramp curve, rather than a step change. This can be achieved by introducing a ramp function or limiter into the control algorithm, which adjusts the torque command based on a preset torque change rate limit.

[0161] Through the above implementation, when the engine switches from torque control mode to speed control mode for startup, the output torque change of the generator will be smoother and more controllable. This reduces the shocks and vibrations that may occur during engine startup, thereby improving the vehicle's driving comfort. At the same time, the smooth torque transition also helps reduce stress on the mechanical components of the engine and transmission system, extending their service life.

[0162] Steps 501-502 above provide a detailed explanation of the torque control stage. The following section describes the speed control stage, which occurs before and adjacent to the torque control stage. See [link to relevant documentation]. Figure 6 Taking the vehicle controller as the executing entity as an example, the following steps can also be performed before step 501 above.

[0163] 601. In response to receiving an engine stop command, the vehicle controller switches the generator to speed control mode.

[0164] The engine shutdown command is used to indicate that the engine needs to stop running. This command can be triggered in various ways, such as by the driver via the ignition switch or start / stop button, or automatically by the vehicle controller based on specific operating conditions (e.g., the vehicle is stationary, the battery is fully charged, etc.). Upon receiving the engine shutdown command, the vehicle controller initiates the engine shutdown process. Switching the generator to speed control mode means that the generator, acting as an actuator connected to the engine's crankshaft, changes its control strategy from the current mode (e.g., generator mode or torque control mode) to a mode focused on controlling engine speed. In speed control mode, the generator adjusts its output torque based on the deviation between the set target speed and the actual speed, so that the engine speed approaches the target speed. This switching typically involves changes to the vehicle controller's internal control algorithm, such as switching from a current control loop to a speed control loop.

[0165] 602. In this speed control mode, the vehicle controller reduces the engine speed through closed-loop speed control.

[0166] Speed ​​closed-loop control is a feedback control strategy. Its core idea is to monitor the engine's actual speed in real time and compare it with the desired target speed. Based on the deviation between the two, the control input (i.e., the generator output torque) is adjusted, thereby continuously bringing the actual speed closer to the target speed. To reduce engine speed, the target speed is gradually set to a lower value, or even set to zero. Speed ​​closed-loop control can be implemented using various control algorithms such as proportional-integral-derivative (PID) controllers, fuzzy controllers, or adaptive controllers. By adjusting the braking torque generated by the generator, a smooth decrease in engine speed is achieved.

[0167] In one possible implementation, in this speed control mode, the vehicle controller obtains feedforward torque through a load observer, which monitors the deviation between the actual and estimated speed of the generator. Based on this feedforward torque, the vehicle controller calculates the generator's output torque through closed-loop speed control. Based on this output torque, the vehicle controller reduces the engine speed.

[0168] The load observer is an algorithm module used to estimate the internal state of a system or external disturbances in real time. Its function is to estimate variables that are difficult to measure directly, such as load torque or internal friction, by observing the system's input and output and combining this with the system model. It can also be used to observe the deviation between the actual and estimated speeds of a generator. Load observers can be implemented in various ways. For example, they can be built based on the Luenberger observer principle, and by designing a suitable gain matrix, the observer's state can asymptotically converge to the actual state. Alternatively, Kalman filtering technology can be used to estimate the system state in a statistically optimal way by fusing the system model and measurement data, thus providing more robust estimation results. Feedforward torque refers to the torque component pre-calculated and applied in a control system according to the system model or preset rules. Its purpose is to counteract known or predictable disturbances, thereby improving the system's response speed and control accuracy. Its function is to intervene in the system before the feedback control has fully responded, thus reducing errors. The feedforward torque can be determined in several ways: firstly, by directly querying a pre-calibrated torque mapping table based on the engine's current speed, load, and other operating parameters; secondly, by establishing a dynamic model of the engine and generator and calculating the required feedforward torque based on the model's predicted output. Speed ​​closed-loop control is a control strategy that monitors the engine's actual speed in real time, compares it with the target speed, and adjusts the generator's output torque based on the deviation between the two. Its purpose is to ensure that the engine speed accurately tracks the target speed and to have a certain degree of suppression capability against external disturbances. The generator's output torque refers to the mechanical torque applied to the engine's crankshaft by the generator through electromagnetic action. During engine deceleration, the generator's output torque is typically a negative torque, i.e., opposite to the engine's rotation direction, used to resist engine rotation and thus reduce its speed. The magnitude and direction of the generator's output torque can be adjusted by controlling the generator's excitation current and armature current. Reducing the engine speed is one of the goals of this technical solution, achieved through the output torque applied by the generator. When the generator generates torque opposite to the engine's rotation direction, it consumes the engine's kinetic energy, thus gradually reducing its speed. This reduction in speed is controlled and smooth, creating conditions for subsequent shutdown operations (such as locking the crankshaft position).

[0169] Through the above implementation methods, the engine speed can be reduced more accurately and smoothly in the engine speed control mode. By introducing a load observer, the deviation between the actual and estimated speed of the generator can be obtained in real time, thereby gaining a more accurate understanding of the engine's operating status and external load conditions, providing a reliable basis for subsequent torque calculation. Based on this, combined with the calculation of feedforward torque, the vehicle controller can pre-compensate for engine inertia or changes in external load, improving the response speed and dynamic performance of speed control and avoiding the lag or overshoot that may occur in pure feedback control. At the same time, the introduction of closed-loop speed control ensures that the engine speed can track the target deceleration curve, suppressing the influence of external disturbances on the speed, thereby achieving a smooth and efficient reduction in engine speed. This control strategy not only improves the comfort of the engine shutdown process but also creates more favorable conditions for subsequent crankshaft shutdown position control, improving the reliability and efficiency of the entire shutdown process.

[0170] For example, in speed control mode, when the engine speed needs to be reduced, the vehicle controller uses a load observer based on an extended Kalman filter to estimate the actual speed and load torque of the generator in real time. This load observer dynamically updates the speed and load estimates using the generator's voltage and current measurements, known motor parameters, and the motor's motion equations. The vehicle controller pre-establishes a torque demand mapping table for the engine at different speeds and loads as a source of feedforward torque. When the engine speed needs to be reduced, the vehicle controller retrieves an initial feedforward torque value from this mapping table based on the current speed and the load estimated by the observer. The vehicle controller uses a proportional-integral (PI) controller as a speed closed-loop controller to compare the actual engine speed (measured by sensors or estimated by the observer) with the target deceleration speed, calculating a feedback torque component. The vehicle controller then superimposes the feedforward torque and the feedback torque to obtain the generator's total output torque command. For example, if the goal is to reduce the engine speed from 1000 rpm to 500 rpm, the vehicle controller calculates the required negative torque based on the deviation between the current speed and the target speed, combined with the feedforward torque. This torque command is then sent to the generator's inverter, which adjusts the output current to cause the generator to produce the corresponding braking torque, thereby smoothly reducing the engine speed.

[0171] Through steps 601-602 above, upon receiving an engine shutdown command, the generator can be switched to speed control mode, and the engine speed can be reduced using closed-loop speed control. This solves the problem of a smooth and efficient transition of the engine from a higher operating speed to the low-speed shutdown preparation phase. Compared to relying solely on the engine's own inertia or simple unloading for deceleration, the active braking effect of the generator can shorten the deceleration time and improve shutdown efficiency. Simultaneously, closed-loop speed control ensures the smoothness of the deceleration process, avoiding sudden drops or fluctuations in speed, thereby improving the comfort of the driver and passengers. Furthermore, this controlled deceleration process also provides the initial conditions for subsequent shutdown control, making the entire engine shutdown process smoother and more reliable.

[0172] Optionally, the following steps can also be performed during the speed closed-loop control process.

[0173] In one possible implementation, the vehicle controller determines the torque limit and speed change slope limit of the generator based on the engine coolant temperature and the altitude of the environment. During this speed closed-loop control process, the vehicle controller limits the generator's output torque and speed change rate based on the torque limit and the speed change slope limit.

[0174] The torque limit value refers to the maximum or minimum torque value that the generator can output during the speed closed-loop control process, used to prevent the generator from outputting excessively large or small torques. The speed change slope limit value refers to the maximum allowable rate of change of the generator's speed per unit time, used to limit sudden changes in speed and ensure smoothness. These limits are parameters used to dynamically adjust the control strategy. They are adjusted according to the actual operating environment of the engine to ensure that the generator operates within a safe, efficient, and stable range. Determining these limits can include: establishing a multi-dimensional lookup table in advance through experiments or simulations between water temperature, altitude, and the torque and speed change slope limits, and obtaining them during operation through interpolation based on real-time water temperature and altitude; or establishing a mathematical model or empirical formula based on water temperature and altitude, and calculating the corresponding limits by inputting real-time water temperature and altitude. Limiting output torque means comparing the calculated torque command with the preset torque limit value at the output of the speed closed-loop controller, ensuring that the actual applied torque does not exceed this limit value. Limiting the rate of change of speed means adjusting the controller output during the speed closed-loop control process so that the actual rate of change of the engine's speed does not exceed the preset rate of change of speed slope value. This ensures that the generator's output behavior during closed-loop speed control conforms to the safety and performance requirements of the current engine and environmental conditions, avoiding overload, shock, or unstable operation. Implementation methods may include: comparing the target torque calculated by the closed-loop speed controller with a torque limit value; if the target torque exceeds the limit range, saturating it to the limit value; and for the rate of change of speed, this can be achieved by introducing a slope limiter within the controller or by adjusting the controller parameters to indirectly limit the rate of change of speed.

[0175] Through the above implementation method, during engine shutdown, when the generator performs closed-loop speed control in speed control mode, it can dynamically adjust its output torque and speed change rate according to actual operating conditions such as engine coolant temperature and ambient altitude. This avoids problems such as excessively rapid engine speed drop, excessively high or low torque output caused by unsuitable control strategies under different environmental conditions, thereby improving the smoothness, comfort, and safety of the engine shutdown process. Especially in extreme coolant temperature or high altitude environments, this solution can prevent impact and wear on engine mechanical components, extend engine life, and enhance the user experience.

[0176] For example, after acquiring the water temperature and altitude, the vehicle controller can preset a multi-dimensional lookup table that stores the torque limit and speed change slope limit for different combinations of water temperature and altitude. For instance, when the water temperature is low, internal engine friction is greater, requiring a greater torque limit to avoid impact; when the altitude is high, the air is thin, reducing engine power output, also necessitating a corresponding adjustment to the torque limit. Based on the real-time acquired water temperature and altitude, the vehicle controller uses linear interpolation or nearest-neighbor interpolation in this lookup table to determine the generator's maximum output torque (torque limit) and maximum permissible speed change rate (speed change slope limit) under the current operating conditions. In the subsequent closed-loop speed control process, the target torque command calculated by the vehicle controller is compared with this torque limit. If the calculated target torque exceeds the limit, the actual torque applied to the generator will be limited within that limit. Simultaneously, the vehicle controller's output also passes through a slope limiting module to ensure that the engine's speed change rate does not exceed the pre-determined speed change slope limit. For example, if the vehicle controller calculates that the engine speed needs to be reduced rapidly, but the current speed change slope limit is low, the actual speed reduction rate will be limited, thus achieving a smooth speed transition.

[0177] Optionally, in speed control mode, the following steps can also be performed.

[0178] In one possible implementation, in this speed control mode, in response to receiving an engine start command, the vehicle controller maintains the generator in this speed control mode and transitions the engine speed from the current speed to the target start speed. During the transition of the engine speed to the target start speed, the vehicle controller limits the output torque of the generator by a slope.

[0179] Maintaining the generator in this speed control mode means that upon receiving a start command, the vehicle controller will not immediately switch to other control modes (such as torque control or angle control), but will continue to use the speed control strategy. This can be achieved by keeping the original speed controller active and updating its target speed. Transitioning the engine speed from the current speed to the target start speed means that, under the start command, the engine's actual speed gradually increases from its current value until it reaches the preset target speed required for start-up. This transition process needs to be smooth to avoid mechanical shock and discomfort. This can be achieved by gradually increasing the target speed setpoint of the speed controller or by tracking a preset speed curve. Limiting the output torque of the generator means limiting the rate of change of the generator's output torque during the engine speed transition, preventing excessive jumps in a short period. This limitation prevents sudden and drastic changes in torque, thereby protecting mechanical components and improving operational smoothness. This can be achieved by introducing a slope limiter in the torque command generation stage, which smooths the torque command based on a preset maximum torque change rate; or by introducing an integral term to indirectly limit the torque change rate.

[0180] Through the above implementation, when the engine is preparing to stop and reducing its speed in speed control mode, if a start command is required, the generator can continue to maintain speed control mode and smoothly transition the engine speed from its current value to the target start speed in a controlled manner. Importantly, by limiting the slope of the generator's output torque, potential torque surges during speed transitions are avoided, thereby improving the smoothness and comfort of the engine start-up process, reducing the risk of impact on the engine and generator mechanical components, and extending the equipment's service life.

[0181] Optionally, in speed control mode, the following steps can also be performed.

[0182] In one possible implementation, in this speed control mode, in response to the detection of an abnormal speed, the vehicle controller re-determines the torque limit and speed change slope limit of the generator based on the engine coolant temperature and the altitude of the environment, and continues to execute the speed closed-loop control.

[0183] Abnormal engine speed refers to a deviation in engine speed from the expected or normal operating state under speed control mode. Abnormal speed may manifest as speed fluctuations exceeding a preset range, excessively rapid or slow speed decreases, or drastic speed changes within a short period. Detection of abnormal speed can be achieved in various ways. For example, by comparing the deviation between the current speed and the target or desired speed curve, an abnormality is identified when the deviation exceeds a preset threshold; or by monitoring the rate of change of speed, an abnormality is identified when the rate of change exceeds a safe range. Furthermore, other engine operating parameters, such as vibration and noise, can be considered for a comprehensive assessment. Re-determining the generator's torque limit value involves dynamically adjusting the maximum or minimum torque output of the generator under speed control mode based on the detected abnormal speed conditions and environmental parameters such as engine coolant temperature and altitude. This ensures that the generator can output appropriate torque to stabilize or reduce engine speed under abnormal conditions, while avoiding excessive torque surges or insufficient torque response. Redetermining the torque limit can be based on a preset lookup table, which takes water temperature, altitude, and abnormal speed type as input and outputs the corresponding torque limit value; or, through a real-time calculation model, the limit value can be dynamically adjusted according to the input parameters. Redetermining the generator's speed change slope limit refers to dynamically adjusting the maximum allowable rate of change of engine speed based on the currently detected abnormal speed conditions and environmental parameters such as engine water temperature and altitude. This helps to control the engine speed to decrease more smoothly or rapidly under abnormal conditions, adapting to the abnormal situation and avoiding drastic speed fluctuations or prolonged stagnation. Redetermining the speed change slope limit can employ a similar method to the torque limit, for example, by consulting a preset parameter mapping table to obtain a new slope limit based on water temperature, altitude, and abnormal speed type; or, through an adaptive control algorithm, dynamically adjusting the slope limit according to real-time operating conditions. Continuing to execute this closed-loop speed control means that after redefining the generator's torque limit and speed change slope limit, the vehicle controller continues to operate according to the closed-loop control principle to bring the engine speed towards the target speed (usually zero speed or shutdown speed). This means that the vehicle controller will adjust the generator's output torque according to the new limit and slope limit to correct abnormal speed and ensure a smooth decrease in engine speed.

[0184] Through the above implementation, during engine shutdown, when an abnormal speed occurs in the speed control mode, the generator's torque limit and speed change slope limit can be dynamically adjusted based on real-time operating conditions such as engine coolant temperature and ambient altitude. This adaptive control strategy enables the engine to adjust its speed more accurately and safely in the face of abnormal situations, avoiding control failures or over-response that may result from fixed parameter control. This improves the robustness and reliability of the engine shutdown process, ensuring a smooth and efficient reduction in engine speed.

[0185] For example, in engine speed control mode, when an abnormal speed is detected—for instance, by comparing the actual engine speed with the target speed curve and finding that the actual speed deviates from the target speed curve by more than 50 rpm for more than 2 seconds—it is determined to be an abnormal speed. The vehicle controller reads the engine coolant temperature (e.g., 70°C) from the temperature sensor installed in the engine coolant circuit and obtains the current altitude (e.g., 1500 meters) from the onboard GPS module. The vehicle controller has a pre-stored multidimensional lookup table that takes coolant temperature, altitude, and the type of speed abnormality (e.g., excessively high speed or slow speed decrease) as input parameters. Based on the current coolant temperature of 70°C, altitude of 1500 meters, and the detected slow speed decrease anomaly, the lookup table outputs a new set of generator torque limit values ​​and speed change slope limits. For example, the vehicle controller adjusts the generator's maximum negative torque limit from -50 Nm to -60 Nm to provide greater braking capability, while adjusting the speed change slope limit from -500 rpm / s to -700 rpm / s to allow for a faster rate of speed decrease. After these new limits are loaded into the vehicle controller, the speed closed-loop control algorithm will continue to run, but its output torque command will be constrained by these new limits, enabling the engine speed to better respond to abnormal conditions and continue to smoothly transition to shutdown speed.

[0186] Figure 7 This is a schematic diagram of the structure of a power system provided in an embodiment of this application. See also... Figure 7 The power system 700 includes an engine 701, a generator 702, and a controller 703; The generator 702 is mechanically connected to the crankshaft of the engine 701, and the generator 702 is configured to apply torque to the crankshaft during the shutdown of the engine 701 in order to control the position of the crankshaft; The controller 703 is configured to execute the control method of the engine described above.

[0187] The controller 703 is at least one of the vehicle controller, engine controller, and motor controller. The generator 702 is a P1 motor.

[0188] Figure 8 This is a schematic diagram of the structure of an engine control device provided in an embodiment of this application. See also... Figure 8 The device includes: The switching module 801 is used to switch the generator connected to the crankshaft of the engine to stall control mode in response to the engine meeting a first preset condition after receiving an engine shutdown command. The application module 802 is used to apply a holding current to the generator based on the generator's electrical angle and engine operating parameters at the time of the control mode switching in the stall control mode, so as to keep the crankshaft locked in the current position.

[0189] It should be noted that the engine control device provided in the above embodiments is only illustrated by the division of the above functional modules when controlling the engine. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. In addition, the engine control device provided in the above embodiments and the engine control method embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0190] Figure 9 This is a schematic diagram of the structure of an electronic device 900 provided in an embodiment of this application. The electronic device 900 can vary significantly due to differences in configuration or performance. It may include one or more Central Processing Units (CPUs) 901 and one or more memories 902. The one or more memories 902 store at least one computer program, which is loaded and executed by the one or more processors 901 to implement the methods provided in the various method embodiments described above. Of course, the electronic device 900 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The electronic device 900 may also include other components for implementing device functions, which will not be elaborated here. In some embodiments, the electronic device 900 may be mounted on a vehicle.

[0191] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a computer program that can be executed by a processor to perform the engine control method in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0192] In an exemplary embodiment, a computer program product or computer program is also provided, which includes program code stored in a computer-readable storage medium. A processor of an electronic device reads the program code from the computer-readable storage medium and executes the program code, causing the electronic device to perform the engine control method described above.

[0193] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0194] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for controlling an engine, characterized in that, The method includes: Upon receiving an engine shutdown command, in response to the engine meeting a first preset condition, the generator connected to the crankshaft of the engine is switched to stall control mode. In the stall control mode, based on the electrical angle of the generator and the engine operating parameters at the time of control mode switching, a holding current is applied to the generator to keep the crankshaft locked in the current position.

2. The method according to claim 1, characterized in that, The first preset condition includes at least one of the following: The engine speed is lower than a preset lock-up speed threshold; The crankshaft of the engine is within a preset error range of the target crankshaft stopping position.

3. The method according to claim 1, characterized in that, The process of applying a holding current to the generator based on the generator's electrical angle and engine operating parameters at the time of control mode switching includes: Based on the electrical angle of the generator at the moment of control mode switching, and at least one of the crankshaft stop position of the engine and the cylinder pressure of the engine, a first current component of the holding current is determined, and the first current component is used to generate a radial holding force that locks the crankshaft in the current position. The current value of the second current component of the holding current is adjusted to zero, and the second current component is used to ensure that no torque is generated to drive the crankshaft to rotate. The holding current is applied to the generator based on the first current component and the second current component.

4. The method according to claim 3, characterized in that, The determination of the first current component of the holding current based on at least one of the following: the electrical angle of the generator at the time of control mode switching, the crankshaft stop position of the engine, and the in-cylinder air pressure of the engine, includes: The current value of the first current component is determined based on at least one of the crankshaft stop position of the engine and the cylinder pressure of the engine, wherein the crankshaft stop position of the engine is the target crankshaft stop position or the current position of the crankshaft. Based on the electrical angle, the application direction of the first current component is determined; The first current component is determined based on the current value and the direction of application.

5. The method according to claim 4, characterized in that, Determining the current value of the first current component based on at least one of the engine crankshaft stop position and engine cylinder pressure includes: Obtain a first correspondence between at least one of the engine crankshaft stop position and engine cylinder pressure and the holding current; determine the current value of the first current component based on the first correspondence between the engine crankshaft stop position and engine cylinder pressure and the first current component. or, Obtain a second correspondence between at least one of the engine crankshaft stop position and engine cylinder pressure and the required torque; determine the required torque based on the engine crankshaft stop position and engine cylinder pressure and the second correspondence; and determine the current value of the first current component based on the required torque through a torque-current conversion relationship.

6. The method according to claim 5, characterized in that, Determining the application direction of the first current component based on the electrical angle includes: Based on the electrical angle, the D-axis direction of the generator is determined; the D-axis direction is then determined as the application direction of the first current component. or, Based on the electrical angle, the D-axis direction of the generator is determined; the D-axis direction is offset by a preset angle to obtain the offset D-axis direction, the preset angle being used to compensate for the directional deviation caused by the response delay of the generator; the offset D-axis direction is determined as the application direction of the first current component.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the stall control execution time; The method of applying a holding current to the generator based on the electrical angle of the generator at the time of control mode switching and the crankshaft stop position of the engine includes: During the stall control execution time, a holding current is applied to the generator based on the electrical angle of the generator and the crankshaft stop position of the engine at the control mode switching time. If the duration of the holding current application exceeds the stall control execution time, the application of the holding current to the generator shall be stopped.

8. The method according to claim 7, characterized in that, The process of obtaining the stall control execution time includes: Obtain a third correspondence between the crankshaft stop position of the engine and the stall control execution time; determine the stall control execution time based on the crankshaft stop position of the engine and the third correspondence. or, Obtain the cylinder pressure decay time corresponding to the crankshaft stop position of the engine. The cylinder pressure decay time is the time required for the cylinder pressure to decay from the current value to a preset pressure threshold after the engine stops at the crankshaft stop position. Based on the cylinder pressure decay time, determine the stall control execution time.

9. The method according to claim 1, characterized in that, The method further includes: In response to the crankshaft position of the engine exceeding the preset error range of the target crankshaft stop position, the generator is switched from the stall control mode to the angle control mode to re-drag the crankshaft to the target crankshaft stop position.

10. The method according to claim 1, characterized in that, The method further includes: In response to receiving an engine start command, the generator is switched from the stall control mode to the speed control mode; Specifically, during the switch from the stall control mode to the speed control mode, the output torque of the generator is limited by a slope so that the engine speed smoothly transitions to the target starting speed.

11. The method according to claim 10, characterized in that, The step of limiting the output torque of the generator by a slope during the switch from the stall control mode to the speed control mode includes: Determine the limit for the rate of change of torque; During the process of switching from the stall control mode to the speed control mode, the output torque of the generator is controlled to transition from the current torque to the target torque based on the torque change rate limit.

12. The method according to claim 1, characterized in that, The method further includes: Upon receiving an engine shutdown command, in response to the engine meeting a second preset condition, the generator is switched to angle control mode, whereby the second preset condition is that the engine speed is lower than a preset angle control speed threshold. In the angle control mode, the crankshaft of the engine is dragged to the target crankshaft stop position through closed-loop angle position control.

13. The method according to claim 12, characterized in that, In the angle control mode, the crankshaft of the engine is dragged to the target crankshaft stop position through closed-loop angle position control, including: When the generator is switched to the angle control mode, the crankshaft position of the engine and the current electrical angle of the generator are obtained, and there is a fourth correspondence between the crankshaft position and the electrical angle; Based on the fourth correspondence and the target crankshaft stopping position, the target electrical angle is determined; Based on the target electrical angle, the crankshaft of the engine is dragged to the target crankshaft stopping position through closed-loop control of the angle position.

14. The method according to claim 13, characterized in that, The determination of the target electrical angle based on the fourth correspondence and the target crankshaft stopping position includes: Obtain a first preset position and a second preset position, wherein the first preset position and the second preset position are the boundaries of the crankshaft position interval corresponding to the target crankshaft stop position; The target electrical angle is determined based on the relationship between the crankshaft position and the first preset position and the second preset position.

15. The method according to claim 14, characterized in that, The determination of the target electrical angle based on the relationship between the crankshaft position and the first preset position and the second preset position includes: When the crankshaft position is less than or equal to the first preset position, the target electrical angle is determined based on the difference between the first preset position and the crankshaft position, the number of pole pairs of the generator, and the electrical angle corresponding to a unit tooth. When the crankshaft position is greater than the second preset position, the target electrical angle is determined based on the difference between the crankshaft position and the second preset position, the first preset position, the number of pole pairs, and the electrical angle corresponding to the unit tooth. When the crankshaft position is greater than the first preset position and less than the second preset position, the target electrical angle is determined based on the difference between the second preset position and the crankshaft position, the number of pole pairs, and the electrical angle corresponding to the unit tooth.

16. The method according to claim 13, characterized in that, The method further includes: Obtain the electrical angle deviation between the target electrical angle and the current electrical angle; If the electrical angle deviation is less than a preset electrical angle threshold and the engine speed is greater than a preset speed threshold, the target electrical angle is increased by a preset electrical angle amount, which is the electrical angle corresponding to a mechanical half-turn or a mechanical full-turn.

17. The method according to claim 13, characterized in that, The method further includes: The feedforward torque is obtained through a load observer, which is used to observe the deviation between the actual speed and the estimated speed of the generator; Based on the cumulative electrical angle and the target electrical angle, the feedback torque is calculated through a position closed loop. Based on the feedforward torque and the feedback torque, the output torque of the generator is determined, and the negative torque in the output torque is limited to zero.

18. The method according to claim 13, characterized in that, The method further includes: The positive torque limit value is determined based on the engine's water temperature and the altitude of the environment. During the closed-loop control of the angular position, the output torque of the generator is limited based on the positive torque limit value.

19. The method according to claim 12, characterized in that, The method further includes: In the angle control mode, in response to receiving an engine start command, the angle control mode is exited and the generator is switched to speed control mode; During the process of switching the generator to the speed control mode, the output torque of the generator is limited by a slope.

20. The method according to claim 12, characterized in that, The method further includes: Upon receiving an engine shutdown command, in response to the engine meeting a third preset condition, the generator is switched to torque control mode, wherein the third preset condition is that the engine speed is lower than a preset torque control speed threshold. In the torque control mode, the generator output torque is controlled based on a preset target torque to reduce the engine speed and limit the negative torque of the generator to zero.

21. The method according to claim 20, characterized in that, The method further includes: In the torque control mode, in response to receiving an engine start command, the torque control mode is exited and the generator is switched to speed control mode; During the process of switching the generator to the speed control mode, the output torque of the generator is limited by a slope.

22. The method according to claim 20, characterized in that, The method further includes: In response to receiving an engine shutdown command, the generator is switched to speed control mode; In the speed control mode, the engine speed is reduced through closed-loop speed control.

23. The method according to claim 22, characterized in that, The method of reducing the engine speed through closed-loop speed control includes: The feedforward torque is obtained through a load observer, which is used to observe the deviation between the actual speed and the estimated speed of the generator; Based on the feedforward torque, the output torque of the generator is calculated through the speed closed-loop control. Based on the output torque, the engine speed is reduced.

24. The method according to claim 22, characterized in that, The method further includes: In the speed control mode, in response to receiving an engine start command, the generator is maintained in the speed control mode, and the engine speed is transitioned from the current speed to the target start speed; During the transition of the engine speed to the target starting speed, the output torque of the generator is limited by a slope.

25. A power system, characterized in that, The power system includes an engine, a generator, and a controller; The generator is mechanically connected to the crankshaft of the engine, and the generator is configured to apply torque to the crankshaft during engine shutdown to control the position of the crankshaft; The controller is configured to perform the engine control method according to any one of claims 1 to 24.

26. A control device for an engine, characterized in that, The device includes: The switching module is used to switch the generator connected to the crankshaft of the engine to a stall control mode in response to the engine meeting a first preset condition after receiving an engine shutdown command. An application module is used to apply a holding current to the generator based on the generator's electrical angle and engine operating parameters at the time of the control mode switch in the stall control mode, so as to keep the crankshaft locked in the current position.

27. An electronic device, characterized in that, The electronic device includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, the computer program being loaded and executed by the one or more processors to implement the engine control method as described in any one of claims 1 to 24.

28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the engine control method as described in any one of claims 1 to 24.