Current detection precision compensation method and device, motor controller and medium
By collecting and compensating the errors of the current sensing operational amplifier and current sensing resistor in the motor control system, the problem of low current detection accuracy is solved, high-precision, low-cost motor control is achieved, and the difficulty of device selection is reduced.
Patent Information
- Application Number
- CN202411013023.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Current detection accuracy in existing motor control systems is poor, resulting in high costs, difficulty in device selection, and the inability to completely eliminate the effects of temperature changes, affecting driving quality and driving safety.
By collecting the voltage output by the current sensing operational amplifier when the bridge arm has zero current in the motor control system, the temperature calibration error compensation parameters are obtained, and the closed-loop control parameters are calculated based on the current request value and the voltage sampling value to realize the control of the current sensing operational amplifier. and full compensation of current sensing resistor errors.
It improves the control accuracy of the motor current, reduces the cost, simplifies the difficulty of device selection, effectively eliminates errors caused by temperature changes, and improves the universality of the system.
Smart Images

Figure CN118731815A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle control technology, and in particular to a current detection accuracy compensation method, device, motor controller and readable storage medium. Background Art
[0002] See also Figure 1 , Figure 1 It is a schematic diagram of the block structure of a motor control system in the related art. Figure 1 In the example, the opening and closing of the upper bridge arms Q11, Q12 and Q13 and the lower bridge arms Q21, Q22 and Q23 of the B6 bridge 110 (three-phase full-bridge inverter circuit) are controlled by the motor pre-driver chip 120. In the three phases U, V and W, a current sensing resistor R1, R2 and R3 are respectively set between the lower bridge arms Q21, Q22 and Q23 of each phase and the ground. When current flows, the voltage signals at both ends of the current sensing resistors R1, R2 and R3 will be transmitted to the motor pre-driver chip 120, and the motor pre-driver 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 of the corresponding current sensing operational amplifiers CSA1 and analog-to-digital converters ADC1 is marked). Taking one of the phase bridge arms connected to the 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, and the amplified signal is transmitted to the microprocessor control unit MCU. When no current passes through the current sensing resistor R1, the voltage difference across the current sensing resistor R1 is zero. After amplification by the motor pre-driver chip 120, the voltage value in the zero current state can be obtained. The microprocessor control unit MCU divides the difference between the two voltages by the theoretical operational amplifier gain of the current sensing operational amplifier CSA1 and the resistance value of the current sensing resistor R1 to obtain the current current value, which is finally used as the current input in the current closed-loop control algorithm.
[0003] If the current-sensing resistors R1, R2 and R3 in the above circuit and the components such as the corresponding current sensing operational amplifiers and analog-to-digital converters are all ideal devices, the error of the current detection link should be zero. However, there are various errors in actual components: the resistance values of the current-sensing resistors R1, R2 and R3 and the amplification factors of their corresponding current sensing operational amplifiers have factory errors, and they will increase with increasing temperature; and the current sensing operational amplifier 1 has an input offset voltage, which will shift with temperature, time, voltage changes, etc.; the 5V voltage on the circuit board that powers the current sensing operational amplifier has an accuracy error; the analog-to-digital converter of the microprocessor control unit MCU has errors when performing analog-to-digital conversion, and the above errors will cause errors in current detection. Therefore, the 0 current sampling accuracy of the microprocessor control unit MCU is low, which will result in poor phase current accuracy when the B6 bridge driver 12 controls the B6 bridge 110 and then drives the motor 140.
[0004] The motor control system of a vehicle has a very high requirement for accuracy. Poor current accuracy usually affects driving quality and even driving safety. Therefore, in the related technology, a motor pre-driver chip 120 with an integrated high-precision current sensing operational amplifier and high-precision current sensing resistors R1, R2 and R3 are usually selected. However, this method has the following defects:
[0005] (1) Selecting a high-precision motor pre-driver 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-driver chip 120 of specific accuracy and the current sensing resistors R1, R2 and R3. However, it is usually difficult to match the device model with the required parameters, resulting in the difficulty of device selection and poor universality.
[0007] (3) Even if high-precision devices are used, there is still the problem of parameter deviation due to temperature changes, and the impact of temperature changes cannot be completely eliminated.
[0008] It should be noted that the information disclosed in the background technology section of the invention is only intended to deepen the understanding of the general background technology of the invention, and should not be regarded as an admission or suggestion in any form that the information constitutes prior art already known to those skilled in the art. Summary of the invention
[0009] The purpose of the present invention is to provide a current detection accuracy compensation method, device, motor controller and readable storage medium to address one or more of the problems existing in the motor control system in the prior art, such as relatively poor current accuracy or high cost corresponding to high-precision control. The present invention can improve the control accuracy of motor current with low cost; at the same time, the present invention also has good universality and can significantly reduce the difficulty of device selection.
[0010] In order to achieve the above object, the present invention is implemented by the following technical scheme: a current detection accuracy compensation method is used in a motor control system, the motor control system includes a motor, a power supply for providing phase current for the motor, and a current detection device, the current detection device includes a current sensing operational amplifier corresponding to a bridge arm for transmitting the phase current; the compensation method includes:
[0011] When it is determined that the running state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, a first voltage output by the corresponding current sensing operational amplifier is collected when the current is zero;
[0012] For each of the bridge arms, according to the current temperature and the correspondence relationship between the temperature and the PAV calibration error pre-calibrated for the bridge arm, obtain the calibration error compensation parameter corresponding to the bridge arm at the current temperature;
[0013] For each of the bridge arms, within one PWM cycle, the voltage value output by the current sensing operational amplifier corresponding to the bridge arm is collected at least twice, and a second voltage is obtained according to all the voltage sampling values;
[0014] Acquire closed-loop control parameters according to the current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage, so as to control the output currents 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 so, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if not, 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 also includes a microprocessor control unit, and the first accuracy compensation preset condition includes: the microprocessor control unit is powered on again or the current of the motor of the motor control system is zero but the current request is not zero; the second accuracy compensation preset condition includes: the microprocessor control unit is powered on again or the current request of the motor is zero.
[0017] Optionally, the current detection accuracy compensation method further includes:
[0018] In the PAV calibration stage, the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error is obtained by calibration.
[0019] Optionally, the current detection device further includes a current sensing resistor corresponding to the current sensing operational amplifier one by one; 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 the ground; the calibration obtains the corresponding relationship between the temperature and PAV calibration error of each phase of the bridge arm, including:
[0020] Determine two different calibration temperatures;
[0021] For each of the bridge arms, at least two different current values are provided to the bridge arm at each calibration temperature 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] According to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, the corresponding relationship between the temperature corresponding to the bridge arm and the PAV calibration error is obtained.
[0023] Optionally, providing at least two different current values to the bridge arm at each calibration temperature to obtain an operational amplifier gain of the current sensing operational amplifier corresponding to the bridge arm and an error compensation parameter of the current sensing resistor at the calibration temperature includes:
[0024] For each of the bridge arms, control the upper bridge arms and the lower bridge arms of all the bridge arms to be in a non-conducting state, and collect the third voltage output by the current sensing operational amplifier corresponding to the bridge arm;
[0025] Control the upper bridge arm and the lower bridge arm of the bridge arm of other phases, the upper bridge arm of the bridge arm to be in a non-conducting state, and control the lower bridge arm of the bridge arm to be turned 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] According to 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 parameter of the current sensing resistor at the calibration temperature are calculated.
[0027] Optionally, the calculating, according to 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 parameter of the current sensing resistor at the calibration temperature includes:
[0028] Calculating a difference between the fourth voltage and the third voltage;
[0029] According to 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 parameter 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; and obtaining the corresponding relationship between the temperature corresponding to the bridge arm and the PAV calibration error according to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature includes:
[0031] According to 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 the error compensation parameter changing with temperature is obtained by fitting;
[0032] Sampling the curve to obtain multiple sets of calibration data pairs of temperature-error compensation parameters;
[0033] The calibration data pair is stored in a storage unit of the motor control system to obtain a corresponding relationship between the temperature and PAV calibration error corresponding to the bridge arm.
[0034] Optionally, before calibrating to obtain the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error, the compensation method further includes:
[0035] The host computer is communicatively 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, collecting at least twice the voltage value output by the current sensing operational amplifier corresponding to the bridge arm, and obtaining the second voltage according to all the voltage sampling values, comprises:
[0037] When the upper bridge arm of the bridge arm of one phase is in a non-conducting state and the lower bridge arm is in a conducting state, and the upper bridge arm of the bridge arm of the other phase is in a conducting state and the lower bridge arm is in a non-conducting state, sampling is performed at least once, and a first voltage sampling value is obtained according to all sampling results in this state;
[0038] When the upper bridge arms of all the bridge arms are in a non-conducting state and the lower bridge arms are in a conducting state, sampling is performed at least once, and a second voltage sampling value is obtained according to all sampling results in this state;
[0039] The first voltage sampling value and the second voltage sampling value are averaged to obtain the second voltage.
[0040] Optionally, acquiring a closed-loop control parameter according to current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage includes:
[0041] For each of the bridge arms, an error compensation current value is calculated according to the first voltage, the calibration error compensation parameter and the second voltage; and a difference between the current current request value and the error compensation current value is calculated;
[0042] The closed-loop control parameter is obtained according to the difference between the current request value of all the bridge arms and the error compensation current value.
[0043] In order to achieve the above object, the present invention further provides a current detection accuracy compensation device for a motor control system, the motor control system comprising a motor, a power supply for providing a phase current for the motor, and a current detection device, the current detection device comprising a current sensing operational amplifier corresponding to a bridge arm for transmitting the phase current; characterized in that the compensation device comprises:
[0044] A bias voltage acquisition unit: configured to collect, for each bridge arm, a first voltage output by the corresponding current sensing operational amplifier at zero current when determining that the running state of the motor control system meets the first accuracy compensation preset condition;
[0045] A calibration error acquisition unit is configured to acquire, for each bridge arm, a calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the current temperature and a correspondence relationship between the temperature and the PAV calibration error pre-calibrated for the bridge arm;
[0046] A sampling error acquisition unit is configured to collect, for each of the bridge arms, at least twice the voltage value output by the current sensing operational amplifier corresponding to the bridge arm within one PWM cycle, and obtain a second voltage according to all the voltage sampling values;
[0047] An error compensation execution unit: configured to obtain a closed-loop control parameter according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage, so as to control the output current of all phases of the power supply;
[0048] The error compensation judgment unit is configured to judge whether the running state of the motor control system meets the second precision compensation preset condition, and if so, drive the bias voltage acquisition unit to acquire the first voltage; if not, drive the sampling error acquisition unit to acquire the second voltage.
[0049] In order to achieve the above-mentioned purpose, the present invention also provides a motor controller, which includes the above-mentioned current detection accuracy compensation device or includes a processor and a memory, and a computer program is stored in the memory. When the computer program is executed by the processor, the current detection accuracy compensation method described in any one of the above-mentioned items is implemented.
[0050] In order to achieve the above-mentioned object, the present invention further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the current detection accuracy compensation method described in any one of the above items is implemented.
[0051] Compared with the prior art, the current detection accuracy compensation method, device, motor controller and readable storage medium provided by the present invention have the following advantages:
[0052] The current detection accuracy compensation method provided by the present invention, when determining that the operating state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to it at zero current is collected in real time. Thus, a foundation is laid 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), and the sampling error of the analog-to-digital converter. Furthermore, for each of the bridge arms, the present invention obtains the calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the corresponding relationship between the temperature-PAV calibration error pre-calibrated for the bridge arm, laying a solid foundation for compensating the operational amplifier gain of the current sensing operational amplifier and the factory inherent error of the current sensing resistor, as well as the offset error of both caused by temperature changes. Furthermore, for each of the bridge arms, the present invention collects the voltage value output by the current sensing operational amplifier corresponding to the bridge arm at least twice within a PWM cycle, and obtains the second voltage according to all the voltage sampling values, thereby laying a good foundation for compensating the parasitic inductance of the current sensing resistor. Finally, the present invention obtains the closed-loop control parameters according to the current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage, so as to realize the control of all phase output currents of the power supply, thereby realizing 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 factory inherent error of the current sensing resistor, and the offset error caused by the temperature change of the two, and the deviation caused by the parasitic inductance of the current sensing resistor. It can be seen that the present 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 the cost is low; at the same time, the present invention also has good universality and can significantly reduce the difficulty of device selection.
[0053] Since the current detection accuracy compensation device, motor controller and readable storage medium provided by the present invention belong to the same inventive concept as the current detection accuracy compensation method provided by the present invention, the current detection accuracy compensation device, motor controller and readable storage medium provided by the present invention at least have all the advantages of the current detection accuracy compensation method provided by the present invention. For details on the beneficial effects of the current detection accuracy compensation device, motor controller and readable storage medium provided by the present invention, please refer to the above description of the beneficial effects of the current detection accuracy compensation method provided by the present invention, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a block diagram of a motor control system in the related art;
[0055] Figure 2 A schematic diagram of the overall flow of a current detection accuracy compensation method provided by a first embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a current sensing operational amplifier of a current detection device of a motor control system to which a specific example of the current detection accuracy compensation method provided by the present invention is applied;
[0057] Figure 4 A schematic diagram of a PAV calibration compensation test environment for one specific example of the current detection accuracy compensation method provided by the present invention;
[0058] Figure 5 A schematic flow chart of a method for applying a specific example of the current detection accuracy compensation method provided by the present invention to calibrate and obtain the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error;
[0059] Figure 6a A schematic diagram of current flow when the B6 bridge of a motor control system is in the 011 stage, which is one specific example of the current detection accuracy compensation method provided by the present invention;
[0060] Figure 6b A schematic diagram of current flow direction when the B6 bridge of a motor control system is in the 000 phase, which is one specific example of the current detection accuracy compensation method provided by the present invention;
[0061] Figure 7 A schematic diagram of the corresponding relationship between the PWM timing of a motor control system, the motor phase current, and the output voltage of a current sensing operational amplifier, which is one specific example of the current detection accuracy compensation method provided by the present invention;
[0062] Figure 8 A schematic diagram of the structure of a current detection accuracy compensation device provided by a second embodiment of the present invention;
[0063] Fig. 9 A schematic block diagram of a motor controller provided in a third embodiment of the present invention;
[0064] The reference numerals 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 DESCRIPTION
[0068] The following is a further detailed description of a current detection accuracy compensation method, device, motor controller and readable storage medium proposed by the present invention in conjunction with the accompanying drawings. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the drawings are in a very simplified form and all use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In order to make the purposes, features and advantages of the present invention more obvious and easy to understand, please refer to the accompanying drawings. It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Any modification of the structure, change of the proportional relationship or adjustment of the size, in the case of the same or similar effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical content disclosed by the present invention. The specific design features of the present invention disclosed herein include, for example, specific dimensions, directions, positions and shapes, which will be determined in part by the specific environment to be applied and used. And, in the embodiments described below, sometimes the same figure mark is used in common between different drawings to represent the same part or part with the same function, and its repeated description is omitted. In this specification, similar reference numerals and letters are used to refer to similar items, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures. In addition, if the method described herein includes a series of steps, the order of these steps presented herein is not necessarily the only order in which these steps can be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.
[0069] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The singular forms "a", "an" and "the" include plural objects, the term "or" is generally used in a sense including "and / or", the term "several" is generally used in a sense including "at least one", and the term "at least two" is generally used in a sense including "two or more". In addition, the terms "first", "second" and "third" are used for descriptive purposes only and are not to be understood as indicating or suggesting relative importance or implicitly indicating the number of the indicated technical features.
[0070] It should be understood that when an element is referred to as being "connected to" or "coupled to" another element, it may be directly connected to the other element or there may be intervening elements. Conversely, when an element is referred to as being "directly connected to" another element, there are no intervening elements.
[0071] In addition, unless otherwise stated or apparent from the context, as used herein, the term "about" is understood to be within the normal tolerance range in the art, such as within 2 standard deviations of the mean. "About" may be understood to be within 10%, 9%, 8%, 7%, 6%, 5%, 4%, 3%, 2%, 1%, 0.5%, 0.1%, 0.05%, or 0.01% of the value. Unless otherwise clear from the context, all numerical values provided herein are modified by the term "about".
[0072] The core idea of the present invention is to provide a current detection accuracy compensation method, device, motor controller and readable storage medium. The present invention can improve the control accuracy of motor current with low cost; at the same time, the present invention also has good universality and can significantly reduce the difficulty of device selection.
[0073] It should be noted that the current detection accuracy compensation method, compensation device and readable storage medium provided by the present invention can be applied to the motor controller provided by the present invention, and the current detection accuracy compensation method, compensation device, motor controller and readable storage medium provided by the present invention can be applied to vehicles. It should be understood that the terms "vehicle" or "vehicle" or other similar terms used in this article include general motor vehicles, such as passenger vehicles including sport utility vehicles (SUVs), buses, trucks, various commercial vehicles, and hybrid vehicles, electric vehicles, plug-in hybrid electric vehicles, fuel cell vehicles and other alternative fuel vehicles (such as fuels obtained from resources other than petroleum).
[0074] In order to facilitate the understanding and explanation of the present invention, the hardware detection circuit of the electronic controller of the three-phase brushless DC motor control system is used as an example for explanation. Obviously, as those skilled in the art can understand, this is not a limitation of the present invention. The present invention is still applicable to other control systems besides the motor control system. For example, the present invention is also applicable to hardware drive circuit solutions 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] In order to realize the above idea, a first embodiment of the present invention provides a current detection accuracy compensation method, which is used in a motor control system. For example, see Figure 1 and Figure 2 ,in, Figure 1 It is a block diagram of a motor control system in the related art; Figure 2 The overall flow chart of the current detection accuracy compensation method provided in this embodiment is as follows. Figure 1 and Figure 2 It can be seen that the motor control system includes a motor 140, a power supply 150 for providing a phase current to the motor 140, and a current detection device 130, wherein the current detection device 130 includes a current sensing operational amplifier corresponding to the bridge arm of the B6 bridge 110 for transmitting the phase current (as described above, Figure 1 Only the current sensing operational amplifier CSA1 corresponding to the bridge arm where the current sensing resistor R1 is located is marked). The compensation method includes:
[0076] S100: When it is determined that the running state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, a first voltage output by the corresponding current sensing operational amplifier is collected when the current is zero;
[0077] S200: For each of the bridge arms, according to the current temperature and the correspondence relationship between the temperature and the PAV calibration error pre-calibrated for the bridge arm, obtaining a calibration error compensation parameter corresponding to the bridge arm at the current temperature;
[0078] S300: For each of the bridge arms, within one PWM cycle, the voltage value output by the current sensing operational amplifier corresponding to the bridge arm is collected at least twice, and a second voltage is obtained according to all the voltage sampling values;
[0079] S400: Acquire closed-loop control parameters according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage, so as to control the output currents of all phases of the power supply 150;
[0080] S500: Determine whether the operating state of the motor control system satisfies the second precision compensation preset condition. If so, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if not, return to execute the steps of obtaining the second voltage and the related steps after obtaining the second voltage.
[0081] The current detection accuracy compensation method provided by the present invention, when determining that the running state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to it at zero current is collected in real time. Thus, 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 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 are compensated for. Further, for each bridge arm, the present invention obtains the calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the corresponding relationship between the temperature-PAV calibration error pre-calibrated for the bridge arm, which lays a solid foundation for compensating the operational amplifier gain of the current sensing operational amplifier and the factory inherent errors of the current sensing resistors R1, R2 and R3, as well as the offset errors of the two caused by temperature changes. Furthermore, for each of the bridge arms, the present invention collects the voltage value output by the current sensing operational amplifier corresponding to the bridge arm at least twice within a PWM cycle, and obtains the second voltage according to all the voltage sampling values, thereby laying a good foundation for compensating the parasitic inductance of the current sensing resistors R1, R2 and R3. Finally, the present invention obtains the closed-loop control parameters according to the current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage, so as to realize the control of all phase output currents of the power supply 150, thereby realizing 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 factory inherent error of the current sensing resistors R1, R2 and R3, as well as the offset error of the two caused by temperature changes, and the deviation caused by the parasitic inductance of the current sensing resistors R1, R2 and R3. It can be seen that 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 with 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 noted that, as can be understood by those skilled in the art, the present invention does not impose too many 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 too many restrictions on the current sensing resistor and the current sensing operational amplifier. The current sensing resistor current sensing operational amplifier can be a single current sensing (shunt), a double current sensing or a triple current sensing. Furthermore, the present invention does not impose any restrictions on the number of channels of the current sensing operational amplifier and the type of the motor 140. For example, the motor 140 is preferably a three-phase brushless direct current motor (BLDC). In addition, the motor 140 can also be a multi-phase motor or a permanent magnet synchronous motor 140. In particular, as a preferred embodiment, the present invention is particularly suitable for FOC (Field-Oriented Control) algorithm control and square wave control.
[0083] Please continue to see Figure 1 ,from Figure 1 It can be seen that the current detection device 130 also includes a microprocessor control unit MCU, and the first precision compensation preset condition includes: the microprocessor control unit MCU is powered on again or the current of the motor 140 of the motor control system is zero but the current request is not zero; the second precision compensation preset condition includes the microprocessor control unit MCU is powered on again or the current request of the motor 140 is zero.
[0084] Therefore, the current detection accuracy compensation method provided by the present invention, when it is determined that the microprocessor control unit MCU is powered on again or the current of the motor 140 of the motor control system is zero but the current request is not zero, for each bridge arm, the first voltage output by the corresponding current sensing operational amplifier CSA1 at zero current is collected in real time. Thus, a foundation is laid for compensating 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, and the sampling error of the analog-to-digital converter.
[0085] For example, as mentioned above, from Figure 1 It can be seen that each bridge arm of the current sensing resistor has a corresponding current sensing operational amplifier and analog-to-digital converter. For ease of understanding and description, this article takes 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 V phase and W phase, please refer to the description of this article for adaptive understanding.
[0086] For a better understanding of the present invention, see Figure 3 , Figure 3 A schematic diagram of a current sensing operational amplifier CSA1 of a current detection device 130 of a motor control system is shown as a specific example of the current detection accuracy compensation method provided by the present invention. Figure 3 , respectively, the first voltage output by the current sensing operational amplifier CSA1 corresponding to the zero current collected in step S100, and the basic principle of laying the foundation for compensating 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 are explained. First, 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 compensation of the analog-to-digital conversion circuit are 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 actual applications, the two input branches inside current sensing operational amplifier CSA1 cannot be completely balanced, and the output is not 0. At this time, if the negative input terminal is kept unchanged and a voltage is applied to the positive input terminal until the output of the op amp is 0, the negative value of the 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: Usually, the reference voltage of analog-to-digital converter ADC1 in microprocessor control unit MCU comes from the reference voltage output by vehicle system basis chip (SBC), and its value is usually 5V (for ease of description and understanding, it is denoted as V in the following text). 5ref ), the accuracy is 1%, if the reference voltage V 5ref The existence of errors will cause the analog-to-digital converter ADC1 to have errors in the corresponding amplitude when sampling, resulting in final current accuracy errors.
[0089] (3) Compensation for sampling error of ADC circuit: The error generated during the sampling process by the analog-to-digital conversion 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 (the vehicle is started) or the motor 140 generates a current control request, the above error is compensated by real-time sampling of the first voltage output by the current sensing operational amplifier CSA1 at zero current.
[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 output by the corresponding analog-to-digital converter ADC1 at zero current can be calculated by the following formula:
[0092]
[0093] In formula (1), V0 is the value of the first voltage, V 5ref is the reference voltage, G is the operational amplifier gain of the current sensing operational amplifier CSA1, V CSAoffset is the offset error of the current sensing operational amplifier CSA1, and ΔADC is the sampling error compensation of the analog-to-digital converter ADC1.
[0094] Similarly, if a constant current of 60A is passed through the current-sense resistor R1, the fifth voltage value output by the corresponding analog-to-digital converter ADC1 when the current is 60A can be calculated by the following formula:
[0095]
[0096] In formula (2), V 60 0 is the fifth voltage value output by the analog-to-digital converter ADC1 when the current is 60A, I 60 is the current value (60A at this time), and R is the resistance value of the current sensing resistor R1.
[0097] If the reference voltage V 5ref and the offset error of the current sensing operational amplifier CSA1 V CSAoffset The error is compensated, and the motor control system directly uses the default value for the current closed-loop algorithm, that is, V 5ref =5V, V CSAoffset =0, △ADC = 0, V0 = 2.5V, and V in formula (2) 5ref 、V CSAoffset , △ADC actually have deviations, which leads to V 60 -V0 is not accurate, thus affecting the current control accuracy. The current detection accuracy compensation method provided by the present invention is used to collect the first voltage in real time when judging that the microprocessor control unit MCU is powered on again, or each time a current request occurs, and perform corresponding filtering on the collected first voltage, which lays a solid foundation for subsequent closed-loop control, thereby eliminating the influence of these errors.
[0098] Preferably, in some exemplary embodiments, the current detection accuracy compensation method provided by the present invention further includes:
[0099] In the PAV (PAV is the abbreviation of German Pruef und Abgleich Vorshrift, which is translated into English as Test and calibration specification) calibration stage, the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error is calibrated.
[0100] Therefore, the current detection accuracy compensation method provided by the present invention, in the PAV calibration stage, calibrates the corresponding relationship between the temperature and the PAV calibration error of each bridge arm, which can not only lay a foundation for compensating for the operational amplifier gain of the current sensing operational amplifier and the factory inherent error of the current sensing resistor and the offset error of the two caused by temperature changes during the control process of the motor control system, but also can significantly reduce the amount of calculation in the control process of the motor control system without increasing any hardware cost of the vehicle.
[0101] Preferably, in some exemplary embodiments, before calibrating to obtain the corresponding relationship between the temperature and the PAV calibration error of the bridge arm of each phase, the compensation method further comprises:
[0102] The host computer PAM is communicatively connected to the motor control system, and the current source I that meets the preset accuracy requirement is electrically connected to the bridge arm to establish a PAV calibration compensation test environment; wherein, the current source I is used to provide a preset constant current to the bridge arm, and the host computer PAM is used to control the calibration process. Therefore, the current detection accuracy compensation method provided by the present invention can calibrate the corresponding relationship between the temperature and PAV calibration error of each bridge arm through the host computer PAM and the current source I that meets the preset accuracy requirement. On the one hand, the existing PAV calibration compensation test environment can be reused, and on the other hand, it is also easy to implement. For example, please refer to Figure 4 , Figure 4 A schematic diagram of a PAV calibration compensation test environment is provided for one specific example of the current detection accuracy compensation method provided by the present invention. Figure 4 It can be seen that in the calibration stage, 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 needed. For example, the high-precision current source I is first connected to the host computer PAM through the communication interface, and the motor controller (not shown in the figure) of the motor control system is connected to the host computer PAM through a fixture.
[0103] Please continue to see Figure 1 and Figure 4 ,like Figure 1 and Figure 4 As shown, the current detection device 130 also includes current detection 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 detection resistors R1, R2 and R3 are respectively connected in series between the lower bridge arm and the ground. The calibration obtains the corresponding relationship between the temperature and PAV calibration error of each phase of the bridge arm, including:
[0104] SA1: Determine two different calibration temperatures;
[0105] SA2: for each of the bridge arms, at least two different current values are provided to the bridge arm at each calibration temperature 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: According to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, the corresponding relationship between the temperature and the PAV calibration error of the bridge arm is obtained.
[0107] Therefore, the current detection accuracy compensation method provided by the present invention, when calibrating the corresponding relationship between the temperature and the 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, so as 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, and finally obtains the corresponding relationship between the temperature and the PAV calibration error corresponding to the bridge arm according to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, thereby realizing the calibration of the operational amplifier gain of the current sensing operational amplifier and the factory inherent error of the current sensing resistor and the offset error of the two caused by temperature changes.
[0108] It should be noted that, as can be understood by those skilled in the art, there are no excessive restrictions on the setting of the calibration temperature. For example, in some embodiments, two calibration temperatures, normal temperature (such as 25°C) and high temperature (such as 85°C) can be selected; in other embodiments, three calibration temperatures, low temperature (such as -30°C), normal temperature (such as 25°C) and high temperature (such as 85°C) can be selected. Examples are no longer given one by one. Furthermore, the present invention does not limit the number of current values provided at each calibration temperature. For example, in some embodiments, a constant current of 0A (such as turning off the current source I and the power supply 150) and a constant current of 60A (such as provided by the current source I) can be provided respectively.
[0109] Preferably, in some exemplary embodiments, at least two different current values are provided to the bridge arm at each calibration temperature in step SA2 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, including:
[0110] SA21: For each phase of the bridge arm, control the upper bridge arm and the lower bridge arm of all the bridge arms to be in a non-conducting state, and collect the third voltage (that is, the output voltage at zero current) output by the current sensing operational amplifier corresponding to the bridge arm;
[0111] SA22: Control the upper bridge arm and the lower bridge arm of the bridge arm of other phases, the upper bridge arm of the bridge arm to be in a non-conducting state, and control the lower bridge arm of the bridge arm to be turned on; and provide a preset constant current to the lower bridge arm and the current sensing resistor of the bridge arm, and collect 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 parameter of the current sensing resistor at the calibration temperature according to the third voltage, the fourth voltage and the current value of the preset constant current, including:
[0114] SA231: Calculate a 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 parameter of the current sensing resistor at the calibration temperature.
[0116] Therefore, the current detection accuracy compensation method provided by the present invention can obtain the operational amplifier gain of the current sensing operational amplifier corresponding to each of the bridge arms 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 making a difference.
[0117] Preferably, in some exemplary embodiments, the calibration temperature includes a first preset temperature and a second preset temperature; step SA3 obtains the corresponding relationship between the temperature corresponding to the bridge arm and the PAV calibration error according to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, including:
[0118] SA31: fitting a curve showing a change in the error compensation parameter with temperature according to the first preset temperature and its corresponding first error compensation parameter, and the second preset temperature and its corresponding second error compensation parameter;
[0119] SA32: sampling the curve to obtain multiple sets of calibration data pairs of temperature-error compensation parameters;
[0120] SA33: Store the calibration data pair in a storage unit of the motor control system to obtain a corresponding relationship between the temperature and PAV calibration error corresponding to the bridge arm.
[0121] The current detection accuracy compensation method provided by the present invention firstly fits the curve of the error compensation parameter changing with temperature according to the first preset temperature and its corresponding first error compensation parameter, and the second preset temperature and its corresponding second error compensation parameter; then samples the curve to obtain multiple sets of temperature-error compensation parameter calibration data pairs; finally, stores the calibration data pairs in the storage unit of the motor control system to obtain the corresponding relationship between the temperature and the PAV calibration error corresponding to the bridge arm. Therefore, the current detection accuracy compensation method provided by the present invention not only obtains a high-precision corresponding relationship between the temperature and the PAV calibration error, but also has simple logic and is easy to implement.
[0122] For example, for each bridge arm, calibration is performed at two calibration temperatures, normal temperature (25°C) and high temperature (85°C), respectively, to obtain the operational amplifier gain of the current sensing operational amplifier and the error compensation parameters of the current sensing resistor corresponding to the bridge arm of this phase. Figure 4 See also Figure 5 , Figure 5 A schematic diagram of a flow chart of obtaining the error compensation parameters of one of the phase bridge arms by calibration in one specific example of the current detection accuracy compensation method provided by the present invention. In this example, taking calibration at room temperature as an example, the specific operation of the specific calibration process is described as follows:
[0123] Step P11: The host computer PAM turns off the output of the current source I, disconnects the upper bridge arms (MOSFET tubes) Q11, Q12 and Q13 and the lower bridge arms Q21, Q22 and Q23 of all phase bridge arms, and the host computer PAM reads the zero current bias voltage (i.e., the voltage output by the current sensing operational amplifier after analog-to-digital converter conversion) in the corresponding register of the microprocessor control unit MCU, which is recorded as V0. As can be understood by those skilled in the art, since the current source I and the bridge arms of all phases are disconnected, there is no current (i.e., zero current) flowing through the current sensing resistor at this time, and the current sensing operational amplifier of the motor pre-driver chip 120 at this time will output a zero current bias voltage, which is input to the microprocessor control unit MCU for analog-to-digital conversion and storage.
[0124] Step P12: The host computer PAM controls the bridge arm of the B6 bridge 110, disconnects all the upper bridge arms (upper three tubes) Q11, Q12 and Q13 and opens the lower bridge arm of one phase (such as Figure 4 The upper computer PAM sends a command to the current source I to output a certain constant current (for example, 60A) to the bridge arm. At this time, the current will flow through the lower bridge arm Q12 of the turned-on phase, the current sensing resistor R1 of the phase, and finally flow into the ground.
[0125] Step P13: The voltage across the current sensing resistor R1 of the phase bridge arm is sent to the corresponding current sensing operational amplifier CSA1 through the SP and SN pins of the motor pre-driver chip 120. The amplified voltage is stored in the register by the microprocessor control unit MCU through the analog-to-digital converter ADC1, and the host computer PAM reads the voltage value V from the register. so , which is the output voltage value under the constant current (the current value is a known value).
[0126] Step P14: By collecting the output voltage of the current sensing operational amplifier CSA1 when there is zero current and when there is current and making a difference, the operational amplifier gain of the current sensing operational amplifier CSA1 corresponding to the bridge arm and the error compensation parameter 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 and other electronic components, the voltage value sampled and read by the host computer PAM through the microprocessor control unit MCU is expressed as:
[0128]
[0129] In formula (3), the superscript ' represents the actual value including the error, and the value without the superscript represents the value without the error, where V is the voltage value, V5' refis the reference voltage, G′ is the operational amplifier gain of the current sensing operational amplifier CSA1, V CSAoffset is the offset error of the current sensing operational amplifier CSA1, and (△ADC)′ is the sampling error compensation of the analog-to-digital converter ADC1.
[0130] When the current source I sets the input current to 0, the voltage value at zero current read by the host computer PAM (host computer PAM software) is recorded as V0. According to the above formula (3), it can be known that:
[0131]
[0132] When the input current is set to 60A through the current source I, the voltage value at zero current read by the host computer PAM (host computer PAM software) is recorded as V 60 , then according to the above formula (3) we can know:
[0133]
[0134] It has been found that the components in the same bridge arm and its corresponding current detection device 130 have a reference voltage V 5ref , the op amp gain G of the current sensing operational amplifier, and the offset error V CSAoffset The error is independent of the current and remains basically unchanged or changes very slightly. The sampling error of the analog-to-digital converter ADC1 at zero current and at current is measured and the deviation is also very small. That is, the following equations (6a), (6b), (6c) and (6d) exist:
[0135] V5′ ref1 =V5′ ref2 (6a)
[0136] V CSAoffset1 =V CSAoffset2 (6b)
[0137] G1′=G2′ (6c)
[0138] △ADC1=△ADC2 (6d)
[0139] According to formula (5) and formula (6a), (6b), (6c) and (6d), we can get:
[0140] V 60 -V0=G′×R′×I 60 (7)
[0141] According to the previous description, the current I (such as the constant current I 60) is output by a current source I that meets the preset accuracy requirement, so the current is known and accurate (determined by the accuracy of the current source I, and the high-precision current source I is only used during PAV calibration, so it will not increase the hardware cost of the motor control system using the current detection accuracy compensation method provided by the present invention). Combined with formula (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, the step S300 of collecting at least twice the voltage value output by the current sensing operational amplifier corresponding to the bridge arm, and obtaining the second voltage according to all the voltage sampling values, includes:
[0143] S310: When the upper bridge arm of the bridge arm of one phase is in a non-conducting state and the lower bridge arm is in a conducting state, and the upper bridge arm of the bridge arm of the other phase is in a conducting state and the lower bridge arm is in a non-conducting state, sampling is performed at least once, and a first voltage sampling value is obtained according to all sampling results in this state;
[0144] S320: When the upper bridge arms of all the bridge arms are in a non-conducting state and the lower bridge arms are in a conducting state, sampling is performed at least once, and a second voltage sampling value is obtained according to all sampling results in this state;
[0145] S330: averaging the first voltage sampling value and the second voltage sampling value to obtain the second voltage.
[0146] Therefore, the current detection accuracy compensation method provided by the present invention can effectively reduce the sampling error by sampling when the B6 bridge 110 is in different stages, thereby laying a good foundation for compensating 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 sampling results in this state. In some exemplary embodiments, sampling may be performed only once, and the voltage value obtained by the sampling may be used as the first voltage sampling value; in other embodiments, multiple samplings are performed, and the average value of the voltage values obtained by 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, which will not be repeated here.
[0148] For example, taking the seven-segment PWM FOC motor 140 control and the current closed-loop stall control of the +U phase (the bridge arm where the current sensing resistor R1 is located) as an example, the principle of compensating for the error of the parasitic inductance of the current sensing resistor R1 by sampling when the B6 bridge 110 is in different stages is briefly described as follows:
[0149] The bridge arms of the B6 bridge 110 have five stages: 111→011→000→011→111, where 1 indicates that the upper bridge arm of the corresponding bridge arm is in the conducting state, and 0 indicates that the upper bridge arm of the corresponding bridge 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 one specific example of the current detection accuracy compensation method 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 one specific example of the current detection accuracy compensation method provided by the present invention is in the 000 stage. Taking the current detection resistor R1 as an example, if there is no parasitic inductance in the current detection resistor R1, that is, the voltage drop across the resistor at a certain current is V1; actually, 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 bridge arm of the B6 bridge 110 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 greater than V1. Similarly, when the current decreases, the voltage V' on the current detection resistor R1 is less than 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 actual current sensing operational amplifier CSA1 is偏大 at 011 and偏小 at 000. The above discussion can also be further verified by Figure 7 obtained. Specifically, please refer to Figure 7 , Figure 7 is a schematic diagram of the correspondence between the PWM timing of the motor control system applying one specific example of the current detection accuracy compensation method provided by the present invention, the phase current of the motor, and the output voltage of the current sensing operational amplifier. From Figure 7 it can be seen that if only the midpoint sampling Vso is performed in the 000 state, it will result in a偏小 Vso being collected, and ultimately lead to an偏大 actual controlled current. According to the above research, the current detection accuracy compensation method provided by the present invention performs multiple samplings of Vso when the B6 bridge 110 is in the 000 and 011 states respectively, and takes the average result as the second voltage, thereby laying a solid foundation for effectively compensating the error caused by the parasitic inductance of the current detection resistors R1, R2, and R3.
[0150] Preferably, in some exemplary implementations, in step S400, obtaining a closed-loop control parameter according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage includes:
[0151] S410: For each of the bridge arms, calculate an error compensation current value according to the first voltage, the calibration error compensation parameter and the second voltage; and calculate a difference between the current current request value and the error compensation current value;
[0152] S420: Obtain the closed-loop control parameter according to the current current request value of all the bridge arms and the difference between the error compensation current values.
[0153] For example, in some exemplary implementations, the error compensation current value in step S410 is calculated by the following formula (9):
[0154]
[0155] In formula (9), I c is the error compensation current value, V2 is the second voltage, V1 is the first voltage, G ′ ×R ′ is the calibration error compensation parameter.
[0156] Based on the same inventive concept, a second embodiment of the present invention provides a current detection accuracy compensation device. The compensation device is used in a motor control system, the motor control system includes a motor 140, a power supply 150 for providing phase current to the motor 140, and a current detection device 130, the current detection device 130 includes a current sensing operational amplifier corresponding to a bridge arm for transmitting the phase current. Specifically, see Figure 8 , Figure 8 This is a schematic diagram of the structure of the current detection accuracy compensation device provided in this embodiment. Figure 8It can be seen that 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 collect the first voltage output by the current sensing operational amplifier corresponding to each bridge arm at zero current when it is determined that the operating state of the motor control system meets the first accuracy compensation preset condition. The calibration error acquisition unit 220 is configured to obtain the calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the current temperature and the corresponding relationship between the temperature-PAV calibration error pre-calibrated for the bridge arm for each bridge arm. The sampling error acquisition unit 230 is configured to collect the voltage value output by the current sensing operational amplifier corresponding to the bridge arm at least twice within a PWM cycle for each bridge arm, and obtain the second voltage according to all the voltage sampling values. The error compensation execution unit 240 is configured to obtain closed-loop control parameters according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter 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 judge whether the running state of the motor control system meets the second precision compensation preset condition, and if so, drive the bias voltage acquisition unit 210 to acquire the first voltage; if not, drive the sampling error acquisition unit 230 to acquire the second voltage.
[0157] Since the current detection accuracy compensation device provided by the present invention and the current detection accuracy compensation method provided by the present invention belong to the same inventive concept, the current detection accuracy compensation device provided by the present invention at least has all the advantages of the current detection accuracy compensation method provided by the present invention. For details on the beneficial effects of the current detection accuracy compensation device provided by the present invention, please refer to the above description of the beneficial effects of the current detection accuracy compensation method provided by the present invention, and no further details will be given here.
[0158] Based on the same inventive concept, the third embodiment of the present invention provides a motor controller. In some exemplary implementations, the motor controller includes the above-mentioned current detection accuracy compensation device. Since the motor controller provided by the present invention and the current detection accuracy compensation device 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 have the same basic principle, the motor controller provided by the present invention will not be described in detail here. For more detailed content, please refer to the above relevant description of the compensation device or compensation method for adaptive understanding.
[0159] Some other embodiments provide another motor controller, for example, see 9, Fig. 9 FIG. 1 is a block diagram of the motor controller provided in this embodiment of the present invention. Fig. 9 As shown, the motor controller provided in this embodiment includes a processor 310 and a memory 320, and a computer program is stored in the memory 320. When the computer program is executed by the processor 310, the current detection accuracy compensation method provided in any of the above embodiments is implemented. Since the motor controller provided in this embodiment and the current detection accuracy compensation method provided in the present invention belong to the same inventive concept, the motor controller provided in this embodiment at least has all the advantages of the current detection accuracy compensation method provided in the present invention. For details, please refer to the above description of the beneficial effects of the current detection accuracy compensation method, which will not be repeated here.
[0160] For example, Fig. 9 As shown, the motor controller may also 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, etc. For ease of representation, only one thick line is used in the figure, but it 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 a vehicle controller, an automatic driving domain controller, a battery management system, etc., not shown in the figure). The communication bus 340 connects the above-mentioned motor controller and other controllers (such as a battery management system, etc., not shown in the figure) and other dispersed nodes into a closed-loop system, so that each controller can perform multiple working states (parking state, charging state, starting state, running state, vehicle forward and backward state, feedback braking state, mechanical braking state, general fault state, major fault state) Communication and data transmission, thereby realizing the control function of the vehicle.
[0161] The processor 310 referred to in the present invention may be a microcontroller unit (MCU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 310 is the control center of the motor controller, and various interfaces and lines are used to connect various parts of the entire motor controller.
[0162] The memory 320 may 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0164] A fourth embodiment of the present invention provides a readable storage medium, wherein a computer program is stored in the readable storage medium, and when the computer program is executed by a processor, the current detection accuracy compensation method described above can be implemented. Since the readable storage medium provided by the present invention and the current detection accuracy compensation method provided by the present invention belong to the same inventive concept, the readable storage medium provided by the present invention at least has all the advantages of the current detection accuracy compensation method provided by the present invention. For details of 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 current detection accuracy compensation method provided by the present invention, and no further description will be given here.
[0165] The readable storage medium of the embodiment of the present invention can adopt 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, a system, device or device of electricity, magnetism, light, electromagnetic, infrared or semiconductor, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer hard disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this article, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0166] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0167] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] Compared with the prior art, the current detection accuracy compensation method, device, motor controller and readable storage medium provided by the present invention have the following advantages:
[0169] The current detection accuracy compensation method provided by the present invention, when determining that the operating state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, the first voltage output by the current sensing operational amplifier corresponding to it at zero current is collected in real time. Thus, a foundation is laid 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), and the sampling error of the analog-to-digital converter. Furthermore, for each of the bridge arms, the present invention obtains the calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the corresponding relationship between the temperature-PAV calibration error pre-calibrated for the bridge arm, laying a solid foundation for compensating the operational amplifier gain of the current sensing operational amplifier and the factory inherent error of the current sensing resistor, as well as the offset error of both caused by temperature changes. Furthermore, for each of the bridge arms, the present invention collects the voltage value output by the current sensing operational amplifier corresponding to the bridge arm at least twice within a PWM cycle, and obtains the second voltage according to all the voltage sampling values, thereby laying a good foundation for compensating the parasitic inductance of the current sensing resistor. Finally, the present invention obtains the closed-loop control parameters according to the current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage, so as to realize the control of all phase output currents of the power supply, thereby realizing 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 factory inherent error of the current sensing resistor, and the offset error caused by the temperature change of the two, and the deviation caused by the parasitic inductance of the current sensing resistor. It can be seen that the present 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 the cost is low; at the same time, the present invention also has good universality and can significantly reduce the difficulty of device selection.
[0170] It should be noted that the devices and methods disclosed in the embodiments of this article can also be implemented in other ways. The device implementation described above is only schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of this article. In this regard, each box in the flowchart or block diagram can represent a part of a module, program or code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system for performing a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0171] In addition, the functional modules in the various embodiments of this document may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0172] The above description is only a description of the preferred implementation of the current detection accuracy compensation method, device, motor controller and readable storage medium provided by the present invention, and is not any limitation to the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure content belong to the protection scope of the present invention. Obviously, technicians in this field can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations fall within the scope of the present invention and its equivalent technology, the present invention is also intended to include these modifications and variations.
Claims
1. A current detection accuracy compensation method for a motor control system, the motor control system comprising a motor, a power supply for providing a phase current to the motor, and a current detection device, the current detection device comprising a current sensing operational amplifier corresponding to a bridge arm for transmitting the phase current; characterized in that: The compensation method comprises: When it is determined that the running state of the motor control system meets the first accuracy compensation preset condition, for each bridge arm, a first voltage output by the corresponding current sensing operational amplifier is collected when the current is zero; For each of the bridge arms, according to the current temperature and the correspondence relationship between the temperature and the PAV calibration error pre-calibrated for the bridge arm, obtain the calibration error compensation parameter corresponding to the bridge arm at the current temperature; For each of the bridge arms, within one PWM cycle, the voltage value output by the current sensing operational amplifier corresponding to the bridge arm is collected at least twice, and a second voltage is obtained according to all the voltage sampling values; Acquire closed-loop control parameters according to the current current request values corresponding to all the bridge arms, as well as the first voltage, the calibration error compensation parameter and the second voltage, so as to control the output currents 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 so, return to execute the steps of obtaining the first voltage and the related steps after obtaining the first voltage; if not, return to execute the steps of obtaining the second voltage and the related steps after obtaining the second voltage.
2. The current detection accuracy compensation method according to claim 1, characterized in that: The current detection device also includes a microprocessor control unit, and the first precision compensation preset condition includes: the microprocessor control unit is powered on again or the current of the motor of 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 current detection accuracy compensation method according to claim 1, characterized in that: The compensation method further includes: In the PAV calibration stage, the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error is obtained by calibration.
4. The current detection accuracy compensation method according to claim 3, characterized in that: The current detection device also includes a current sensing resistor corresponding to the current sensing operational amplifier one by one; 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 the ground; The calibration obtains a corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error, including: Determine two different calibration temperatures; For each of the bridge arms, at least two different current values are provided to the bridge arm at each calibration temperature 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; According to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, the corresponding relationship between the temperature corresponding to the bridge arm and the PAV calibration error is obtained.
5. The current detection accuracy compensation method according to claim 4, characterized in that: The providing 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 corresponding to the bridge arm and the error compensation parameter of the current sensing resistor at the calibration temperature includes: For each of the bridge arms, control the upper bridge arms and the lower bridge arms of all the bridge arms to be in a non-conducting state, and collect the third voltage output by the current sensing operational amplifier corresponding to the bridge arm; Control the upper bridge arm and the lower bridge arm of the bridge arm of other phases, the upper bridge arm of the bridge arm to be in a non-conducting state, and control the lower bridge arm of the bridge arm to be turned 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; According to 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 parameter of the current sensing resistor at the calibration temperature are calculated.
6. The current detection accuracy compensation method 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 parameter of the current sensing resistor at the calibration temperature according to the third voltage, the fourth voltage and the current value of the preset constant current includes: Calculating a difference between the fourth voltage and the third voltage; According to 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 parameter of the current sensing resistor at the calibration temperature are calculated.
7. The current detection accuracy compensation method according to claim 4, characterized in that: The calibration temperature includes a first preset temperature and a second preset temperature; the corresponding relationship between the temperature corresponding to the bridge arm and the PAV calibration error is obtained according to all the calibration temperatures and the error compensation parameter corresponding to each calibration temperature, including: According to 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 the error compensation parameter changing with temperature is obtained by fitting; Sampling the curve to obtain multiple sets of calibration data pairs of temperature-error compensation parameters; The calibration data pair is stored in a storage unit of the motor control system to obtain a corresponding relationship between the temperature and PAV calibration error corresponding to the bridge arm.
8. The current detection accuracy compensation method according to any one of claims 3 to 7, characterized in that: Before calibrating and obtaining the corresponding relationship between the temperature of the bridge arm of each phase and the PAV calibration error, the compensation method further includes: The host computer is communicatively 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 current detection accuracy compensation method according to claim 1, characterized in that: The step of collecting at least twice the voltage value output by the current sensing operational amplifier corresponding to the bridge arm and obtaining a second voltage according to all the voltage sampling values includes: When the upper bridge arm of the bridge arm of one phase is in a non-conducting state and the lower bridge arm is in a conducting state, and the upper bridge arm of the bridge arm of the other phase is in a conducting state and the lower bridge arm is in a non-conducting state, sampling is performed at least once, and a first voltage sampling value is obtained according to all sampling results in this state; When the upper bridge arms of all the bridge arms are in a non-conducting state and the lower bridge arms are in a conducting state, sampling is performed at least once, and a second voltage sampling value is obtained according to all sampling results in this state; The first voltage sampling value and the second voltage sampling value are averaged to obtain the second voltage.
10. The current detection accuracy compensation method according to claim 1, characterized in that: The step of acquiring a closed-loop control parameter according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage includes: For each of the bridge arms, an error compensation current value is calculated according to the first voltage, the calibration error compensation parameter and the second voltage; and a difference between the current current request value and the error compensation current value is calculated; The closed-loop control parameter is obtained according to the difference between the current request value of all the bridge arms and the error compensation current value.
11. A current detection accuracy compensation device, characterized in that: Used in a motor control system, the motor control system includes a motor, a power supply for providing phase current for the motor, and a current detection device, the current detection device includes a current sensing operational amplifier corresponding to a bridge arm for transmitting the phase current; characterized in that the compensation device includes: A bias voltage acquisition unit: configured to collect, for each bridge arm, a first voltage output by the corresponding current sensing operational amplifier at zero current when determining that the running state of the motor control system meets the first accuracy compensation preset condition; A calibration error acquisition unit is configured to acquire, for each bridge arm, a calibration error compensation parameter corresponding to the bridge arm at the current temperature according to the current temperature and a correspondence relationship between the temperature and the PAV calibration error pre-calibrated for the bridge arm; A sampling error acquisition unit is configured to collect, for each of the bridge arms, at least twice the voltage value output by the current sensing operational amplifier corresponding to the bridge arm within one PWM cycle, and obtain a second voltage according to all the voltage sampling values; An error compensation execution unit: configured to obtain a closed-loop control parameter according to the current current request values corresponding to all the bridge arms, the first voltage, the calibration error compensation parameter and the second voltage, so as to control the output current of all phases of the power supply; The error compensation judgment unit is configured to judge whether the running state of the motor control system meets the second precision compensation preset condition, and if so, drive the bias voltage acquisition unit to acquire the first voltage; if not, drive the sampling error acquisition unit to acquire the second voltage.
12. A motor controller, characterized in that: A current detection accuracy compensation device comprising the current detection accuracy compensation device as claimed in claim 11 or comprising a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the current detection accuracy compensation method as claimed in any one of claims 1 to 10 is implemented.
13. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the current detection accuracy compensation method according to any one of claims 1 to 10 is implemented.
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
Electrical tuning circuit arrangement for a measurement bridge, especially a Wheatstone's bridge, has at least a current source for generating a compensation current
DE102004016425A1
Motor control circuit for a power tool
EP1775831A2
Cited By
Current sensor self-calibration method and system of motor controller and phase current calibration method
CN119936769A
