WO2022087897A1 - Electric motor control method and apparatus, and movable platform - Google Patents

Electric motor control method and apparatus, and movable platform Download PDF

Info

Publication number
WO2022087897A1
WO2022087897A1 PCT/CN2020/124430 CN2020124430W WO2022087897A1 WO 2022087897 A1 WO2022087897 A1 WO 2022087897A1 CN 2020124430 W CN2020124430 W CN 2020124430W WO 2022087897 A1 WO2022087897 A1 WO 2022087897A1
Authority
WO
WIPO (PCT)
Prior art keywords
mcu
motor
modules
phase current
pwm
Prior art date
Application number
PCT/CN2020/124430
Other languages
French (fr)
Chinese (zh)
Inventor
陈鸿滨
马晨旭
邱贞平
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/124430 priority Critical patent/WO2022087897A1/en
Priority to CN202080044378.5A priority patent/CN114051691A/en
Publication of WO2022087897A1 publication Critical patent/WO2022087897A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/04Arrangements for controlling or regulating the speed or torque of more than one motor
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/22Current control, e.g. using a current control loop
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P27/00Arrangements or methods for the control of AC motors characterised by the kind of supply voltage
    • H02P27/04Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage
    • H02P27/06Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage using dc to ac converters or inverters
    • H02P27/08Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage using dc to ac converters or inverters with pulse width modulation
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/28Arrangements for controlling current
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/04Arrangements for controlling or regulating the speed or torque of more than one motor
    • H02P2006/045Control of current
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P2207/00Indexing scheme relating to controlling arrangements characterised by the type of motor
    • H02P2207/05Synchronous machines, e.g. with permanent magnets or DC excitation

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a motor control method, a motor control device and a movable platform.
  • MCU Microcontroller Unit
  • UAVs with multiple motors multiple MCUs are generally required to perform vector control of multiple permanent magnet synchronous motors.
  • the vector control scheme using multiple MCUs requires more hardware layout area and will make the hardware weight larger.
  • the present application provides a motor control method, a motor control device and a movable platform, which can reduce hardware layout area and hardware weight.
  • an embodiment of the present application provides a motor control method, which is applied to a movable platform.
  • the movable platform includes a micro-control unit MCU and N motors, where N is an integer.
  • the method includes:
  • the MCU outputs a plurality of pulse width modulation PWM signals respectively for the N motors;
  • the MCU obtains the phase currents of the single motors one by one according to the preset sequence
  • the MCU performs a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the motor corresponding to the previous time sequence according to the operation result. PWM signal.
  • an embodiment of the present application further provides a motor control device, including an MCU and N motors, where N is an integer;
  • the MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence;
  • the phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  • an embodiment of the present application further provides a movable platform, including an MCU and N motors, where N is an integer;
  • the MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence;
  • the phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  • the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result.
  • the method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
  • FIG. 1 is a block diagram of a motor control device provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a preset timing sequence provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a half-bridge module provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of outputting a PWM signal to a half-bridge module provided by an embodiment of the present application
  • FIG. 5 is another schematic diagram of outputting a PWM signal to a half-bridge module provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a phase current sampling circuit provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of another phase current sampling circuit provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a bus current sampling current provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a drive module detecting abnormality provided by an embodiment of the present application.
  • FIG. 10 is a flowchart of a motor control method provided by an embodiment of the present application.
  • FIG. 11 is a block diagram of a movable platform provided by an embodiment of the present application.
  • FIG. 12 is a block diagram of another movable platform provided by an embodiment of the present application.
  • the embodiment of the present application proposes a motor control method that can use a single Microcontroller Unit (MCU) to control multiple permanent magnet synchronous motors, and the method can be applied to a movable platform, where the movable platform can be a drone, Human ships, driverless cars, robots, etc.
  • the unmanned aerial vehicle may be a rotorcraft, for example, a multi-rotor aircraft propelled through air by a plurality of propulsion devices, and the embodiment of the present application is not limited thereto.
  • this embodiment is described by taking an unmanned aerial vehicle as an example, but the embodiment of this application is not limited to being applied to an unmanned aerial vehicle, and can be applied to other movable platforms, such as: unmanned vehicles, unmanned ships, Robots etc.
  • the main control method of permanent magnet synchronous motor is vector control, also known as field-oriented control FOC (Field-Oriented Control). Modulate PWM (Pulse Width Modulation) signal.
  • FIG. 1 shows a block diagram of a motor control apparatus provided by an embodiment of the present application, where the motor control apparatus includes an MCU 10 and N motors 11 , where N is an integer.
  • the MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence;
  • the phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  • a single MCU may output multiple PWM signals to each motor.
  • each motor generally needs 6 channels and 3 groups of PWM signals, which are configured in the form of two-by-two complementary conduction.
  • the MCU can use the timer module to realize the output of the PWM signal, and the MCU can also use the PWM module to realize the output of the PWM signal. For example, assuming that the number of motors is 4, each motor needs 6 PWM signals, and the MCU needs to output 24 PWM signals in total.
  • the periods Ts of the multiple PWM signals for the N motors are the same, that is to say, the periods of the PWM signals of each motor are the same.
  • the number of each motor can be preset, and the MCU can obtain the phase current of a single motor one by one according to the number of the motor according to the preset sequence.
  • the numbers of 4 motors are M0, M1, M2, M3 respectively.
  • the preset timing can be: M0—>M1—>M2—>M3 cycle.
  • those skilled in the art can obtain the phase current of a single motor one by one according to other time sequences, which is not limited in this embodiment of the present application.
  • FIG. 2 a schematic diagram of a preset timing sequence provided by an embodiment of the present application is shown.
  • the phase of the PWM signal corresponding to the motor M0 and the PWM signal corresponding to the motor M2 is the same;
  • the phase of the PWM signal corresponding to the motor M1 and the PWM signal corresponding to the motor M3 are the same;
  • the phase of the PWM signal corresponding to the motor M0 and the motor M2 is the same as that of the motor
  • the phases of the PWM signals corresponding to M1 and the motor M3 differ by 180°.
  • the MCU needs to complete the vector control operation of the motor corresponding to the previous time sequence before sampling the phase current of the motor corresponding to the next time sequence, and adjust the vector control operation according to the result of the vector control operation.
  • a timing corresponding to the PWM signal of the motor is a timing corresponding to the PWM signal of the motor.
  • the MCU can control the phase current sampling of the motor M0, and perform vector control on the motor M0 according to the phase current.
  • the vector control needs to be completed before the phase current sampling of the motor M1.
  • the MCU can determine whether the next sequence has been reached through the timer module, and can also determine whether the next sequence has been reached through the counter in the PWM module.
  • the MCU determines that the next sequence has been reached, and controls the motor M1.
  • the phase current sampling is performed, and the vector control is performed on the motor M1 according to the phase current.
  • the vector control needs to be completed before the phase current sampling is performed on the motor M2.
  • the MCU determines that the next sequence is reached, controls the phase current sampling of the motor M2, and performs vector control on the motor M2 according to the phase current.
  • the vector control needs to be completed before the phase current sampling of the motor M3.
  • the MCU determines that the next sequence is reached, controls the phase current sampling of the motor M3, and performs vector control of the motor M3 according to the phase current.
  • the vector control needs to be completed before the phase current sampling of the motor M0.
  • the vector control of the 4 motors is cycled according to the preset sequence.
  • the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2.
  • Ts/2 the time interval between two adjacent time sequences
  • the time interval may be set according to the computing resources of the MCU, wherein the computing resources may include the main frequency of the MCU, the number of IOs, the number of external interfaces, and the like.
  • the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result.
  • the method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
  • the motor control apparatus may further include N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of pulse width modulation PWMs for the N half-bridge modules respectively Signal.
  • each half-bridge module may include three half-bridge circuits, and each half-bridge circuit may include an upper half-bridge circuit and a lower half-bridge circuit.
  • the upper half-bridge circuit Q1 and the lower half-bridge circuit Q2 form a half-bridge circuit, which respectively require two complementary PWM signals;
  • the upper half-bridge circuit Q3 and the lower half-bridge circuit Q4 form a half-bridge circuit , 2 complementary PWM signals are required respectively;
  • the upper half-bridge circuit Q5 and the lower half-bridge circuit Q6 form a half-bridge circuit, and 2 complementary PWM signals are required respectively. Therefore, each half-bridge module needs a total of 6 PWM signals.
  • the N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • the MCU may include M PWM modules, and the M PWM modules are configured to respectively output 6 channels of PWM signals for the N half-bridge modules, where M is an integer.
  • FIG. 4 is a schematic diagram of outputting a PWM signal to a half-bridge module according to an embodiment of the present application.
  • the PWM module can output PWM signals. If the MCU has enough PWM modules, the 6-channel PWM signals required by each half-bridge module can be provided by M PWM modules of the MCU.
  • each half-bridge module needs 6 PWM signals, a total of 24 PWM signals, the general PWM module can output 2 PWM signals, so the MCU needs a total of 12 PWM module.
  • the motor control device may further include N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one; the MCU includes K PWM modules, where K is an integer; the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules.
  • the N driving modules are configured to output 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively output 3 complementary PWM signals for the N half-bridge modules.
  • the N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • FIG. 5 is another schematic diagram of outputting a PWM signal to a half-bridge module according to an embodiment of the present application.
  • the MCU also includes a general purpose input/output port GPIO (General Purpose I/O Ports), and the GPIO port outputs an enable signal EN to the drive module module to make the drive module in a working state.
  • GPIO General Purpose I/O Ports
  • the MCU does not have enough PWM modules, among the 6 PWM signals required by each half-bridge module, 3 PWM signals can be generated by the PWM module, and the other 3 PWM signals can be generated by the drive module. 3-way PWM signal is obtained.
  • each half-bridge module needs 6 channels of PWM signals, a total of 24 channels of PWM signals, and a general PWM module can output 2 channels of PWM signals.
  • 6 PWMs can be used to output a total of 12 PWM signals, and another 12 PWM signals can be output through the drive module.
  • the PWM module can output 3 PWM signals to the driving module corresponding to the half-bridge module.
  • the driving module generates 3 complementary PWM signals according to the 3 PWM signals output by the PWM module, and then outputs a total of 6 PWM signals to the half-bridge module. bridge module.
  • the motor control device may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC (analogue-to-digital conversion ADC) connected to the N phase current sampling circuits.
  • ADC analog-to-digital conversion ADC
  • -digital conversion module can be a component integrated in the MCU or an external component connected to the MCU.
  • the MCU is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module.
  • the phase current sampled by the phase current sampling circuit is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module.
  • the MCU controls the phase current sampling circuit corresponding to the motor to sample the phase current of the motor one by one according to the preset timing sequence for the motor.
  • the phase current sampled by the phase current sampling circuit is converted into a digital signal by the ADC module and then transmitted to the MCU.
  • the phase current sampling circuit is configured to sample the phase currents of the three phases of the motor, and output the phase currents of the three phases to the ADC module.
  • FIG. 6 a schematic diagram of a phase current sampling circuit according to an embodiment of the present application is shown.
  • Ra, Rb, and Rc are sampling resistors.
  • Each sampling resistor needs to use an ADC interface of the ADC module. Since the differential sampling of the two-phase current of each motor uses the common terminal, a total of 4 ADC interfaces are required. Because the current is positive and negative, the voltage across the sampling resistor is positive and negative.
  • the input signal of the ADC module of the MCU needs to be 0 to 3.3V, so it is necessary to set the bias circuit to raise the voltage signal at both ends of the sampling resistor to the required voltage.
  • the phase current sampling circuit is used to sample the phase currents of the two phases of the motor, and output the phase currents of the two phases to the ADC module; the MCU is used to measure the phase currents of the two phases according to the Determine the phase currents of the three phases.
  • FIG. 7 a schematic diagram of another phase current sampling circuit provided by an embodiment of the present application is shown.
  • the phase current sampling circuit samples the phase currents of the two phases of the motor, and the MCU can calculate the phase current of the third phase by using the principle that the sum of the three phase currents is 0.
  • Ra and Rb are sampling resistors, two ADC interfaces are required for the two sampling resistors, and the common terminal is used for the differential sampling of the two-phase current of each motor. Therefore, only 3 ADC interfaces are required for each motor, which can reduce the need for ADC interfaces.
  • the motor control device may further include a programmable gain amplifier PGA (Pmgrammable Gain Amplifier); the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU.
  • the PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
  • phase current sampling circuit After the phase current sampling circuit collects the phase current, the phase current is amplified by the PGA and then output to the ADC module.
  • Each PGA can amplify one phase current.
  • PGAs corresponding to each motor can be set, and the plurality of PGAs respectively amplify the phase currents of the corresponding motors.
  • the MCU can control the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling by the phase current sampling circuit corresponding to the motor in the next sequence.
  • the motor control unit requires at least two PGAs.
  • the N half-bridge modules may include a common bus; the motor control device may further include a bus current sampling circuit, which is configured to sample the bus current of the bus and output it to the MCU; the MCU is used to detect whether there is a fault according to the bus current.
  • FIG. 8 a schematic diagram of a bus current sampling current according to an embodiment of the present application is shown.
  • the bus current sampling circuit is similar to the phase current sampling circuit, in which Rbus is the bus sampling resistor, and R9, R10, R11, and R12 form a bias circuit to raise the voltage of the bus sampling resistor to the required voltage.
  • N motors only need one bus current sampling circuit.
  • the MCU can set a current threshold. If the bus current exceeds the current threshold, it can be considered that there is a fault.
  • Ripple is a phenomenon caused by voltage or current fluctuation. If the busbar current ripple is too large, the RMS value of the busbar current will increase, which will increase the line loss I 2 *R on the busbar; and it will also cause the busbar voltage ripple. The wave increases, so that the motor output fluctuation increases.
  • the bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal.
  • the phase difference of the PWM signals of every two motors in the N motors needs to be different by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out. For example, suppose the four motors are M0, M1, M2, and M3. The phases of the PWM signals of the motor M0 and the motor M2 differ by 1/4 cycle. The phases of the PWM signals of the motor M1 and the motor M3 differ by 1/4 cycle.
  • N MCUs are required for N motors.
  • a synchronization signal can be sent between different MCUs to indicate that the PWM signals of the two motors are 1/4 cycle out of phase, so that the fluctuation of the bus current can be cancelled.
  • the MCU may include an input/output IO port, the drive module has an error Fault pin, and the Fault pin is connected to the IO port; the drive module is used when an abnormality is detected , output the feedback signal to the MCU through the Fault pin, and stop outputting the PWM signal.
  • the drive module can detect abnormalities such as Mos short circuit, undervoltage, and overtemperature. When an exception occurs, the driver module can feedback the error through the Fault pin and turn off the output.
  • the driving module may be provided with a protection circuit, including a voltage monitoring circuit and a comparator.
  • the voltage monitoring circuit is used to detect the voltage difference between the two ends of the DS pole of the Mos tube of the half-bridge circuit, and compare the voltage difference with a preset comparator threshold through a comparator. If the voltage difference exceeds the comparator threshold, the driver chip outputs a Fault signal to the MCU through the Falut pin.
  • the Fault pin of the driver module is usually an open-drain output, which needs to be pulled up and input into the IO of the MCU.
  • FIG. 10 shows a flowchart of a motor control method provided by an embodiment of the present application.
  • the method can be applied to a movable platform, where the movable platform can include a microcontroller MCU and N motors, where N is an integer , the method includes:
  • the MCU respectively outputs a plurality of pulse width modulated PWM signals for the N motors.
  • a single MCU may output multiple PWM signals to each motor.
  • each motor In vector control, each motor generally needs 6 channels and 3 groups of PWM signals, which are configured in the form of two-by-two complementary conduction.
  • the movable platform may further include N half-bridge modules connected to the N motors one by one, and the step of the MCU outputting a plurality of pulse width modulated PWM signals for the N motors respectively may be
  • the method includes: the MCU outputs a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively.
  • Each half-bridge module can include 3 half-bridge circuits, and each half-bridge circuit can include an upper half-bridge circuit and a lower half-bridge circuit.
  • the upper half-bridge circuit and the lower half-bridge circuit require a total of 2 complementary PWM signals, so each A total of 6 PWM signals are required for each half-bridge module.
  • the N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • the MCU may include M PWM modules, where M is an integer; the step of the MCU outputting a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively may include: The M PWM modules respectively output 6 PWM signals for the N half-bridge modules.
  • the 6-channel PWM signals required by each half-bridge module can be provided by M PWM modules of the MCU.
  • the movable platform further includes N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one;
  • the MCU includes K PWM modules, wherein K is an integer;
  • the step of the MCU outputting a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively may include: the K PWM modules respectively output 3 PWM signals for the N half-bridge modules; the N The driving modules respectively output 3 PWM signals for the N half-bridge modules according to the K PWM modules, respectively output 3 complementary PWM signals for the N half-bridge modules.
  • the N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • the PWM module can output 3 channels of PWM signals to the driver module corresponding to the half-bridge module. A total of 6 PWM signals are output to the half-bridge module.
  • the periods Ts of the plurality of PWM signals for the N motors are the same, that is, the periods of the PWM signals of each motor are the same.
  • the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2.
  • the MCU acquires the phase currents of the single motors one by one according to a preset time sequence.
  • the number of each motor can be preset, and the MCU can obtain the phase current of a single motor one by one according to the number of the motor according to the preset sequence.
  • the movable platform may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC module connected to the N phase current sampling circuits;
  • the ADC module can be a component integrated in the MCU or an external component connected to the MCU.
  • the step that the MCU obtains the phase currents of the single motors one by one according to the preset time sequence may include: the MCU controls the phase current sampling circuits one by one according to the preset time sequence, samples the phase currents of the corresponding motors and outputs them to the ADC module; The MCU acquires the phase current sampled by the phase current sampling circuit corresponding to a single motor through the ADC module.
  • the MCU controls the phase current sampling circuits one by one according to a preset time sequence
  • the step of sampling the phase current of the corresponding motor and outputting to the ADC module may include: the MCU according to the preset The time sequence controls the phase current sampling circuits one by one, samples the corresponding three-phase phase currents of the motor, and outputs the three-phase phase currents to the ADC module.
  • the MCU controls the phase current sampling circuits one by one according to a preset time sequence
  • the step of sampling the phase current of the corresponding motor and outputting it to the ADC module may include: the MCU according to the preset timing. Set the timing sequence to control the phase current sampling circuit to sample the corresponding two-phase phase current of the motor to output the three-phase phase current to the ADC module;
  • the step that the MCU obtains, through the ADC module, the phase current sampled by the phase current sampling circuit corresponding to the single motor may include: the MCU obtains, through the ADC module, two-phase phase currents sampled by the phase current sampling circuit corresponding to the single motor. , according to the phase currents of the two phases to determine the phase currents of the three phases.
  • the phase current sampling circuit can sample the phase currents of the two phases of the motor, and the MCU calculates the phase current of the third phase by using the principle that the sum of the three phase currents is 0.
  • the movable platform may further include a programmable gain amplifier PGA; the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU.
  • the step that the MCU obtains the phase current sampled by the phase current sampling circuit corresponding to the single motor through the ADC module may include: the PGA amplifies the phase current sampled by the phase current sampling circuit one by one according to a preset timing sequence; the The MCU obtains the phase current amplified by the PGA through the ADC module.
  • phase current sampling circuit After the phase current sampling circuit collects the phase current, the phase current is amplified by the PGA and then output to the ADC module.
  • Each PGA can amplify one phase current.
  • the method further includes: the MCU controls the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling the phase current sampling circuit corresponding to the motor in the next sequence.
  • the MCU Before sampling by the phase current sampling circuit corresponding to the motor in the next sequence, the MCU controls the PGA to switch the phase current sampling circuit corresponding to the motor in the next sequence, which can reduce the number of PGAs required.
  • the N half-bridge modules may include a common bus; the movable platform further includes a bus current sampling circuit; the method may further include: the bus current sampling circuit sampling the bus current sampling circuit The bus current is output to the MCU; the MCU detects whether there is a fault according to the bus current.
  • N motors only need one bus current sampling circuit.
  • the MCU can set a current threshold. If the bus current exceeds the current threshold, it can be considered that there is a fault.
  • the bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal.
  • the phases of the PWM signals of every two motors in the N motors differ by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out.
  • the MCU includes an input and output IO port
  • the drive module has a fault pin
  • the Fault pin is connected to the IO port
  • the method may further include: when the drive module When an abnormality is detected, the drive module outputs a feedback signal to the MCU through the Fault pin, and stops outputting the PWM signal.
  • the drive module can detect abnormalities such as Mos tube short circuit, undervoltage, and overtemperature. When an exception occurs, the driver module feeds back the error through the Fault pin and turns off the output.
  • the MCU performs a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the corresponding operation for the previous time sequence according to the operation result.
  • PWM signal of the motor is a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the corresponding operation for the previous time sequence according to the operation result.
  • the MCU needs to complete the vector control operation of the motor corresponding to the previous time sequence before sampling the phase current of the motor corresponding to the next time sequence, and adjust the vector control operation according to the result of the vector control operation.
  • a timing corresponding to the PWM signal of the motor is a timing corresponding to the PWM signal of the motor.
  • the phase current of the motor corresponding to the first sequence is first sampled, and the vector control is performed on the motor of the first sequence according to the phase current.
  • the MCU can determine whether the next sequence is reached through the timer module. When the next sequence is reached, it samples the phase current of the motor corresponding to the next sequence, and performs vector control on the motor in the next sequence according to the phase current. Then, the above process is performed again corresponding to the next time sequence.
  • the MCU can control multiple motors by looping the above process.
  • the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result.
  • the method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
  • FIG. 11 shows a block diagram of a movable platform provided by an embodiment of the present application, where the movable platform may include an MCU 20 and N motors 21 , where N is an integer.
  • the MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence;
  • the phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  • the periods Ts of the multiple PWM signals for the N motors are the same, that is to say, the periods of the PWM signals of each motor are the same.
  • the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2.
  • the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result.
  • the method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
  • the movable platform may further include N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of pulse width modulation PWMs for the N half-bridge modules respectively Signal.
  • the N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • the MCU may include M PWM modules, and the M PWM modules are configured to respectively output 6 channels of PWM signals for the N half-bridge modules, where M is an integer.
  • the movable platform may further include N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one;
  • the MCU includes K PWM modules, where K is an integer; the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules.
  • the N driving modules are used for outputting 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively outputting 3 complementary PWM signals for the N half-bridge modules.
  • the N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
  • the movable platform may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC module connected to the N phase current sampling circuits.
  • the ADC module can be a component integrated in the MCU or an external component connected to the MCU.
  • the MCU is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module.
  • the phase current sampled by the phase current sampling circuit is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module.
  • the phase current sampling circuit is configured to sample the phase currents of the three phases of the motor, and output the phase currents of the three phases to the ADC module.
  • the phase current sampling circuit is used to sample the phase currents of the two phases of the motor, and output the phase currents of the two phases to the ADC module; the MCU is used to measure the phase currents of the two phases according to the Determine the phase currents of the three phases.
  • the movable platform may further include a programmable gain amplifier PGA (Pmgrammable Gain Amplifier); the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU.
  • the PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
  • the MCU may control the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling the phase current sampling circuit corresponding to the motor in the next sequence.
  • the motor control unit requires at least two PGAs.
  • the N half-bridge modules include a common bus; the movable platform may further include a bus current sampling circuit, which is used for sampling the bus current of the bus and outputting it to the MCU; the MCU is configured to detect whether there is a fault according to the bus current.
  • the bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal.
  • the phases of the PWM signals of every two motors in the N motors differ by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out.
  • the MCU may include an input/output IO port, the drive module has an error Fault pin, and the Fault pin is connected to the IO port; the drive module is used when an abnormality is detected , output the feedback signal to the MCU through the Fault pin, and stop outputting the PWM signal.
  • FIG. 12 is a block diagram of another movable platform provided by the embodiments of the present application.
  • the movable platform can include MCU, 4 motors, 4 half-bridge modules connected with the 4 motors one by one, 4 drive modules respectively connected with the 4 half-bridge modules, and 4 of the phase currents of the 4 motors are collected respectively.
  • a phase current sampling circuit may include an ADC module, multiple PWM modules, and GPIO.
  • the four motors can be M0, M1, M2, and M3 respectively.
  • the half-bridge module corresponding to the motor M0 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M0-Q1 and M0-Q2, which are composed of Mos tubes M0 -Half-bridge circuit composed of Q3 and M0-Q4, half-bridge circuit composed of Mos tubes M0-Q5 and M0-Q6.
  • the half-bridge module can also include two sampling resistors M0-Ra and M0-Rb, and the phase current sampling circuit can collect the phase currents of two phases through M0-Ra and M0-Rb.
  • the half-bridge module corresponding to the motor M1 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M1-Q1 and M1-Q2, which are composed of Mos tubes M1. -Half-bridge circuit composed of Q3 and M1-Q4, half-bridge circuit composed of Mos tubes M1-Q5 and M1-Q6.
  • the half-bridge module can also include two sampling resistors M1-Ra and M1-Rb, and the phase current sampling circuit can collect the phase currents of the two phases through M1-Ra and M1-Rb.
  • the half-bridge module corresponding to the motor M2 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M2-Q1 and M2-Q2, and a Mos tube M2. -Half-bridge circuit composed of Q3 and M2-Q4, half-bridge circuit composed of Mos tubes M2-Q5 and M2-Q6.
  • the half-bridge module may further include two sampling resistors M2-Ra and M2-Rb, and the phase current sampling circuit can collect the phase currents of the two phases through M2-Ra and M2-Rb.
  • the half-bridge module corresponding to the motor M3 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M3-Q1 and M3-Q2, and a Mos tube M3. -Half-bridge circuit composed of Q3 and M3-Q4, half-bridge circuit composed of Mos tubes M3-Q5 and M3-Q6.
  • the half-bridge module can also include two sampling resistors M3-Ra and M3-Rb, and the phase current sampling circuit can collect the phase currents of two phases through M3-Ra and M3-Rb.
  • Each half-bridge circuit needs two complementary PWM signals, so each half-bridge module needs a total of 6 PWM signals, and 4 motors need 24 PWM signals.
  • each PWM module of the MCU can output two PWM signals, then 12 PWM modules are required for 4 motors, but the general MCU does not have so many PWM modules. More PWM signals can be provided through the driver module.
  • the PWM module can output 3 channels of PWM signals to the driver module, and the driver module can generate another 3 channels of complementary PWM signals, so it can reduce the number of MCU PWM modules.
  • the motor only needs 6 PWM modules, which can be satisfied by most MCUs.
  • the movable platform may also include a bus current sampling circuit, and the four half-bridge modules may include a common bus.
  • the bus current sampling circuit can sample the bus current of the bus and output it to the MCU, and the MCU can detect whether there is a fault according to the bus current.
  • the MCU can set a current threshold, and if the bus current exceeds the current threshold, it can be considered that there is a fault.
  • the phase current sampling circuit can sample the phase currents of the motor vector, and then output the phase currents of the two phases to the ADC module.
  • the MCU obtains the phase currents of the two phases through the ADC module, and calculates the phase current of the third phase according to the principle that the sum of the three-phase phase currents is 0.
  • the differential sampling of the two-phase current of each motor uses the common terminal, so each motor only needs 3 ADC interfaces, and 4 motors only need 12 ADC interfaces, which greatly reduces the need for ADC interfaces.
  • the sampled phase current needs to be amplified by an operational amplifier, which can be amplified by the built-in PGA of the MCU and then output to the ADC module.
  • the MCU can control the PGA to switch the phase current sampling circuit before sampling a certain motor phase current, thereby reducing the need for the number of PGAs.
  • 12 PWM signals output by 6 PWM modules can be grouped, and each 3 PWM modules can output 3 PWMs to control one motor.
  • the phases of the PWM signals for motor M0 and motor M2 can be set to be the same; the phases of the PWM signals for motor M1 and motor M3 can be set to be the same; the phases of the PWM signals for motor M0 and motor M2 can be set to be the same as those for motors M1 and M3
  • the phases of the PWM signals of the motor M3 are set to be 180° out of phase.
  • the time for triggering sampling for each motor can be determined by the timer module.
  • the phase current of the motor M0 can be sampled first, and the vector control operation can be performed after the sampling is completed.
  • Vector control needs to be done before sampling the phase currents of the motor for the next sequence.
  • the phase current sampling of the M1 motor is carried out. After the sampling is completed, the vector control operation is performed, and the channel of the phase current sampling is switched to the M2 motor, and the trigger point for the M2 motor to start sampling is set to The half-cycle value that passes through the PWM signal.
  • the phase current sampling of the M2 motor is carried out. After the sampling is completed, the vector control operation is carried out, and the channel of the phase current sampling is switched to the M3 motor, and the trigger point for the M3 motor to start sampling is set to The half-cycle value that passes through the PWM signal.
  • the phase current sampling of the M3 motor is carried out. After the sampling is completed, the vector control operation is carried out, and the channel of the phase current sampling is switched to the M1 motor, and the trigger point for the M1 motor to start sampling is set to The half-cycle value that passes through the PWM signal.
  • the vector control of the 4 motors can be performed cyclically according to the above process.
  • any reference signs placed between parentheses shall not be construed as limiting the claim.
  • the word “comprising” does not exclude the presence of elements or steps not listed in a claim.
  • the word “a” or “an” preceding an element does not exclude the presence of a plurality of such elements.
  • the application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware.
  • the use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Multiple Motors (AREA)

Abstract

An electric motor control method, an electric motor control apparatus, and a movable platform. The method comprises: an MCU (10) respectively outputting a plurality of pulse width modulation (PWM) signals for N electric motors (11); the MCU (10) acquiring phase currents of the individual electric motors (11) one by one according to a preset time sequence; and within the time interval between two adjacent time sequences, the MCU (10) performing a vector control operation according to the phase current of the electric motor (11) corresponding to the previous time sequence, and obtaining an operation result, and adjusting, according to the operation result, the PWM signal for the electric motor (11) corresponding to the previous time sequence. By means of the method, control over a plurality of electric motors can be realized by means of a single MCU, such that the number of MCUs required for controlling the plurality of electric motors can be reduced, thereby reducing the area of a hardware layout, and reducing the weight of the hardware.

Description

电机控制方法、装置及可移动平台Motor control method, device and movable platform 技术领域technical field
本申请涉及通信技术领域,特别是涉及一种电机控制方法、一种电机控制装置及一种可移动平台。The present application relates to the field of communication technologies, and in particular, to a motor control method, a motor control device and a movable platform.
背景技术Background technique
永磁同步电机作为一种节能电机,目前广泛应用于医疗器械、航空、新能源汽车等领域。As an energy-saving motor, permanent magnet synchronous motor is widely used in medical equipment, aviation, new energy vehicles and other fields.
现有的永磁同步电机的电流控制方案大多使用一个微控制单元MCU(Microcontroller Unit)控制一个电机,或者一个MCU控制两个电机。对于具有多个电机的无人机,一般需要多个MCU对多个永磁同步电机进行矢量控制,使用多个MCU的矢量控制方案需要较多的硬件布局面积,且会使得硬件重量较大。Most of the current control schemes of the existing permanent magnet synchronous motor use a microcontroller unit MCU (Microcontroller Unit) to control one motor, or one MCU controls two motors. For UAVs with multiple motors, multiple MCUs are generally required to perform vector control of multiple permanent magnet synchronous motors. The vector control scheme using multiple MCUs requires more hardware layout area and will make the hardware weight larger.
发明内容SUMMARY OF THE INVENTION
本申请提供一种电机控制方法、一种电机控制装置及一种可移动平台,可以降低硬件布局面积、减轻硬件重量。The present application provides a motor control method, a motor control device and a movable platform, which can reduce hardware layout area and hardware weight.
第一方面,本申请实施例提供了一种电机控制方法,应用于可移动平台,所述可移动平台包括一微控制单元MCU、N个电机,其中N为整数,所述方法包括:In a first aspect, an embodiment of the present application provides a motor control method, which is applied to a movable platform. The movable platform includes a micro-control unit MCU and N motors, where N is an integer. The method includes:
所述MCU针对所述N个电机分别输出多个脉冲宽度调制PWM信号;The MCU outputs a plurality of pulse width modulation PWM signals respectively for the N motors;
所述MCU按照预设时序逐一获取单个电机的相电流;The MCU obtains the phase currents of the single motors one by one according to the preset sequence;
所述MCU在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU performs a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the motor corresponding to the previous time sequence according to the operation result. PWM signal.
第二方面,本申请实施例还提供了一种电机控制装置,包括一MCU、N个电机,其中N为整数;In a second aspect, an embodiment of the present application further provides a motor control device, including an MCU and N motors, where N is an integer;
所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
第三方面,本申请实施例还提供了一种可移动平台,包括一MCU、N个电机,其中N为整数;In a third aspect, an embodiment of the present application further provides a movable platform, including an MCU and N motors, where N is an integer;
所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
本申请实施例中,MCU可以分别针对N个电机输出多个脉冲宽度调制PWM信号;按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据运算结果调整针对前一个时序对应的电机的PWM信号。本申请实施例的方法可以通过单个MCU实现对多个电机的控制,可以减少对多个电机进行控制所需的MCU的数量,从而可以降低硬件布局面积、减轻硬件重量。In the embodiment of the present application, the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result. The method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
附图说明Description of drawings
图1是本申请实施例提供的一种电机控制装置的框图;1 is a block diagram of a motor control device provided by an embodiment of the present application;
图2是本申请实施例提供的一种预设时序的示意图;2 is a schematic diagram of a preset timing sequence provided by an embodiment of the present application;
图3是本申请实施例提供的一种半桥模块的示意图;3 is a schematic diagram of a half-bridge module provided by an embodiment of the present application;
图4是本申请实施例提供的一种向半桥模块输出PWM信号的示意图;4 is a schematic diagram of outputting a PWM signal to a half-bridge module provided by an embodiment of the present application;
图5是本申请实施例提供的另一种向半桥模块输出PWM信号的示意图;5 is another schematic diagram of outputting a PWM signal to a half-bridge module provided by an embodiment of the present application;
图6是本申请实施例提供的一种相电流采样电路的示意图;6 is a schematic diagram of a phase current sampling circuit provided by an embodiment of the present application;
图7是本申请实施例提供的另一种相电流采样电路的示意图;7 is a schematic diagram of another phase current sampling circuit provided by an embodiment of the present application;
图8是本申请实施例提供的一种母线电流采样电流的示意图;8 is a schematic diagram of a bus current sampling current provided by an embodiment of the present application;
图9是本申请实施例提供的一种驱动模块检测异常的示意图;9 is a schematic diagram of a drive module detecting abnormality provided by an embodiment of the present application;
图10是本申请实施例提供的一种电机控制方法的流程图;10 is a flowchart of a motor control method provided by an embodiment of the present application;
图11是本申请实施例提供的一种可移动平台的框图;11 is a block diagram of a movable platform provided by an embodiment of the present application;
图12是本申请实施例提供的另一种可移动平台的框图。FIG. 12 is a block diagram of another movable platform provided by an embodiment of the present application.
具体实施例specific embodiment
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
本申请实施例提出一种可以利用单个微控制单元MCU(Microcontroller Unit)控制多个永磁同步电机的电机控制方法,该方法可以应用于可移动平台,其中可移动平台可以是无人机、无人船、无人驾驶汽车、机器人等。无人机又例如可以是旋翼飞行器(rotorcraft),例如,由多个推动装置通过空气推动的多旋翼飞行器,本申请实施例并不限于此。需要说明的是,本实施例以无人机为例进行说明,但本申请实施例不限于应用于无人机,可以应用于其它的可移动平台,例如:无人驾驶汽车、无人船、机器人等。The embodiment of the present application proposes a motor control method that can use a single Microcontroller Unit (MCU) to control multiple permanent magnet synchronous motors, and the method can be applied to a movable platform, where the movable platform can be a drone, Human ships, driverless cars, robots, etc. For example, the unmanned aerial vehicle may be a rotorcraft, for example, a multi-rotor aircraft propelled through air by a plurality of propulsion devices, and the embodiment of the present application is not limited thereto. It should be noted that this embodiment is described by taking an unmanned aerial vehicle as an example, but the embodiment of this application is not limited to being applied to an unmanned aerial vehicle, and can be applied to other movable platforms, such as: unmanned vehicles, unmanned ships, Robots etc.
永磁同步电机的主要控制方法是矢量控制,也称为磁场定向控制FOC(Field-Oriented Control),矢量控制中,需要获取转子位置、相电流及转速,输出是三相逆变器的脉冲宽度调制PWM(Pulse Width Modulation)信号。The main control method of permanent magnet synchronous motor is vector control, also known as field-oriented control FOC (Field-Oriented Control). Modulate PWM (Pulse Width Modulation) signal.
参照图1示出了本申请实施例提供的一种电机控制装置的框图,其中电机控制装置包括一MCU10、N个电机11,其中N为整数。1 shows a block diagram of a motor control apparatus provided by an embodiment of the present application, where the motor control apparatus includes an MCU 10 and N motors 11 , where N is an integer.
所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
本申请实施例中可以由单个MCU向每个电机输出多个PWM信号。矢量控制中,每个电机一般需要6路3组PWM信号,配置为两两互补导通的形式。MCU可以使用定时器模块来实现PWM信号的输出,MCU也可以使用PWM模块来实现PWM信号的输出。例如,假设电机数量为4,每个电机需要6路PWM信号,MCU总共需要输出24路PWM信号。In this embodiment of the present application, a single MCU may output multiple PWM signals to each motor. In vector control, each motor generally needs 6 channels and 3 groups of PWM signals, which are configured in the form of two-by-two complementary conduction. The MCU can use the timer module to realize the output of the PWM signal, and the MCU can also use the PWM module to realize the output of the PWM signal. For example, assuming that the number of motors is 4, each motor needs 6 PWM signals, and the MCU needs to output 24 PWM signals in total.
在本申请实施例中,针对所述N个电机的多个PWM信号的周期Ts相同,也就是说各个电机的 PWM信号的周期都相同。In the embodiment of the present application, the periods Ts of the multiple PWM signals for the N motors are the same, that is to say, the periods of the PWM signals of each motor are the same.
每个电机可以预先设置编号,MCU可以根据电机的编号按照预设时序逐一获取单个电机的相电流。例如,4个电机的编号分别为M0、M1、M2、M3。预设时序可以是:M0—>M1—>M2—>M3的循环。当然本领域技术人员可以按照其他时序逐一获取单个电机的相电流,本申请实施例在此不作限制。The number of each motor can be preset, and the MCU can obtain the phase current of a single motor one by one according to the number of the motor according to the preset sequence. For example, the numbers of 4 motors are M0, M1, M2, M3 respectively. The preset timing can be: M0—>M1—>M2—>M3 cycle. Of course, those skilled in the art can obtain the phase current of a single motor one by one according to other time sequences, which is not limited in this embodiment of the present application.
参照图2所示为本申请实施例提供的一种预设时序的示意图。其中,电机M0对应的PWM信号和电机M2对应的PWM信号的相位相同;电机M1对应的PWM信号和电机M3对应的PWM信号的相位相同;电机M0和电机M2对应的PWM信号的相位,与电机M1和电机M3对应的PWM信号的相位相差180°。Referring to FIG. 2, a schematic diagram of a preset timing sequence provided by an embodiment of the present application is shown. Among them, the phase of the PWM signal corresponding to the motor M0 and the PWM signal corresponding to the motor M2 is the same; the phase of the PWM signal corresponding to the motor M1 and the PWM signal corresponding to the motor M3 are the same; the phase of the PWM signal corresponding to the motor M0 and the motor M2 is the same as that of the motor The phases of the PWM signals corresponding to M1 and the motor M3 differ by 180°.
在相邻的两个时序的时间间隔内,MCU需要在对下一个时序对应的电机进行相电流采样之前,完成对前一个时序对应的电机的矢量控制运算,并根据矢量控制运算结果调整针对前一个时序对应的电机的PWM信号。In the time interval of two adjacent time sequences, the MCU needs to complete the vector control operation of the motor corresponding to the previous time sequence before sampling the phase current of the motor corresponding to the next time sequence, and adjust the vector control operation according to the result of the vector control operation. A timing corresponding to the PWM signal of the motor.
在T0时刻,MCU可以控制对电机M0进行相电流采样,根据相电流对电机M0进行矢量控制,矢量控制需要在对电机M1进行相电流采样之前完成。At time T0, the MCU can control the phase current sampling of the motor M0, and perform vector control on the motor M0 according to the phase current. The vector control needs to be completed before the phase current sampling of the motor M1.
MCU可以通过定时器模块来确定是否到达下一个时序,也可以通过PWM模块中的计数器来确定是否到达下一个时序,经过预设时间间隔到达T1时,MCU确定到达下一个时序,控制对电机M1进行相电流采样,根据相电流对电机M1进行矢量控制,矢量控制需要在对电机M2进行相电流采样之前完成。The MCU can determine whether the next sequence has been reached through the timer module, and can also determine whether the next sequence has been reached through the counter in the PWM module. When the preset time interval reaches T1, the MCU determines that the next sequence has been reached, and controls the motor M1. The phase current sampling is performed, and the vector control is performed on the motor M1 according to the phase current. The vector control needs to be completed before the phase current sampling is performed on the motor M2.
经过预设时间间隔到达T2时,MCU确定到达下一个时序,控制对电机M2进行相电流采样,根据相电流对电机M2进行矢量控制,矢量控制需要在对电机M3进行相电流采样之前完成。When the preset time interval reaches T2, the MCU determines that the next sequence is reached, controls the phase current sampling of the motor M2, and performs vector control on the motor M2 according to the phase current. The vector control needs to be completed before the phase current sampling of the motor M3.
经过预设时间间隔到达T3时,MCU确定到达下一个时序,控制对电机M3进行相电流采样,根据相电流对电机M3进行矢量控制,矢量控制需要在对电机M0进行相电流采样之前完成。4个电机的矢量控制按照预设时序循环。When the preset time interval reaches T3, the MCU determines that the next sequence is reached, controls the phase current sampling of the motor M3, and performs vector control of the motor M3 according to the phase current. The vector control needs to be completed before the phase current sampling of the motor M0. The vector control of the 4 motors is cycled according to the preset sequence.
在一种可选实施例中,相邻两个时序的时间间隔可以为所述PWM信号的半周期值,也就是相邻两个时序的时间间隔为Ts/2。当然,本领域技术人员可以采用其他时间作为两个时序的时间间隔,本申请实施例在此不作限制。时间间隔可以是根据MCU的计算资源来设定,其中计算资源可以包括MCU主频、IO数量、外部接口数量等。In an optional embodiment, the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2. Of course, those skilled in the art may use other times as the time interval between the two time sequences, which is not limited in this embodiment of the present application. The time interval may be set according to the computing resources of the MCU, wherein the computing resources may include the main frequency of the MCU, the number of IOs, the number of external interfaces, and the like.
本申请实施例中,MCU可以分别针对N个电机输出多个脉冲宽度调制PWM信号;按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据运算结果调整针对前一个时序对应的电机的PWM信号。本申请实施例的方法可以通过单个MCU实现对多个电机的控制,可以减少对多个电机进行控制所需的MCU的数量,从而可以降低硬件布局面积、减轻硬件重量。In the embodiment of the present application, the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result. The method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
在本申请实施例中,电机控制装置还可以包括与所述N个电机一一连接的N个半桥模块;所述 MCU用于针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。In the embodiment of the present application, the motor control apparatus may further include N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of pulse width modulation PWMs for the N half-bridge modules respectively Signal.
参照图3所示为本申请实施例提供的一种半桥模块的示意图。在本申请实施例中,每个半桥模块可以包括3个半桥电路,每个半桥电路可以包括上半桥电路和下半桥电路。例如,如图3所示,上半桥电路Q1和下半桥电路Q2组成一个半桥电路,分别需要互补的2路PWM信号;上半桥电路Q3和下半桥电路Q4组成一个半桥电路,分别需要互补的2路PWM信号;上半桥电路Q5和下半桥电路Q6组成一个半桥电路,分别需要互补的2路PWM信号。因此每个半桥模块总共需要6路PWM信号。N个半桥模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。Referring to FIG. 3, a schematic diagram of a half-bridge module according to an embodiment of the present application is shown. In this embodiment of the present application, each half-bridge module may include three half-bridge circuits, and each half-bridge circuit may include an upper half-bridge circuit and a lower half-bridge circuit. For example, as shown in Figure 3, the upper half-bridge circuit Q1 and the lower half-bridge circuit Q2 form a half-bridge circuit, which respectively require two complementary PWM signals; the upper half-bridge circuit Q3 and the lower half-bridge circuit Q4 form a half-bridge circuit , 2 complementary PWM signals are required respectively; the upper half-bridge circuit Q5 and the lower half-bridge circuit Q6 form a half-bridge circuit, and 2 complementary PWM signals are required respectively. Therefore, each half-bridge module needs a total of 6 PWM signals. The N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
在一种可选实施例中,所述MCU可以包括M个PWM模块,所述M个PWM模块用于针对所述N个半桥模块,分别输出6路PWM信号,其中M为整数。In an optional embodiment, the MCU may include M PWM modules, and the M PWM modules are configured to respectively output 6 channels of PWM signals for the N half-bridge modules, where M is an integer.
如图4所示为本申请实施例提供的一种向半桥模块输出PWM信号的示意图。PWM模块可以输出PWM信号,在MCU具有足够PWM模块的情况下,每个半桥模块所需的6路PWM信号都可以由MCU的M个PWM模块来提供。FIG. 4 is a schematic diagram of outputting a PWM signal to a half-bridge module according to an embodiment of the present application. The PWM module can output PWM signals. If the MCU has enough PWM modules, the 6-channel PWM signals required by each half-bridge module can be provided by M PWM modules of the MCU.
例如,假设总共有4个电机,对应有4个半桥模块,每个半桥模块需要6路PWM信号,总共24路PWM信号,一般的PWM模块能输出2路PWM信号,因此MCU总共需要12个PWM模块。For example, suppose there are 4 motors in total, corresponding to 4 half-bridge modules, each half-bridge module needs 6 PWM signals, a total of 24 PWM signals, the general PWM module can output 2 PWM signals, so the MCU needs a total of 12 PWM module.
在另一种可选实施例中,电机控制装置还可以包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;所述MCU包括K个PWM模块,其中K为整数;所述K个PWM模块用于针对所述N个半桥模块,分别输出3路PWM信号。所述N个驱动模块用于根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM信号。N个驱动模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。In another optional embodiment, the motor control device may further include N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one; the MCU includes K PWM modules, where K is an integer; the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules. The N driving modules are configured to output 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively output 3 complementary PWM signals for the N half-bridge modules. The N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
如图5所示为本申请实施例提供的另一种向半桥模块输出PWM信号的示意图。其中,MCU还包括通用输入/输出端口GPIO(General Purpose I/O Ports),GPIO端口向驱动模块模块输出使能信号EN使驱动模块处于工作状态。在MCU不具有足够的PWM模块的情况下,每个半桥模块所需的6路PWM信号中,其中3路PWM信号可以由PWM模块生成,另外3路PWM信号可以是通过驱动模块生成互补的3路PWM信号获得。FIG. 5 is another schematic diagram of outputting a PWM signal to a half-bridge module according to an embodiment of the present application. Among them, the MCU also includes a general purpose input/output port GPIO (General Purpose I/O Ports), and the GPIO port outputs an enable signal EN to the drive module module to make the drive module in a working state. In the case that the MCU does not have enough PWM modules, among the 6 PWM signals required by each half-bridge module, 3 PWM signals can be generated by the PWM module, and the other 3 PWM signals can be generated by the drive module. 3-way PWM signal is obtained.
例如,假设总共有4个电机,对应有4个半桥模块,每个半桥模块需要6路PWM信号,总共24路PWM信号,一般的PWM模块能输出2路PWM信号。在MCU不具有12个PWM模块的情况下,可以使用6个PWM输出总共12路PWM信号,通过驱动模块输出另外12路PWM信号。具体的,PWM模块可以输出3路PWM信号至与半桥模块对应的驱动模块,驱动模块根据PWM模块输出的3路PWM信号生成互补的3路PWM信号,然后将总共6路PWM信号输出至半桥模块。For example, suppose there are 4 motors in total, corresponding to 4 half-bridge modules, each half-bridge module needs 6 channels of PWM signals, a total of 24 channels of PWM signals, and a general PWM module can output 2 channels of PWM signals. When the MCU does not have 12 PWM modules, 6 PWMs can be used to output a total of 12 PWM signals, and another 12 PWM signals can be output through the drive module. Specifically, the PWM module can output 3 PWM signals to the driving module corresponding to the half-bridge module. The driving module generates 3 complementary PWM signals according to the 3 PWM signals output by the PWM module, and then outputs a total of 6 PWM signals to the half-bridge module. bridge module.
在本申请实施例中,电机控制装置还可以包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC(analogue-to-digital conversion)模块。ADC模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。In the embodiment of the present application, the motor control device may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC (analogue-to-digital conversion ADC) connected to the N phase current sampling circuits. -digital conversion) module. The ADC module can be a component integrated in the MCU or an external component connected to the MCU.
在本申请实施例中,所述MCU还用于按照预设时序逐一控制所述相电流采样电路,采样对应的 电机的相电流并向所述ADC模块输出,通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。In the embodiment of the present application, the MCU is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module. The phase current sampled by the phase current sampling circuit.
MCU按照针对电机的预设时序,逐一控制电机对应的相电流采样电路采样电机的相电流。相电流采样电路采样的相电流经过ADC模块转换为数字信号之后传输至MCU。The MCU controls the phase current sampling circuit corresponding to the motor to sample the phase current of the motor one by one according to the preset timing sequence for the motor. The phase current sampled by the phase current sampling circuit is converted into a digital signal by the ADC module and then transmitted to the MCU.
在一种可选实施例中,所述相电流采样电路用于采样电机的三相的相电流,向所述ADC模块输出三相的相电流。In an optional embodiment, the phase current sampling circuit is configured to sample the phase currents of the three phases of the motor, and output the phase currents of the three phases to the ADC module.
参照图6所示为本申请实施例提供的一种相电流采样电路的示意图。其中,Ra、Rb、Rc是采样电阻,每个采样电阻对应需要使用ADC模块的一个ADC接口,由于每个电机的两相相电流的差分采样使用公共端,因此总共需要使用4个ADC接口。因为电流有正有负,采样电阻两端的电压有正有负。但是MCU的ADC模块的输入信号需要是0~3.3V,因此需要设置偏置电路把采样电阻两端的电压信号抬升所要求的电压。图6的偏置电路中R1、R2、R3、R4、R5、R6、R7、R8一般阻值相同,所抬升的偏置电压可以是3.3V/2=1.65V。Referring to FIG. 6, a schematic diagram of a phase current sampling circuit according to an embodiment of the present application is shown. Among them, Ra, Rb, and Rc are sampling resistors. Each sampling resistor needs to use an ADC interface of the ADC module. Since the differential sampling of the two-phase current of each motor uses the common terminal, a total of 4 ADC interfaces are required. Because the current is positive and negative, the voltage across the sampling resistor is positive and negative. However, the input signal of the ADC module of the MCU needs to be 0 to 3.3V, so it is necessary to set the bias circuit to raise the voltage signal at both ends of the sampling resistor to the required voltage. In the bias circuit of FIG. 6 , R1, R2, R3, R4, R5, R6, R7, and R8 generally have the same resistance value, and the raised bias voltage can be 3.3V/2=1.65V.
在另一种可选实施例中,所述相电流采样电路用于采样电机的两相的相电流,向所述ADC模块输出两相的相电流;所述MCU用于根据两相的相电流确定三相的相电流。In another optional embodiment, the phase current sampling circuit is used to sample the phase currents of the two phases of the motor, and output the phase currents of the two phases to the ADC module; the MCU is used to measure the phase currents of the two phases according to the Determine the phase currents of the three phases.
参照图7所示为本申请实施例提供的另一种相电流采样电路的示意图。相电流采样电路采样电机的两相的相电流,MCU可以利用三相相电流相加为0的原理计算得到第三相相电流。Ra和Rb是采样电阻,两个采样电阻需要使用2个ADC接口,每个电机的两相相电流的差分采样使用公共端。因此每个电机只需要3个ADC接口,可以减少ADC接口的需求。图7的偏置电路中R1、R2、R3、R4、R5、R6一般阻值相同,所抬升的偏置电压可以是3.3V/2=1.65V。Referring to FIG. 7, a schematic diagram of another phase current sampling circuit provided by an embodiment of the present application is shown. The phase current sampling circuit samples the phase currents of the two phases of the motor, and the MCU can calculate the phase current of the third phase by using the principle that the sum of the three phase currents is 0. Ra and Rb are sampling resistors, two ADC interfaces are required for the two sampling resistors, and the common terminal is used for the differential sampling of the two-phase current of each motor. Therefore, only 3 ADC interfaces are required for each motor, which can reduce the need for ADC interfaces. In the bias circuit of FIG. 7 , R1, R2, R3, R4, R5, and R6 generally have the same resistance value, and the raised bias voltage can be 3.3V/2=1.65V.
在本申请实施例中,电机控制装置还可以包括可编程增益放大器PGA(Pmgrammable Gain Amplifier);PGA可以是集成在MCU的部件,也可以是连接至MCU的外部部件。所述PGA用于按照预设时序逐一对所述相电流采样电路采样的相电流进行放大,并向所述ADC模块输出放大后的相电流。In this embodiment of the present application, the motor control device may further include a programmable gain amplifier PGA (Pmgrammable Gain Amplifier); the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU. The PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
相电流采样电路采集到相电流后,相电流经过PGA放大,然后再被输出到ADC模块。每个PGA可以对一路的相电流进行放大。在不限制PGA数量的情况下,可以设置与各个电机对应的PGA,多个PGA分别为对应电机的相电流进行放大。若要减低对PGA数量的需求,MCU可以在下一时序的电机对应的相电流采样电路进行采样之前,控制PGA切换至下一时序的电机对应的相电流采样电路。在这种情况下,电机控制装置至少需要两个PGA。After the phase current sampling circuit collects the phase current, the phase current is amplified by the PGA and then output to the ADC module. Each PGA can amplify one phase current. Under the condition that the number of PGAs is not limited, PGAs corresponding to each motor can be set, and the plurality of PGAs respectively amplify the phase currents of the corresponding motors. To reduce the requirement for the number of PGAs, the MCU can control the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling by the phase current sampling circuit corresponding to the motor in the next sequence. In this case, the motor control unit requires at least two PGAs.
在本申请实施例中,所述N个半桥模块可以包括共用的母线;所述电机控制装置还可以包括母线电流采样电路,所述母线电流采样电路用于采样所述母线的母线电流并输出至所述MCU;所述MCU用于根据所述母线电流检测是否存在故障。参照图8所示为本申请实施例提供的一种母线电流采样电流的示意图。母线电流采样电路与相电流采样电路类似,其中,Rbus为母线采样电阻,R9、R10、R11、R12组成偏置电路,将母线采样电阻的电压抬升至所需要的电压。N个电机只需要一个母线电 流采样电路,MCU可以设置一个电流阈值,如果母线电流的大小超过该电流阈值则可以认为存在故障。In this embodiment of the present application, the N half-bridge modules may include a common bus; the motor control device may further include a bus current sampling circuit, which is configured to sample the bus current of the bus and output it to the MCU; the MCU is used to detect whether there is a fault according to the bus current. Referring to FIG. 8, a schematic diagram of a bus current sampling current according to an embodiment of the present application is shown. The bus current sampling circuit is similar to the phase current sampling circuit, in which Rbus is the bus sampling resistor, and R9, R10, R11, and R12 form a bias circuit to raise the voltage of the bus sampling resistor to the required voltage. N motors only need one bus current sampling circuit. The MCU can set a current threshold. If the bus current exceeds the current threshold, it can be considered that there is a fault.
纹波是电压或者电流波动造成的一种现象,如果母线电流纹波过大,会导致母线电流的有效值增大,使得母线上的线路损耗I 2*R增加;并且还会导致母线电压纹波增大,使得电机输出波动增加。 Ripple is a phenomenon caused by voltage or current fluctuation. If the busbar current ripple is too large, the RMS value of the busbar current will increase, which will increase the line loss I 2 *R on the busbar; and it will also cause the busbar voltage ripple. The wave increases, so that the motor output fluctuation increases.
母线电流在电机控制过程中会波动,并且对于矢量控制来说,母线电流波动的频率是PWM信号的频率的两倍,母线电流波动的周期是PWM信号的周期的1/2。在一个MCU对N个电机进行矢量控制的情况下,需要N个电机中的每两个电机的PWM信号的相位相差1/4个周期,就可以让母线电流的波动抵消。例如,假设4个电机分别为M0、M1、M2、M3。电机M0与电机M2的PWM信号的相位相差1/4个周期。电机M1与电机M3的PWM信号的相位相差1/4个周期。The bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal. In the case where one MCU performs vector control on N motors, the phase difference of the PWM signals of every two motors in the N motors needs to be different by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out. For example, suppose the four motors are M0, M1, M2, and M3. The phases of the PWM signals of the motor M0 and the motor M2 differ by 1/4 cycle. The phases of the PWM signals of the motor M1 and the motor M3 differ by 1/4 cycle.
在一个MCU对一个电机进行矢量控制的情况下,N个电机需要N个MCU。不同的MCU之间可以发送同步信号,以表示两个电机的PWM信号达到相位相差1/4个周期,从而可以抵消母线电流的波动。In the case of vector control of one motor by one MCU, N MCUs are required for N motors. A synchronization signal can be sent between different MCUs to indicate that the PWM signals of the two motors are 1/4 cycle out of phase, so that the fluctuation of the bus current can be cancelled.
在本申请实施例中,所述MCU可以包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;所述驱动模块用于当检测到异常时,通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。In the embodiment of the present application, the MCU may include an input/output IO port, the drive module has an error Fault pin, and the Fault pin is connected to the IO port; the drive module is used when an abnormality is detected , output the feedback signal to the MCU through the Fault pin, and stop outputting the PWM signal.
针对多旋翼控制场合,可能出现多种类型的错误,驱动模块可检测如Mos短路、欠压、过温等异常。在异常发生时,驱动模块可以通过Fault引脚反馈错误并关闭输出。For multi-rotor control occasions, various types of errors may occur, and the drive module can detect abnormalities such as Mos short circuit, undervoltage, and overtemperature. When an exception occurs, the driver module can feedback the error through the Fault pin and turn off the output.
参照图9所示为本申请实施例提供的一种驱动模块检测异常的示意图。其中,驱动模块可以设有保护电路,包括电压监控电路和比较器。电压监控电路用于检测半桥电路的Mos管的DS极两端的电压差,通过比较器将电压差与预设的比较器阈值进行比较。如果电压差超过比较器阈值,则驱动芯片的通过Falut引脚向MCU输出Fault信号。当Mos管需要打开但是实际打不开时,电压差会超过比较器阈值;当Mos管打开,但是流过异常的大电流,电压差也会超过比较器阈值。其中,驱动模块的Fault引脚通常为开漏输出,需要将该引脚上拉后输入MCU的IO中。Referring to FIG. 9, a schematic diagram of abnormality detection of a driving module according to an embodiment of the present application is shown. Wherein, the driving module may be provided with a protection circuit, including a voltage monitoring circuit and a comparator. The voltage monitoring circuit is used to detect the voltage difference between the two ends of the DS pole of the Mos tube of the half-bridge circuit, and compare the voltage difference with a preset comparator threshold through a comparator. If the voltage difference exceeds the comparator threshold, the driver chip outputs a Fault signal to the MCU through the Falut pin. When the Mos tube needs to be turned on but cannot be turned on, the voltage difference will exceed the comparator threshold; when the Mos tube is turned on, but an abnormally large current flows, the voltage difference will also exceed the comparator threshold. Among them, the Fault pin of the driver module is usually an open-drain output, which needs to be pulled up and input into the IO of the MCU.
参照图10示出了本申请实施例提供的一种电机控制方法的流程图,该方法可以应用于可移动平台,其中可移动平台可以包括一微控制单元MCU、N个电机,其中N为整数,所述方法包括:10 shows a flowchart of a motor control method provided by an embodiment of the present application. The method can be applied to a movable platform, where the movable platform can include a microcontroller MCU and N motors, where N is an integer , the method includes:
101,所述MCU针对所述N个电机分别输出多个脉冲宽度调制PWM信号。101. The MCU respectively outputs a plurality of pulse width modulated PWM signals for the N motors.
本申请实施例中可以由单个MCU向每个电机输出多个PWM信号。矢量控制中,每个电机一般需要6路3组PWM信号,配置为两两互补导通的形式。In this embodiment of the present application, a single MCU may output multiple PWM signals to each motor. In vector control, each motor generally needs 6 channels and 3 groups of PWM signals, which are configured in the form of two-by-two complementary conduction.
在本申请实施例中,可移动平台还可以包括与所述N个电机一一连接的N个半桥模块,所述MCU针对所述N个电机分别输出多个脉冲宽度调制PWM信号的步骤可以包括:所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。In the embodiment of the present application, the movable platform may further include N half-bridge modules connected to the N motors one by one, and the step of the MCU outputting a plurality of pulse width modulated PWM signals for the N motors respectively may be The method includes: the MCU outputs a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively.
每个半桥模块可以包括3个半桥电路,每个半桥电路可以包括上半桥电路和下半桥电路,上半桥电路和下半桥电路总共需要互补的2路PWM信号,因此每个半桥模块总共需要6路PWM信号。N 个半桥模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。Each half-bridge module can include 3 half-bridge circuits, and each half-bridge circuit can include an upper half-bridge circuit and a lower half-bridge circuit. The upper half-bridge circuit and the lower half-bridge circuit require a total of 2 complementary PWM signals, so each A total of 6 PWM signals are required for each half-bridge module. The N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
在一种可选实施例中,所述MCU可以包括M个PWM模块,其中M为整数;所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号的步骤可以包括:所述M个PWM模块针对所述N个半桥模块,分别输出6路PWM信号。In an optional embodiment, the MCU may include M PWM modules, where M is an integer; the step of the MCU outputting a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively may include: The M PWM modules respectively output 6 PWM signals for the N half-bridge modules.
在MCU具有足够PWM模块的情况下,每个半桥模块所需的6路PWM信号都可以由MCU的的M个PWM模块来提供。In the case that the MCU has enough PWM modules, the 6-channel PWM signals required by each half-bridge module can be provided by M PWM modules of the MCU.
在另一种可选实施例中,所述可移动平台还包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;所述MCU包括K个PWM模块,其中K为整数;In another optional embodiment, the movable platform further includes N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one; the MCU includes K PWM modules, wherein K is an integer;
所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号的步骤可以包括:所述K个PWM模块针对所述N个半桥模块,分别输出3路PWM信号;所述N个驱动模块根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM信号。N个驱动模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。The step of the MCU outputting a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively may include: the K PWM modules respectively output 3 PWM signals for the N half-bridge modules; the N The driving modules respectively output 3 PWM signals for the N half-bridge modules according to the K PWM modules, respectively output 3 complementary PWM signals for the N half-bridge modules. The N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
在MCU不具有足够PWM模块的情况下,PWM模块可以输出3路PWM信号至与半桥模块对应的驱动模块,驱动模块根据PWM模块输出的3路PWM信号生成互补的3路PWM信号,然后将总共6路PWM信号输出至半桥模块。When the MCU does not have enough PWM modules, the PWM module can output 3 channels of PWM signals to the driver module corresponding to the half-bridge module. A total of 6 PWM signals are output to the half-bridge module.
在本申请实施例中,所述针对所述N个电机的多个PWM信号的周期Ts相同,也就是说各个电机的PWM信号的周期都相同。在一种可选实施例中,相邻两个时序的时间间隔可以为所述PWM信号的半周期值,也就是相邻两个时序的时间间隔为Ts/2。In the embodiment of the present application, the periods Ts of the plurality of PWM signals for the N motors are the same, that is, the periods of the PWM signals of each motor are the same. In an optional embodiment, the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2.
102,所述MCU按照预设时序逐一获取单个电机的相电流。102. The MCU acquires the phase currents of the single motors one by one according to a preset time sequence.
每个电机可以预先设置编号,MCU可以根据电机的编号按照预设时序逐一获取单个电机的相电流。The number of each motor can be preset, and the MCU can obtain the phase current of a single motor one by one according to the number of the motor according to the preset sequence.
在本申请实施例中,所述可移动平台还可以包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC模块;ADC模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。所述MCU按照预设时序逐一获取单个电机的相电流的步骤可以包括:所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出;所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。In the embodiment of the present application, the movable platform may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC module connected to the N phase current sampling circuits; The ADC module can be a component integrated in the MCU or an external component connected to the MCU. The step that the MCU obtains the phase currents of the single motors one by one according to the preset time sequence may include: the MCU controls the phase current sampling circuits one by one according to the preset time sequence, samples the phase currents of the corresponding motors and outputs them to the ADC module; The MCU acquires the phase current sampled by the phase current sampling circuit corresponding to a single motor through the ADC module.
在一种可选实施例中,所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出的步骤可以包括:所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的三相的相电流,向所述ADC模块输出三相的相电流。In an optional embodiment, the MCU controls the phase current sampling circuits one by one according to a preset time sequence, and the step of sampling the phase current of the corresponding motor and outputting to the ADC module may include: the MCU according to the preset The time sequence controls the phase current sampling circuits one by one, samples the corresponding three-phase phase currents of the motor, and outputs the three-phase phase currents to the ADC module.
在另一种可选实施例中,所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出的步骤可以包括:所述MCU按照预设时序逐一控制所述相电流采样电路采样对应的电机的两相的相电流向所述ADC模块输出三相的相电流;In another optional embodiment, the MCU controls the phase current sampling circuits one by one according to a preset time sequence, and the step of sampling the phase current of the corresponding motor and outputting it to the ADC module may include: the MCU according to the preset timing. Set the timing sequence to control the phase current sampling circuit to sample the corresponding two-phase phase current of the motor to output the three-phase phase current to the ADC module;
所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流的步骤可以包括:所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的两相的相电流,根据两相的相电流确定三相的相电流。The step that the MCU obtains, through the ADC module, the phase current sampled by the phase current sampling circuit corresponding to the single motor may include: the MCU obtains, through the ADC module, two-phase phase currents sampled by the phase current sampling circuit corresponding to the single motor. , according to the phase currents of the two phases to determine the phase currents of the three phases.
相电流采样电路可以采样电机的两相的相电流,MCU利用三相相电流相加为0的原理进行计算得到第三相相电流。The phase current sampling circuit can sample the phase currents of the two phases of the motor, and the MCU calculates the phase current of the third phase by using the principle that the sum of the three phase currents is 0.
在本申请实施例中,所述可移动平台还可以包括可编程增益放大器PGA;PGA可以是集成在MCU的部件,也可以是连接至MCU的外部部件。所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流的步骤可以包括:所述PGA按照预设时序逐一对所述相电流采样电路采样的相电流进行放大;所述MCU通过所述ADC模块获取所述PGA放大后的相电流。In the embodiment of the present application, the movable platform may further include a programmable gain amplifier PGA; the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU. The step that the MCU obtains the phase current sampled by the phase current sampling circuit corresponding to the single motor through the ADC module may include: the PGA amplifies the phase current sampled by the phase current sampling circuit one by one according to a preset timing sequence; the The MCU obtains the phase current amplified by the PGA through the ADC module.
相电流采样电路采集到相电流后,相电流经过PGA放大,然后再被输出到ADC模块。每个PGA可以对一路的相电流进行放大。After the phase current sampling circuit collects the phase current, the phase current is amplified by the PGA and then output to the ADC module. Each PGA can amplify one phase current.
在本申请实施例中,所述方法还包括:所述MCU在下一时序的电机对应的相电流采样电路进行采样之前,控制所述PGA切换至所述下一时序的电机对应的相电流采样电路。In the embodiment of the present application, the method further includes: the MCU controls the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling the phase current sampling circuit corresponding to the motor in the next sequence. .
在下一时序的电机对应的相电流采样电路采样之前,通过MCU控制PGA切换下一时序的电机对应的相电流采样电路,可以减少所需的PGA数量。Before sampling by the phase current sampling circuit corresponding to the motor in the next sequence, the MCU controls the PGA to switch the phase current sampling circuit corresponding to the motor in the next sequence, which can reduce the number of PGAs required.
在本申请实施例中,所述N个半桥模块可以包括共用的母线;所述可移动平台还包括母线电流采样电路;所述方法还可以包括:所述母线电流采样电路采样所述母线的母线电流并输出至所述MCU;所述MCU根据所述母线电流检测是否存在故障。In the embodiment of the present application, the N half-bridge modules may include a common bus; the movable platform further includes a bus current sampling circuit; the method may further include: the bus current sampling circuit sampling the bus current sampling circuit The bus current is output to the MCU; the MCU detects whether there is a fault according to the bus current.
N个电机只需要一个母线电流采样电路,MCU可以设置一个电流阈值,如果母线电流的大小超过该电流阈值则可以认为存在故障。母线电流在电机控制过程中会波动,并且对于矢量控制来说,母线电流波动的频率是PWM信号的频率的两倍,母线电流波动的周期是PWM信号的周期的1/2。N motors only need one bus current sampling circuit. The MCU can set a current threshold. If the bus current exceeds the current threshold, it can be considered that there is a fault. The bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal.
在本申请实施例中,所述N个电机中每两个电机的PWM信号的相位相差1/4个周期,可以使得母线电流的波动抵消。In the embodiment of the present application, the phases of the PWM signals of every two motors in the N motors differ by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out.
在本申请实施例中,所述MCU包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;所述方法还可以包括:当所述驱动模块检测到异常时,所述驱动模块通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。In the embodiment of the present application, the MCU includes an input and output IO port, the drive module has a fault pin, and the Fault pin is connected to the IO port; the method may further include: when the drive module When an abnormality is detected, the drive module outputs a feedback signal to the MCU through the Fault pin, and stops outputting the PWM signal.
针对多旋翼控制场合,可能出现多种类型的错误,驱动模块可检测如Mos管短路、欠压、过温等异常。在异常发生时,驱动模块通过Fault引脚反馈错误并关闭输出。For multi-rotor control occasions, various types of errors may occur, and the drive module can detect abnormalities such as Mos tube short circuit, undervoltage, and overtemperature. When an exception occurs, the driver module feeds back the error through the Fault pin and turns off the output.
103,所述MCU在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。103. The MCU performs a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the corresponding operation for the previous time sequence according to the operation result. PWM signal of the motor.
在相邻的两个时序的时间间隔内,MCU需要在对下一个时序对应的电机进行相电流采样之前,完成对前一个时序对应的电机的矢量控制运算,并根据矢量控制运算结果调整针对前一个时序对应的 电机的PWM信号。In the time interval of two adjacent time sequences, the MCU needs to complete the vector control operation of the motor corresponding to the previous time sequence before sampling the phase current of the motor corresponding to the next time sequence, and adjust the vector control operation according to the result of the vector control operation. A timing corresponding to the PWM signal of the motor.
可移动平台启动时,首先对第一个时序对应的电机进行相电流采样,根据相电流对第一个时序的电机进行矢量控制。MCU可以通过定时器模块来确定是否到达下一个时序,在到达下一个时序时,对下一个时序对应的电机进行相电流采样,根据相电流对下一个时序的电机进行矢量控制。然后再次对下一个时序对应的执行上述过程。MCU可以通过循环上述过程实现对多个电机的控制。When the movable platform starts, the phase current of the motor corresponding to the first sequence is first sampled, and the vector control is performed on the motor of the first sequence according to the phase current. The MCU can determine whether the next sequence is reached through the timer module. When the next sequence is reached, it samples the phase current of the motor corresponding to the next sequence, and performs vector control on the motor in the next sequence according to the phase current. Then, the above process is performed again corresponding to the next time sequence. The MCU can control multiple motors by looping the above process.
本申请实施例中,MCU可以分别针对N个电机输出多个脉冲宽度调制PWM信号;按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据运算结果调整针对前一个时序对应的电机的PWM信号。本申请实施例的方法可以通过单个MCU实现对多个电机的控制,可以减少对多个电机进行控制所需的MCU的数量,从而可以降低硬件布局面积、减轻硬件重量。In the embodiment of the present application, the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result. The method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
参照图11示出了本申请实施例提供的一种可移动平台的框图,其中可移动平台可以包括一MCU20、N个电机21,其中N为整数。11 shows a block diagram of a movable platform provided by an embodiment of the present application, where the movable platform may include an MCU 20 and N motors 21 , where N is an integer.
所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
在本申请实施例中,针对所述N个电机的多个PWM信号的周期Ts相同,也就是说各个电机的PWM信号的周期都相同。In the embodiment of the present application, the periods Ts of the multiple PWM signals for the N motors are the same, that is to say, the periods of the PWM signals of each motor are the same.
在一种可选实施例中,相邻两个时序的时间间隔可以为所述PWM信号的半周期值,也就是相邻两个时序的时间间隔为Ts/2。In an optional embodiment, the time interval between two adjacent time sequences may be the half-cycle value of the PWM signal, that is, the time interval between two adjacent time sequences is Ts/2.
本申请实施例中,MCU可以分别针对N个电机输出多个脉冲宽度调制PWM信号;按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据运算结果调整针对前一个时序对应的电机的PWM信号。本申请实施例的方法可以通过单个MCU实现对多个电机的控制,可以减少对多个电机进行控制所需的MCU的数量,从而可以降低硬件布局面积、减轻硬件重量。In the embodiment of the present application, the MCU can output multiple pulse width modulated PWM signals for N motors respectively; obtain the phase currents of a single motor one by one according to a preset sequence; within the time interval of two adjacent sequences, according to the previous sequence The phase current of the corresponding motor is subjected to vector control operation and the operation result is obtained, and the PWM signal for the motor corresponding to the previous time sequence is adjusted according to the operation result. The method of the embodiment of the present application can realize control of multiple motors through a single MCU, and can reduce the number of MCUs required to control multiple motors, thereby reducing hardware layout area and hardware weight.
在本申请实施例中,可移动平台还可以包括与所述N个电机一一连接的N个半桥模块;所述MCU用于针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。N个半桥模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。In this embodiment of the present application, the movable platform may further include N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of pulse width modulation PWMs for the N half-bridge modules respectively Signal. The N half-bridge modules may be components integrated in the MCU, or may be external components connected to the MCU.
在一种可选实施例中,所述MCU可以包括M个PWM模块,所述M个PWM模块用于针对所述N个半桥模块,分别输出6路PWM信号,其中M为整数。In an optional embodiment, the MCU may include M PWM modules, and the M PWM modules are configured to respectively output 6 channels of PWM signals for the N half-bridge modules, where M is an integer.
在另一种可选实施例中,可移动平台还可以包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;所述MCU包括K个PWM模块,其中K为整数;所述K个PWM模块用于针对所述N个半桥模块,分别输出3路PWM信号。所述N个驱动模块用于根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM 信号。N个驱动模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。In another optional embodiment, the movable platform may further include N drive modules, and the N drive modules are connected to the N half-bridge circuits one by one; the MCU includes K PWM modules, where K is an integer; the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules. The N driving modules are used for outputting 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively outputting 3 complementary PWM signals for the N half-bridge modules. The N driving modules may be components integrated in the MCU, or may be external components connected to the MCU.
在本申请实施例中,可移动平台还可以包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC模块。ADC模块可以是集成在MCU的部件,也可以是连接至MCU的外部部件。In this embodiment of the present application, the movable platform may further include: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC module connected to the N phase current sampling circuits. The ADC module can be a component integrated in the MCU or an external component connected to the MCU.
在本申请实施例中,所述MCU还用于按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出,通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。In the embodiment of the present application, the MCU is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the corresponding motor corresponding to a single motor through the ADC module. The phase current sampled by the phase current sampling circuit.
在一种可选实施例中,所述相电流采样电路用于采样电机的三相的相电流,向所述ADC模块输出三相的相电流。In an optional embodiment, the phase current sampling circuit is configured to sample the phase currents of the three phases of the motor, and output the phase currents of the three phases to the ADC module.
在另一种可选实施例中,所述相电流采样电路用于采样电机的两相的相电流,向所述ADC模块输出两相的相电流;所述MCU用于根据两相的相电流确定三相的相电流。In another optional embodiment, the phase current sampling circuit is used to sample the phase currents of the two phases of the motor, and output the phase currents of the two phases to the ADC module; the MCU is used to measure the phase currents of the two phases according to the Determine the phase currents of the three phases.
在本申请实施例中,可移动平台还可以包括可编程增益放大器PGA(Pmgrammable Gain Amplifier);PGA可以是集成在MCU的部件,也可以是连接至MCU的外部部件。所述PGA用于按照预设时序逐一对所述相电流采样电路采样的相电流进行放大,并向所述ADC模块输出放大后的相电流。In this embodiment of the present application, the movable platform may further include a programmable gain amplifier PGA (Pmgrammable Gain Amplifier); the PGA may be a component integrated in the MCU, or may be an external component connected to the MCU. The PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
MCU可以在下一时序的电机对应的相电流采样电路进行采样之前,控制PGA切换至下一时序的电机对应的相电流采样电路。在这种情况下,电机控制装置至少需要两个PGA。The MCU may control the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling the phase current sampling circuit corresponding to the motor in the next sequence. In this case, the motor control unit requires at least two PGAs.
在本申请实施例中,所述N个半桥模块包括共用的母线;所述可移动平台还可以包括母线电流采样电路,所述母线电流采样电路用于采样所述母线的母线电流并输出至所述MCU;所述MCU用于根据所述母线电流检测是否存在故障。In the embodiment of the present application, the N half-bridge modules include a common bus; the movable platform may further include a bus current sampling circuit, which is used for sampling the bus current of the bus and outputting it to the MCU; the MCU is configured to detect whether there is a fault according to the bus current.
母线电流在电机控制过程中会波动,并且对于矢量控制来说,母线电流波动的频率是PWM信号的频率的两倍,母线电流波动的周期是PWM信号的周期的1/2。The bus current fluctuates during motor control, and for vector control, the frequency of the bus current fluctuation is twice the frequency of the PWM signal, and the period of the bus current fluctuation is 1/2 the period of the PWM signal.
在本申请实施例中,所述N个电机中每两个电机的PWM信号的相位相差1/4个周期,可以使得母线电流的波动抵消。In the embodiment of the present application, the phases of the PWM signals of every two motors in the N motors differ by 1/4 cycle, so that the fluctuation of the bus current can be cancelled out.
在本申请实施例中,所述MCU可以包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;所述驱动模块用于当检测到异常时,通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。In the embodiment of the present application, the MCU may include an input/output IO port, the drive module has an error Fault pin, and the Fault pin is connected to the IO port; the drive module is used when an abnormality is detected , output the feedback signal to the MCU through the Fault pin, and stop outputting the PWM signal.
为了使本领域技术人员能够更好地理解本申请实施例,下面通过一个示例对本申请实施例加以说明:参照图12为本申请实施例提供的另一种可移动平台的框图。其中,可移动平台可以包括MCU、4个电机、与4个电机一一连接的4个半桥模块,分别与4个半桥模块连接的4个驱动模块,分别采集4个电机相电流的4个相电流采样电路。其中,MCU可以包括ADC模块,多个PWM模块,GPIO。In order to enable those skilled in the art to better understand the embodiments of the present application, an example is used to describe the embodiments of the present application below: FIG. 12 is a block diagram of another movable platform provided by the embodiments of the present application. Among them, the movable platform can include MCU, 4 motors, 4 half-bridge modules connected with the 4 motors one by one, 4 drive modules respectively connected with the 4 half-bridge modules, and 4 of the phase currents of the 4 motors are collected respectively. A phase current sampling circuit. Among them, the MCU may include an ADC module, multiple PWM modules, and GPIO.
4个电机可以分别为M0、M1、M2、M3。电机M0对应的半桥模块可以3个半桥电路组成,每个半桥电路可以由两个Mos管组成,分别包括由Mos管M0-Q1和M0-Q2组成的半桥电路,由Mos 管M0-Q3和M0-Q4组成的半桥电路,由Mos管M0-Q5和M0-Q6组成的半桥电路。半桥模块还可以包括两个采样电阻M0-Ra、M0-Rb,相电流采样电路可以通过M0-Ra、M0-Rb采集两相的相电流。The four motors can be M0, M1, M2, and M3 respectively. The half-bridge module corresponding to the motor M0 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M0-Q1 and M0-Q2, which are composed of Mos tubes M0 -Half-bridge circuit composed of Q3 and M0-Q4, half-bridge circuit composed of Mos tubes M0-Q5 and M0-Q6. The half-bridge module can also include two sampling resistors M0-Ra and M0-Rb, and the phase current sampling circuit can collect the phase currents of two phases through M0-Ra and M0-Rb.
电机M1对应的半桥模块可以3个半桥电路组成,每个半桥电路可以由两个Mos管组成,分别包括由Mos管M1-Q1和M1-Q2组成的半桥电路,由Mos管M1-Q3和M1-Q4组成的半桥电路,由Mos管M1-Q5和M1-Q6组成的半桥电路。半桥模块还可以包括两个采样电阻M1-Ra、M1-Rb,相电流采样电路可以通过M1-Ra、M1-Rb采集两相的相电流。The half-bridge module corresponding to the motor M1 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M1-Q1 and M1-Q2, which are composed of Mos tubes M1. -Half-bridge circuit composed of Q3 and M1-Q4, half-bridge circuit composed of Mos tubes M1-Q5 and M1-Q6. The half-bridge module can also include two sampling resistors M1-Ra and M1-Rb, and the phase current sampling circuit can collect the phase currents of the two phases through M1-Ra and M1-Rb.
电机M2对应的半桥模块可以3个半桥电路组成,每个半桥电路可以由两个Mos管组成,分别包括由Mos管M2-Q1和M2-Q2组成的半桥电路,由Mos管M2-Q3和M2-Q4组成的半桥电路,由Mos管M2-Q5和M2-Q6组成的半桥电路。半桥模块还可以包括两个采样电阻M2-Ra、M2-Rb,相电流采样电路可以通过M2-Ra、M2-Rb采集两相的相电流。The half-bridge module corresponding to the motor M2 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M2-Q1 and M2-Q2, and a Mos tube M2. -Half-bridge circuit composed of Q3 and M2-Q4, half-bridge circuit composed of Mos tubes M2-Q5 and M2-Q6. The half-bridge module may further include two sampling resistors M2-Ra and M2-Rb, and the phase current sampling circuit can collect the phase currents of the two phases through M2-Ra and M2-Rb.
电机M3对应的半桥模块可以3个半桥电路组成,每个半桥电路可以由两个Mos管组成,分别包括由Mos管M3-Q1和M3-Q2组成的半桥电路,由Mos管M3-Q3和M3-Q4组成的半桥电路,由Mos管M3-Q5和M3-Q6组成的半桥电路。半桥模块还可以包括两个采样电阻M3-Ra、M3-Rb,相电流采样电路可以通过M3-Ra、M3-Rb采集两相的相电流。The half-bridge module corresponding to the motor M3 can be composed of 3 half-bridge circuits, and each half-bridge circuit can be composed of two Mos tubes, respectively including a half-bridge circuit composed of Mos tubes M3-Q1 and M3-Q2, and a Mos tube M3. -Half-bridge circuit composed of Q3 and M3-Q4, half-bridge circuit composed of Mos tubes M3-Q5 and M3-Q6. The half-bridge module can also include two sampling resistors M3-Ra and M3-Rb, and the phase current sampling circuit can collect the phase currents of two phases through M3-Ra and M3-Rb.
每个半桥电路需要两两互补的两个PWM信号,所以每个半桥模块总共需要6路PWM信号,4个电机就需要24路PWM信号。一般MCU的每个PWM模块能输出两路PWM信号,则4个电机就需要12个PWM模块,但是一般MCU没有这么多PWM模块。可以通过驱动模块来提供更多的PWM信号,PWM模块可以输出3路PWM信号至驱动模块,驱动模块可以产生另外3路互补的PWM信号,因此可以降低对MCU的PWM模块数量的需求,4个电机就只需要6个PWM模块,大部分MCU都可以满足。Each half-bridge circuit needs two complementary PWM signals, so each half-bridge module needs a total of 6 PWM signals, and 4 motors need 24 PWM signals. Generally, each PWM module of the MCU can output two PWM signals, then 12 PWM modules are required for 4 motors, but the general MCU does not have so many PWM modules. More PWM signals can be provided through the driver module. The PWM module can output 3 channels of PWM signals to the driver module, and the driver module can generate another 3 channels of complementary PWM signals, so it can reduce the number of MCU PWM modules. The motor only needs 6 PWM modules, which can be satisfied by most MCUs.
可移动平台还可以包括母线电流采样电路,4个半桥模块可以包括共用的母线。母线电流采样电路可以采样母线的母线电流并输出至MCU,MCU可以根据母线电流检测是否存在故障。MCU可以设置一个电流阈值,如果母线电流的大小超过该电流阈值则可以认为存在故障。The movable platform may also include a bus current sampling circuit, and the four half-bridge modules may include a common bus. The bus current sampling circuit can sample the bus current of the bus and output it to the MCU, and the MCU can detect whether there is a fault according to the bus current. The MCU can set a current threshold, and if the bus current exceeds the current threshold, it can be considered that there is a fault.
矢量控制需要电机三相的相电流,相电流采样电路可以采样电机向量的相电流,然后将两相的相电流输出至ADC模块。MCU通过ADC模块获取两相的相电流,根据三相相电流相加为0的原理进行计算得到第三相的相电流。并且每个电机的两相相电流的差分采样使用公共端,因此每个电机只需要3个ADC接口,4个电机只需要12个ADC接口,大大减少了ADC接口的需求。Vector control requires the phase currents of the three phases of the motor. The phase current sampling circuit can sample the phase currents of the motor vector, and then output the phase currents of the two phases to the ADC module. The MCU obtains the phase currents of the two phases through the ADC module, and calculates the phase current of the third phase according to the principle that the sum of the three-phase phase currents is 0. And the differential sampling of the two-phase current of each motor uses the common terminal, so each motor only needs 3 ADC interfaces, and 4 motors only need 12 ADC interfaces, which greatly reduces the need for ADC interfaces.
采样得到的相电流需要经过运算放大器放大,可以使用MCU内置的PGA进行放大后再输出至ADC模块。MCU可以在采样某个电机相电流之前控制PGA切换相电流采样电路,从而减少对PGA数量的需求。The sampled phase current needs to be amplified by an operational amplifier, which can be amplified by the built-in PGA of the MCU and then output to the ADC module. The MCU can control the PGA to switch the phase current sampling circuit before sampling a certain motor phase current, thereby reducing the need for the number of PGAs.
在对电机进行矢量控制时,可以将6个PWM模块输出的12路PWM信号进行分组,可以由每3个PWM模块输出3路PWM来控制1个电机。When vector control is performed on the motor, 12 PWM signals output by 6 PWM modules can be grouped, and each 3 PWM modules can output 3 PWMs to control one motor.
针对电机M0和电机M2的PWM信号的相位可以设置为相同;针对电机M1和电机M3的PWM 信号的相位可以设置为相同;针对电机M0和电机M2的PWM信号的相位,可以与针对电机M1和电机M3的PWM信号的相位设置为相差180°。The phases of the PWM signals for motor M0 and motor M2 can be set to be the same; the phases of the PWM signals for motor M1 and motor M3 can be set to be the same; the phases of the PWM signals for motor M0 and motor M2 can be set to be the same as those for motors M1 and M3 The phases of the PWM signals of the motor M3 are set to be 180° out of phase.
针对各个电机触发采样的时间,可以通过定时器模块来确定。The time for triggering sampling for each motor can be determined by the timer module.
可以首先对电机M0进行相电流采样,采样完成后进行矢量控制运算,并将相电流采样的通道切换到M1电机,以及将M1电机开始采样的触发点设置为经过PWM信号的半周期值。矢量控制需要在对下一个时序的电机进行相电流采样之前完成。The phase current of the motor M0 can be sampled first, and the vector control operation can be performed after the sampling is completed. Vector control needs to be done before sampling the phase currents of the motor for the next sequence.
在经过PWM信号的半周期值时,进行对M1电机进行相电流采样,采样完成后进行矢量控制运算,并将相电流采样的通道切换到M2电机,以及将M2电机开始采样的触发点设置为经过PWM信号的半周期值。When the half-cycle value of the PWM signal passes, the phase current sampling of the M1 motor is carried out. After the sampling is completed, the vector control operation is performed, and the channel of the phase current sampling is switched to the M2 motor, and the trigger point for the M2 motor to start sampling is set to The half-cycle value that passes through the PWM signal.
在经过PWM信号的半周期值时,进行对M2电机进行相电流采样,采样完成后进行矢量控制运算,并将相电流采样的通道切换到M3电机,以及将M3电机开始采样的触发点设置为经过PWM信号的半周期值。When the half-cycle value of the PWM signal passes, the phase current sampling of the M2 motor is carried out. After the sampling is completed, the vector control operation is carried out, and the channel of the phase current sampling is switched to the M3 motor, and the trigger point for the M3 motor to start sampling is set to The half-cycle value that passes through the PWM signal.
在经过PWM信号的半周期值时,进行对M3电机进行相电流采样,采样完成后进行矢量控制运算,并将相电流采样的通道切换到M1电机,以及将M1电机开始采样的触发点设置为经过PWM信号的半周期值。对4个电机的矢量控制可以按照上述过程循环进行。When the half-cycle value of the PWM signal passes, the phase current sampling of the M3 motor is carried out. After the sampling is completed, the vector control operation is carried out, and the channel of the phase current sampling is switched to the M1 motor, and the trigger point for the M1 motor to start sampling is set to The half-cycle value that passes through the PWM signal. The vector control of the 4 motors can be performed cyclically according to the above process.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本申请的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本申请的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other. Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of the present application. Also, please note that instances of the phrase "in one embodiment" herein are not necessarily all referring to the same embodiment. In the description provided herein, numerous specific details are set forth. It will be understood, however, that the embodiments of the present application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (51)

  1. 一种电机控制方法,应用于可移动平台,其特征在于,所述可移动平台包括一微控制单元MCU、N个电机,其中N为整数,所述方法包括:A motor control method, applied to a movable platform, characterized in that the movable platform includes a micro-control unit MCU and N motors, where N is an integer, and the method includes:
    所述MCU针对所述N个电机分别输出多个脉冲宽度调制PWM信号;The MCU outputs a plurality of pulse width modulation PWM signals respectively for the N motors;
    所述MCU按照预设时序逐一获取单个电机的相电流;The MCU obtains the phase currents of the single motors one by one according to the preset sequence;
    所述MCU在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果,以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU performs a vector control operation according to the phase current of the motor corresponding to the previous time sequence within the time interval of two adjacent time sequences and obtains the operation result, and adjusts the motor corresponding to the previous time sequence according to the operation result. PWM signal.
  2. 根据权利要求1所述的方法,其特征在于,The method of claim 1, wherein:
    所述针对所述N个电机的多个PWM信号的周期相同。The periods of the plurality of PWM signals for the N motors are the same.
  3. 根据权利要求2所述的方法,其特征在于,The method of claim 2, wherein:
    相邻两个时序的时间间隔为所述PWM信号的半周期值。The time interval between two adjacent time sequences is the half-cycle value of the PWM signal.
  4. 根据权利要求1所述的方法,其特征在于,所述可移动平台还包括与所述N个电机一一连接的N个半桥模块,所述MCU针对所述N个电机分别输出多个脉冲宽度调制PWM信号,包括:The method according to claim 1, wherein the movable platform further comprises N half-bridge modules connected to the N motors one by one, and the MCU outputs a plurality of pulses for the N motors respectively Width-modulated PWM signals including:
    所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。The MCU outputs a plurality of pulse width modulated PWM signals for the N half-bridge modules respectively.
  5. 根据权利要求4所述的方法,其特征在于,所述可移动平台还包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC模块;所述MCU按照预设时序逐一获取单个电机的相电流,包括:The method according to claim 4, wherein the movable platform further comprises: N phase current sampling circuits corresponding to the N motors one-to-one and a module connected to the N phase current sampling circuits Digital conversion ADC module; the MCU obtains the phase current of a single motor one by one according to the preset sequence, including:
    所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出;The MCU controls the phase current sampling circuits one by one according to the preset time sequence, samples the phase currents of the corresponding motors and outputs them to the ADC module;
    所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。The MCU acquires the phase current sampled by the phase current sampling circuit corresponding to a single motor through the ADC module.
  6. 根据权利要求5所述的方法,其特征在于,所述可移动平台还包括可编程增益放大器PGA;The method of claim 5, wherein the movable platform further comprises a programmable gain amplifier (PGA);
    所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流,包括:The MCU obtains the phase current sampled by the phase current sampling circuit corresponding to a single motor through the ADC module, including:
    所述PGA按照预设时序逐一对所述相电流采样电路采样的相电流进行放大;The PGA amplifies the phase currents sampled by the phase current sampling circuit one by one according to a preset time sequence;
    所述MCU通过所述ADC模块获取所述PGA放大后的相电流。The MCU acquires the phase current amplified by the PGA through the ADC module.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    所述MCU在下一时序的电机对应的相电流采样电路进行采样之前,控制所述PGA切换至所述下一时序的电机对应的相电流采样电路。The MCU controls the PGA to switch to the phase current sampling circuit corresponding to the motor in the next sequence before sampling the phase current sampling circuit corresponding to the motor in the next sequence.
  8. 根据权利要求5所述的方法,其特征在于,所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出,包括:The method according to claim 5, wherein the MCU controls the phase current sampling circuits one by one according to a preset time sequence, and samples the phase currents of the corresponding motors and outputs them to the ADC module, comprising:
    所述MCU按照预设时序逐一控制所述相电流采样电路采样对应的电机的两相的相电流向所述ADC模块输出三相的相电流;The MCU controls the phase current sampling circuit to sample the phase currents of the corresponding two phases of the motor one by one according to the preset time sequence to output the phase currents of the three phases to the ADC module;
    所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流,包括:The MCU obtains the phase current sampled by the phase current sampling circuit corresponding to a single motor through the ADC module, including:
    所述MCU通过所述ADC模块获取单个电机对应的相电流采样电路采样的两相的相电流,根据两相的相电流确定三相的相电流。The MCU obtains the phase currents of the two phases sampled by the phase current sampling circuit corresponding to the single motor through the ADC module, and determines the phase currents of the three phases according to the phase currents of the two phases.
  9. 根据权利要求5所述的方法,其特征在于,所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出,包括:The method according to claim 5, wherein the MCU controls the phase current sampling circuits one by one according to a preset time sequence, and samples the phase currents of the corresponding motors and outputs them to the ADC module, comprising:
    所述MCU按照预设时序逐一控制所述相电流采样电路,采样对应的电机的三相的相电流,向所述ADC模块输出三相的相电流。The MCU controls the phase current sampling circuits one by one according to a preset time sequence, samples the corresponding three-phase phase currents of the motor, and outputs the three-phase phase currents to the ADC module.
  10. 根据权利要求4所述的方法,其特征在于,每个所述半桥模块包括3个半桥电路;所述MCU包括M个PWM模块;The method according to claim 4, wherein each of the half-bridge modules comprises 3 half-bridge circuits; the MCU comprises M PWM modules;
    所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号,包括:The MCU outputs a plurality of pulse width modulation PWM signals for the N half-bridge modules, including:
    所述M个PWM模块针对所述N个半桥模块,分别输出6路PWM信号,其中M为整数。The M PWM modules respectively output 6 PWM signals for the N half-bridge modules, where M is an integer.
  11. 根据权利要求4所述的方法,其特征在于,所述可移动平台还包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;每个所述半桥模块包括3个半桥电路;所述MCU包括K个PWM模块;The method according to claim 4, wherein the movable platform further comprises N driving modules, the N driving modules are connected to the N half-bridge circuits one by one; each of the half-bridge modules Including 3 half-bridge circuits; the MCU includes K PWM modules;
    所述MCU针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号,包括:The MCU outputs a plurality of pulse width modulation PWM signals for the N half-bridge modules, including:
    所述K个PWM模块针对所述N个半桥模块,分别输出3路PWM信号,其中K为整数;The K PWM modules respectively output 3 PWM signals for the N half-bridge modules, wherein K is an integer;
    所述N个驱动模块根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM信号。The N driving modules respectively output three PWM signals for the N half-bridge modules according to the K PWM modules, and respectively output three complementary PWM signals for the N half-bridge modules.
  12. 根据权利要求4所述的方法,其特征在于,所述N个半桥模块包括共用的母线;所述可移动平台还包括母线电流采样电路;所述方法还包括:The method according to claim 4, wherein the N half-bridge modules comprise a common bus; the movable platform further comprises a bus current sampling circuit; the method further comprises:
    所述母线电流采样电路采样所述母线的母线电流并输出至所述MCU;The bus current sampling circuit samples the bus current of the bus and outputs it to the MCU;
    所述MCU根据所述母线电流检测是否存在故障。The MCU detects whether there is a fault according to the bus current.
  13. 根据权利要求11所述的方法,其特征在于,所述MCU包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;所述方法还包括:The method according to claim 11, wherein the MCU includes an input/output IO port, the driver module has a fault pin, and the Fault pin is connected to the IO port; the method further comprises:
    当所述驱动模块检测到异常时,所述驱动模块通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。When the drive module detects an abnormality, the drive module outputs a feedback signal to the MCU through the Fault pin, and stops outputting the PWM signal.
  14. 根据权利要求4所述的方法,其特征在于,所述N个半桥模块集成在所述MCU。The method according to claim 4, wherein the N half-bridge modules are integrated in the MCU.
  15. 根据权利要求11所述的方法,其特征在于,所述N个驱动模块集成在所述MCU。The method according to claim 11, wherein the N driving modules are integrated in the MCU.
  16. 根据权利要求5所述的方法,其特征在于,所述ADC模块集成在所述MCU。The method according to claim 5, wherein the ADC module is integrated in the MCU.
  17. 根据权利要求6所述的方法,其特征在于,所述PGA集成在所述MCU。The method according to claim 6, wherein the PGA is integrated in the MCU.
  18. 一种电机控制装置,其特征在于,包括一MCU、N个电机,其中N为整数;A motor control device, characterized in that it comprises an MCU and N motors, wherein N is an integer;
    所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并 获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  19. 根据权利要求18所述的电机控制装置,其特征在于,所述针对所述N个电机的多个PWM信号的周期相同。The motor control device according to claim 18, wherein the cycles of the plurality of PWM signals for the N motors are the same.
  20. 根据权利要求19所述的电机控制装置,其特征在于,相邻两个时序的时间间隔为所述PWM信号的半周期值。The motor control device according to claim 19, wherein a time interval between two adjacent time sequences is a half-cycle value of the PWM signal.
  21. 根据权利要求18所述的电机控制装置,其特征在于,还包括与所述N个电机一一连接的N个半桥模块;所述MCU用于针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。The motor control device according to claim 18, further comprising N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of outputs for the N half-bridge modules respectively Pulse width modulated PWM signal.
  22. 根据权利要求21所述的电机控制装置,其特征在于,还包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC模块;所述MCU还用于按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出,通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。The motor control device according to claim 21, further comprising: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC connected to the N phase current sampling circuits module; the MCU is further configured to control the phase current sampling circuits one by one according to a preset sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the phase current sampling circuit corresponding to a single motor through the ADC module Sampled phase current.
  23. 根据权利要求22所述的电机控制装置,其特征在于,还包括可编程增益放大器PGA;The motor control device of claim 22, further comprising a programmable gain amplifier (PGA);
    所述PGA用于按照预设时序逐一对所述相电流采样电路采样的相电流进行放大,并向所述ADC模块输出放大后的相电流。The PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
  24. 根据权利要求23所述的电机控制装置,其特征在于,所述MCU还用于在下一时序的电机对应的相电流采样电路进行采样之前,控制所述PGA切换至所述下一时序的电机对应的相电流采样电路。The motor control device according to claim 23, wherein the MCU is further configured to control the PGA to switch to the motor corresponding to the next sequence before the phase current sampling circuit corresponding to the motor of the next sequence performs sampling The phase current sampling circuit.
  25. 根据权利要求22所述的电机控制装置,其特征在于,The motor control device of claim 22, wherein:
    所述相电流采样电路用于采样电机的两相的相电流,向所述ADC模块输出两相的相电流;The phase current sampling circuit is used for sampling the two-phase phase currents of the motor, and outputting the two-phase phase currents to the ADC module;
    所述MCU用于根据两相的相电流确定三相的相电流。The MCU is used to determine the phase currents of the three phases according to the phase currents of the two phases.
  26. 根据权利要求22所述的电机控制装置,其特征在于,The motor control device of claim 22, wherein:
    所述相电流采样电路用于采样电机的三相的相电流,向所述ADC模块输出三相的相电流。The phase current sampling circuit is used for sampling the phase currents of the three phases of the motor, and outputs the phase currents of the three phases to the ADC module.
  27. 根据权利要求21所述的电机控制装置,其特征在于,The motor control device of claim 21, wherein:
    每个所述半桥模块包括3个半桥电路;Each of the half-bridge modules includes 3 half-bridge circuits;
    所述MCU包括M个PWM模块,所述M个PWM模块用于针对所述N个半桥模块,分别输出6路PWM信号,其中M为整数。The MCU includes M PWM modules, and the M PWM modules are configured to respectively output 6 PWM signals for the N half-bridge modules, where M is an integer.
  28. 根据权利要求21所述的电机控制装置,其特征在于,还包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;The motor control device according to claim 21, further comprising N driving modules, and the N driving modules are connected to the N half-bridge circuits one by one;
    每个所述半桥模块包括3个半桥电路;Each of the half-bridge modules includes 3 half-bridge circuits;
    所述MCU包括K个PWM模块,所述K个PWM模块用于针对所述N个半桥模块,分别输出3路PWM信号,其中K为整数;The MCU includes K PWM modules, and the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules, where K is an integer;
    所述N个驱动模块用于根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM信号。The N driving modules are configured to output 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively output 3 complementary PWM signals for the N half-bridge modules.
  29. 根据权利要求21所述的电机控制装置,其特征在于,所述N个半桥模块包括共用的母线;所述电机控制装置还包括母线电流采样电路;The motor control device according to claim 21, wherein the N half-bridge modules comprise a common bus; the motor control device further comprises a bus current sampling circuit;
    所述母线电流采样电路用于采样所述母线的母线电流并输出至所述MCU;The busbar current sampling circuit is used for sampling the busbar current of the busbar and outputting it to the MCU;
    所述MCU用于根据所述母线电流检测是否存在故障。The MCU is used to detect whether there is a fault according to the bus current.
  30. 根据权利要求28所述的电机控制装置,其特征在于,所述MCU包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;The motor control device according to claim 28, wherein the MCU includes an input/output IO port, the drive module has an error Fault pin, and the Fault pin is connected to the IO port;
    所述驱动模块用于当检测到异常时,通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。The driving module is configured to output a feedback signal to the MCU through the Fault pin when an abnormality is detected, and stop outputting the PWM signal.
  31. 根据权利要求21所述的电机控制装置,其特征在于,所述N个半桥模块集成在所述MCU。The motor control device according to claim 21, wherein the N half-bridge modules are integrated in the MCU.
  32. 根据权利要求28所述的电机控制装置,其特征在于,所述N个驱动模块集成在所述MCU。The motor control device according to claim 28, wherein the N driving modules are integrated in the MCU.
  33. 根据权利要求22所述的电机控制装置,其特征在于,所述ADC模块集成在所述MCU。The motor control device according to claim 22, wherein the ADC module is integrated in the MCU.
  34. 根据权利要求23所述的电机控制装置,其特征在于,所述PGA集成在所述MCU。The motor control device according to claim 23, wherein the PGA is integrated in the MCU.
  35. 一种可移动平台,其特征在于,包括一MCU、N个电机,其中N为整数;A movable platform, characterized in that it comprises an MCU and N motors, wherein N is an integer;
    所述MCU用于针对所述N个电机分别输出多个PWM信号,按照预设时序逐一获取单个电机的相电流;在相邻的两个时序的时间间隔内,根据前一个时序对应的电机的相电流进行矢量控制运算并获得运算结果;以及根据所述运算结果调整针对所述前一个时序对应的电机的PWM信号。The MCU is used to output a plurality of PWM signals for the N motors respectively, and obtain the phase currents of a single motor one by one according to a preset sequence; The phase current performs a vector control operation and obtains an operation result; and adjusts the PWM signal for the motor corresponding to the previous time sequence according to the operation result.
  36. 根据权利要求35所述的可移动平台,其特征在于,所述针对所述N个电机的多个PWM信号的周期相同。The movable platform of claim 35, wherein the periods of the plurality of PWM signals for the N motors are the same.
  37. 根据权利要求36所述的可移动平台,其特征在于,相邻两个时序的时间间隔为所述PWM信号的半周期值。The movable platform according to claim 36, wherein a time interval between two adjacent time sequences is a half-cycle value of the PWM signal.
  38. 根据权利要求35所述的可移动平台,其特征在于,还包括与所述N个电机一一连接的N个半桥模块;所述MCU用于针对所述N个半桥模块分别输出多个脉冲宽度调制PWM信号。The movable platform according to claim 35, further comprising N half-bridge modules connected to the N motors one by one; the MCU is configured to output a plurality of outputs for the N half-bridge modules respectively Pulse width modulated PWM signal.
  39. 根据权利要求38所述的可移动平台,其特征在于,还包括:与所述N个电机一一对应的N个相电流采样电路以及与所述N个相电流采样电路连接的模数转换ADC模块;The movable platform according to claim 38, further comprising: N phase current sampling circuits corresponding to the N motors one-to-one, and an analog-to-digital conversion ADC connected to the N phase current sampling circuits module;
    所述MCU还用于按照预设时序逐一控制所述相电流采样电路,采样对应的电机的相电流并向所述ADC模块输出,通过所述ADC模块获取单个电机对应的相电流采样电路采样的相电流。The MCU is further configured to control the phase current sampling circuits one by one according to a preset time sequence, sample the phase current of the corresponding motor and output it to the ADC module, and obtain the phase current sampling circuit corresponding to a single motor through the ADC module. phase current.
  40. 根据权利要求39所述的可移动平台,其特征在于,还包括可编程增益放大器PGA;The movable platform of claim 39, further comprising a programmable gain amplifier (PGA);
    所述PGA用于按照预设时序逐一对所述相电流采样电路采样的相电流进行放大,并向所述ADC模块输出放大后的相电流。The PGA is used to amplify the phase currents sampled by the phase current sampling circuit one by one according to a preset timing sequence, and output the amplified phase currents to the ADC module.
  41. 根据权利要求40所述的可移动平台,其特征在于,所述MCU还用于在下一时序的电机对应的相电流采样电路进行采样之前,控制所述PGA切换至所述下一时序的电机对应的相电流采样电路。The movable platform according to claim 40, wherein the MCU is further configured to control the PGA to switch to the motor corresponding to the next sequence before the phase current sampling circuit corresponding to the motor of the next sequence performs sampling The phase current sampling circuit.
  42. 根据权利要求39所述的可移动平台,其特征在于,所述相电流采样电路用于采样电机的两相的相电流,向所述ADC模块输出两相的相电流;The movable platform according to claim 39, wherein the phase current sampling circuit is used to sample the phase currents of two phases of the motor, and output the phase currents of the two phases to the ADC module;
    所述MCU用于根据两相的相电流确定三相的相电流。The MCU is used to determine the phase currents of the three phases according to the phase currents of the two phases.
  43. 根据权利要求39所述的可移动平台,其特征在于,所述相电流采样电路用于采样电机的三相的相电流,向所述ADC模块输出三相的相电流。The movable platform according to claim 39, wherein the phase current sampling circuit is used to sample the three-phase phase currents of the motor, and output the three-phase phase currents to the ADC module.
  44. 根据权利要求38所述的可移动平台,其特征在于,每个所述半桥模块包括3个半桥电路;The movable platform of claim 38, wherein each half-bridge module comprises three half-bridge circuits;
    所述MCU包括M个PWM模块,所述M个PWM模块用于针对所述N个半桥模块,分别输出6路PWM信号,其中M为整数。The MCU includes M PWM modules, and the M PWM modules are configured to respectively output 6 PWM signals for the N half-bridge modules, where M is an integer.
  45. 根据权利要求38所述的可移动平台,其特征在于,还包括N个驱动模块,所述N个驱动模块与所述N个半桥电路一一连接;The movable platform according to claim 38, further comprising N driving modules, and the N driving modules are connected to the N half-bridge circuits one by one;
    每个所述半桥模块包括3个半桥电路;Each of the half-bridge modules includes 3 half-bridge circuits;
    所述MCU包括K个PWM模块,所述K个PWM模块用于针对所述N个半桥模块,分别输出3路PWM信号,其中K为整数;The MCU includes K PWM modules, and the K PWM modules are used to respectively output 3 PWM signals for the N half-bridge modules, where K is an integer;
    所述N个驱动模块用于根据所述K个PWM模块针对所述N个半桥模块,分别输出的3路PWM信号,针对所述N个半桥模块分别输出互补的3路PWM信号。The N driving modules are configured to output 3 PWM signals respectively for the N half-bridge modules according to the K PWM modules, and respectively output 3 complementary PWM signals for the N half-bridge modules.
  46. 根据权利要求38所述的可移动平台,其特征在于,所述N个半桥模块包括共用的母线;所述电机控制装置还包括母线电流采样电路;The movable platform according to claim 38, wherein the N half-bridge modules comprise a common bus; the motor control device further comprises a bus current sampling circuit;
    所述母线电流采样电路用于采样所述母线的母线电流并输出至所述MCU;The busbar current sampling circuit is used for sampling the busbar current of the busbar and outputting it to the MCU;
    所述MCU用于根据所述母线电流检测是否存在故障。The MCU is used to detect whether there is a fault according to the bus current.
  47. 根据权利要求45所述的可移动平台,其特征在于,所述MCU包括输入输出IO端口,所述驱动模块具有错误Fault引脚,所述Fault引脚连接至所述IO端口;The movable platform of claim 45, wherein the MCU includes an input/output IO port, the driver module has a fault pin, and the Fault pin is connected to the IO port;
    所述驱动模块用于当检测到异常时,通过所述Fault引脚向所述MCU输出反馈信号,并停止输出PWM信号。The driving module is configured to output a feedback signal to the MCU through the Fault pin when an abnormality is detected, and stop outputting the PWM signal.
  48. 根据权利要求38所述的可移动平台,其特征在于,所述N个半桥模块集成在所述MCU。The movable platform according to claim 38, wherein the N half-bridge modules are integrated in the MCU.
  49. 根据权利要求45所述的可移动平台,其特征在于,所述N个驱动模块集成在所述MCU。The movable platform according to claim 45, wherein the N driving modules are integrated in the MCU.
  50. 根据权利要求39所述的可移动平台,其特征在于,所述ADC模块集成在所述MCU。The movable platform according to claim 39, wherein the ADC module is integrated in the MCU.
  51. 根据权利要求40所述的可移动平台,其特征在于,所述PGA集成在所述MCU。The mobile platform according to claim 40, wherein the PGA is integrated in the MCU.
PCT/CN2020/124430 2020-10-28 2020-10-28 Electric motor control method and apparatus, and movable platform WO2022087897A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/124430 WO2022087897A1 (en) 2020-10-28 2020-10-28 Electric motor control method and apparatus, and movable platform
CN202080044378.5A CN114051691A (en) 2020-10-28 2020-10-28 Motor control method and device and movable platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/124430 WO2022087897A1 (en) 2020-10-28 2020-10-28 Electric motor control method and apparatus, and movable platform

Publications (1)

Publication Number Publication Date
WO2022087897A1 true WO2022087897A1 (en) 2022-05-05

Family

ID=80205748

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124430 WO2022087897A1 (en) 2020-10-28 2020-10-28 Electric motor control method and apparatus, and movable platform

Country Status (2)

Country Link
CN (1) CN114051691A (en)
WO (1) WO2022087897A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116404941A (en) * 2023-06-08 2023-07-07 宁德时代新能源科技股份有限公司 Motor control method and device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110080131A1 (en) * 2009-10-02 2011-04-07 Aisin Aw Co., Ltd. Control device
CN103916061A (en) * 2012-12-30 2014-07-09 硅实验室公司 Apparatus For Motor Control System And Associated Methods
CN108173475A (en) * 2018-02-11 2018-06-15 矽力杰半导体技术(杭州)有限公司 Motor driver and motor
CN108832849A (en) * 2018-06-15 2018-11-16 北京精密机电控制设备研究所 A kind of electromechanical coupling system control method
CN110677093A (en) * 2019-10-21 2020-01-10 四川宜途汽车电子科技有限公司 Position-free dual-motor controller and control method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3163742B1 (en) * 2015-08-04 2024-03-13 Mitsubishi Electric Corporation Inverter control device and air-conditioner
CN107681929B (en) * 2017-10-30 2023-11-28 广东美的制冷设备有限公司 Motor control system and variable frequency air conditioner

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110080131A1 (en) * 2009-10-02 2011-04-07 Aisin Aw Co., Ltd. Control device
CN103916061A (en) * 2012-12-30 2014-07-09 硅实验室公司 Apparatus For Motor Control System And Associated Methods
CN108173475A (en) * 2018-02-11 2018-06-15 矽力杰半导体技术(杭州)有限公司 Motor driver and motor
CN108832849A (en) * 2018-06-15 2018-11-16 北京精密机电控制设备研究所 A kind of electromechanical coupling system control method
CN110677093A (en) * 2019-10-21 2020-01-10 四川宜途汽车电子科技有限公司 Position-free dual-motor controller and control method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116404941A (en) * 2023-06-08 2023-07-07 宁德时代新能源科技股份有限公司 Motor control method and device and readable storage medium
CN116404941B (en) * 2023-06-08 2024-02-13 宁德时代新能源科技股份有限公司 Motor control method and device and readable storage medium

Also Published As

Publication number Publication date
CN114051691A (en) 2022-02-15

Similar Documents

Publication Publication Date Title
US9166469B2 (en) System for optimizing switching dead-time and method of making same
US20190386483A1 (en) Igbt short-circuit detection and protection circuit and igbt-based controllable rectifier circuit
WO2022087897A1 (en) Electric motor control method and apparatus, and movable platform
JP6425855B1 (en) Power converter
CN102377326B (en) Insulated gate bipolar transistor (IGBT)-bridge-switch-topology-based driving circuit and protection module thereof
WO2023040869A1 (en) Current measurement device and boost conversion system
WO2023207789A1 (en) Power adapter, over-current protection circuit, and electronic device
WO2022161184A1 (en) Power source module and power source system
CN103326579B (en) Magnetic isolation feedback circuit
CN102162822B (en) Direct-current detection circuit and variable-frequency air conditioner using same
JP5786408B2 (en) Voltage balance circuit of semiconductor switch circuit
CN104242608A (en) Power semiconductor module
WO2019034132A1 (en) Protection apparatus for electric motor controller, electric motor controller and electric automobile
CN115833580A (en) Totem-pole bridgeless circuit and power supply module
CN217238178U (en) Detection AC/DC source simply applied to sampling circuit
US20060197490A1 (en) Half-bridge control circuit
CN101361256A (en) Output inverter for single phase and its output current detection method
WO2022247040A1 (en) Intelligent synchronous rectification system of electronic speed controller, and control method for intelligent synchronous rectification system
WO2014175695A1 (en) Switching amplifier and control method therefor
CN212321726U (en) Chip resistance detection device and chip device
Yao et al. High step-up tapped inductor SEPIC converter with charge pump cell
CN106877643B (en) The voltage sampling method of PFC pfc circuit and pfc circuit
CN219499244U (en) Dual-motor control circuit
CN212646838U (en) Detection apparatus for electric locomotive power module
WO2016165601A1 (en) Current sampling equivalent amplification method and circuit for identifying initial position of motor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20959060

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20959060

Country of ref document: EP

Kind code of ref document: A1