Multi-motor real-time control method and related equipment
By backing up and verifying motor control parameters in FLASH, controlling multiple motors based on the current-speed dual closed loop method, and combining multiple power-on strategies for fault detection, the problems of synchronous operation and fault positioning of multiple motors are solved, and the motor is improved Control stability and fault response speed.
Patent Information
- Application Number
- CN202411202861.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-11-26
Smart Images

Figure CN119030371A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a real-time control method for multiple motors and related equipment. Background Art
[0002] In the field of motor control, in many usage scenarios, the load during motor operation will change dynamically according to factors such as motor speed, pressure, and external environment. These usage scenarios have high requirements for the real-time and reliability of motor control. Therefore, for a complex motor control environment (poor external natural environment, frequent operation trajectory adjustment, and fast load changes), it will be an extremely complex task to achieve simultaneous and synchronous adjustment of the speed of multiple motors and change the operation trajectory of the carrier. The reliability and stability of its control directly affect the success of the entire process; Conversely, in a complex environment, after the motor has an abnormality, how to quickly and accurately locate the motor fault is also an extremely important task.
[0003] A multi-type motor control method based on an embedded management system (Chinese patent CN116015110A) is a scheduling of multi-type motor control software, which schedules different motor control software for different types of motors, and loads the configuration table of the corresponding motor according to different motor numbers, thereby realizing the control of multiple types of motors, and does not involve the simultaneous synchronous operation of multiple motors and the abnormality detection method of the motor drive module; a control method for a motor controller for dual communication (Korean patent KR102309701 B1) is used for multiple motors, and multiple motor controllers are used to control the first and second motors respectively, and does not involve the algorithm optimization, specific fault inspection and other methods of scheduling and controlling multiple motors and a single motor by one controller at the same time; a centralized motor controller for controlling multiple motors (Chinese patent WO2014019373A1) is mainly used for motors in the field of electrical appliances, and at least two motors are permanent magnet synchronous motors without motor controllers. It does not belong to a software patent and does not involve the simultaneous synchronous operation of multiple motors and the abnormality detection method of the motor drive module. Summary of the invention
[0004] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to provide a real-time control method of multiple motors and related equipment to solve the technical problem in the prior art that the simultaneous operation of motors cannot be controlled in real time.
[0005] The present invention is achieved through the following technical solutions:
[0006] In a first aspect, the present invention provides a real-time control method for multiple motors, comprising:
[0007] Back up the key control parameters of the motor in the AB dual zones in FLASH, verify the key control parameters of the motor in the AB dual zones, and restore the key control parameters of the motor in the AB dual zones according to the verification results;
[0008] The restored key control parameters of the motors in the AB dual zones are initialized, and the key control parameters of the motors in the AB dual zones are configured in the drive modules of the multiple motors, and the multiple motors are controlled in real time based on the current-speed dual closed-loop method.
[0009] Preferably, the first-level boot code is loaded after the CPU is powered on, and the first-level boot code guides the loading of the second-level boot code. After the second-level boot code runs, the PLL, EMIF and timer modules of the CPU are initialized, the FLASH is accessed through the chip select 1 space of the EMIF, and the key control parameters of the motor are backed up in AB dual areas in the FLASH.
[0010] Preferably, the key control parameters of the motor in the AB dual zone are verified, and the specific process of restoring the key control parameters of the motor in the AB dual zone according to the verification result is as follows:
[0011] If there are no abnormal parameters in the key control parameters of the motors in both zones A and B, move the key control parameters of the motors in zone A to the internal RAM and execute;
[0012] If there is an abnormal parameter in one of the motor key control parameters in the AB dual zones, the motor key control parameters in the correct zone are written into the abnormal motor key control parameter zone to overwrite the abnormal parameter, and the data in zone A is moved to the internal RAM for execution;
[0013] If there are abnormal parameters in the key control parameters of the motor in both zones AB, an error will be reported and the process will be stopped.
[0014] Preferably, after the key control parameters of the motors based on the AB dual zones are configured to the drive modules of multiple motors, fault detection is performed on the drive modules of multiple motors. When the detection result is a fault, an error is reported and the process is stopped, and the fault is located; otherwise, real-time control of multiple motors is performed.
[0015] Furthermore, the drive modules of multiple motors are subjected to fault detection according to three one-input two-output power-on strategies and three two-input one-output power-on strategies. The specific process is as follows:
[0016] A and B phase current sensors and 270V bus voltage sensors are used to perform static detection on the upper and lower pipes of the three phases A, B and C in the drive module by controlling the duty cycle of each half-bridge without rotating the motor. Among them, the corresponding upper tubes opened in the drive module all adopt small duty cycle PWM modulation, and the corresponding lower tubes opened are in a full duty cycle modulation state. Three one-input and two-output power-on strategies and three two-input and one-output power-on strategies are executed respectively. During the execution process, when it is judged that the upper and lower limits of the phase current and bus voltage thresholds are within the threshold range, the IGBT state is determined to be normal, otherwise it is determined to be abnormal.
[0017] Preferably, the specific process of real-time control of multiple motors based on the current-speed dual closed-loop method is as follows:
[0018] The execution cycle is set, the execution cycle is divided equally according to the number of motors, and each motor is controlled in real time in turn according to the current-speed dual closed-loop method according to the equally divided execution cycle.
[0019] Furthermore, the specific process of real-time control of each motor based on the current-speed dual closed-loop method is as follows:
[0020] Obtain motor related parameters and determine whether to enter the speed loop based on the motor related parameters;
[0021] If the speed loop is entered, the target speed of the motor is calculated according to the first-order inertia equation, and the target speed is used as the final target speed of the speed loop; the Q-axis target value of the current loop is calculated according to the final target speed, which is the output of the speed loop; compensation is performed according to the calculation time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively; among which, the D-axis target value is 0, and the Q-axis target value is the output of the speed loop;
[0022] If the speed loop is not entered, compensation is performed based on the calculated time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively;
[0023] After the sector number is determined based on the obtained Q-axis target value and D-axis target value, the action time of each sector is calculated based on the bus voltage and the result is output. PWM is output based on the result to complete a cycle of motor control.
[0024] In a second aspect, the present invention further provides a real-time control system for multiple motors, comprising:
[0025] The data dual-zone backup and recovery module is used to perform dual-zone AB backup of the key control parameters of the motor in FLASH, verify the key control parameters of the motor in the AB dual-zone, and restore the key control parameters of the motor in the AB dual-zone according to the verification results;
[0026] The motor control algorithm module is used to initialize the restored key control parameters of the motor in the AB dual zone, configure the key control parameters of the motor in the AB dual zone into the drive module of the multi-motor, and perform real-time control of the multi-motor based on the current-speed dual closed-loop method.
[0027] In a third aspect, the present invention further provides a mobile terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the real-time control method of multiple motors as described above when executing the computer program.
[0028] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the real-time control method of multiple motors as described above is implemented.
[0029] Compared with the prior art, the present invention has the following beneficial technical effects:
[0030] The present invention provides a real-time control method for multiple motors. The method backs up the key control parameters of the motors in AB dual zones in FLASH, verifies the key control parameters of the motors in AB dual zones, and restores the key control parameters of the motors in AB dual zones according to the verification results. The restored key control parameters of the motors in AB dual zones are initialized, and the key control parameters of the motors in AB dual zones are configured in a driving module of multiple motors. The multiple motors are controlled in real time based on a current-speed dual closed-loop mode. For the occasional bit flip problem after the FLASH is used for a long time, it is ensured that even if a certain bit is abnormally flipped, it will not affect the control of the motor, and an automatic repair function for the bit flip is realized through software. To ensure that the motor controller can still work normally after long-term use, the reliability and safety are greatly improved. By optimizing the algorithm formula, strategy and segmented processing, the motor's computing efficiency is improved and the CPU usage rate is reduced; by adding desaturation, inertia equation, speed compensation and other methods in the algorithm, the stability of the motor operation is improved, and the speed can be greatly increased or decreased without overshoot, so that the motor can reach 12000 speed from stop in only 0.75 seconds, and the overshoot does not exceed 20 revolutions. After stabilization, the speed reaches 12000 within plus or minus 5 revolutions; by collecting the phase current, angle, speed and other information of multiple motors in time-sharing, and changing the PWM output in time-sharing, multiple motors can be operated simultaneously without interference with each other.
[0031] Furthermore, after configuring the key control parameters of the motor based on the AB dual zones to the drive modules of multiple motors, fault detection is performed on the drive modules of multiple motors. By designing six power-on strategies, using A and B phase current sensors and 270V bus voltage sensors, static detection is achieved by controlling the duty cycle of each half-bridge without rotating the motor. The upper and lower pipes of the A, B, and C phases of the motor drive module are comprehensively detected, and the fault of the motor drive module can be quickly located. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A flowchart of a real-time control method for multiple motors in an embodiment of the present invention;
[0033] Figure 2 This is a flow chart of real-time control of multiple motors based on a current-speed dual closed-loop method in an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of a one-input and two-output power-on strategy in an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of a two-input and one-output power-on strategy in an embodiment of the present invention;
[0036] Figure 5 A schematic diagram of the structure of a real-time control system for multiple motors in an embodiment of the present invention;
[0037] In the figure: 1-data dual-zone backup and recovery module; 2-motor control algorithm module. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0041] The object of the present invention is to provide a real-time control method for multiple motors and related equipment to solve the technical problem in the prior art that simultaneous operation of motors cannot be controlled in real time.
[0042] See also Figure 1 In one embodiment of the present invention, a real-time control method for multiple motors is provided, comprising:
[0043] In step 1, the key control parameters of the motor are backed up in the AB dual zone in FLASH, and the key control parameters of the motor in the AB dual zone are verified, and the key control parameters of the motor in the AB dual zone are restored according to the verification result;
[0044] Specifically, the first-level boot code is loaded after the CPU is powered on, and the first-level boot code guides the loading of the second-level boot code. After the second-level boot code runs, the PLL, EMIF and timer modules of the CPU are initialized, and the FLASH is accessed through the chip select 1 space of the EMIF, and the key control parameters of the motor are backed up in the AB dual areas in the FLASH.
[0045] Among them, the specific process of verifying the key control parameters of the motor in the AB dual zone and restoring the key control parameters of the motor in the AB dual zone according to the verification results is as follows:
[0046] If there are no abnormal parameters in the key control parameters of the motors in both zones A and B, move the key control parameters of the motors in zone A to the internal RAM and execute;
[0047] If there is an abnormal parameter in one of the motor key control parameters in the AB dual zones, the motor key control parameters in the correct zone are written into the abnormal motor key control parameter zone to overwrite the abnormal parameter, and the data in zone A is moved to the internal RAM for execution;
[0048] If there are abnormal parameters in the key control parameters of the motor in both zones AB, an error will be reported and the process will be stopped.
[0049] Step 2, initialize the restored key control parameters of the motors in the AB dual zones, configure the key control parameters of the motors in the AB dual zones into the drive modules of the multiple motors, and control the multiple motors in real time based on the current-speed dual closed-loop method.
[0050] Specifically, after the key control parameters of the motors based on the AB dual zones are configured to the drive modules of multiple motors, fault detection is performed on the drive modules of multiple motors. When the detection result is a fault, an error is reported and the process is stopped, and the fault is located; otherwise, multiple motors are controlled in real time.
[0051] Among them, the drive modules of multiple motors are fault-detected according to three one-input and two-output power-on strategies and three two-input and one-output power-on strategies. The specific process is as follows:
[0052] The A and B phase current sensors and the 270V bus voltage sensor are used to perform static detection on the upper and lower pipes of the A, B, and C phases in the drive module by controlling the duty cycle of each half-bridge without rotating the motor. Among them, the corresponding upper tubes opened in the drive module all adopt small duty cycle PWM modulation, and the corresponding lower tubes opened are in a full duty cycle modulation state. The three one-input and two-output power-on strategies and the three two-input and one-output power-on strategies are executed respectively. During the execution process, when it is judged that the upper and lower limits of the phase current and bus voltage thresholds are within the threshold range, the IGBT state is determined to be normal, otherwise it is determined to be abnormal.
[0053] Among them, during the power-on process, no matter the one-input two-output or two-input one-output mode, the corresponding upper tubes that are turned on use small duty cycle PWM modulation, and the corresponding lower tubes that are turned on are in full duty cycle modulation state. Figure 3 Shown and Figure 4 As shown, taking the 1 0 0 power-on strategy as an example, PWM1+ is a small duty cycle output (the duty cycle is about 8%), PWM1- is a complementary output with a dead zone, PWM2- and PWM3- are full duty cycles, and the other two tubes are in the off state.
[0054] During the static test, the software executes the above six power-on strategies in the order of 100→010→001→110→101→011. The execution time of each strategy is 50ms, and the interval between two strategies is 50ms. After completing the test of the six strategies, the test is repeated, that is, the six strategies are executed twice, and the test order and interval time remain consistent.
[0055] During the execution of each 50ms power-on strategy, the A and B phase currents and the 270V bus voltage are collected and accumulated every 0.5ms interruption cycle until the end of 50ms. The accumulated value is divided by the number of counts to obtain the average current and bus voltage of phase A and phase B under the power-on strategy conditions for subsequent judgment. There is a 50ms interval between each two power-on strategies to ensure that the current drops to zero and avoid the influence of the freewheeling effect on the collected values.
[0056] After 2 times of 12 power-on cycles, 12 average current values of phases A and B, and 12 average bus voltage values are obtained. In the judgment process, four judgment quantities are designed, namely, the upper and lower limits of the current threshold and the upper and lower limits of the voltage threshold. When the voltage and current are within the upper and lower limits of the current threshold and within the upper and lower limits of the voltage threshold, the IGBT state is judged to be normal, otherwise it is judged to be abnormal.
[0057] Specifically, the motor control software performs a speed loop calculation once every six current loop cycles. In the speed loop, the motor control software performs inertial filtering on the latest target speed sent by the host computer. The time constant of the inertial filtering can be configured through the parameter table. The time constant*3 is the time it takes for the given speed to reach the target speed. For example, if the time constant is configured to 0.25, the given speed can reach the actual speed within 0.75 seconds.
[0058] y(k)=Ts / (T+Ts)*u(k)+T / (T+Ts)*y(k-1)
[0059] Among them, u(k) is the motor speed command received in the current cycle, y(k) and y(k-1) are the speed commands after filtering in the current cycle and the previous cycle respectively, T is the inertia filter time constant, and Ts is the speed loop control period.
[0060] The current loop execution cycle of the motor control module is 200us. At the beginning of the 200us time axis, the motor control software will collect the resolver information and obtain the current speed and electrical angle information of the motor. After the collection is completed, the motor control software will complete the D and Q axis current loop calculations in sequence within the current loop. All calculations take about 53us. In order to make up for the time spent on the collection moment and the calculation process, the motor control software will time compensate the collected electrical angle according to the actual motor speed at the time of collection, and minimize the impact of software calculation time on the output results through code.
[0061] Specifically, the specific process of real-time control of multiple motors based on the current-speed dual closed-loop method is as follows:
[0062] The execution cycle is set, the execution cycle is divided equally according to the number of motors, and each motor is controlled in real time in turn according to the current-speed dual closed-loop method according to the equally divided execution cycle.
[0063] Among them, according to Figure 2 As shown, the specific process of the current-speed dual closed loop method in this embodiment is as follows:
[0064] Obtain motor related parameters and determine whether to enter the speed loop based on the motor related parameters;
[0065] If the speed loop is entered, the target speed of the motor is calculated according to the first-order inertia equation, and the target speed is used as the final target speed of the speed loop; the Q-axis target value of the current loop is calculated according to the final target speed, which is the output of the speed loop; compensation is performed according to the calculation time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively; among which, the D-axis target value is 0, and the Q-axis target value is the output of the speed loop;
[0066] If the speed loop is not entered, compensation is performed based on the calculated time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively;
[0067] After the sector number is determined based on the obtained Q-axis target value and D-axis target value, the action time of each sector is calculated based on the bus voltage and the result is output. PWM is output based on the result to complete a cycle of motor control.
[0068] The specific process of real-time control of multiple motors based on the current-speed dual closed-loop method is as follows:
[0069] Step S1, the motor control software receives an external instruction, and passes the received speed instructions of multiple motors as "target speed" to step S2;
[0070] Step S2, the speed loop execution cycle of the motor control module is 1200us. After entering this step, the motor control software determines whether the time has reached an integer multiple of 1200us. If not, it enters step S3. If it has, it executes speed loop related processing; the default target speeds of multiple motors in the speed loop are all 0. If the external instruction in step S1 sends a new target speed, the motor control module will set it as the new target speed and calculate it in the first-order inertia equation of the speed loop, and set the final speed of the speed loop to the target speed step by step in a step-by-step manner. The formula of the first-order inertia equation is as follows:
[0071] y(k)=Ts / (T+Ts)*u(k)+T / (T+Ts)*y(k-1)
[0072] Among them, u(k) is the motor speed command received in the current cycle, y(k) and y(k-1) are the speed commands after filtering in the current cycle and the previous cycle respectively, T is the inertia filter time constant, and Ts is the speed loop control period.
[0073] Step S3: The current loop execution cycle of the motor control module is 200us. After entering this step, the motor control software determines whether the time has reached an integer multiple of 200us. If not, it returns to step S1. If it has, it executes current loop related processing.
[0074] At the beginning of the 200us time axis, the motor control software will collect the resolver information and phase current to obtain the current motor speed, electrical angle information and phase current. After the collection is completed, the motor control software will complete the D and Q axis current loop calculations in sequence in the current loop. First, calculate the clark and park coordinate transformations. The purpose of the clark transformation is to obtain Ialfa and Ibeta. The formula is as follows:
[0075] f64_IAlfa=f64_odata.f64_IA
[0076] f64_Ibeta=((0.57735026918962576450914878050196*f64_odata.f64_IA)+(1.1547005383792515290182975610039*f64_odata.f64_IB))
[0077] Among them, f64_IA is the A-phase current of the motor, and f64_odata.f64_IB is the B-phase current of the motor;
[0078] The purpose of Park transformation is to obtain id feedback and iq feedback. The formula is as follows:
[0079] temp_sin = sin(f64_Angle);
[0080] temp_cos = cos(f64_Angle);
[0081] f64_IdFK=f64_Ialfa*temp_cos+f64_Ibeta*temp_sin;
[0082] f64_IqFK=f64_Ibeta*temp_cos-f64_Ialfa*temp_sin;
[0083] Among them, f64_Angle is the angle information collected by the resolver (using electrical angle), f64_IdFK is id feedback, and f64_IqFK is iq feedback. After obtaining the D and Q feedback values, ud and uq are calculated through the PID algorithm, where the D-axis target value is 0 and the Q-axis target value is the output of the speed loop.
[0084] Step S4: According to the ud and uq values obtained in step S3, complete the park inverse transformation:
[0085] temp_sin=sin(f64_odata.f64_Angle);
[0086] temp_cos=cos(f64_odata.f64_Angle);
[0087] f64_Ualfa=f64_Ud*temp_cos-f64_Uq*temp_sin;
[0088] f64_Ubeta=f64_Ud*temp_sin+f64_Uq*temp_cos;
[0089] Wherein f64_Angle is the angle information collected by the resolver (using electrical angle), f64_Ud and f64_Uq are ud and uq calculated in step S3;
[0090] Step S5: Determine the coordinate system by transformation according to f64_Ualfa and f64_Ubeta calculated in step S4:
[0091] DEG = 0.8660254;
[0092] U_A = f64_Ubeta;
[0093] U_B=DEG*f64_Ualfa-0.5*f64_Ubeta;
[0094] U_C=0.0-DEG*f64_Ualfa-0.5*f64_Ubeta;
[0095] Num=0;
[0096] if(U_A>0.0)
[0097] {
[0098] Num=1;
[0099] }
[0100] if(U_B>0.0)
[0101] {
[0102] Num = Num + 2;
[0103] }
[0104] if(U_C>0.0)
[0105] {
[0106] Num = Num + 4;
[0107] }
[0108] Among them, f64_Ualfa and f64_Ubeta are the calculation results in step S4, and Num is the sector number. After determining the sector number, the action time of each sector is calculated according to the bus voltage, and PWM is output according to the result. At this point, one cycle of motor control is completed.
[0109] After step S5 is completed, the process returns to step S1 and executes in a loop.
[0110] The real-time control method for multiple motors provided in this embodiment has been verified, tested and used in batches on engine controller products. The test results show that the present invention can achieve efficient and stable control of multiple motors simultaneously, and the motor control process is safe and reliable, and has good ease of use.
[0111] In this embodiment, the motor is controlled based on the current-speed dual closed loop mode, and the synchronous control of multiple motors is completed simultaneously by using the time-sharing and segmented processing mode; the operation ratio of the speed loop to the current loop is 1 to 6, and the speed loop is calculated once for every 6 executions of the current loop. The speed increase of the speed loop is calculated by the inertia growth equation, which realizes the smoothness of the speed increase. The algorithms used by multiple motors have been optimized, which greatly reduces the CPU usage rate. By designing six power-on strategies, using A and B phase current sensors and 270V bus voltage sensors, it is comprehensively judged whether each switch tube is in a normal state; the six power-on strategies include three one-input and two-output power-on strategies and three two-input and one-output power-on strategies. During the power-on process, regardless of the one-input and two-output or two-input and one-output mode, the corresponding upper tube that is turned on adopts a small duty cycle PWM modulation, and the corresponding lower tube that is turned on is in a full duty cycle modulation state. The six power-on strategies are executed in sequence for a total of two rounds. During the execution of each power-on strategy, when it is judged that the phase current and the upper and lower limits of the bus voltage threshold are within the range, the IGBT state is judged to be normal, otherwise it is judged to be abnormal. Through this algorithm, when any fault occurs in the motor drive module, the fault of a specific pipeline can be quickly located. The motor control software itself and the key parameters used in its operation process are stored in FLASH in AB dual-area mode. If a bit of FLASH is flipped after long-term use, causing an error in a certain area of the program or parameter, the error area can be determined by checksum, and the data in the correct area can be written to the abnormal area, and the erroneous data in the abnormal area can be overwritten with the data in the correct area.
[0112] Example 2
[0113] according to Figure 5 As shown, this embodiment also provides a real-time control system for multiple motors, including:
[0114] The data dual-zone backup and recovery module 1 is used to perform AB dual-zone backup of the key control parameters of the motor in FLASH, verify the key control parameters of the motor in AB dual-zones, and restore the key control parameters of the motor in AB dual-zones according to the verification results;
[0115] The motor control algorithm module 2 is used to initialize the restored key control parameters of the motor in the AB dual zone, configure the key control parameters of the motor in the AB dual zone into the drive module of the multi-motor, and perform real-time control of the multi-motor based on the current-speed dual closed-loop method.
[0116] Example 3
[0117] The present invention also provides a mobile terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, such as a real-time control program for multiple motors.
[0118] When the processor executes the computer program, the steps of implementing the above-mentioned multi-motor real-time control method are, for example:
[0119] Back up the key control parameters of the motor in the AB dual zones in FLASH, verify the key control parameters of the motor in the AB dual zones, and restore the key control parameters of the motor in the AB dual zones according to the verification results;
[0120] The restored key control parameters of the motors in the AB dual zones are initialized, and the key control parameters of the motors in the AB dual zones are configured in the drive modules of the multiple motors, and the multiple motors are controlled in real time based on the current-speed dual closed-loop method.
[0121] Alternatively, when the processor executes the computer program, the functions of each module in the above system are realized, for example:
[0122] The data dual-zone backup and recovery module 1 is used to perform AB dual-zone backup of the key control parameters of the motor in FLASH, verify the key control parameters of the motor in AB dual-zones, and restore the key control parameters of the motor in AB dual-zones according to the verification results;
[0123] The motor control algorithm module 2 is used to initialize the restored key control parameters of the motor in the AB dual zone, configure the key control parameters of the motor in the AB dual zone into the drive module of the multi-motor, and perform real-time control of the multi-motor based on the current-speed dual closed-loop method.
[0124] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the mobile terminal.
[0125] For example, the computer program can be divided into a data dual-area backup and recovery module 1 and a motor control algorithm module 2; the specific functions of each module are as follows:
[0126] The data dual-zone backup and recovery module 1 is used to perform AB dual-zone backup of the key control parameters of the motor in FLASH, verify the key control parameters of the motor in AB dual-zones, and restore the key control parameters of the motor in AB dual-zones according to the verification results;
[0127] The motor control algorithm module 2 is used to initialize the restored key control parameters of the motor in the AB dual zone, configure the key control parameters of the motor in the AB dual zone into the drive module of the multi-motor, and perform real-time control of the multi-motor based on the current-speed dual closed-loop method.
[0128] The mobile terminal may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The mobile terminal may include, but is not limited to, a processor and a memory.
[0129] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the mobile terminal, and uses various interfaces and lines to connect various parts of the entire mobile terminal.
[0130] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the mobile terminal by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0131] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0132] Example 4
[0133] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the real-time control method of multiple motors are implemented.
[0134] If the module / unit integrated in the mobile terminal is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0135] Based on such understanding, the present invention implements all or part of the processes in the above method, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above multi-motor real-time control method can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.
[0136] The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0137] It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A real-time control method for multiple motors, characterized in that: include: Back up the key control parameters of the motor in the AB dual zones in FLASH, verify the key control parameters of the motor in the AB dual zones, and restore the key control parameters of the motor in the AB dual zones according to the verification results; The restored key control parameters of the motors in the AB dual zones are initialized, and the key control parameters of the motors in the AB dual zones are configured in the drive modules of the multiple motors, and the multiple motors are controlled in real time based on the current-speed dual closed-loop method.
2. A multi-motor real-time control method according to claim 1, characterized in that: After the CPU is powered on, the first-level boot code is loaded. The first-level boot code guides the loading of the second-level boot code. After the second-level boot code runs, the PLL, EMIF and timer modules of the CPU are initialized, the FLASH is accessed through the chip select 1 space of the EMIF, and the key control parameters of the motor are backed up in the AB dual-zone in the FLASH.
3. A multi-motor real-time control method according to claim 1, characterized in that: The specific process of verifying the key control parameters of the motor in the AB dual zone and restoring the key control parameters of the motor in the AB dual zone according to the verification results is as follows: If there are no abnormal parameters in the key control parameters of the motors in both zones A and B, move the key control parameters of the motors in zone A to the internal RAM and execute; If there is an abnormal parameter in one of the motor key control parameters in the AB dual zones, the motor key control parameters in the correct zone are written into the abnormal motor key control parameter zone to overwrite the abnormal parameter, and the data in zone A is moved to the internal RAM for execution; If there are abnormal parameters in the key control parameters of the motor in both zones AB, an error will be reported and the process will be stopped.
4. A multi-motor real-time control method according to claim 1, characterized in that: After the key control parameters of the motor based on the AB dual zones are configured to the drive modules of multiple motors, fault detection is performed on the drive modules of multiple motors. When the detection result is a fault, an error is reported and the process is stopped, and the fault is located; otherwise, real-time control of multiple motors is performed.
5. A multi-motor real-time control method according to claim 4, characterized in that: The drive modules of multiple motors are fault-checked according to three one-input two-output power-on strategies and three two-input one-output power-on strategies. The specific process is as follows: A and B phase current sensors and 270V bus voltage sensors are used to perform static detection on the upper and lower pipes of the three phases A, B and C in the drive module by controlling the duty cycle of each half-bridge without rotating the motor. Among them, the corresponding upper tubes opened in the drive module all adopt small duty cycle PWM modulation, and the corresponding lower tubes opened are in a full duty cycle modulation state. Three one-input and two-output power-on strategies and three two-input and one-output power-on strategies are executed respectively. During the execution process, when it is judged that the upper and lower limits of the phase current and bus voltage thresholds are within the threshold range, the IGBT state is determined to be normal, otherwise it is determined to be abnormal.
6. A multi-motor real-time control method according to claim 1, characterized in that: The specific process of real-time control of multiple motors based on the current-speed dual closed-loop method is as follows: The execution cycle is set, the execution cycle is divided equally according to the number of motors, and each motor is controlled in real time in turn according to the current-speed dual closed-loop method according to the equally divided execution cycle.
7. A multi-motor real-time control method according to claim 6, characterized in that: The specific process of real-time control of each motor based on the current-speed dual closed-loop method is as follows: Obtain motor related parameters and determine whether to enter the speed loop based on the motor related parameters; If the speed loop is entered, the target speed of the motor is calculated based on the first-order inertia equation, and the target speed is used as the final target speed of the speed loop; and the Q-axis target value of the current loop is calculated based on the final target speed, which is the output of the speed loop; Compensation is performed based on the calculated time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively; the D-axis target value is 0, and the Q-axis target value is the output of the speed loop; If the speed loop is not entered, compensation is performed based on the calculated time angle information, and the Q-axis target value and D-axis target value of the current loop are calculated respectively; After the sector number is determined based on the obtained Q-axis target value and D-axis target value, the action time of each sector is calculated based on the bus voltage and the result is output. PWM is output based on the result to complete a cycle of motor control.
8. A real-time control system for multiple motors, characterized in that: include: The data dual-zone backup and recovery module (1) is used to perform dual-zone AB backup of the key control parameters of the motor in the FLASH, verify the key control parameters of the motor in the AB dual-zone, and restore the key control parameters of the motor in the AB dual-zone according to the verification result; The motor control algorithm module (2) is used to initialize the restored key motor control parameters of the AB dual zones, configure the key motor control parameters of the AB dual zones into the drive module of the multi-motor, and perform real-time control of the multi-motor based on the current-speed dual closed-loop method.
9. A mobile terminal, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the real-time control method for multiple motors as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the real-time control method for multiple motors as described in any one of claims 1 to 7 is implemented.
