Motor control circuit
By introducing a transfer function into the motor control circuit for phase error compensation, the phase delay problem of torque pulsation harmonics under different bandwidths and speeds is solved, and effective torque pulsation cancellation under different conditions is achieved, which improves the motor driving performance.
Patent Information
- Application Number
- CN202410925133.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-12
- Filing Date
- 2024-07-11
- Publication Date
- 2025-01-14
AI Technical Summary
Existing motor control circuits cannot effectively offset torque pulsation harmonics at different bandwidths and speeds, resulting in phase delay and phase errors, affecting the driving performance of the motor, especially at low speeds, the pulsation effect is not good.
The motor control circuit including a motor demand signal generator, torque pulsation compensation stage, phase error compensation stage and PI controller is adopted to compensate phase errors through transfer functions to ensure that the phase error of the torque pulsation signal is eliminated at different bandwidths and speeds. And automatically corrects by storing appropriate proportional coefficients through memory.
Tuning under the bandwidth of standard motor control circuits ensures that the phase error of the torque pulsation compensation signal is eliminated, and can operate at different bandwidths and speeds without affecting the performance of the current demand signal, achieving wider application adaptability.
Smart Images

Figure CN119315877A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a motor control circuit for pulse width modulation drive of a permanent magnet motor. Background Art
[0002] It is well known in the field of motor control circuits for permanent magnet motors that at a certain speed and operating point (current demand), a certain torque pulsation will be generated in the motor due to reasons such as cogging, current measurement noise and bridge inverter nonlinearity. This is particularly noticeable in automotive power steering systems at low motor speeds, as the driver will feel the pulsation at the steering wheel. To improve this, it is known to include a torque pulsation cancellation stage in the motor control circuit, sometimes called a low speed compensation stage (LSCS), because in some applications it may only work at low speeds. This stage generates an appropriate torque pulsation cancellation waveform. Depending on the current demand, the correct coefficients are selected as the sine amplitude and cosine amplitude of the waveform. The waveform frequency will depend on the motor speed, because it is known that the pulsation frequency is a harmonic of the motor speed. The induced sine waveform and cosine waveform are added together, which produces a torque pulsation cancellation waveform and the torque pulsation cancellation waveform is added (or subtracted) from the motor control waveform to produce a total motor demand signal. The effect is to reduce the pulsation of a specific order or multiple orders of the harmonics that are tuned. Each order requires a separate component in the compensation waveform.
[0003] Tuning of the current demand ripple compensation can be accomplished by taking three measurements at each operating point (current demand) at a certain amplitude (for scaling). These measurements are used to calculate the optimum cancellation amplitude and phase of the torque ripple cancellation waveform. The tuning is typically generated during the design of the motor control circuit by a software tool that performs the calculations. These coefficients are then saved in the memory of the motor control circuit for use during operation of the motor control circuit.
[0004] Tuning works most effectively at the speed and bandwidth required for the tuning. Various requirements are measured, but usually only one speed, such as 25rpm, and one bandwidth, such as 100Hz, in part because of the large number of measurements required. Therefore, tuning is only partially effective when different bandwidths are used for motor control.
[0005] Consider an example where the LSCS operates between 0–220rpm, which means there is a range of LSCS compensation signal frequencies in the system, depending on the order being compensated. For example, for the third electrical order in a motor with 3 pole pairs at 100rpm: f = 100 / 60*3*3 = 15Hz LSCS signal frequency. This frequency will vary with speed.
[0006] Depending on the bandwidth chosen for the motor current control circuit, the presence of the LSCS compensation signal can have a significant effect on the phase delay in the system. Phase delay means that the cancellation waveform is not exactly out of phase with the harmonic that needs to be cancelled. This can be seen from the Figure 1 and Figure 2 This can be seen in the figure, where the bottom plot represents the phase delay vs. frequency. The higher the frequency of the signal, the greater the delay. Additionally, the effect is stronger when the bandwidth of the controller is lower, most commonly because the motor current controller operates more slowly or due to delays introduced by the current measurement circuitry.
[0007] During the tuning process, any phase delay due to bandwidth is automatically taken into account in the tuning. However, if the motor is tuned at 100Hz, 25rpm and is operating at 220rpm, for the sixth electrical pulsation order, the difference in signal phase between 25rpm and 220rpm is, for example, ~60 degrees. The higher the order, the greater the difference. Therefore, the compensation signal may not be the most effective at this speed. Figure 2 In the specific case shown, the compensation completely fails at a delay of 60 degrees. For higher delays, the pulsation will now intensify further, up to 180 degrees.
[0008] Applicants have recognised that it is desirable to further reduce the presence of torque pulsation harmonics beyond that achievable using prior art LSCS as described above, particularly at low speeds. The present invention seeks to improve the effect of a cancellation signal on the pulsations felt at the vehicle steering wheel. Summary of the invention
[0009] According to a first aspect, the present invention provides a motor control circuit for a permanent magnet motor, the control circuit comprising:
[0010] a motor demand signal generator that outputs an intermediate motor current demand signal iDQ* that is dependent on the requested current demand and the electrical position of the motor;
[0011] a torque ripple compensation stage that outputs a torque ripple compensation waveform that includes a frequency having an amplitude that at least matches a harmonic frequency of torque ripple that would be generated by the motor when the motor is driven in response to the intermediate signal, the torque ripple compensation waveform being in anti-phase with the torque ripple at a set frequency and control circuit bandwidth at which the torque ripple compensation stage is tuned; and
[0012] a phase error compensation stage that receives the torque ripple compensation waveform as an input and outputs a modified torque ripple compensation waveform, wherein any undesirable phase delay or phase advance of the torque ripple compensation signal has been substantially eliminated when the motor control bandwidth and frequency are different from the motor control bandwidth and frequency used in tuning of the torque ripple compensation stage, so that the modified waveform is in anti-phase with the torque ripple,
[0013] and the motor control circuit combines the intermediate current demand signal iDQ* with the modified torque ripple compensation waveform to generate a compensated current demand signal, and
[0014] A PI controller receives an input signal and an output signal that depends on the value of the compensated current demand signal.
[0015] By implementing the present invention, a set of motor control circuits can be tuned at a standard motor current control circuit bandwidth and speed (e.g., 500 Hz and 25 rpm or even lower speeds), wherein the lead compensator circuit ensures that any phase error in the torque ripple compensation signal is eliminated when the circuit is used at a bandwidth different from the tuned bandwidth. In addition, the user can switch to any bandwidth and operate over the full speed range of the torque ripple compensation stage without having to worry about degradation in the current demand signal performance, as this will be automatically corrected by the motor control circuit.
[0016] The phase error compensation stage may apply phase compensation to the torque ripple compensation signal based on a transfer function having at least one proportionality coefficient, the value of the constant or each constant being stored in an electronic memory of the control circuit, and one or more appropriate proportionality coefficients being selected based on the motor speed, bandwidth and frequency. The bandwidth here refers to the bandwidth of the motor current closed loop circuit including the motor and the PI controller.
[0017] The stored information may include a multi-dimensional map of one or more scaling coefficients used by the transfer function.
[0018] The motor control circuit may be configured such that the output of the torque ripple compensation stage is input to a transfer function, and the output of the transfer function is combined with the intermediate torque demand signal.
[0019] The transfer function can have the following form:
[0020]
[0021] in:
[0022] X is the input of the function;
[0023] Y is the output of the function;
[0024] C(s) is the output of the transfer function defining the modified torque ripple compensation waveform;
[0025] s is the complex Laplace transform variable;
[0026] ω0 is the filter zero crossover frequency;
[0027] Ts is the time constant;
[0028] as well as
[0029] α is the scaling factor stored in memory.
[0030] In this transfer function, ω0 moves with the operating point, so ω0=ω.
[0031] Gains:
[0032] This gain can be set by appropriately selecting the value of the coefficient "α" so as to compensate for any gain loss resulting from applying the transfer function to the torque ripple compensation waveform.
[0033] The transfer function also imposes the following phase shift on the input signal:
[0034] Phase:
[0035]
[0036] The required value of "α" can be determined from the gain and phase formulas depending on the phase shift required.
[0037] Those skilled in the art will appreciate that the phase error compensation stage may use a different transform, which may have two or more scaling factors.
[0038] The system may comprise a memory in which the transfer function is stored and in which the or each proportionality factor is stored, optionally as a map as suggested above.The memory may be the same memory in which the parameters used by the torque ripple compensation stage set during the tuning process are stored.
[0039] The phase error compensation stage may include two functional modules. The first module determines the value for the one or more proportional coefficients based on the bandwidth and the motor rotor speed. Thus, the function of this module may be considered as a prediction of the phase error. The second module receives the torque ripple compensation waveform at the input and modifies the torque ripple compensation waveform using a transfer function to eliminate the predicted phase error.
[0040] In the alternative, the torque ripple compensation stage and the phase error compensation stage may be combined such that a corrected torque ripple compensation waveform is derived directly from the requested current demand, motor speed, bandwidth and frequency without first generating an uncorrected torque demand signal.
[0041] The motor control circuit may form part of a motor circuit according to the second aspect of the invention, the motor circuit comprising a permanent magnet motor, a motor drive circuit for applying a voltage waveform to each phase of the motor, and a motor control circuit as defined by the first aspect of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] One embodiment of the present invention will now be described, by way of example only, with reference to and as shown in the accompanying drawings, in which:
[0043] Figure 1 is a diagram of a single torque ripple harmonic and a torque compensation signal waveform that is completely anti-phase with the resulting ripple-eliminated torque generated by the motor;
[0044] Figure 2 is with Figure 1 Same waveform as above, but with torque ripple compensation waveform Figure 1 The ideal anti-phase waveforms have a phase difference of 60 degrees, showing how the pulsation is not eliminated from the motor torque in this case;
[0045] Figure 3 is a schematic diagram of an electric power steering system including an embodiment of a motor control circuit according to the first aspect of the present invention;
[0046] Figure 4 is a detailed schematic diagram of the motor circuit portion of the electric power steering system, showing the various signals present within the circuit;
[0047] Figure 5 is a Bode plot of the output of the phase error compensation stage with the transfer function set up to apply a phase shift from -40 degrees to +40 degrees at a frequency of 80 Hz for different values of "α" in the transfer function;
[0048] Figure 6 is corresponding to Figure 5 Bode plot showing the amplitude of the output of the phase error compensation stage when the value of "α" is chosen so that the frequency varies while maintaining a constant 45 degree phase shift;
[0049] Figure 7 is corresponding to Figure 5 A Bode plot showing the amplitude of the output of the phase error compensation stage when the scaling factor "α" is selected so that the frequency is fixed but the phase shift varies;
[0050] Figure 8is a schematic diagram showing in detail the functional modules within the motor control circuit, which generate a corrected torque ripple compensation waveform that is completely anti-phase with the torque ripple;
[0051] Fig. 9 is a circuit diagram of a suitable bridge inverter and motor phase windings, which can be found in Figure 3 used in electric power steering systems; and
[0052] Fig.10 The structure is shown in more detail Figure 3 Module for the motor control circuit of the electric power steering system. DETAILED DESCRIPTION
[0053] Figure 3 is a schematic diagram of a key portion of an electric steering system for a vehicle, which includes an embodiment of a motor control circuit according to the present invention. The electric steering system includes a three-phase brushless motor 1, which is connected to a steering wheel through a gearbox. When in use, the motor 1 applies a motor torque that either assists the driver in turning the steering wheel or hinders the driver from turning the steering wheel. The former mode is typically used in situations where there is a direct mechanical connection from the steering wheel of the vehicle to the wheels and makes steering lighter. The latter mode is typically used in situations where the steering wheel has no mechanical connection to the wheels, and this setting is usually called a wire control system.
[0054] The electric power steering system includes a torque sensor 26 which measures the torque in the steering column and feeds this torque into a torque controller 28. The torque controller calculates Figure 4 The requested torque demand signal T* is shown, which indicates the motor torque to be generated by the motor. The torque demand signal is fed into the current controller 21, which converts the torque demand into the requested current demand based on the known characteristics of the motor 1, and feeds the current demand into the PI controller. The control circuit 21 causes current to flow in the motor 1, so that the motor works to provide the required torque. Therefore, Figure 3 The system in the example has two closed loops, namely a torque controller loop and a current control circuit loop.
[0055] like Figure 4As shown, the motor control circuit 21 obtains the measured values of the required torque T* and the motor rotor position w, and generates the requested current demand iDQ* signal in the fixed dq coordinate system. This signal is then fed to the subtractor module of the motor current circuit 21 together with the measured value of the actual current iDQ flowing in the motor, which is represented in the dq coordinate system and derived from the output of the current sensor 24. The output of the subtractor is an error signal eDQ, which represents the difference between the requested current demand iDQ* and the actual measured dq current iDQ.
[0056] The error signal eDQ is fed to the input of a proportional integral (PI) controller stage, which converts the current error signal eDQ in the dq coordinate system into a voltage signal in the dq coordinate system, and then the voltage signal is converted into a three-phase voltage UVW by a dq-UVW converter. The three-phase voltage is then converted into the PWM voltage signal required for each phase by a PWM converter using the selected SVM modulation technique. The motor control circuit continuously attempts to push the value of the error signal eDQ to zero, which ensures that the current in the motor phase matches the demand current.
[0057] The signal takes time to propagate in the closed loop formed by the motor control circuit 21, the motor 1 and the current measurement path, which determines the bandwidth, referred to herein as the motor current control circuit bandwidth. Note that in most embodiments there will be a second closed loop at the torque demand level, which will have its own independent bandwidth.
[0058] exist Figure 3 and Figure 4 The motor 1 in the example of FIG. 1 includes three motor windings, usually designated as phase A, phase B and phase C. This can be Fig. 9 The phases can be connected in a star network, or they can be connected in another arrangement, such as a delta topology. One end of each coil is connected to a respective terminal. The other ends of the coils are connected together to form a star center 7. The free ends are connected to the motor drive circuit, which includes a set of high power switches arranged as a bridge inverter 8.
[0059] Fig. 9 The Figure 3 and Figure 4 An example bridge inverter 8 for an electric power steering system of FIG. The bridge inverter comprises three bridge arms 8, one for each phase of the motor. Each arm 10, 12, 14 of the bridge comprises a pair of switches in the form of a top transistor 16 and a bottom transistor 18 connected in series between a supply rail 20 and a ground line 22. The motor windings 2, 4, 6 are each drawn between respective complementary transistor pairs 16, 18.
[0060] In response to the Figure 3 The transistors 16, 18 are controllably turned on and off according to the signal output by the motor control circuit 21 to provide pulse width modulation of the potential applied to each phase winding, thereby controlling the potential difference applied across each winding 2, 4, 6, and therefore also controlling the current flowing through the winding. This in turn controls the strength and direction of the magnetic field generated by the winding, thereby setting the torque generated by the motor.
[0061] A current sensor 24 is provided in the ground line 22 between the motor 1 and the ground, so that the controller 21 can measure the total current flowing through all windings 2, 4, 6. In order to measure the current in each winding, the total current must be sampled at a precise moment during the PWM period, where the voltage applied to each terminal of the winding (and therefore the conduction state of a particular phase) is known. Preferably, a separate current sensor may be provided for each phase.
[0062] The controller in this example uses a space vector modulation (SVM) algorithm, although any modulation technique may be used equally within the scope of the invention and this should not be construed as limiting.
[0063] Each winding 2, 4, 6 in a three-phase system can only be connected to the supply rail 20 or the ground 22, and therefore the switches of the control circuit have eight possible states. Using 1 to represent one of the phases at a positive voltage and 0 to represent a grounded phase,
[100] can represent state 1 and indicate that phase A is 1, phase B is 0 and phase C is 0,
[110] represents state 2,
[010] represents state 3,
[011] represents state 4,
[001] represents state 5,
[101] represents state 6,
[000] represents state 0 and
[111] represents state 7. Each of states 1 to 6 is a conductive state in which current flows through all windings 2, 4, 6, in one direction through one of the windings and in the other direction through the other two windings. State 0 is a zero volt state with all windings grounded, and state 7 is a zero volt state with all windings connected to the supply rails.
[0064] During normal operation, when the bridge inverter switching circuit is being controlled by the motor control circuit 21 to produce pulse width modulation, each of phases 2, 4, 6 will typically be switched on and off once per PWM period. The relative length of time spent in each state will determine the magnitude and direction of the magnetic field generated in each winding, and therefore the magnitude and direction of the total torque applied to the rotor.
[0065] In practice, the motor 1 will generate a torque that varies periodically from the requested torque requirement as it rotates, due to a phenomenon known as cogging torque. This variation appears as a harmonic component superimposed on the desired motor torque and this will vary with motor speed. The phenomenon is well known and is caused by the interaction between the rotor permanent magnets and the stator teeth.
[0066] In order to reduce the effects of cogging torque, it is known to add an additional torque ripple compensation waveform having the same frequency as the torque ripple harmonics, but in anti-phase with the torque ripple, to the motor current demand signal iDQ* generated by the motor control circuit 21. The motor control circuit generates the current demand signal in the usual way, but this current demand signal is combined with the torque ripple compensation waveform as a modified iDQ* signal before being transmitted to the motor drive stage.
[0067] like Fig.10 As shown, the motor control circuit includes a torque ripple compensation stage 30. In this example, this stage only works when the motor speed is low, and is therefore generally referred to as a low speed compensation stage (LSCS). Based on the requested motor current demand iDQ*, the torque ripple compensation stage selects two coefficients as the sine amplitude and cosine amplitude of the compensation waveform. The waveform frequency will depend on the motor speed. The generated sine waveform and cosine waveform are added together, which produces a torque ripple cancellation waveform in the DQ domain and reduces the ripple of the specific order for which it is tuned. Each order requires a separate coefficient mapping. The torque ripple cancellation stage can be tuned to eliminate a single harmonic or several different harmonics. This signal is the output of the LSCS.
[0068] Before the motor control circuit is used with the motor, the torque ripple compensation stage 30 is tuned, usually during the design and development phase of the project. For each operating point (requested current demand), three measurements are taken at a certain amplitude (for scaling). These measurements are used to calculate the required compensation amplitude and phase of the waveform and are used to set the values stored as a map. The tuning is generated by an internal tool that performs the calculations.
[0069] Applicants have realised that tuning provides effective compensation only when the motor circuit operates within a tuned bandwidth. Outside this tuned bandwidth, the cancellation is ineffective due to phase offsets which means that the compensation signal is not completely anti-phase with the torque ripple.
[0070] To ameliorate this effect, the motor control circuit further includes a phase error compensation stage 32 which applies a transfer function to the output of the LCSC to produce a modified torque ripple compensation stage. Figure 8 It is schematically shown how this stage and the preceding torque ripple compensation stage may be implemented within the motor current control circuit 21 .
[0071] exist Figure 8 In the first block, a LSCS stage 30 is shown, which receives the measured values of the demand current iDQ* and the electrical position of the motor. From this, a transfer function is applied according to the tuning of the LSCS. This transfer function is then fed to the input of a phase error compensation stage 32, which applies another transfer function 36 that changes the phase and amplitude of the signal. The parameters of this transfer function are received from a phase lag prediction circuit 34, the function of which is to feed the parameters of the transfer function to the compensation stage. These parameters can be selected from a mapping or lookup table stored in a memory 38. The selection is made according to the actual control circuit bandwidth and frequency.
[0072] The phase correction signal output from the phase error compensation stage is then combined with the current demand signal iDQ* generated by the motor control stage and the measured value of the actual current iDQ using an addition or subtraction module to provide a compensated current demand signal. This compensated current demand signal is then combined with the measured current signal iDQ to form an error signal eDQ, which is fed to the PI controller. Figure 8 and Fig.10 As shown, this means that compensation is applied to iDQ* before the measured iDQ signal is subtracted to form the error signal eDQ, but compensation can also be applied to the result of this subtraction. It should be noted that this subtraction is not shown in the figure. Figure 4 Shown in.
[0073] The transfer function used in the phase error compensation stage of this example has the form of a lead-lag compensator having the following form:
[0074]
[0075] Among them, ω0 is the input frequency and α is the proportional coefficient.
[0076] Gain and Phase Continuous Time
[0077] In this implementation, ω0 moves with the operating point, so ω 0= ω.
[0078] Gains:
[0079] (This is necessary to compensate for the loss of LSCS signal gain caused by the current controller)
[0080] Phase:
[0081]
[0082] Thus, "α" can be determined according to the required phase shift.
[0083] Figure 5 A lead compensator Bode plot is shown with a phase shift from -40 degrees to +40 degrees at a frequency of 80 Hz for different values of "α" in the transfer function.
[0084] Figure 1 Bode plot of the lead compensator with phase shift at 80 Hz using different “α” parameters.
[0085]
[0086] (In Matlab @ , converted to radians)
[0087] Since the implementation uses
[0088] The characteristics of the transfer function can also be considered in discrete time. Discretizing the system using the "Tustin" transformation method yields:
[0089]
[0090] Algorithm Implementation
[0091]
[0092] Gain and Phase Discrete Time
[0093] Gains:
[0094]
[0095] Phase: To avoid complex mathematical transformations, the phase remains the same as the continuous-time phase:
[0096]
[0097] When ω varies with the operating frequency of the compensated LSCS harmonic order, the system is always at the same operating point of the Bode plot, that is, the same gain and phase, such as Figure 6 However, if a different phase shift is chosen, the “α” parameter will change and the gain graph will also change, as shown in Figure 7 Therefore, a new gain compensation needs to be calculated to make the output signal as close to the original amplitude as possible.
[0098] In summary, it has been described here that the phase shift can be made for different frequencies by changing "α". However, it is also observed that the phase shift remains the same for the same "α" shift frequency. This means that if a sine wave with a different frequency is input (i.e., a torque ripple compensation signal at various motor speeds), the phase error compensation stage using this transfer function can independently control the phase shift applied to the input of the transfer function and maintain the same amplitude of the sine wave.
[0099] The present invention overcomes the shortcomings of existing designs of motor control circuits that use low speed current shaping (LSCS) tuned at a single bandwidth and speed. The calculation algorithm used for the LSCS implicitly accounts for any system hysteresis that exists when the algorithm is optimized for minimum torque ripple. However, at different speeds, the system hysteresis will change even within the same bandwidth of current controllers. Therefore, the LSCS will not operate at an optimal point other than the speed to which it was tuned. In addition, if the application requires a bandwidth different from the bandwidth to which the original LSCS was tuned, it will affect the entire "slope" of the hysteresis with speed changes. Therefore, the LSCS needs to be re-tuned for different operating points, which requires a lot of work.
[0100] The apparatus of the present invention compensates for this phase shift, and by selecting the appropriate mapped coefficient values for the phase error compensation stage, a simple design of a tuned motor control circuit can be used for a different range of applications. Since the effects of bandwidth and frequency variations are automatically eliminated by the phase error compensation stage, there is no need to re-tune the motor control circuit for each application.
Claims
1. A motor control circuit for a permanent magnet motor, the control circuit comprising: a motor demand signal generator that outputs an intermediate motor current demand signal iDQ* that depends on the requested current demand and the electrical position of the motor; a torque ripple compensation stage, the torque ripple compensation stage outputting a torque ripple compensation waveform, the torque ripple compensation waveform comprising a frequency having an amplitude that at least matches a harmonic frequency of torque ripple that would be generated by the motor if the motor was driven in response to the intermediate signal, the torque ripple compensation waveform being in anti-phase with the torque ripple at a set frequency and control circuit bandwidth at which the torque ripple compensation stage is tuned; as well as a phase error compensation stage receiving the torque ripple compensation waveform as an input and outputting a modified torque ripple compensation waveform, wherein any undesirable phase delay or phase advance of the torque ripple compensation signal has been substantially eliminated when the motor control bandwidth and frequency are different from the motor control bandwidth and frequency used in tuning of the torque ripple compensation stage, such that the modified waveform is anti-phase with the torque ripple, Furthermore, the motor control circuit combines the intermediate current demand signal iDQ* with the modified torque ripple compensation waveform to generate a compensated current demand signal, and A PI controller receives an input signal that is dependent on a value of the compensated current demand signal.
2. The motor control circuit according to claim 1, wherein: The phase error compensation stage applies phase compensation to the torque ripple compensation signal based on a transfer function having at least one proportionality coefficient, the value of the constant or each constant being stored in an electronic memory of the control circuit, and one or more appropriate said proportionality coefficients being selected based on the motor speed, bandwidth and frequency.
3. The motor control circuit according to claim 2, wherein: The stored information includes a multi-dimensional map of one or more scaling coefficients used by the transfer function.
4. The motor control circuit according to claim 2 or claim 3, wherein: The motor control circuit is configured such that an output of a phase compensation stage function is added to the intermediate motor current demand signal to produce a total current demand signal.
5. The motor control circuit according to any one of claims 2 to 4, wherein: The transfer function of the phase error compensation stage has the following form: in: C(s) is the output of the transfer function defining the modified torque ripple compensation waveform; ω0 is the input frequency, and α is the scaling factor stored in memory.
6. The motor control circuit according to claim 5, wherein: The gain of the transfer function is set by appropriately selecting the value of the coefficient "α" so as to compensate for any gain loss due to applying the transfer function to the torque ripple compensation waveform.
7. A motor control circuit according to any preceding claim, wherein: The phase error compensation stage comprises: a first functional module that determines values for the one or more proportionality coefficients based on the bandwidth and the motor rotor speed; and A second functional module receives the torque ripple compensation waveform at an input terminal and modifies the torque ripple compensation waveform using a transfer function to eliminate the predicted phase error.
8. A motor circuit comprising a permanent magnet motor and the motor control circuit according to any one of claims 1 to 7.