A bidirectional current sampling method and motor FOC control system
By introducing a bias voltage calibration mechanism into the FOC control system, and utilizing operational amplifiers and digital-to-analog converters, high-precision, dynamically calibrable bidirectional current sampling is achieved, solving the problem of poor bias voltage generation accuracy and improving current sampling accuracy and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUMI ZHIJING FUTURE (SUZHOU) TECHNOLOGY CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-10
AI Technical Summary
In existing FOC control systems, the bias voltage generation accuracy is poor, resulting in low bidirectional current sampling accuracy and the inability to dynamically calibrate, which affects system reliability and hardware cost.
By introducing a bias voltage calibration mechanism into the motor FOC control system, and using operational amplifiers and digital-to-analog converters, the bias voltage is adjusted in real time to match the actual characteristics of the circuit, thereby achieving high-precision, dynamically calibrable bidirectional current sampling.
It significantly improves the generation accuracy of bias voltage, ensures that the bidirectional current signal is fully mapped to the analog-to-digital converter range, enhances the current sampling accuracy and stability of the FOC control system, and reduces hardware costs.
Smart Images

Figure CN122361886A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motor control, specifically to a bidirectional current sampling method and a motor FOC control system. Background Technology
[0002] Field-oriented control (FOC) has become a core technology for high-performance permanent magnet synchronous motor drive systems, and its control effect is highly dependent on the accuracy of phase current sampling. During motor operation, the phase current exhibits bidirectional changing characteristics, requiring the current sampling circuit to accurately acquire bidirectional current signals.
[0003] However, most existing controllers integrate analog-to-digital converters (ADCs) with a unipolar input structure, whose input voltage range is typically limited to 0V to a reference voltage (e.g., 3.3V), making it impossible to directly sample negative current signals. To address this issue, existing technologies typically introduce a bias circuit in the ADC pre-stage, generating a fixed bias voltage through resistor dividers or an external reference voltage source to boost the bipolar current signal to the range that the ADC can input.
[0004] The aforementioned traditional solutions have the following drawbacks: First, the bias voltage is determined by the hardware device parameters and is easily affected by factors such as resistor accuracy, temperature drift, and op-amp input bias current, leading to current zero-point drift and affecting FOC control accuracy. Second, fixed bias cannot be dynamically adjusted according to motor operating conditions, temperature changes, or device aging, making it difficult to maintain sampling accuracy over a long period. Third, the bias circuit requires high-precision resistors and reference sources, resulting in high hardware costs and complex debugging. Fourth, online calibration is not possible, and zero-point errors accumulate over time and with environmental changes, affecting system reliability.
[0005] Therefore, there is an urgent need to develop a bidirectional current sampling method that can overcome the above-mentioned defects, and achieve high-precision, high-stability, and dynamically calibrated current sampling while maintaining hardware simplicity. Summary of the Invention
[0006] This application provides a bidirectional current sampling method and a motor FOC control system to solve the problem of low bidirectional current sampling accuracy in FOC control caused by poor bias voltage generation accuracy in existing methods.
[0007] This application provides a bidirectional current sampling method applied in a motor FOC control system. The bidirectional current sampling method includes the following steps: acquiring the differential voltage signal corresponding to the three-phase phase current in the motor's drive current loop; amplifying the differential voltage signal through an amplification processing circuit; using a bias voltage acting in the amplification processing circuit to cause the amplification processing circuit to output an offset amplified voltage signal; wherein the bias voltage is calibrated in the initialization state of the control system or when the motor is not rotating; sampling the offset amplified voltage signal to obtain digital voltage sampling data; and performing bias restoration and conversion on the digital voltage sampling data to obtain the corresponding bidirectional current value.
[0008] Furthermore, the bias voltage calibration process includes: acquiring digital voltage sampling data when the phase current of the motor is zero, and comparing it with the expected digital value of the current bias voltage. If the deviation between the two exceeds a preset range, the bias voltage is adjusted to update the digital voltage sampling data, thereby updating the deviation, until the deviation is within the preset range. When the deviation is within the preset range, the adjusted bias voltage is used as the calibrated bias voltage, and the updated digital voltage sampling data is used as the zero-point reference value. The expected digital value is a theoretical digital value obtained based on the current sampling circuit, and the zero-point reference value is used to perform bias restoration on the digital voltage sampling data.
[0009] Furthermore, the motor FOC control system includes a sampling resistor, an analog-to-digital converter (ADC), and a controller. The sampling resistor is connected to the input terminal of the amplification processing circuit, the input terminal of the ADC is connected to the output terminal of the amplification processing circuit, the output terminal of the ADC is electrically connected to the controller, and the controller is electrically connected to the amplification processing circuit. The bias restoration and conversion of the digital voltage sampling data includes: subtracting the zero-point reference value from the digital voltage sampling data to obtain the bias-subtracted digital voltage; and then converting the subtracted digital voltage by combining the sampling resistor parameters, the closed-loop gain of the amplification processing circuit, and the conversion relationship of the ADC to obtain a bidirectional current value corresponding to the actual phase current direction and amplitude.
[0010] Furthermore, by detecting the operating status of the motor, it is determined whether the phase current of the motor is zero.
[0011] Furthermore, the bias voltage during the calibration process includes: when the phase current of the motor is zero, using the current bias voltage as the initial value of the bias voltage to determine whether the deviation exceeds the preset range; when adjusting the bias voltage, the bias voltage is still within the middle preset range of the sampling signal range after being amplified by the amplification processing circuit.
[0012] Specifically, analog-to-digital converters (ADCs), based on their parameters and structure, have a certain sampling signal range. The optimal adjustment range of the bias voltage can be calculated from the middle preset range of the sampling signal range. This allows the bias voltage to find a value that meets the deviation conditions within the optimal adjustment range, thus fully utilizing the sampling signal range during the sampling process and reducing the risk of the amplified signal exceeding the sampling signal range. The middle preset range is a certain range above and below the midpoint of the sampling signal range, preferably 5% to 25%. For example, if the sampling signal range of the ADC is 0-10V, with a midpoint of 5V, the middle preset range can be set to 4-6V with a 10% fluctuation.
[0013] Furthermore, the amplification processing circuit includes an operational amplifier, and the bidirectional current sampling method includes: the controller generates the bias voltage through its built-in digital-to-analog converter, and the bias voltage is connected to the closed-loop adjustment path of the operational amplifier through a resistor network, so that the amplification processing circuit outputs an offset amplified voltage signal.
[0014] Further, the zero-point reference value is subtracted from the digital voltage sampling data to obtain the bias-subtracted digital voltage, and the formula is as follows:
[0015] ADC code =Vref / Vadc (2^N-1) ADC corr =ADC code -ADC offset Among them, ADC code This represents digital voltage sampling data, where Vref represents the reference voltage of the analog-to-digital converter (ADC), Vadc represents the input voltage of the ADC, and N represents the resolution bits of the ADC. corr The ADC represents the digital voltage after bias subtraction. offset This indicates the zero-point reference value.
[0016] Furthermore, based on the relationship between the output voltage and the input differential voltage of the operational amplifier, the offset voltage signal is obtained, and its formula is as follows:
[0017]
[0018] in, This refers to the bias voltage. This indicates the bias added to the digital-to-analog converter. This indicates the contribution of the current signal channel to the output when acting alone. The offset voltage signal is represented by R, the input resistance is represented by nR, the feedback resistance is represented by n, the operational amplifier differential gain is represented by n, and GND represents the reference ground.
[0019] This application also provides a motor FOC control system, including a controller, the controller including a memory and a processor.
[0020] The memory is used to store executable program code; the processor is used to read the executable program code to run the computer program corresponding to the executable program code to execute the bidirectional current sampling method.
[0021] Furthermore, the motor FOC control system also includes a motor, a sampling resistor, an operational amplifier, and a resistor network.
[0022] The motor includes a drive current loop; the sampling resistor is connected in series in the drive current loop of the motor to generate a differential voltage signal corresponding to the phase current; the operational amplifier is connected to the sampling resistor, and the operational amplifier and the sampling resistor form a negative feedback amplifier circuit to amplify the differential voltage signal; the resistor network is connected between the output terminal of the digital-to-analog converter in the controller and the input terminal or reference terminal of the operational amplifier.
[0023] The advantages of this application lie in providing a bidirectional current sampling method and motor control system for FOC control. By introducing ADC feedback deviation to continuously calibrate the bias voltage, the generation accuracy of the bias voltage is significantly improved, thereby achieving multi-dimensional performance enhancement of bidirectional current sampling. The actual digital voltage sampling data is compared in a closed loop with the expected digital quantity corresponding to the current bias voltage. The bias voltage is continuously adjusted according to the deviation until convergence, ensuring that the bias voltage accurately matches the actual characteristics of the circuit. This fundamentally eliminates the zero-point error introduced by component tolerances, temperature drift, and operational amplifier offset in existing methods. The calibrated high-precision bias voltage is injected into the negative feedback closed-loop path of the operational amplifier through a resistor network. Working together with the differential voltage signal, it precisely raises the DC operating point of the amplified voltage signal to the target position within the input range of the analog-to-digital converter, ensuring that the bidirectional current signal is completely mapped to the voltage range that the analog-to-digital converter can sample. Finally, the zero-point reference value corresponding to the calibrated bias voltage is subtracted in the digital domain to restore the bidirectional current value that strictly corresponds to the direction and amplitude of the actual phase current. This application focuses on improving the accuracy of bias voltage, which drives the optimization of the entire link performance, including zero-point stability, ADC range utilization, and current restoration accuracy. It significantly improves the current sampling accuracy and control performance of the FOC control system, providing a high-precision and high-stability current feedback foundation for the FOC control system. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the motor FOC control system described in the embodiments of this application. Figure 1 ; Figure 2 This is a flowchart of the bidirectional current acquisition steps described in the embodiments of this application; Figure 3 This is a schematic diagram of the motor FOC control system described in the embodiments of this application. Figure 2 ; Figure 4 This is a schematic diagram of the motor FOC control system described in the embodiments of this application. Figure 3 .
[0026] Explanation of reference numerals in the attached figures: 100 operational amplifier, 200 digital-to-analog converter, 300 analog-to-digital converter. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] Most existing controllers integrate analog-to-digital converters (ADCs) with a unipolar input structure, whose input voltage range is typically limited to 0V to a reference voltage (e.g., 3.3V), making it impossible to directly sample negative current signals. Current technologies typically introduce a bias circuit before the ADC stage, generating a fixed bias voltage through resistor dividers or an external reference voltage source to boost the bipolar current signal to the range that the ADC can input.
[0029] In existing technologies, the bias voltage is determined by hardware device parameters, which is easily affected by factors such as resistor accuracy, temperature drift, and op-amp input bias current, leading to current zero-point drift and affecting FOC control accuracy. Fixed bias cannot be dynamically adjusted according to motor operating conditions, temperature changes, or device aging, making it difficult to maintain sampling accuracy over a long period. The bias circuit requires high-precision resistors and reference sources, resulting in high hardware costs and complex debugging. Online calibration cannot be achieved, and zero-point error accumulates with time and environmental changes, affecting system reliability.
[0030] To address the problem of poor bias voltage generation accuracy, which affects the bidirectional current sampling accuracy of FOC control, this application includes the following technical features.
[0031] As shown in Title 1, this application provides a motor control system, including a motor (not shown), a sampling resistor (not shown), an operational amplifier 100, a controller, and a resistor network (not shown).
[0032] The motor includes a drive current loop; the sampling resistor is connected in series in the drive current loop of the motor to generate a differential voltage signal corresponding to the phase current; the operational amplifier 100 is connected to the sampling resistor, and the operational amplifier 100 and the sampling resistor form a negative feedback amplifier circuit to amplify the differential voltage signal; the controller integrates a digital-to-analog converter (DAC) 200 and an analog-to-digital converter (ADC) 300; the resistor network is connected between the output terminal of the DAC 200 in the controller and the input terminal or reference terminal of the operational amplifier 100.
[0033] The technical advantage lies in the fact that by connecting the sampling resistor in series with the motor drive current loop, the differential voltage signal corresponding to the phase current can be accurately obtained; the operational amplifier and the sampling resistor form a negative feedback amplification circuit to accurately amplify the weak differential signal; the digital-to-analog converter integrated inside the controller is connected to the input terminal of the operational amplifier through a resistor network, so that the bias voltage enters the closed-loop adjustment path of the operational amplifier, realizing continuous calibration of the bias voltage, thereby obtaining a high-precision bias voltage. The high-precision bias voltage and the current signal work together to accurately control the DC operating point of the output voltage; finally, the analog-to-digital converter samples and subtracts the bias in the digital domain to achieve accurate restoration of the bidirectional current. This application makes full use of the internal resources of the MCU and achieves high-precision, high-stability, and dynamically calibrable bidirectional current sampling with a simple hardware structure, effectively solving the problem of low bidirectional current sampling accuracy in FOC control caused by the poor generation accuracy of the bias voltage in traditional solutions.
[0034] The controller further includes a memory and a processor. The memory is used to store executable program code. The processor is used to read the executable program code to run a computer program corresponding to the executable program code, so as to execute a bidirectional current sampling method for FOC control and realize hardware support for the bidirectional current sampling method.
[0035] To improve the accuracy of bias voltage generation and bidirectional current sampling, this application includes the following technical features.
[0036] like Figure 2As shown, this application provides a bidirectional current sampling method, which is applied in the motor FOC control system. The bidirectional current sampling method includes steps S1 to S3.
[0037] Step S1) Obtain the differential voltage signal corresponding to the three-phase phase current in the motor drive current loop, and amplify the differential voltage signal through an amplification processing circuit.
[0038] In this application, the differential voltage signal corresponding to the three-phase phase current in the motor drive current loop is obtained by means of the sampling resistor connected in series in the motor drive current loop. The voltage across the sampling resistor satisfies the following relationship.
[0039] Where Vshunt represents the differential voltage signal, Iphase represents the phase current amplitude, and Rs represents the sampling resistor value.
[0040] Since the motor phase current exhibits bidirectional flow characteristics during FOC control, the polarity of the voltage across the sampling resistor also changes with the current direction. Therefore, the generated voltage signal is essentially a bipolar differential signal.
[0041] The technical advantage lies in the fact that the sampling resistor outputs positive and negative sampling signals from its two ends, forming a pair of differential input signals to reflect the true current sampling information reflecting the magnitude and direction of the phase current. Since the resistance value of the sampling resistor is usually small (milliohms), the voltage amplitude across its ends is generally in the millivolt or even microvolt range. Therefore, directly sampling the single-ended voltage is not only difficult to accurately reflect current changes, but is also easily affected by ground potential fluctuations and power device switching noise. Based on the above reasons, this application uses a differential sampling method to obtain the voltage signal across the sampling resistor, calculates the differential voltage value through an operational amplifier, and then performs related calculations to obtain the phase current, laying a solid foundation for subsequent FOC control.
[0042] like Figure 3 As shown, based on the acquired differential voltage signal, the operational amplifier 100 amplifies the differential voltage signal to obtain an amplified voltage signal proportional to the phase current. The output voltage of the operational amplifier 100 and the input differential voltage satisfy the following relationship:
[0043] Where Vout represents the voltage signal output by operational amplifier 100, Vin represents the input voltage of operational amplifier 100, R represents the input resistance, nR represents the feedback resistance, n represents the differential gain of operational amplifier 100, and GND represents the reference ground.
[0044] The technical advantage lies in the fact that the operational amplifier amplifies the weak differential voltage signal generated by the sampling resistor, increasing the original millivolt-level signal to the volt-level range, making it effectively recognizable and processed by subsequent circuits. The output voltage of the operational amplifier satisfies the relationship Vout = nR / R×(Vin - GND) with respect to the input differential voltage. The ratio of the input resistance R to the feedback resistance nR precisely determines the amplification gain n, ensuring a strict proportional relationship between the amplified voltage signal and the phase current, thus guaranteeing the linearity and accuracy of current detection. This amplification process simultaneously converts the differential signal to a single-ended signal, providing a voltage signal that meets the input requirements for subsequent analog-to-digital converter sampling.
[0045] Step S2) By applying a bias voltage to the amplification processing circuit, the amplification processing circuit outputs an offset amplified voltage signal; wherein the bias voltage is calibrated when the control system is in the initialization state or when the motor is not rotating.
[0046] like Figure 4 As shown, the controller generates the bias voltage through its built-in digital-to-analog converter. The bias voltage is connected to the closed-loop adjustment path of the operational amplifier through a resistor network, so that the amplification processing circuit outputs an offset amplified voltage signal.
[0047] Based on the relationship between the output voltage and the input differential voltage of the operational amplifier, the offset voltage signal is obtained, and its formula is as follows:
[0048]
[0049] in, This refers to the bias voltage. This indicates the bias added to the digital-to-analog converter. This indicates the contribution of the current signal channel to the output when acting alone. This refers to the offset voltage signal.
[0050] For steps S1 to S2, specifically, a bias is first added to the differential voltage signal, and then the biased differential voltage signal is amplified by the operational amplifier to obtain the amplified voltage signal after biasing. It should be noted that there is no strict order between steps S1 and S2. For example, steps S1 and S2 can occur sequentially, or steps S2 and S1 can occur sequentially, or even steps S1 and S2 can occur simultaneously. The bias voltage can be output only during sampling, or it can be continuously output both during sampling and without sampling. Its output strategy is determined in conjunction with the expected motor current sampling requirements and the rules for selecting effective sampled values.
[0051] like Figure 4 As shown, the differential voltage signal is connected to the inverting input terminal of the operational amplifier 100 via the input resistor R, and the bias voltage is... It is connected to the same node as the differential voltage signal. Bias voltage The differential voltage signal is superimposed at the op-amp input, and the resulting total signal is amplified by the op-amp, ultimately producing the offset amplified voltage signal Vout at the output. This mechanism ensures that amplification and offset are performed synchronously, avoiding errors caused by cascading processing.
[0052] The technical effect lies in achieving precise superposition of the bias voltage and differential voltage signal within the same closed loop by injecting a calibrated high-precision bias voltage into the negative feedback closed-loop adjustment path of the operational amplifier through a resistor network. This shifts the DC operating point of the amplified voltage signal to a preset position while maintaining the dynamic response characteristics of the current signal unaffected. Specifically, based on the superposition principle, the output voltage Vout satisfies Vout = nVin + nV DAC The relationship between nV DAC =nR / R×(V DAC - GND indicates that the bias contribution and the current signal contribution are linearly superimposed and do not interfere with each other, and the bias gain is precisely determined by the ratio of the feedback resistor to the input resistor. This mechanism effectively converts the generated high-precision bias voltage into a DC offset of the output voltage, making the output voltage in the zero-current state accurately stable at the preset position within the ADC range; it allows the bias voltage and the current signal to work together in the same closed loop, ensuring that the amplification gain and linearity of the current signal are not affected by bias injection; it provides an offset voltage signal that is always within the effective input range of the analog-to-digital converter for subsequent voltage sampling, enabling the bidirectional current to be fully acquired by the analog-to-digital converter, fundamentally solving the problems of negative current cutoff or positive current saturation in traditional solutions.
[0053] In this application, by detecting the operating state of the motor, it can be determined whether the phase current of the motor is zero. For example, if the motor is rotating, the phase current will certainly not be zero, and effective calibration cannot be performed; if the motor is not rotating and no drive command is issued, the phase current is presumed to be zero.
[0054] Based on this, in one feasible embodiment, when the control system is powered on but not performing any work, the system is in an initial state and the phase current is zero. At this time, starting calibration can establish an accurate bias reference for subsequent operation.
[0055] In one feasible embodiment, during system operation, when the motor is detected to be stationary (i.e., the phase current is zero), calibration can also be triggered to compensate for zero-point drift caused by temperature changes or device aging in real time.
[0056] The above-mentioned calibration timing is based on the premise that the phase current is zero, to ensure that the adjustment of the bias voltage is not affected by the current signal, thereby obtaining accurate bias voltage and zero-point reference value, laying the foundation for the accuracy of the entire current sampling link.
[0057] The technical effect lies in the fact that by precisely calibrating the bias voltage at the calibration time (control system initialization or motor zero-current state), the bias voltage can accurately match the actual characteristics of the circuit, thereby significantly improving the accuracy and stability of the operating point offset of the amplified voltage signal. Specifically, calibration is performed when the system is powered on but not in operation, ensuring that an accurate bias reference is established at the beginning of system startup, eliminating zero-point errors caused by initial tolerances of components; calibration is performed when the motor is in a zero-current state, avoiding phase current interference, so that the adjustment of the bias voltage purely reflects the characteristics of the circuit itself; after the calibrated high-precision bias voltage is applied to the amplification processing circuit, the DC operating point of the amplified voltage signal is precisely raised to the preset target position, providing an offset voltage signal that is always within the effective input range for subsequent analog-to-digital converter sampling, ensuring that the bidirectional current signal can be completely and linearly mapped to the digital domain, fundamentally solving the problems of zero-point drift and current sampling distortion caused by insufficient bias voltage accuracy, and laying a solid foundation for high-precision current loop control of the FOC control system.
[0058] The bias voltage calibration process includes: acquiring digital voltage sampling data when the phase current of the motor is zero, and comparing it with the expected digital value of the current bias voltage. If the deviation between the two exceeds a preset range, the bias voltage is adjusted to update the digital voltage sampling data, thereby updating the deviation, until the deviation is within the preset range. When the deviation is within the preset range, the adjusted bias voltage is used as the calibrated bias voltage, and the updated digital voltage sampling data is used as the zero-point reference value. The expected digital value is a theoretical digital value obtained based on the current sampling circuit, and the zero-point reference value is used to perform bias restoration on the digital voltage sampling data.
[0059] The technical advantage lies in the fact that the bias voltage calibration process, by introducing a closed-loop feedback mechanism based on the expected digital quantity, achieves high-precision self-calibration of the bias voltage, fundamentally solving the zero-point drift problem caused by device tolerances, temperature drift, and operational amplifier offset in traditional open-loop bias schemes. Specifically, during the calibration process, the actual digital voltage sampling data is compared in real time with the theoretical expected digital quantity calculated based on the current bias voltage, the gain of the amplification processing circuit, and the analog-to-digital converter conversion relationship. The bias voltage is continuously adjusted according to the deviation between the two until the actual sampling value converges to the theoretical expected value. This mechanism makes the determination of the bias voltage no longer dependent on the absolute accuracy of the analog device parameters, but achieves active compensation for the non-ideal characteristics of the circuit through digital closed-loop control. The bias voltage obtained after calibration accurately matches the actual operating point of the circuit, and the recorded zero-point reference value accurately reflects the digital output under zero current conditions, providing a reliable benchmark for bias subtraction during subsequent normal operation. The entire calibration process is performed under the condition of zero phase current, ensuring that the adjustment is not interfered with by current signals, thereby significantly improving the generation accuracy of the bias voltage and laying a solid foundation for high-precision current sampling of the FOC control system.
[0060] The bias voltage calibration process includes: when the phase current of the motor is zero, using the current bias voltage as the initial value of the bias voltage to determine whether the deviation exceeds the preset range; when adjusting the bias voltage, the bias voltage is still within the middle preset range of the sampling signal range after being amplified by the amplification processing circuit.
[0061] In this application, the analog-to-digital converter (ADC) has a certain sampling signal range based on its parameters and structure. In this embodiment, the optimal adjustment range of the bias voltage can be calculated by using a preset intermediate range of the sampling signal range. This allows the bias voltage to find a voltage value that meets the deviation condition within the optimal adjustment range, thereby making full use of the sampling signal range during the sampling process and reducing the risk of the sampled and amplified signal exceeding the sampling signal range. The preset intermediate range is a certain range above and below the midpoint of the sampling signal range, preferably a range of 5% to 25%. For example, if the sampling signal range of the ADC is 0-10V, with a midpoint of 5V, the preset intermediate range can be set to 4-6V when the range fluctuates by 10%.
[0062] The technical effect lies in achieving high-precision adaptive calibration of the bias voltage and optimized matching of the signal dynamic range by using the current bias voltage as the initial value for closed-loop adjustment and ensuring that the adjusted bias voltage keeps the offset signal near the middle value of the analog-to-digital converter input range. Specifically, using the current bias voltage as the initial value for deviation judgment allows the calibration process to start based on the actual circuit state, avoiding initial errors caused by the mismatch between the preset ideal value and the actual circuit characteristics; by continuously adjusting the bias voltage to make the actual sampled value approach the expected digital value, dynamic compensation is achieved for non-ideal factors such as device tolerance, temperature drift, and operational amplifier offset; at the same time, during the calibration process, it is ensured that the offset signal, after amplification, always remains within the preset range in the middle of the sampling range, reserving symmetrical swing space for the positive and negative changes of the bidirectional current signal and avoiding signal saturation or truncation due to improper bias. This mechanism ensures that the calibrated bias voltage accurately matches the circuit characteristics and guarantees that the signal is fully mapped to the effective range of the ADC, thereby significantly improving the accuracy, linearity, and long-term stability of bidirectional current sampling in the FOC control system.
[0063] Step S3) Sample the amplified voltage signal after offset to obtain digital voltage sampling data. Perform bias restoration and conversion on the digital voltage sampling data to obtain the corresponding bidirectional current value.
[0064] Specifically, the sampling resistor is connected to the input terminal of the amplification processing circuit, the input terminal of the analog-to-digital converter 300 is connected to the output terminal of the amplification processing circuit, the output terminal of the analog-to-digital converter 300 is electrically connected to the controller, and the controller is electrically connected to the amplification processing circuit. The zero-point reference value is subtracted from the digital voltage sampling data to obtain the bias-subtracted digital voltage. The subtracted digital voltage is then converted by combining the sampling resistor parameters, the closed-loop gain of the amplification processing circuit, and the conversion relationship of the analog-to-digital converter 300 to obtain the bidirectional current value corresponding to the actual phase current direction and amplitude.
[0065] The zero-point reference value is subtracted from the digital voltage sampling data to obtain the bias-subtracted digital voltage value, and the formula is as follows: ADC code =Vref / Vadc (2^N-1) ADC corr =ADC code -ADC offset Among them, ADC code This represents digital voltage sampling data, where Vref represents the reference voltage of the analog-to-digital converter (ADC), Vadc represents the input voltage of the ADC, and N represents the resolution bits of the ADC. corr The ADC represents the digital voltage after bias subtraction.offset This indicates the zero-point reference value.
[0066] In this application, the process of converting the digital voltage quantity using sampling resistor parameters, closed-loop gain, and the conversion relationship of the analog-to-digital converter is as follows: First, the digital quantity is converted by the ADC... corr Normalized to a scale value relative to full scale ADC corr Multiplying this by (2^N-1) and then by the reference voltage Vref of the analog-to-digital converter (ADC) to restore the corresponding analog voltage value, and finally dividing by the amplification gain G and the sampling resistor Rs, yields the actual phase current value. Since the ADC... corr After deducting the bias, its positive and negative values directly correspond to the current direction (positive values represent forward current, and negative values represent reverse current), and the absolute value corresponds to the current amplitude, thus realizing the complete reconstruction of bidirectional current information.
[0067] Its technical advantage lies in the fact that by performing bias subtraction operations in the digital domain, the zero-point reference value is accurately subtracted from the sampled data of the analog-to-digital converter, eliminating the influence of static bias introduced in the analog link on current sensing, thus improving the accuracy of the subtracted digital ADC signal. corr A strict linear proportional relationship is restored between the actual phase current and the bias subtraction process; this bias subtraction process realizes a complete closed loop of analog domain bias construction and digital domain bias restoration, ensuring that the current data fed into the FOC control algorithm truly reflects the magnitude and direction of the motor phase current; by using the ADC corr Converted into bidirectional current values, this completes the entire conversion link from analog signal acquisition to digital current information, enabling the accurate reconstruction of bidirectional currents that could not be directly sampled by analog-to-digital converters (ADCs), thus providing accurate and reliable current feedback information for high-precision field-oriented control.
[0068] The advantages of this application lie in providing a bidirectional current sampling method and motor control system for FOC control. By introducing ADC feedback deviation to continuously calibrate the bias voltage, the generation accuracy of the bias voltage is significantly improved, thereby achieving multi-dimensional performance enhancement of bidirectional current sampling. The actual digital voltage sampling data is compared in a closed loop with the expected digital quantity corresponding to the current bias voltage. The bias voltage is continuously adjusted according to the deviation until convergence, ensuring that the bias voltage accurately matches the actual characteristics of the circuit. This fundamentally eliminates the zero-point error introduced by component tolerances, temperature drift, and operational amplifier offset in existing methods. The calibrated high-precision bias voltage is injected into the negative feedback closed-loop path of the operational amplifier through a resistor network. Working together with the differential voltage signal, it precisely raises the DC operating point of the amplified voltage signal to the target position within the input range of the analog-to-digital converter, ensuring that the bidirectional current signal is completely mapped to the voltage range that the analog-to-digital converter can sample. Finally, the zero-point reference value corresponding to the calibrated bias voltage is subtracted in the digital domain to restore the bidirectional current value that strictly corresponds to the direction and amplitude of the actual phase current. This application focuses on improving the accuracy of bias voltage, which drives the optimization of the entire link performance, including zero-point stability, ADC range utilization, and current restoration accuracy. It significantly improves the current sampling accuracy and control performance of the FOC control system, providing a high-precision and high-stability current feedback foundation for the FOC control system.
[0069] The above provides a detailed description of the bidirectional current sampling method and motor FOC control system provided by this application. Specific examples have been used to illustrate the principle and implementation of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A bidirectional current sampling method, characterized in that, When applied to a motor FOC control system, the bidirectional current sampling method includes the following steps: The differential voltage signal corresponding to the three-phase phase current in the motor drive current loop is obtained, and the differential voltage signal is amplified by an amplification processing circuit. A bias voltage applied to the amplification circuit causes the amplification circuit to output an offset amplified voltage signal; wherein the bias voltage is calibrated during the initialization state of the control system or when the motor is not rotating. The amplified voltage signal after offset is sampled to obtain digital voltage sampling data. The digital voltage sampling data is then offset-restored and converted to obtain the corresponding bidirectional current value.
2. The bidirectional current sampling method as described in claim 1, characterized in that, The bias voltage during the calibration process includes: When the phase current of the motor is zero, digital voltage sampling data is acquired and compared with the expected digital value of the current bias voltage. If the deviation between the two exceeds a preset range, the bias voltage is adjusted to update the digital voltage sampling data, thereby updating the deviation, until the deviation is within the preset range. When the deviation is within the preset range, the adjusted bias voltage is used as the calibrated bias voltage, and the updated digital voltage sampling data is used as the zero-point reference value. The expected digital quantity is a theoretical digital value obtained based on the current sampling circuit, and the zero-point reference value is used to perform bias restoration on the digital voltage sampling data.
3. The bidirectional current sampling method as described in claim 2, characterized in that, The motor FOC control system includes a sampling resistor, an analog-to-digital converter, and a controller. The sampling resistor is connected to the input terminal of the amplification processing circuit, the input terminal of the analog-to-digital converter is connected to the output terminal of the amplification processing circuit, the output terminal of the analog-to-digital converter is electrically connected to the controller, and the controller is electrically connected to the amplification processing circuit. The bias restoration and conversion of digital voltage sampling data includes: The zero-point reference value is subtracted from the digital voltage sampling data to obtain the bias-subtracted digital voltage. The subtracted digital voltage is then converted by combining the sampling resistor parameters, the closed-loop gain of the amplification processing circuit, and the conversion relationship of the analog-to-digital converter to obtain the bidirectional current value corresponding to the actual phase current direction and amplitude.
4. The bidirectional current sampling method as described in claim 1, characterized in that, By detecting the operating status of the motor, it can be determined whether the phase current of the motor is zero.
5. The bidirectional current sampling method as described in claim 2, characterized in that, The bias voltage during the calibration process includes: When the phase current of the motor is zero, the current bias voltage is used as the initial value of the bias voltage to determine whether the deviation exceeds the preset range. When adjusting the bias voltage, the bias voltage, after being amplified by the amplification processing circuit, is still within the middle preset range of the sampling signal range.
6. The bidirectional current sampling method as described in claim 3, characterized in that, The amplification processing circuit includes an operational amplifier, and the bidirectional current sampling method includes: The controller generates the bias voltage through its built-in digital-to-analog converter. The bias voltage is connected to the closed-loop adjustment path of the operational amplifier through a resistor network, so that the amplification processing circuit outputs the offset amplified voltage signal.
7. The bidirectional current sampling method as described in claim 3, characterized in that, The zero-point reference value is subtracted from the digital voltage sampling data to obtain the bias-subtracted digital voltage value, and the formula is as follows: ADC code =Vref / Vadc (2^N-1) ADC corr =ADC code -ADC offset Among them, ADC code This represents digital voltage sampling data, where Vref represents the reference voltage of the analog-to-digital converter (ADC), Vadc represents the input voltage of the ADC, and N represents the resolution bits of the ADC. corr The ADC represents the digital voltage after bias subtraction. offset This indicates the zero-point reference value.
8. The bidirectional current sampling method as described in claim 6, characterized in that, Based on the relationship between the output voltage and the input differential voltage of the operational amplifier, the offset voltage signal is obtained, and its formula is as follows: in, This refers to the bias voltage. This indicates the bias added to the digital-to-analog converter. This indicates the contribution of the current signal channel to the output when acting alone. The offset voltage signal is represented by R, the input resistance is represented by nR, the feedback resistance is represented by n, the operational amplifier differential gain is represented by n, and GND represents the reference ground.
9. A motor FOC control system, comprising a controller, characterized in that, The controller includes: Memory, used to store executable program code; and The processor reads the executable program code to run the computer program corresponding to the executable program code, in order to execute the bidirectional current sampling method according to any one of claims 1 to 8.
10. The motor FOC control system as described in claim 9, characterized in that, Also includes An electric motor, which includes a drive current circuit; A sampling resistor is connected in series in the drive current circuit of the motor to generate a differential voltage signal corresponding to the phase current. An operational amplifier is connected to the sampling resistor, and the operational amplifier and the sampling resistor form a negative feedback amplifier circuit for amplifying the differential voltage signal; and A resistor network is connected between the controller and the operational amplifier.