Compensation methods, devices, motor controllers, and media for improving current detection accuracy
By acquiring zero-current voltage and temperature calibration error compensation in real time in the motor control system and optimizing the closed-loop control parameters, the problem of low current detection accuracy is solved, achieving high-precision current detection and cost reduction.
Patent Information
- Application Number
- CN202411013023.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In existing technologies, the current detection accuracy of motor control systems is poor, resulting in high hardware costs, difficulty in selecting components, and significant impact from temperature changes, making it difficult to meet high-precision requirements.
By acquiring the voltage of the current sensing operational amplifier when there is zero current in real time in the motor control system, and combining the temperature calibration error relationship and multiple voltage sampling, calibration error compensation parameters are obtained to achieve error compensation for the current sensing operational amplifier and the current sensing resistor, thereby optimizing the closed-loop control parameters.
It improves the accuracy of motor current detection, reduces costs and simplifies component selection, achieves comprehensive error compensation for current detection devices, and enhances driving quality and safety.
Smart Images

Figure CN118731815B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle control technology, and in particular to a compensation method, device, motor controller, and readable storage medium for improving the accuracy of current detection. Background Technology
[0002] Please see Figure 1 , Figure 1 This is a block diagram of a motor control system in related technologies. Figure 1 In the B6 bridge 110 (three-phase full-bridge inverter circuit), the switching on and off of the upper bridge arms Q11, Q12, and Q13 and the lower bridge arms Q21, Q22, and Q23 are controlled by the motor pre-drive chip 120. In the U, V, and W phases, a current sensing resistor R1, R2, and R3 are respectively set between the lower bridge arms Q21, Q22, and Q23 of each phase and ground. When current flows, the voltage signal across the current sensing resistors R1, R2, and R3 is transmitted to the motor pre-drive chip 120. The motor pre-drive chip 120 integrates a current sensing operational amplifier CSA1 (each phase has a corresponding current sensing operational amplifier and an analog-to-digital converter). Figure 1 Only one corresponding current-sensing operational amplifier (CSA1) and analog-to-digital converter (ADC1) are shown in the diagram. Taking one phase bridge arm connected to a current-sensing resistor R1 as an example, the current-sensing operational amplifier CSA1 amplifies the small voltage difference between the two voltage signals applied to the current-sensing resistor R1. The amplified signal is transmitted to the microprocessor control unit (MCU). When no current flows through the current-sensing resistor R1, the voltage difference across R1 is zero. After being amplified by the motor pre-drive chip 120, the voltage value at zero current can be obtained. The MCU divides the difference between the two voltages by the theoretical op-amp gain of the current-sensing operational amplifier CSA1 and the resistance value of the current-sensing resistor R1 to obtain the current value, which is ultimately used as the current input in the current closed-loop control algorithm.
[0003] If the current sensing resistors R1, R2, and R3, their corresponding current sensing operational amplifiers, and the analog-to-digital converter in the above circuit were all ideal devices, the error in the current sensing stage should be zero. However, actual components have various errors: the resistance values of the current sensing resistors R1, R2, and R3, as well as the amplification factor of their respective current sensing operational amplifiers, have factory errors, which increase with temperature; moreover, the current sensing operational amplifier 1 has an input offset voltage, which shifts with temperature, time, and voltage changes; the 5V voltage on the circuit board supplying the current sensing operational amplifier has accuracy errors; and the analog-to-digital converter in the microprocessor control unit (MCU) has errors during analog-to-digital conversion. All of these errors contribute to current sensing errors. Therefore, the low current sampling accuracy of the MCU leads to poor phase current accuracy when the B6 bridge driver 12 controls the B6 bridge 110 and thus drives the motor 140.
[0004] For vehicle motor control systems, high precision is required; poor current accuracy can significantly impact driving quality and even safety. Therefore, related technologies typically employ a motor pre-drive chip 120 integrating a high-precision current-sensing operational amplifier and high-precision current-sensing resistors R1, R2, and R3. However, this approach has the following drawbacks:
[0005] (1) Selecting high-precision motor pre-drive chip 120 and current sensing resistors R1, R2 and R3 will significantly increase hardware costs;
[0006] (2) To achieve the expected current accuracy, it is often necessary to cooperate with the motor pre-drive chip 120 with specific accuracy and the current sensing resistors R1, R2 and R3. However, it is usually difficult to match the required device model with the required parameters, resulting in the problem of difficult device selection and poor universality.
[0007] (3) Even if high-precision devices are selected, there is still a problem of parameter shift with temperature changes, and the influence of temperature changes cannot be completely eliminated.
[0008] It should be noted that the information disclosed in the background section of this invention is intended only to enhance the understanding of the general background of this invention, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0009] The purpose of this invention is to address one or more problems in existing motor control systems, such as relatively poor current accuracy or high cost associated with high-precision control, by providing a compensation method, device, motor controller, and readable storage medium for improving current detection accuracy. This invention can improve the control accuracy of motor current at a low cost; at the same time, this invention also has good universality and can significantly reduce the difficulty of device selection.
[0010] To achieve the above objectives, the present invention provides a compensation method for improving current detection accuracy, used in a motor control system. The motor control system includes a motor, a power supply providing phase current to the motor, and a current detection device. The current detection device includes current sensing operational amplifiers corresponding one-to-one with the bridge arms used to transmit the phase current. The compensation method includes:
[0011] When it is determined that the operating state of the motor control system meets the first precision compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to zero current is collected.
[0012] For each of the bridge arms, the calibration error compensation parameters corresponding to the bridge arm at the current temperature are obtained based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm.
[0013] For each bridge arm, within one PWM cycle, the voltage value output by the current sensing operational amplifier corresponding to that bridge arm is sampled at least twice, and the second voltage is obtained based on all voltage sampling values.
[0014] Based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, closed-loop control parameters are obtained to achieve control of the output current of all phases of the power supply.
[0015] Determine whether the operating state of the motor control system meets the second precision compensation preset condition. If yes, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if no, return to execute the steps of obtaining the second voltage and the related steps after obtaining the second voltage.
[0016] Optionally, the current detection device further includes a microprocessor control unit, wherein the first precision compensation preset condition includes: the microprocessor control unit is powered on again or the current of the motor in the motor control system is zero but the current request is not zero; the second precision compensation preset condition includes: the microprocessor control unit is powered on again or the current request of the motor is zero.
[0017] Optionally, the compensation method for improving current detection accuracy further includes:
[0018] During the PAV calibration phase, the temperature-PAV calibration error correspondence for each phase of the bridge arm is determined.
[0019] Optionally, the current sensing device further includes current sensing resistors corresponding one-to-one with the current sensing operational amplifiers; the bridge arm includes an upper bridge arm and a lower bridge arm connected in series, the power supply is coupled to the other end of the upper bridge arm, and the current sensing resistors are connected in series between the lower bridge arm and ground; the calibration to obtain the corresponding relationship of temperature-PAV calibration error for each phase of the bridge arm includes:
[0020] Two different calibration temperatures were determined;
[0021] For each bridge arm, at each calibration temperature, at least two different current values are provided to the bridge arm to obtain the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameter of the current sensing resistor at the calibration temperature; wherein, at least one of the current values is 0 and at least one of the current values is greater than 0;
[0022] Based on all the calibration temperatures and the error compensation parameters corresponding to each calibration temperature, the correspondence between the temperature and PAV calibration error for that bridge arm is obtained.
[0023] Optionally, the step of providing at least two different current values to the bridge arm at each of the calibration temperatures to obtain the operational amplifier gain of the current-sensing operational amplifier corresponding to that bridge arm and the error compensation parameters of the current-sensing resistor at that calibration temperature includes:
[0024] For each bridge arm, control the upper and lower bridge arms of all bridge arms to be in a non-conducting state, and collect the third voltage output by the current sensing operational amplifier corresponding to that bridge arm;
[0025] Control the upper and lower bridge arms of the bridge arms of other phases, the upper bridge arm of the bridge arm is in a non-conducting state, and control the lower bridge arm of the bridge arm to be on; and provide a preset constant current to the lower bridge arm of the bridge arm and the current sensing resistor, and collect the fourth voltage output by the current sensing operational amplifier corresponding to the bridge arm;
[0026] Based on the third voltage, the fourth voltage, and the current value of the preset constant current, the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature are calculated.
[0027] Optionally, the step of calculating the operational amplifier gain of the current-sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current-sensing resistor at the calibration temperature based on the current values of the third voltage, the fourth voltage, and the preset constant current includes:
[0028] Calculate the difference between the fourth voltage and the third voltage;
[0029] Based on the difference and the current value of the preset constant current, the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature are calculated.
[0030] Optionally, the calibration temperature includes a first preset temperature and a second preset temperature; the step of obtaining the correspondence between the temperature and PAV calibration error of the bridge arm based on all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature includes:
[0031] Based on the first preset temperature and its corresponding first error compensation parameter, and the second preset temperature and its corresponding second error compensation parameter, a curve of error compensation parameter changing with temperature is obtained by fitting.
[0032] The curve is sampled to obtain multiple sets of calibration data pairs for temperature-error compensation parameters;
[0033] The calibration data is stored in the storage unit of the motor control system to obtain the correspondence between the temperature and PAV calibration error of the bridge arm.
[0034] Optionally, before calibrating to obtain the correspondence between the temperature-PAV calibration error for each phase arm, the compensation method further includes:
[0035] The host computer is connected to the motor control system, and a current source that meets the preset accuracy requirements is electrically connected to the bridge arm to establish a PAV calibration compensation test environment; wherein, the current source is used to provide a preset constant current to the bridge arm, and the host computer is used to control the calibration process.
[0036] Optionally, the step of acquiring the voltage value output by the current sensing operational amplifier corresponding to the bridge arm at least twice, and obtaining the second voltage based on all voltage samples, includes:
[0037] When the upper arm of one phase of the bridge arm is in a non-conducting state and the lower arm is in a conducting state, and the upper arm of the other phases of the bridge arm is in a conducting state and the lower arm is in a non-conducting state, at least one sampling is performed, and the first voltage sampling value is obtained based on all the sampling results in this state.
[0038] When the upper bridge arm of all the bridge arms is in a non-conducting state and the lower bridge arm is in a conducting state, at least one sampling is performed, and the second voltage sampling value is obtained based on all the sampling results in this state;
[0039] The second voltage is obtained by averaging the first voltage sample value and the second voltage sample value.
[0040] Optionally, obtaining the closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage includes:
[0041] For each of the bridge arms, the error compensation current value is calculated based on the first voltage, the calibration error compensation parameter, and the second voltage; and the difference between the current current request value and the error compensation current value is calculated.
[0042] The closed-loop control parameters are obtained based on the difference between the current current request value and the error compensation current value of all the bridge arms.
[0043] To achieve the above objectives, the present invention also provides a compensation device for improving current detection accuracy, used in a motor control system. The motor control system includes a motor, a power supply providing phase current to the motor, and a current detection device. The current detection device includes current sensing operational amplifiers corresponding one-to-one with the bridge arms used to transmit the phase current. The compensation device includes:
[0044] Bias voltage acquisition unit: configured to, when determining that the operating state of the motor control system meets the first precision compensation preset condition, acquire the first voltage output by the current sensing operational amplifier corresponding to each bridge arm when there is zero current;
[0045] Calibration error acquisition unit: configured to, for each of the bridge arms, acquire the calibration error compensation parameters corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm;
[0046] Sampling error acquisition unit: configured to, for each of the bridge arms, acquire at least twice the voltage value output by the current sensing operational amplifier corresponding to that bridge arm within one PWM cycle, and obtain a second voltage based on all voltage sampling values;
[0047] Error compensation execution unit: configured to obtain closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters and the second voltage, so as to realize the control of the output current of all phases of the power supply;
[0048] Error compensation judgment unit: configured to determine whether the operating state of the motor control system meets the second precision compensation preset condition; if yes, drive the bias voltage acquisition unit to acquire the first voltage; if no, drive the sampling error acquisition unit to acquire the second voltage.
[0049] To achieve the above objectives, the present invention also provides a motor controller, which includes the above-described compensation device for improving current detection accuracy or includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the compensation method for improving current detection accuracy described above.
[0050] To achieve the above objectives, the present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the compensation method for improving current detection accuracy as described in any of the preceding claims.
[0051] Compared with the prior art, the compensation method, device, motor controller, and readable storage medium provided by the present invention for improving the accuracy of current detection have the following advantages:
[0052] The compensation method for improving current detection accuracy provided by this invention, when determining that the operating state of the motor control system meets the first accuracy compensation preset condition, acquires in real time the first voltage output of the current sensing operational amplifier corresponding to zero current for each bridge arm. This lays the foundation for compensating for the offset voltage of the current sensing operational amplifier, the reference voltage error of the current sensing operational amplifier, the reference voltage error of the analog-to-digital conversion circuit (including but not limited to the analog-to-digital converter inside the microprocessor control unit), and the sampling error of the analog-to-digital converter. Furthermore, for each bridge arm, this invention obtains the calibration error compensation parameter corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm. This lays a solid foundation for compensating for the operational amplifier gain of the current sensing operational amplifier and the inherent factory error of the current sensing resistor, as well as the offset error of both caused by temperature changes. Furthermore, for each bridge arm, this invention samples the voltage value output by the current-sensing operational amplifier corresponding to that bridge arm at least twice within one PWM cycle, and obtains a second voltage based on all voltage samples, thus laying a good foundation for compensating the parasitic inductance of the current-sensing resistor. Finally, this invention obtains closed-loop control parameters based on the current current request value corresponding to all bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, to control the output current of all phases of the power supply. This achieves comprehensive compensation for the offset voltage of the current-sensing operational amplifier, the reference voltage error of the current-sensing operational amplifier and the reference voltage error of the analog-to-digital converter, the sampling error of the analog-to-digital converter, the operational amplifier gain of the current-sensing operational amplifier and the inherent factory error of the current-sensing resistor, the offset error of both due to temperature changes, and the deviation caused by the parasitic inductance of the current-sensing resistor. Therefore, this invention can eliminate various errors caused by the current detection device (hardware sampling circuit), thereby effectively improving the control accuracy of the motor current, and at a low cost; at the same time, this invention also has good universality, significantly reducing the difficulty of device selection.
[0053] Since the compensation device, motor controller, and readable storage medium for improving current detection accuracy provided by this invention belong to the same inventive concept as the compensation method for improving current detection accuracy provided by this invention, the compensation device, motor controller, and readable storage medium for improving current detection accuracy provided by this invention have at least all the advantages of the compensation method for improving current detection accuracy provided by this invention. For details on the beneficial effects of the compensation device, motor controller, and readable storage medium for improving current detection accuracy provided by this invention, please refer to the above description of the beneficial effects of the compensation method for improving current detection accuracy provided by this invention, which will not be repeated here. Attached Figure Description
[0054] Figure 1 This is a block diagram of a motor control system in related technologies;
[0055] Figure 2 This is a schematic diagram of the overall process of a compensation method for improving current detection accuracy provided in the first embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a current sensing operational amplifier in a motor control system for applying the compensation method for improving current detection accuracy provided by the present invention.
[0057] Figure 4 A schematic diagram of a PAV calibration compensation test environment for applying one specific example of the compensation method for improving current detection accuracy provided by the present invention.
[0058] Figure 5 A schematic flowchart illustrating the process of calibrating the temperature-PAV calibration error correspondence of each phase arm using a specific example of the compensation method for improving current detection accuracy provided by the present invention.
[0059] Figure 6a A schematic diagram of the current flow direction of the B6 bridge in a motor control system when it is in the 011 stage, as a specific example of the compensation method for improving current detection accuracy provided by the present invention.
[0060] Figure 6b A schematic diagram of the current flow direction of the B6 bridge of a motor control system in the 000 stage, as a specific example of the compensation method for improving current detection accuracy provided by the present invention.
[0061] Figure 7 A schematic diagram showing the correspondence between the PWM timing of a motor control system and the motor phase current and the output voltage of the current sensing operational amplifier, as a specific example of the compensation method for improving current detection accuracy provided by the present invention.
[0062] Figure 8 This is a schematic diagram of the structure of a compensation device for improving current detection accuracy provided in a second embodiment of the present invention;
[0063] Figure 9 A block diagram of the motor controller provided in the third embodiment of the present invention;
[0064] The reference numerals in the attached figures are as follows:
[0065] B6 Bridge - 110; Motor Pre-Driver Chip - 120; B6 Bridge Driver - 121; Current Detection Device - 130; Current Sensing Resistors - R1, R2, R3; Current Sensing Operational Amplifier - CSA1; Microprocessor Control Unit - MCU; Analog-to-Digital Converter - ADC1; Motor - 140; Power Supply - 150; Upper Bridge Arm - Q11, Q12, Q13; Lower Bridge Arm - Q21, Q22, Q23; Host Computer - PAM; Current Source - I;
[0066] Bias voltage acquisition unit-210, calibration error acquisition unit-220, sampling error acquisition unit-230, error compensation execution unit-240, error compensation judgment unit-250;
[0067] Processor-310, memory-320, communication interface-330, communication bus-340. Detailed Implementation
[0068] The following detailed description, in conjunction with the accompanying drawings, provides a compensation method, apparatus, motor controller, and readable storage medium for improving current detection accuracy according to the present invention. The advantages and features of the present invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, used only to facilitate and clearly illustrate the embodiments of the present invention. Please refer to the drawings to make the objectives, features, and advantages of the present invention more apparent and understandable. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the implementation conditions of the present invention. Any modifications to the structure, changes in proportions, or adjustments to the size, provided that the effects and objectives achieved by the present invention are the same or similar, should still fall within the scope of the technical content disclosed in the present invention. Specific design features of the present invention disclosed herein, including, for example, specific dimensions, orientations, positions, and shapes, will be determined in part by the specific application and usage environment. Furthermore, in the embodiments described below, the same reference numerals are sometimes used across different drawings to denote the same parts or parts having the same function, omitting repeated descriptions. In this specification, similar reference numerals and letters are used to denote similar items; therefore, once an item is defined in one figure, it need not be discussed further in subsequent figures. Furthermore, if the methods described herein involve a series of steps, and the order of these steps presented herein is not necessarily the only possible order in which they can be performed, some of the described steps may be omitted and / or other steps not described herein may be added to the method.
[0069] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The singular forms “a,” “an,” and “the” include plural objects. The term “or” is generally used to mean “and / or,” the term “several” is generally used to mean “at least one,” and the term “at least two” is generally used to mean “two or more.” Furthermore, the terms “first,” “second,” and “third” are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0070] It should be understood that when a component is described as "connected to" or "coupled to" other components, it may be directly connected to other components or there may be intermediary components. Conversely, when a component is described as "directly connected to" other components, there are no intermediary components.
[0071] Additionally, unless specifically stated or obvious from the context, as used herein, the term “about” is understood to mean within the normal tolerance range in the field, such as within 2 standard deviations of the mean. “About” can be understood as within 10%, 9%, 8%, 7%, 6%, 5%, 4%, 3%, 2%, 1%, 0.5%, 0.1%, 0.05%, or 0.01% of the stated value. Unless otherwise specified from the context, all numerical values provided herein are modified by the term “about”.
[0072] The core idea of this invention is to provide a compensation method, device, motor controller, and readable storage medium for improving the accuracy of current detection. This invention can improve the control accuracy of motor current and is low in cost. At the same time, this invention also has good universality and can significantly reduce the difficulty of device selection.
[0073] It should be noted that the compensation method, compensation device, and readable storage medium for improving current detection accuracy provided by this invention can be applied to the motor controller provided by this invention, and the compensation method, compensation device, motor controller, and readable storage medium for improving current detection accuracy provided by this invention can be applied to vehicles. It should be understood that the terms "vehicle" or "of a vehicle" or other similar terms as used herein include general motor vehicles, such as passenger vehicles including SUVs, buses, trucks, and various commercial vehicles, and include hybrid vehicles, electric vehicles, plug-in hybrid electric vehicles, fuel cell vehicles, and other alternative fuel vehicles (e.g., fuels obtained from resources other than petroleum).
[0074] To facilitate understanding and explanation of this invention, the hardware detection circuit of the electronic controller of a three-phase brushless DC motor control system is used as an example. Obviously, as those skilled in the art will understand, this is not a limitation of the invention. This invention is still applicable to other control systems besides motor control systems. For example, this invention is also applicable to hardware drive circuit schemes based on three-phase full-bridge inverter circuits, three-phase current sensing resistors, and current compensation such as single / dual current sensing resistors or multi-phase bridge circuits.
[0075] To achieve the above-mentioned goals, a first embodiment of the present invention provides a compensation method for improving the accuracy of current detection, wherein the compensation method is used in a motor control system. For example, please refer to... Figure 1 and Figure 2 ,in, Figure 1 This is a block diagram of a motor control system in related technologies; Figure 2 This is a schematic diagram of the overall process of the compensation method for improving current detection accuracy provided in this embodiment. From... Figure 1 and Figure 2 As can be seen, the motor control system includes a motor 140, a power supply 150 that provides phase current to the motor 140, and a current detection device 130. The current detection device 130 includes current sensing operational amplifiers (as described above) that correspond one-to-one with the bridge arms of the B6 bridge 110 used to transmit the phase current. Figure 1 Only the current sensing operational amplifier CSA1 corresponding to the bridge arm where the current sensing resistor R1 is located is shown in the diagram. The compensation method includes:
[0076] S100: When it is determined that the operating state of the motor control system meets the first precision compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to zero current is collected.
[0077] S200: For each of the bridge arms, based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm, obtain the calibration error compensation parameter corresponding to that bridge arm at the current temperature;
[0078] S300: For each bridge arm, within one PWM cycle, the voltage value output by the current sensing operational amplifier corresponding to that bridge arm is sampled at least twice, and the second voltage is obtained based on all voltage sampling values;
[0079] S400: Based on the current current request value corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage, obtain closed-loop control parameters to realize the control of the output current of all phases of the power supply 150;
[0080] S500: Determine whether the operating state of the motor control system meets the second precision compensation preset condition. If yes, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if no, return to execute the steps of obtaining the second voltage and the related steps after obtaining the second voltage.
[0081] The compensation method for improving current detection accuracy provided by this invention, when determining that the operating state of the motor control system meets the first accuracy compensation preset condition, acquires in real time the first voltage output of the current sensing operational amplifier corresponding to zero current for each bridge arm. This lays the foundation for compensating the offset voltage of the current sensing operational amplifier, the reference voltage error of the current sensing operational amplifier, the reference voltage error of the analog-to-digital conversion circuit (including but not limited to the analog-to-digital converter inside the microprocessor control unit MCU), and the sampling error of the analog-to-digital converter ADC1. Furthermore, for each bridge arm, this invention obtains the calibration error compensation parameters corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm. This lays a solid foundation for compensating the operational amplifier gain of the current sensing operational amplifier and the inherent factory errors of the current sensing resistors R1, R2, and R3, as well as the offset errors caused by temperature changes in both. Furthermore, for each of the bridge arms, this invention acquires the voltage value output by the current-sensing operational amplifier corresponding to that bridge arm at least twice within one PWM cycle, and obtains a second voltage based on all voltage samples, thus laying a good foundation for compensating the parasitic inductance of the current-sensing resistors R1, R2, and R3. Finally, this invention obtains closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, to achieve control of the output current of all phases of the power supply 150. This achieves comprehensive compensation for the offset voltage of the current-sensing operational amplifier, the reference voltage error of the current-sensing operational amplifier and the reference voltage error of the analog-to-digital converter, the sampling error of the analog-to-digital converter, the operational amplifier gain of the current-sensing operational amplifier and the inherent factory errors of the current-sensing resistors R1, R2, and R3, as well as the offset errors caused by temperature changes, and the deviations caused by the parasitic inductance of the current-sensing resistors R1, R2, and R3. Therefore, the present invention can eliminate various errors caused by the current detection device 130 (hardware sampling circuit), thereby effectively improving the control accuracy of the motor 140 current, and at a low cost; at the same time, the present invention also has good universality and can significantly reduce the difficulty of device selection.
[0082] It should be specifically noted that, as those skilled in the art will understand, the present invention does not impose excessive restrictions on the specific structure of the motor control system. For example, the inverter of the motor 140 can be a half-B6 bridge 110 structure or a full-B6 bridge 110 structure. Furthermore, the present invention does not impose excessive restrictions on the current sensing resistor and the current sensing operational amplifier; the current sensing resistor and the current sensing operational amplifier can be single-shunt, dual-shunt, or triple-shunt. Even further, the present invention does not impose restrictions on the number of channels of the current sensing operational amplifier or the type of the motor 140. For example, the motor 140 is preferably a three-phase brushless direct current motor (BLDC), but it can also be a multi-phase motor or a permanent magnet synchronous motor 140. In particular, as a preferred embodiment, the present invention is especially applicable to FOC (Field-Oriented Control) algorithm control and square wave control.
[0083] Please continue reading Figure 1 ,from Figure 1 It can be seen that the current detection device 130 also includes a microprocessor control unit (MCU). The first precision compensation preset condition includes: the MCU is powered on again or the current of the motor 140 in the motor control system is zero but the current request is not zero. The second precision compensation preset condition includes: the MCU is powered on again or the current request of the motor 140 is zero.
[0084] Therefore, the compensation method for improving current detection accuracy provided by this invention, when determining that the microprocessor control unit (MCU) is powered on again or the current of the motor 140 in the motor control system is zero but the current request is not zero, acquires in real time the first voltage output of the current sensing operational amplifier CSA1 corresponding to the zero current for each bridge arm. This lays the foundation for compensating for the offset voltage of the current sensing operational amplifier, the reference voltage error of the current sensing operational amplifier, the reference voltage error of the analog-to-digital converter (ADC), and the sampling error of the ADC.
[0085] For example, as previously described, from Figure 1 As can be seen, each current sensing resistor bridge arm has a corresponding current sensing operational amplifier and analog-to-digital converter. For ease of understanding and description, this paper uses the U phase of the three-phase motor 140, that is, the bridge arm where the current sensing resistor R1 is located, and the corresponding current sensing operational amplifier CSA1 and analog-to-digital converter ADC1 as an example to describe the present invention. For the V phase and W phase, please refer to the description of this paper for an adaptive understanding.
[0086] For a better understanding of this invention, please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of the current sensing operational amplifier CSA1 in a motor control system current sensing device 130, which is a specific example of the compensation method for improving current sensing accuracy provided by the present invention. The following is in conjunction with... Figure 3 The fundamental principle behind how the first voltage output by the current sensing operational amplifier CSA1 at the zero current acquisition point in step S100 can provide a basis for compensating for the offset voltage of the current sensing operational amplifier CSA1, the reference voltage error of the current sensing operational amplifier CSA1, the reference voltage error of the analog-to-digital converter ADC1, and the sampling error of the analog-to-digital converter ADC1 will be explained. First, the compensation for the offset error of the current sensing operational amplifier CSA1, the reference voltage error of the current sensing operational amplifier CSA1, the reference voltage error of the analog-to-digital converter ADC1, and the sampling error of the analog-to-digital conversion circuit will be explained.
[0087] (1) Offset error of current sensing operational amplifier CSA1: When both input terminals of current sensing operational amplifier CSA1 are grounded, the output should be 0. However, in practical applications, the two input branches inside current sensing operational amplifier CSA1 cannot be perfectly balanced, and the output is not 0. At this time, if the negative input terminal is kept unchanged, a voltage is applied to the positive input terminal until the output of the op-amp is 0. The negative value of this voltage is the input offset error of current sensing operational amplifier CSA1. Its existence will make the output bias voltage of current sensing operational amplifier CSA1 when reading zero current and the output voltage when there is current inaccurate.
[0088] (2) Reference voltage error of current sensing operational amplifier CSA1 and reference voltage error of analog-to-digital converter ADC1: Under normal circumstances, the reference voltage of analog-to-digital converter ADC1 in microprocessor control unit MCU comes from the reference voltage output by the vehicle's system base chip (SBC), and its value is usually 5V (for ease of description and understanding, it is referred to as 5V in the following text). The accuracy is 1%, if the reference voltage is... The presence of errors will cause corresponding magnitude errors in the sampling of the analog-to-digital converter ADC1, resulting in errors in the final current accuracy.
[0089] (3) Sampling error compensation of ADC circuit: The error generated during sampling by the analog-to-digital converter circuit on the PCB board corresponding to the motor control system and the analog-to-digital converter ADC1 inside the microprocessor control unit MCU.
[0090] Each time the microprocessor control unit (MCU) is powered on (starts the vehicle) or the motor 140 generates a current control request, the error mentioned above is compensated by sampling the first voltage output of the current sensing operational amplifier CSA1 when the current is zero in real time.
[0091] Specifically, taking the current sensing resistor R1 as an example, when the current flowing through the current sensing resistor R1 is 0, the first voltage value of the output of the corresponding analog-to-digital converter ADC1 at zero current can be calculated by the following formula:
[0092] (1)
[0093] In equation (1), The value of the first voltage. The reference voltage, The op-amp gain of the current sensing operational amplifier CSA1 is... This refers to the offset error of the current sensing operational amplifier CSA1. This is for the sampling error compensation of the analog-to-digital converter ADC1.
[0094] Similarly, if a constant current of 60A is applied to the current sensing resistor R1, the fifth voltage value output by the analog-to-digital converter ADC1 at a current of 60A can be calculated using the following formula:
[0095] (2)
[0096] In equation (2), 0 represents the fifth voltage value output by the analog-to-digital converter ADC1 when the current is 60A. R is the current value (60A in this case), and R is the resistance value of the current sensing resistor R1.
[0097] If the reference voltage is not used Offset error of the current sensing operational amplifier CSA1 To compensate for errors, the motor control system directly uses the default value for the current closed-loop algorithm, i.e. , , , In equation (2) , , In reality, there are deviations, which leads to The results are inaccurate, thus affecting the accuracy of current control. The compensation method provided by this invention for improving current detection accuracy involves real-time acquisition of the first voltage when the microprocessor control unit (MCU) is repowered or when a current request occurs, and the acquired first voltage is filtered accordingly. This lays a solid foundation for subsequent closed-loop control, thereby eliminating the influence of these errors.
[0098] Preferably, in some exemplary embodiments, the compensation method for improving current detection accuracy provided by the present invention further includes:
[0099] During the PAV (PAV is an abbreviation of Pruef und Abgleich Vorshrift in German, which translates to Test and calibration specification in English) calibration phase, the temperature-PAV calibration error correspondence for each phase of the bridge arm is calibrated.
[0100] Therefore, the compensation method for improving current detection accuracy provided by the present invention, in the PAV calibration stage, calibrates the correspondence between temperature and PAV calibration error for each of the bridge arms. This not only lays the foundation for compensating the operational amplifier gain of the current sensing operational amplifier and the inherent factory error of the current sensing resistor, as well as the offset error caused by temperature changes, during the motor control system control process, but also significantly reduces the amount of computation in the motor control system control process without increasing any hardware costs of the vehicle.
[0101] Preferably, in some exemplary embodiments, the compensation method further includes, before calibrating to obtain the correspondence between the temperature-PAV calibration error for each phase arm:
[0102] The host computer PAM is communicatively connected to the motor control system, and a current source I that meets the preset accuracy requirements is electrically connected to the bridge arm to establish a PAV calibration compensation test environment. The current source I provides a preset constant current to the bridge arm, and the host computer PAM controls the calibration process. Therefore, the compensation method for improving current detection accuracy provided by this invention can calibrate the correspondence between temperature and PAV calibration errors for each bridge arm using the host computer PAM and the current source I that meets the preset accuracy requirements. This allows for the reuse of existing PAV calibration compensation test environments and is easy to implement. For example, please refer to [link to example]. Figure 4 , Figure 4 This is a schematic diagram of a PAV calibration compensation test environment, illustrating one specific example of the compensation method for improving current detection accuracy provided by this invention. From... Figure 4As can be seen, during the calibration phase, only the host computer PAM for controlling the calibration process and the current source I for providing a preset constant current to the bridge arm are required. For example, the high-precision current source I is first connected to the host computer PAM through a communication interface, and the motor controller of the motor control system (not shown in the figure) is connected to the host computer PAM through a fixture.
[0103] Please continue reading Figure 1 and Figure 4 ,like Figure 1 and Figure 4 As shown, the current detection device 130 further includes current sensing resistors R1, R2, and R3 corresponding to the current sensing operational amplifier; the bridge arm includes an upper bridge arm and a lower bridge arm connected in series, the power supply 150 is coupled to the other end of the upper bridge arm, and the current sensing resistors R1, R2, and R3 are respectively connected in series between the lower bridge arm and ground. The calibration obtains the corresponding relationship of temperature-PAV calibration error for each phase of the bridge arm, including:
[0104] SA1: Determine two different calibration temperatures;
[0105] SA2: For each bridge arm, at each calibration temperature, at least two different current values are provided to the bridge arm to obtain the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameter of the current sensing resistor at the calibration temperature; wherein, at least one of the current values is 0 and at least one of the current values is greater than 0;
[0106] SA3: Based on all the calibration temperatures and the error compensation parameters corresponding to each calibration temperature, obtain the correspondence between the temperature and PAV calibration error for the bridge arm.
[0107] Therefore, the compensation method for improving current detection accuracy provided by the present invention, when calibrating the correspondence between temperature and PAV calibration error of each bridge arm, determines two different calibration temperatures, and then provides at least two different current values to the bridge arm at each calibration temperature to obtain the operational amplifier gain of the current sensing operational amplifier and the error compensation parameters of the current sensing resistor at that calibration temperature. Finally, based on all the calibration temperatures and the error compensation parameters corresponding to each calibration temperature, the correspondence between temperature and PAV calibration error of the bridge arm is obtained, thereby realizing the calibration of the inherent factory error of the operational amplifier gain of the current sensing operational amplifier and the current sensing resistor, as well as the offset error of both caused by temperature changes.
[0108] It should be noted that, as those skilled in the art will understand, the setting of the calibration temperature is not overly limited. For example, in some embodiments, two calibration temperatures can be selected: room temperature (e.g., 25°C) and high temperature (e.g., 85°C); in other embodiments, three calibration temperatures can be selected: low temperature (e.g., -30°C), room temperature (e.g., 25°C), and high temperature (e.g., 85°C). Examples will not be provided individually. Furthermore, the present invention does not limit the number of current values provided at each calibration temperature. For instance, in some embodiments, a constant current of 0A can be provided (e.g., with current source I and power supply 150 turned off) and a constant current of 60A can be provided (e.g., provided through current source I).
[0109] Preferably, in some exemplary embodiments, step SA2 provides at least two different current values to the bridge arm at each of the calibration temperatures to obtain the operational amplifier gain of the current-sensing operational amplifier corresponding to that bridge arm and the error compensation parameters of the current-sensing resistor at that calibration temperature, including:
[0110] SA21: For each phase of the bridge arm, control the upper and lower bridge arms of all bridge arms to be in a non-conducting state, and collect the third voltage (i.e. the output voltage at zero current) output by the current sensing operational amplifier corresponding to that bridge arm.
[0111] SA22: Controls the upper and lower bridge arms of the bridge arms of other phases, the upper bridge arm of the bridge arm is in a non-conducting state, and controls the lower bridge arm of the bridge arm to be on; and provides a preset constant current to the lower bridge arm of the bridge arm and the current sensing resistor, and collects the fourth voltage output by the current sensing operational amplifier corresponding to the bridge arm.
[0112] SA23: Based on the third voltage, the fourth voltage, and the current value of the preset constant current, calculate the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameter of the current sensing resistor at the calibration temperature.
[0113] Preferably, in some exemplary embodiments, step SA23 calculates the operational amplifier gain of the current-sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current-sensing resistor at the calibration temperature based on the third voltage, the fourth voltage, and the current value of the preset constant current, including:
[0114] SA231: Calculate the difference between the fourth voltage and the third voltage;
[0115] SA232: Based on the difference and the current value of the preset constant current, calculate the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature.
[0116] Therefore, the compensation method for improving current detection accuracy provided by the present invention can obtain the operational amplifier gain of the current sensing operational amplifier corresponding to each bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature by collecting the output voltage of the current sensing operational amplifier when there is zero current and when there is current, and taking the difference.
[0117] Preferably, in some exemplary embodiments, the calibration temperature includes a first preset temperature and a second preset temperature; step SA3 obtains the correspondence between the temperature and PAV calibration error corresponding to the bridge arm based on all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, including:
[0118] SA31: Based on the first preset temperature and its corresponding first error compensation parameter, and the second preset temperature and its corresponding second error compensation parameter, a curve of error compensation parameter changing with temperature is fitted.
[0119] SA32: Sample the curve to obtain multiple sets of calibration data pairs for temperature-error compensation parameters;
[0120] SA33: Store the calibration data pair in the storage unit of the motor control system to obtain the correspondence between the temperature and PAV calibration error of the bridge arm.
[0121] The compensation method for improving current detection accuracy provided by this invention firstly obtains a curve showing the change of error compensation parameters with temperature based on a first preset temperature and its corresponding first error compensation parameter, and a second preset temperature and its corresponding second error compensation parameter; then, the curve is sampled to obtain multiple sets of temperature-error compensation parameter calibration data pairs; finally, the calibration data pairs are stored in the storage unit of the motor control system to obtain the correspondence between the temperature and PAV calibration errors corresponding to that bridge arm. Therefore, the compensation method for improving current detection accuracy provided by this invention not only obtains a highly accurate correspondence between temperature and PAV calibration errors, but also has simple logic and is easy to implement.
[0122] For example, for each bridge arm, calibration is performed once at both room temperature (25°C) and high temperature (85°C) to obtain the operational amplifier gain of the current sensing operational amplifier and the error compensation parameters of the current sensing resistor for that phase bridge arm. Specifically, please refer to the appendix... Figure 4 Please see Figure 5 , Figure 5 The following is a flowchart illustrating the process of calibrating the error compensation parameters of one phase bridge arm, illustrating a specific example of the compensation method for improving current detection accuracy provided by this invention. In this example, calibration is performed at room temperature, and the specific operation of the calibration process is explained below:
[0123] Step P11: The host computer PAM shuts off the output of current source I and disconnects all the upper bridge arms (MOSFETs) Q11, Q12, and Q13 and the lower bridge arms Q21, Q22, and Q23. The host computer PAM reads the zero-current bias voltage (i.e., the voltage output from the current sensing operational amplifier after analog-to-digital converter conversion) from the corresponding registers of the microprocessor control unit (MCU), and records it as... As those skilled in the art will understand, since the current source I and all phase arms are disconnected, no current flows through the current sensing resistor (i.e., zero current). At this time, the current sensing operational amplifier of the motor pre-drive chip 120 will output a zero current bias voltage and input it to the microprocessor control unit MCU for analog-to-digital conversion and storage.
[0124] Step P12: The host computer PAM controls the bridge arms of bridge 110 of B6, disconnecting all upper bridge arms (upper three tubes) Q11, Q12 and Q13 and opening one phase of the lower bridge arm (e.g. Figure 4 In the lower bridge arm Q21, the host computer PAM sends a command to the current source I to output a constant current (e.g., 60A) to the bridge arm. At this time, the current will flow through the already turned-on lower bridge arm Q12, the current sensing resistor R1 of that phase, and finally flow into ground.
[0125] Step P13: The voltage across the current sensing resistor R1 of this phase bridge arm is fed into the corresponding current sensing operational amplifier CSA1 through the SP and SN pins of the motor pre-drive chip 120. The amplified voltage is then stored in the register by the microprocessor control unit MCU through the analog-to-digital converter ADC1. The host computer PAM reads the voltage value from the register. This is the output voltage value under the constant current (the current value is known).
[0126] Step P14: By measuring and subtracting the output voltages of the current sensing operational amplifier CSA1 when there is zero current and when there is current, the operational amplifier gain of the corresponding current sensing operational amplifier CSA1 for this bridge arm and the error compensation parameters of the current sensing resistor R1 at the calibration temperature are obtained.
[0127] Specifically, considering the sampling error and the errors of the current sensing resistor R1 and its corresponding current sensing operational amplifier CSA1 and analog-to-digital converter ADC1, the expression for the voltage value sampled and read by the host computer PAM through the microprocessor control unit MCU is as follows:
[0128] (3)
[0129] In equation (3), the superscript ' represents the actual value including error, and the value without the superscript represents the value without error. The value of the voltage. For reference voltage, This refers to the op-amp gain of the current sensing operational amplifier CSA1. This refers to the offset error of the current sensing operational amplifier CSA1. This is for compensating for the sampling error of the analog-to-digital converter ADC1.
[0130] When the input current of current source I is set to 0, the voltage value at zero current read by the host computer PAM (host computer PAM software) is recorded as follows: Therefore, according to the above formula (3), we know that:
[0131] (4)
[0132] When the input current is set to 60A through current source I, the voltage value at zero current read by the host computer PAM (host computer PAM software) is recorded as follows: Therefore, according to the above formula (3), we know that:
[0133] (5)
[0134] Research revealed that the reference voltage of the components in the same bridge arm and its corresponding current detection device 130 remained constant within a short period of time and at the same temperature. Operational amplifier gain of current sensing operational amplifier and misalignment error The error is independent of the current; its error remains essentially constant or changes very little. Furthermore, the sampling errors of the analog-to-digital converter ADC1 under zero current and current conditions have been measured and show very small deviations. That is, the following equations (6a), (6b), (6c), and (6d) exist:
[0135] = (6a)
[0136] (6b)
[0137] (6c)
[0138] (6d)
[0139] According to equations (5), (6a), (6b), (6c), and (6d), we can obtain:
[0140] (7)
[0141] As described above, current I (e.g., constant current) The current is output by the current source I that meets the preset accuracy requirements. Therefore, the current is known and accurate (determined by the accuracy of the current source I, which is only used during PAV calibration, so it will not increase the hardware cost of the motor control system that uses the compensation method provided by this invention to improve the accuracy of current detection). Combined with equation (7), the actual value of the product of the operational amplifier gain G of the current sensing operational amplifier CSA1 on each bridge arm and the resistance value of the current sensing resistor can be obtained.
[0142] Preferably, in some exemplary embodiments, step S300, which involves acquiring the voltage value output by the current-sensing operational amplifier corresponding to the bridge arm at least twice and obtaining the second voltage based on all voltage samples, includes:
[0143] S310: When the upper arm of one phase bridge arm is in a non-conducting state and the lower arm is in a conducting state, and the upper arm of the other phase bridge arms is in a conducting state and the lower arm is in a non-conducting state, at least one sampling is performed, and a first voltage sampling value is obtained based on all sampling results under this state.
[0144] S320: When the upper bridge arm of all the bridge arms is in a non-conducting state and the lower bridge arm is in a conducting state, perform at least one sampling and obtain the second voltage sampling value based on all the sampling results in this state;
[0145] S330: The second voltage is obtained by averaging the first voltage sample value and the second voltage sample value.
[0146] Therefore, the compensation method for improving current detection accuracy provided by the present invention can effectively reduce sampling error by sampling when the B6 bridge 110 is in different stages, thereby laying a good foundation for compensating for the error caused by the parasitic inductance of the current sensing resistor.
[0147] Preferably, at least one sampling is performed in step S310, and a first voltage sampling value is obtained according to all the sampling results in this state. In some exemplary embodiments, only one sampling may be performed, and the voltage value obtained from this sampling is used as the first voltage sampling value; in other embodiments, multiple samplings are performed, and the average value of the voltage values obtained from the multiple samplings is used as the first voltage sampling value. For the method of obtaining the second voltage sampling value in step S320, please refer to the detailed description of step S310, and will not be elaborated here.
[0148] Exemplarily, taking the control of the FOC motor 140 with seven-segment PWM and the current closed-loop stall control of the +U phase (the arm where the current detection resistor R1 is located) as an example, the principle of compensating for the error of the parasitic inductance of the current detection resistor R1 by sampling when the B6 bridge 110 is in different stages is briefly described as follows:
[0149] The arm of the B-6 bridge 110 has five stages: 111→011→000→, 011→111, where 1 indicates that the upper arm of the corresponding arm is in the conducting state, and 0 indicates that the upper arm of the corresponding arm is in the off state. Specifically, please refer to Figure 6a and Figure 6b , where Figure 6a is a schematic diagram of the current flow direction when the B6 bridge 110 of the motor control system applying a specific example of the compensation method for improving current detection accuracy provided by the present invention is in the 011 stage; Figure 6b is a schematic diagram of the current flow direction when the B6 bridge 110 of the motor control system applying a specific example of the compensation method for improving current detection accuracy provided by the present invention is in the 000 stage. Taking the current detection resistor R1 as an example, if the current detection resistor R1 has no parasitic inductance, that is, the voltage drop across the resistor at a certain current is V1; in fact, the current detection resistors R1, R2, and R3 and the circuit board (layout) leads will generate parasitic inductance, and it is difficult to quantify. When the current in the motor 140 winding changes, the induced electromotive force generated by the changing current is denoted as V2. Since the external voltage is opposite to the self-inductance voltage, the actual voltage V across the current detection resistor R1 is V = V1 - V2; when the state of the upper arm of the B6 bridge changes from 011 to 000, the winding of the motor 140 changes from being powered by the power supply 150 to the freewheeling state, and the current on the current detection resistor R1 changes from rising to falling. According to V2 = -L * di / dt, when the current increases, V2 <, 0, so the voltage V = V1 - V2 = V1 + L * di / dt applied to the current detection resistor R1 is > V1. Similarly, when the current decreases, the voltage V' on the current detection resistor R1 < V1, and when the duty cycle of the modulated PWM wave is close to 50%, V - V' ≈ 2L * di / dt. Therefore, the output voltage Vso of the actually collected current sensing operational amplifier CSA1 is偏大 under 011 and偏小 under 000. Regarding the above discussion, it can also be through Figure 7 This has been further verified. For details, please see [link to relevant documentation]. Figure 7 , Figure 7 This diagram illustrates the correspondence between the PWM timing of a motor control system and the phase current of the motor, as well as the output voltage of the current sensing operational amplifier, in one specific example of the compensation method for improving current detection accuracy provided by this invention. From... Figure 7 It can be seen that if Vso is sampled only at the midpoint of the 000 state, the sampled Vso will be too small, ultimately resulting in an excessively large actual controlled current. Based on the above research, the compensation method for improving current detection accuracy provided by this invention performs multiple samplings of Vso in both the 000 and 011 states of the B6 bridge 110, and uses the average result as the second voltage. This lays a solid foundation for effectively reducing the error caused by the parasitic inductance of the current sensing resistors R1, R2, and R3.
[0150] Preferably, in some exemplary embodiments, step S400 involves obtaining closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter, and the second voltage, including:
[0151] S410: For each of the bridge arms, calculate the error compensation current value based on the first voltage, the calibration error compensation parameter, and the second voltage; and calculate the difference between the current current request value and the error compensation current value.
[0152] S420: The closed-loop control parameters are obtained based on the difference between the current current request value and the error compensation current value of all the bridge arms.
[0153] For example, in some exemplary embodiments, the error compensation current value in step S410 is calculated using the following formula (9):
[0154] (9)
[0155] In equation (9), This is the error compensation current value. The second voltage, The first voltage, The calibration error compensation parameter is referred to here.
[0156] Based on the same inventive concept, a second embodiment of the present invention provides a compensation device for improving current detection accuracy. This compensation device is used in a motor control system, which includes a motor 140, a power supply 150 providing phase current to the motor 140, and a current detection device 130. The current detection device 130 includes current sensing operational amplifiers corresponding one-to-one with the bridge arms used to transmit the phase current. For details, please refer to... Figure 8 , Figure 8 This is a schematic diagram of the compensation device for improving current detection accuracy provided in this embodiment. Figure 8 As can be seen, the compensation device provided in this embodiment includes a bias voltage acquisition unit 210, a calibration error acquisition unit 220, a sampling error acquisition unit 230, an error compensation execution unit 240, and an error compensation judgment unit 250. Preferably, the bias voltage acquisition unit 210 is configured to, when determining that the operating state of the motor control system meets the first precision compensation preset condition, acquire the first voltage output by the current sensing operational amplifier corresponding to each bridge arm when there is zero current. The calibration error acquisition unit 220 is configured to, for each bridge arm, acquire the calibration error compensation parameter corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm. The sampling error acquisition unit 230 is configured to, for each bridge arm, acquire the voltage value output by the current sensing operational amplifier corresponding to that bridge arm at least twice within one PWM cycle, and obtain the second voltage based on all voltage sampling values. The error compensation execution unit 240 is configured to obtain closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, so as to control the output current of all phases of the power supply 150. The error compensation judgment unit 250 is configured to determine whether the operating state of the motor control system meets the second precision compensation preset condition. If yes, it drives the bias voltage acquisition unit 210 to acquire the first voltage; if no, it drives the sampling error acquisition unit 230 to acquire the second voltage.
[0157] Since the compensation device for improving current detection accuracy provided by this invention belongs to the same inventive concept as the compensation method for improving current detection accuracy provided by this invention, the compensation device for improving current detection accuracy provided by this invention has at least all the advantages of the compensation method for improving current detection accuracy provided by this invention. For details on the beneficial effects of the compensation device for improving current detection accuracy provided by this invention, please refer to the above description of the beneficial effects of the compensation method for improving current detection accuracy provided by this invention, which will not be repeated here.
[0158] Based on the same inventive concept, a third embodiment of the present invention provides a motor controller. In some exemplary embodiments, the motor controller includes the aforementioned compensation device for improving current detection accuracy. Since the motor controller provided by the present invention and the compensation device for improving current detection accuracy provided by the present invention belong to the same inventive concept, and the compensation device provided by the present invention and the compensation method provided by the present invention are based on the same principle, the motor controller provided by the present invention will not be described in detail here. For more detailed information, please refer to the relevant descriptions of the compensation device or compensation method above for an adaptive understanding.
[0159] Other implementations provide an alternative motor controller; for example, see 9. Figure 9 This is a block diagram of the motor controller provided in this embodiment of the present invention. Figure 9 As shown, the motor controller provided in this embodiment includes a processor 310 and a memory 320. The memory 320 stores a computer program. When the computer program is executed by the processor 310, it implements the compensation method for improving current detection accuracy provided in any of the embodiments above. Since the motor controller provided in this embodiment and the compensation method for improving current detection accuracy provided by this invention belong to the same inventive concept, the motor controller provided in this embodiment has at least all the advantages of the compensation method for improving current detection accuracy provided by this invention. For details, please refer to the relevant description of the beneficial effects of the compensation method for improving current detection accuracy above, which will not be repeated here.
[0160] For example, such as Figure 9 As shown, the motor controller may further include a communication interface 330 and a communication bus 340, wherein the processor 310, the communication interface 330, and the memory 320 communicate with each other through the communication bus 340. The communication bus 340 includes, but is not limited to, a CAN bus. For ease of illustration, only one thick line is used to represent it in the figure, but this does not mean that there is only one bus or one type of bus. The communication interface 330 is used for communication between the above-mentioned motor controller and other controllers (such as the vehicle controller, the autonomous driving domain controller, the battery management system, etc., not shown in the figure). The communication bus 340 connects the above-mentioned motor controller and other controllers (such as the battery management system, etc., not shown in the figure) into a closed-loop system, enabling each controller to perform communication and data transmission in multiple working states (parking state, charging state, starting state, running state, vehicle forward and reverse state, regenerative braking state, mechanical braking state, general fault state, major fault state), thereby realizing the vehicle control function.
[0161] The processor 310 referred to in this invention can be a microcontroller unit (MCU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 310 is the control center of the motor controller, connecting various parts of the entire motor controller via various interfaces and lines.
[0162] The memory 320 can be used to store the computer program. The processor 310 implements various functions of the motor controller by running or executing the computer program stored in the memory 320 and calling the data stored in the memory 320.
[0163] The memory 320 may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0164] A fourth embodiment of the present invention provides a readable storage medium storing a computer program. When executed by a processor, the computer program can implement the compensation method for improving current detection accuracy described above. Since the readable storage medium provided by the present invention and the compensation method for improving current detection accuracy provided by the present invention belong to the same inventive concept, the readable storage medium provided by the present invention possesses at least all the advantages of the compensation method for improving current detection accuracy provided by the present invention. For details regarding the beneficial effects of the readable storage medium provided by the present invention, please refer to the above description of the beneficial effects of the compensation method for improving current detection accuracy provided by the present invention; further details will not be repeated here.
[0165] The readable storage medium of embodiments of the present invention can be any combination of one or more computer-readable media. The readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (not exhaustive examples) of a computer-readable storage medium include: an electrical connection having one or more wires, a portable computer hard disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device.
[0166] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0167] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] Compared with the prior art, the compensation method, device, motor controller, and readable storage medium provided by the present invention for improving the accuracy of current detection have the following advantages:
[0169] The compensation method for improving current detection accuracy provided by this invention, when determining that the operating state of the motor control system meets the first accuracy compensation preset condition, acquires in real time the first voltage output of the current sensing operational amplifier corresponding to zero current for each bridge arm. This lays the foundation for compensating for the offset voltage of the current sensing operational amplifier, the reference voltage error of the current sensing operational amplifier, the reference voltage error of the analog-to-digital conversion circuit (including but not limited to the analog-to-digital converter inside the microprocessor control unit), and the sampling error of the analog-to-digital converter. Furthermore, for each bridge arm, this invention obtains the calibration error compensation parameter corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm. This lays a solid foundation for compensating for the operational amplifier gain of the current sensing operational amplifier and the inherent factory error of the current sensing resistor, as well as the offset error of both caused by temperature changes. Furthermore, for each bridge arm, this invention samples the voltage value output by the current-sensing operational amplifier corresponding to that bridge arm at least twice within one PWM cycle, and obtains a second voltage based on all voltage samples, thus laying a good foundation for compensating the parasitic inductance of the current-sensing resistor. Finally, this invention obtains closed-loop control parameters based on the current current request value corresponding to all bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, to control the output current of all phases of the power supply. This achieves comprehensive compensation for the offset voltage of the current-sensing operational amplifier, the reference voltage error of the current-sensing operational amplifier and the reference voltage error of the analog-to-digital converter, the sampling error of the analog-to-digital converter, the operational amplifier gain of the current-sensing operational amplifier and the inherent factory error of the current-sensing resistor, the offset error of both due to temperature changes, and the deviation caused by the parasitic inductance of the current-sensing resistor. Therefore, this invention can eliminate various errors caused by the current detection device (hardware sampling circuit), thereby effectively improving the control accuracy of the motor current, and at a low cost; at the same time, this invention also has good universality, significantly reducing the difficulty of device selection.
[0170] It should be noted that the apparatus and methods disclosed in the embodiments herein can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments herein. In this regard, each block in a flowchart or block diagram may represent a module, program, or part of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system to perform the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0171] In addition, the functional modules in the various embodiments of this article can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0172] The above description is merely a preferred embodiment of the compensation method, apparatus, motor controller, and readable storage medium for improving current detection accuracy provided by the present invention, and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure are within the protection scope of the present invention. Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the present invention and its equivalents, the present invention also intends to include these modifications and variations.
Claims
1. A compensation method for improving current detection accuracy, used in a motor control system, the motor control system comprising a motor, a power supply providing phase current to the motor, and a current detection device, the current detection device comprising a current sensing operational amplifier corresponding one-to-one with the bridge arms used to transmit the phase current; characterized in that, The compensation method includes: When it is determined that the operating state of the motor control system meets the first precision compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to zero current is collected. For each of the bridge arms, the calibration error compensation parameters corresponding to the bridge arm at the current temperature are obtained based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm. For each bridge arm, within one PWM cycle, when the upper bridge arm of one phase of the bridge arm is in a non-conducting state and the lower bridge arm is in a conducting state, and the upper bridge arm of the other phases of the bridge arm is in a conducting state and the lower bridge arm is in a non-conducting state, at least one sampling is performed, and a first voltage sample value is obtained based on all sampling results in this state; when the upper bridge arm of all the bridge arms is in a non-conducting state and the lower bridge arm is in a conducting state, at least one sampling is performed, and a second voltage sample value is obtained based on all sampling results in this state; the first voltage sample value and the second voltage sample value are averaged to obtain the second voltage; Based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage, closed-loop control parameters are obtained to achieve control of the output current of all phases of the power supply. Determine whether the operating state of the motor control system meets the second precision compensation preset condition. If yes, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if no, return to execute the steps of obtaining the second voltage and the related steps after obtaining the second voltage.
2. The compensation method for improving current detection accuracy according to claim 1, characterized in that, The current detection device further includes a microprocessor control unit. The first precision compensation preset condition includes: the microprocessor control unit is powered on again or the current of the motor in the motor control system is zero but the current request is not zero. The second precision compensation preset condition includes: the microprocessor control unit is powered on again or the current request of the motor is zero.
3. The compensation method for improving current detection accuracy according to claim 1, characterized in that, The compensation method further includes: During the PAV calibration phase, the temperature-PAV calibration error correspondence for each phase arm is determined.
4. The compensation method for improving current detection accuracy according to claim 3, characterized in that, The current detection device also includes current sensing resistors that correspond one-to-one with the current sensing operational amplifier; the bridge arm includes an upper bridge arm and a lower bridge arm connected in series, the power supply is coupled to the other end of the upper bridge arm, and the current sensing resistor is connected in series between the lower bridge arm and ground. The calibration yields the corresponding relationship between the temperature-PAV calibration error for each phase of the bridge arm, including: Two different calibration temperatures were determined; For each bridge arm, at each calibration temperature, at least two different current values are provided to the bridge arm to obtain the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameter of the current sensing resistor at the calibration temperature; wherein, at least one of the current values is 0 and at least one of the current values is greater than 0; Based on all the calibration temperatures and the error compensation parameters corresponding to each calibration temperature, the correspondence between the temperature and PAV calibration error for that bridge arm is obtained.
5. The compensation method for improving current detection accuracy according to claim 4, characterized in that, The step of providing at least two different current values to the bridge arm at each of the calibration temperatures to obtain the operational amplifier gain of the current-sensing operational amplifier corresponding to that bridge arm and the error compensation parameters of the current-sensing resistor at that calibration temperature includes: For each bridge arm, control the upper and lower bridge arms of all bridge arms to be in a non-conducting state, and collect the third voltage output by the current sensing operational amplifier corresponding to that bridge arm; Control the upper and lower bridge arms of the bridge arms of other phases, the upper bridge arm of the bridge arm is in a non-conducting state, and control the lower bridge arm of the bridge arm to be on; and provide a preset constant current to the lower bridge arm of the bridge arm and the current sensing resistor, and collect the fourth voltage output by the current sensing operational amplifier corresponding to the bridge arm; Based on the third voltage, the fourth voltage, and the current value of the preset constant current, the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature are calculated.
6. The compensation method for improving current detection accuracy according to claim 5, characterized in that, The step of calculating the operational amplifier gain of the current-sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current-sensing resistor at the calibration temperature based on the current values of the third voltage, the fourth voltage, and the preset constant current includes: Calculate the difference between the fourth voltage and the third voltage; Based on the difference and the current value of the preset constant current, the operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and the error compensation parameters of the current sensing resistor at the calibration temperature are calculated.
7. The compensation method for improving current detection accuracy according to claim 4, characterized in that, The calibration temperature includes a first preset temperature and a second preset temperature; the step of obtaining the correspondence between the temperature and PAV calibration error of the bridge arm based on all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature includes: Based on the first preset temperature and its corresponding first error compensation parameter, and the second preset temperature and its corresponding second error compensation parameter, a curve of error compensation parameter changing with temperature is obtained by fitting. The curve is sampled to obtain multiple sets of calibration data pairs for temperature-error compensation parameters; The calibration data is stored in the storage unit of the motor control system to obtain the correspondence between the temperature and PAV calibration error of the bridge arm.
8. The compensation method for improving current detection accuracy according to any one of claims 3 to 7, characterized in that, Before calibrating to obtain the correspondence between the temperature-PAV calibration error for each phase arm, the compensation method further includes: The host computer is connected to the motor control system, and a current source that meets the preset accuracy requirements is electrically connected to the bridge arm to establish a PAV calibration compensation test environment; wherein, the current source is used to provide a preset constant current to the bridge arm, and the host computer is used to control the calibration process.
9. The compensation method for improving current detection accuracy according to claim 1, characterized in that, The step of obtaining closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters, and the second voltage includes: For each of the bridge arms, the error compensation current value is calculated based on the first voltage, the calibration error compensation parameter, and the second voltage; and the difference between the current current request value and the error compensation current value is calculated. The closed-loop control parameters are obtained based on the difference between the current current request value and the error compensation current value of all the bridge arms.
10. A compensation device for improving the accuracy of current detection, characterized in that, For a motor control system, the motor control system includes a motor, a power supply providing phase current to the motor, and a current detection device, the current detection device including current sensing operational amplifiers corresponding one-to-one with the bridge arms for transmitting the phase current; characterized in that the compensation device includes: Bias voltage acquisition unit: configured to, when determining that the operating state of the motor control system meets the first precision compensation preset condition, acquire the first voltage output by the current sensing operational amplifier corresponding to each bridge arm when there is zero current; Calibration error acquisition unit: configured to, for each of the bridge arms, acquire the calibration error compensation parameters corresponding to the bridge arm at the current temperature based on the current temperature and the pre-calibrated temperature-PAV calibration error correspondence for that bridge arm; The sampling error acquisition unit is configured to, for each of the bridge arms, within one PWM cycle, when the upper bridge arm of one phase of the bridge arm is in a non-conducting state and the lower bridge arm is in a conducting state, and the upper bridge arm of the other phases of the bridge arm is in a conducting state and the lower bridge arm is in a non-conducting state, perform at least one sampling, and obtain a first voltage sample value based on all sampling results in this state; when the upper bridge arm of all the bridge arms is in a non-conducting state and the lower bridge arm is in a conducting state, perform at least one sampling, and obtain a second voltage sample value based on all sampling results in this state; and average the first voltage sample value and the second voltage sample value to obtain a second voltage. Error compensation execution unit: configured to obtain closed-loop control parameters based on the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameters and the second voltage, so as to realize the control of the output current of all phases of the power supply; Error compensation judgment unit: configured to determine whether the operating state of the motor control system meets the second precision compensation preset condition; if yes, drive the bias voltage acquisition unit to acquire the first voltage; if no, drive the sampling error acquisition unit to acquire the second voltage.
11. A motor controller, characterized in that, The device includes the compensation device for improving current detection accuracy as described in claim 10, or includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the compensation method for improving current detection accuracy as described in any one of claims 1 to 9.
12. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, implements the compensation method for improving current detection accuracy as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Temperature compensation method and apparatus based on direct current charging base
CA3224164A1
Three-phase motor driver with current error correction capability and correction method
CN111313786A