Motor angle writing method and system
Through UDS service, the motor angle is written in the motor controller MCU and the verification is solved, and the existing motor angle writing methods are complicated and prone to errors is easily implemented, and the convenient matching and accurate writing angles between the motor controller MCU and the motor angle are achieved.
Patent Information
- Application Number
- CN202510338121.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-20
AI Technical Summary
The existing motor angle writing method is cumbersome to operate, which is inconvenient to apply to the production line, and is prone to human or system errors, resulting in the electric drive system not working according to the design requirements.
The write service of the UDS service writes a known motor angle into the inherent parameters of the motor controller MCU, and checks the write result to ensure that the angle value is within the set range. The method includes setting the low voltage state of the whole vehicle, secure access authentication of the diagnostic equipment and the motor controller MCU, writing the angle value and checking it, storing the angle value in the EEPROM after the write is successful, and reading and verifying the angle value.
It realizes convenient matching of the motor controller MCU and motor angle, improves the accuracy of the write angle, reduces human errors, and is suitable for production line applications and after-sales motor replacement.
Smart Images

Figure CN120179453A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle driving, and specifically, to a method and system for writing motor angles. Background Art
[0002] During the development of new energy vehicles, the motor controller MCU needs to match the correct motor angle to control the motor to operate in an efficient and correct manner. Since the motor controller MCU and the motor belong to different products respectively, the motor angle matching work may not be carried out before leaving the factory, so the angle marking work needs to be carried out after the vehicle is assembled. At present, there are two mainstream angle marking methods on the market: one is the zero-position angle self-learning method, and the other is the method of writing the motor angle into the controller. The first method can be used in the prototype vehicle development stage, but the second method is more applicable in the mass production stage. However, during the writing process, it is inevitable to have human or system errors in writing the motor angle into the controller, resulting in the electric drive system not working according to the design requirements. And the existing motor angle writing methods are cumbersome to operate, not easy to be applied to the production line and promoted for use, and the angle writing process does not consider the possible problems during the process. Summary of the Invention
[0003] Aiming at the defects in the prior art, the purpose of the present invention is to provide a method and system for writing motor angles, which write the known motor angle into the inherent parameters of the motor controller MCU software through the write service of the UDS service, and verify the writing result to ensure that the angle value does not exceed the set range.
[0004] According to the first aspect of the present invention, a method for writing a motor angle is provided, and the method includes the following steps:
[0005] A1: Set the vehicle to be in a low-voltage state, the diagnostic device enables the motor controller MCU to enter the extended mode, and passes the security access authentication of the motor controller MCU;
[0006] A2: The diagnostic device sends a write angle request to the motor controller MCU and waits for the response of the motor controller MCU. The diagnostic device writes the motor angle value into the motor controller MCU through the unified diagnostic service UDS, and then the motor controller MCU checks the angle value;
[0007] A3: If the motor controller MCU checks that the written angle value is not within the angle range provided by the supplier, the motor controller MCU responds that the write angle fails and reports a fault, restricting torque output; if the motor controller MCU checks that the written angle value is within the angle range provided by the supplier, step A4 is executed;
[0008] A4: The motor controller MCU writes the angle value into the internal memory EEPROM;
[0009] A5: The diagnostic device sends a reset instruction to the motor controller MCU, and the motor controller MCU responds with a successful angle write and performs a reset operation.
[0010] A6: The diagnostic device sends a read angle request to the motor controller MCU and waits for the motor controller MCU to respond. The diagnostic device reads the angle value written to the internal memory EEPROM at this time and checks whether this value is equal to the angle value on the motor label.
[0011] A7: If the angle value read by the diagnostic device is the same as the angle value on the motor label, the angle write process is completed, and the motor controller MCU responds with a successful read angle and performs a vehicle power-off operation. If the angle value read by the diagnostic device is different from the angle value on the motor label, steps A1 to A7 are repeated to perform angle writing again. When the number of times of repeated angle writing is greater than three, the angle write process ends, and the motor controller MCU responds with a failed read angle and reports a fault.
[0012] Preferably, when repeating angle writing in step A7, the temporary fault code and historical angle value stored in the motor controller MCU need to be cleared before each angle write.
[0013] Preferably, the method further includes an after-sales motor angle write process, and the process includes the following steps:
[0014] B1: Clear the motor angle value already stored in the motor controller MCU through the diagnostic device.
[0015] B2: Replace the motor.
[0016] B3: Execute the motor angle write process of steps A1 to A7.
[0017] Preferably, in step A3, if the motor controller MCU checks that the written angle value is not within the angle range provided by the supplier, the motor controller MCU reports a fault and limits the torque output to 0.
[0018] According to the second aspect of the present invention, there is provided a motor angle write system for implementing any of the above-mentioned motor angle write methods, and the system includes:
[0019] Diagnostic module: used for communicating with the motor controller MCU.
[0020] Security verification unit: performs security verification between the motor controller MCU and the diagnostic module.
[0021] Verification module: Integrate the verification of the angle value written by the motor controller MCU with the angle range provided by the supplier and the data consistency verification of the angle value written by the motor controller MCU and the angle value of the motor label;
[0022] Fault protection module: Trigger torque limit and record fault codes;
[0023] Reset control unit: Perform the reset operation of the motor controller MCU to activate the angle reading request. Compared with the prior art, the present invention has the following beneficial effects:
[0024] 1. A motor angle writing method and system provided by the present invention complete the matching work of the motor controller MCU and the motor angle in a convenient manner to meet the requirement of simplifying the angle writing during product off-line, and at the same time optimize the steps of angle writing and prevent possible problems during the angle writing process, thereby improving the accuracy of angle writing.
[0025] 2. A motor angle writing method and system provided by the present invention optimize the process of replacing the motor and writing the angle after-sales, and standardize the operations of after-sales personnel to reduce human errors. Description of the Drawings
[0026] By reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings, other features, objects, and advantages of the present invention will become more apparent:
[0027] Figure 1 It is a flowchart of the motor angle writing method in the first embodiment. Detailed Embodiments
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and shown herein can be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0030] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, all directional indications (such as up, down, left, right, front, back, bottom, etc.) in the present invention are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly. Further, the descriptions involving "first", "second", etc. in the invention are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features.
[0031] First Embodiment
[0032] As Figure 1 shown, the following is the motor angle writing method provided by this embodiment. The method includes the following steps:
[0033] A1: Set the whole vehicle to a low-voltage state. The diagnostic device enables the motor controller MCU to enter the extended mode. Only in this mode can the motor controller MCU perform the operation of writing data stream. Before performing the angle value writing operation, the diagnostic device also needs to pass the security access restriction of the motor controller MCU. Only when the security verification is completed between the diagnostic device and the motor controller MCU, will the motor controller MCU allow the diagnostic device to write the angle value into the memory.
[0034] A2: The diagnostic device sends a write angle request to the motor controller MCU and waits for the response of the motor controller MCU. The diagnostic device writes the motor angle value into the motor controller MCU through the write service in the unified diagnostic service UDS. Subsequently, the motor controller MCU performs an angle value check. For example, if the angle value of the motor provided by the motor manufacturer is within 295° - 305°, the motor controller MCU will make a judgment within this range based on the read and written angle and execute step A3 processing.
[0035] A3: If the motor controller MCU checks that the written angle value is not within the angle range provided by the supplier, the motor controller MCU responds that the write angle fails and reports a fault, and restricts the torque output. At this time, the output torque of the motor controller MCU is always 0, avoiding the unexpected operation of the electric drive system due to the wrong angle value; if the motor controller MCU checks that the written angle value is within the angle range provided by the supplier, execute step A4;
[0036] A4: The motor controller MCU writes the angle value into the internal memory EEPROM;
[0037] A5: The diagnostic device sends a reset instruction to the motor controller MCU, and the motor controller MCU responds that the write angle is successful and performs a reset operation;
[0038] A6: The diagnostic device sends a read angle request to the motor controller MCU and waits for the motor controller MCU to respond. The diagnostic device reads the angle value written to the internal memory EEPROM at this time and checks whether this value is equal to the angle value on the motor label.
[0039] A7: If the angle value read by the diagnostic device is the same as the angle value on the motor label, the angle writing process is completed. The motor controller MCU responds that the read angle is successful and performs the vehicle power-off operation. If the angle value read by the diagnostic device is different from the angle value on the motor label, steps A1 to A7 are repeated to perform angle writing again. When the number of times of repeated angle writing is greater than three, the angle writing process ends. The motor controller MCU responds that the read angle fails and reports a fault. When repeating angle writing, the temporary fault code and historical angle value stored in the motor controller MCU need to be cleared before each angle writing.
[0040] Before the motor controller MCU writes the matching motor angle value, the angle is an invalid value. At this time, the motor controller MCU will report a fault. This fault will not affect the vehicle's high-voltage power-on, but after the motor controller MCU reports this fault, the output torque will be limited to 0. That is to say, the vehicle cannot run at this time, which can avoid unexpected control of the motor controller MCU when the motor angle is unknown.
[0041] The motor angle writing method provided in this embodiment further includes an after-sales motor angle writing process, and the process includes the following steps:
[0042] B1: Clear the motor angle value stored in the motor controller MCU through the diagnostic device to prevent the behavior of after-sales personnel omitting angle writing after replacing the motor, thereby avoiding the electric drive system from operating in an incorrect state.
[0043] B2: Replace the motor.
[0044] B3: The after-sales personnel perform the operation of writing the motor angle value to the motor controller MCU and execute the motor angle writing process of steps A1 to A7.
[0045] The present invention provides a method for writing the motor angle. The known motor angle is written into the inherent parameters of the motor controller MCU software through the write service of the UDS service, and the result of the writing is verified to ensure that the angle value does not exceed the set range. On the one hand, the matching work between the motor controller MCU and the motor angle can be completed in a convenient way to meet the requirement of simplifying the angle writing during product off-line, and at the same time, the steps of angle writing are optimized, and the problems that may occur during the angle writing process are prevented, so as to improve the accuracy of angle writing; on the other hand, the process of replacing the motor and writing the angle after-sales is optimized, and the operation of after-sales personnel is standardized to reduce human errors.
[0046] Second Embodiment
[0047] This embodiment provides a motor angle writing system for implementing the motor angle writing method described in the above embodiment. The system includes:
[0048] Diagnostic module: used to communicate with the motor controller MCU;
[0049] Security verification unit: performs security verification between the motor controller MCU and the diagnostic module;
[0050] Verification module: integrates the verification of the angle value written by the motor controller MCU with the angle range provided by the supplier and the data consistency verification of the angle value written by the motor controller MCU and the angle value of the motor label;
[0051] Fault protection module: triggers torque limitation and records the fault code;
[0052] Reset control unit: performs the reset operation of the motor controller MCU to activate the angle reading request.
[0053] The specific embodiments of the present invention have been described above. Through the above description, relevant staff can make various changes and modifications completely within the scope not deviating from the technical idea of the present invention.
Claims
1. A method for writing a motor angle, characterized in that: The method comprises the following steps: A1: Set the vehicle to a low voltage state, and the diagnostic equipment enables the motor controller MCU to enter the extended mode and pass the security access authentication of the motor controller MCU; A2: The diagnostic device sends a write angle request to the motor controller MCU and waits for the motor controller MCU to respond. The diagnostic device writes the motor angle value into the motor controller MCU through the unified diagnostic service UDS, and then the motor controller MCU checks the angle value. A3: If the motor controller MCU detects that the written angle value is not within the angle range provided by the supplier, the motor controller MCU responds to the angle writing failure and reports a fault, limiting the torque output; if the motor controller MCU detects that the written angle value is within the angle range provided by the supplier, execute step A4; A4: The motor controller MCU writes the angle value into the internal storage EEPROM; A5: The diagnostic device sends a reset command to the motor controller MCU, and the motor controller MCU responds that the angle writing is successful and performs a reset operation; A6: The diagnostic device sends an angle reading request to the motor controller MCU and waits for the motor controller MCU to respond. The diagnostic device reads the angle value written to the internal storage EEPROM at this time and checks whether the value is equal to the angle value on the motor label; A7: If the angle value read by the diagnostic device is the same as the angle value on the motor tag, the angle writing process is completed, and the motor controller MCU responds that the angle reading is successful and executes the vehicle power-off operation; if the angle value read by the diagnostic device is different from the angle value on the motor tag, repeat steps A1 to A7 and write the angle again. When the number of repeated angle writing is greater than three times, the angle writing process is terminated, and the motor controller MCU responds that the angle reading fails and reports a fault.
2. The motor angle writing method according to claim 1, characterized in that: When the angle writing is repeated in step A7, the temporary fault code and historical angle value stored in the motor controller MCU need to be cleared before each angle writing.
3. The motor angle writing method according to claim 1, characterized in that: The method also includes an aftermarket motor angle writing process, the process comprising the following steps: B1: Clear the motor angle value stored in the motor controller MCU through the diagnostic device; B2: Replace the motor; B3: Execute the motor angle writing process of steps A1 to A7.
4. The motor angle writing method according to claim 1, characterized in that: In step A3, if the motor controller MCU detects that the written angle value is not within the angle range provided by the supplier, the motor controller MCU reports a fault and limits the torque output to 0.
5. A motor angle writing system, used to implement the motor angle writing method described in any one of claims 1 to 4, characterized in that: The system comprises: Diagnostic module: used to communicate with the motor controller MCU; Safety verification unit: performs safety verification between the motor controller MCU and the diagnostic module; Verification module: The angle value written by the integrated motor controller MCU is verified with the angle range provided by the supplier, and the angle value written by the motor controller MCU is verified with the angle value data consistency of the motor tag; Fault protection module: triggers torque limit and records fault codes; Reset control unit: performs a motor controller MCU reset operation to activate the angle reading request.