A kind of hardware based field orientation is controlled (FOC) apparatus and method
Technical field
The present invention relates to a kind of hardware based field orientation and control (FOC) apparatus and method, belong to electricity field, more specifically, being specifically related to a kind of motor vector control algorithm module is an independent peripheral, rather than one independently the hardware based field orientation of processor control (FOC) apparatus and method.
Background technology
Conventional motor vector control is based on microcontroller or DSP, and motor vector control algorithm wherein adopts the mode of pure software to realize.Due to the complexity of motor vector control algorithm, the coding of this algorithm, debugging and test tend to become the main task of Motor control Application exploitation, not only can have higher specification requirement to developer, and tend to take the more development time.Pure software mode not only means follow-up higher software maintenance cost, and the reliability that plays its code often depends on coding and tester's personal experience and professional, is not to be easy to control.
The Electric Machine Control MCU of IR company also realizes motor vector control algorithm Hardware, be called Electric Machine Control engine (MCE), but on framework, MCE is equivalent to an independently processor, have oneself independently program space, the program of MCE is carried out the flexibility of implementation algorithm by a motion control sequence generator.Because MCE and CPU adopt different core, MCE need to adopt special compiler and object code the Link tool, and this makes development process comparatively complicated.
Summary of the invention
The present invention is directed to the problems referred to above, provide a kind of hardware based field orientation to control (FOC) apparatus and method, by complicated motor vector control algorithm Hardware, a peripheral hardware as microcontroller, coordinate special debugging acid, developer only needs configuration parameter, without programming, just can realize the vector control to motor.
The present invention addresses the above problem adopted technical scheme:
A kind of hardware based field orientation is controlled (FOC) device, comprise a motor vector control algorithm module, it is characterized in that, described motor vector control algorithm module is an independent peripheral, a rather than processor independently, coordinate special debugging acid, only need configuration parameter, without programming, just can realize the vector control to motor.
Further, described motor vector control algorithm module Z is mainly by electric current reconstructing module, Clark conversion module, Park conversion module, Hua Mo & PLL estimated position speed module, speed PI ring module, d shaft current PI ring module, q shaft current PI ring module, Repark conversion module, SVPWM duty ratio computing module and software correction module form; Described electric current reconstructing module connects Clark conversion module; Described Clark conversion module connects Hua Mo & PLL estimated position speed module and Park conversion module; Described Hua Mo & PLL estimated position speed module connection speed PI encircles module; Described Park conversion module connects d shaft current PI ring module and q shaft current PI ring module; Described Repark conversion module connects d shaft current PI ring module and q shaft current PI ring module, and described Repark conversion module connects SVPWM duty ratio computing module and Hua Mo & PLL estimated position speed module; Described SVPWM duty ratio computing module connects software correction module.
Further, a kind of hardware based field orientation is controlled (FOC) method, comprises the following steps:
(1) user is by on-line debugging instrument input parameter information, and CPU directly carries out parameter configuration to motor peripheral hardware;
(2) analog quantity sampling module is by select automatic sample conversion list resistor current or two resistor current according to configuration mode;
(3) current value that motor peripheral hardware collects according to analog quantity sampling module, realizes FOC algorithm by computing;
(4) motor peripheral hardware, simultaneously by the process data of motor operation, by bus, is passed CPU back, then is fed back to user by on-line debugging instrument, and be convenient to user data are followed the tracks of, and corresponding adjustment;
(5), if user need to adjust parameter, can again to motor peripheral hardware, carry out parameter configuration by on-line debugging instrument;
(6) repeat the second to the 5th step.Finally reach the index request of user to Electric Machine Control.
Further, the current value that described motor peripheral hardware collects according to analog quantity sampling module, by computing, realize FOC algorithm and comprise the following steps:
(1) analog quantity sampling module is sent the single resistance sampling or two resistance sampling current value into motor peripheral hardware according to different configurations;
(2) motor peripheral hardware selects single resistance or two resistance processing method to reconstruct electric machine phase current Ia, Ib according to configuration;
(3) electric machine phase current Ia, Ib are transformed to electric current I α, I β under α, β coordinate system by Clark conversion module;
(4) according to electric current I α, I β and rotor position angle θ under α, β coordinate system, by Park conversion module, be transformed to electric current I d, Iq under d, q coordinate system;
(5) if speed ring enables the PID result of computational speed set-point and speed feedback value and obtains torque current reference value, generation maskable interrupts after calculating completes, if do not enable, interrupting the reference value of follow-up d shaft current ring is that 0, q shaft current ring reference value is that torque current is with reference to calculating.If enable, interrupt, d shaft current reference value, q shaft current reference value are write by software.If speed ring does not enable, do not calculate this link.
(6) if calculating, electric current loop enables according to current q shaft current actual value Iq and the definite q shaft current ring reference value of step (5), by PID, to calculate q shaft voltage Uq.If calculating, electric current loop do not enable not calculate this link;
(7) if calculating, electric current loop enables according to current d shaft current actual value Id and the definite d shaft current ring reference value of step (5), by PID, to calculate d shaft voltage Ud.Generation maskable interrupts after calculating completes, the input value of interrupting if do not enable in RePark module is Ud, the Uq calculating, if enable, interrupting the input value of RePark module is that software writes.If calculating, electric current loop do not enable not calculate this link;
(8) the RePark module input value obtaining according to step (7) and rotor position angle θ calculate voltage U α, the U β under α, β coordinate system by RePark module, have calculated rear generation maskable interrupts.If enable, interrupt, follow-up SVPWM duty ratio computing module and sliding mode positioning estimation block be input as voltage U α, the U β calculating, if enable, interrupt, follow-up SVPWM duty ratio computing module and Hua Mo & The software that is input as of PLL estimated position speed module writes;
(9) voltage U α, the U β that basis obtains and α, β shaft current I α, I β utilize sliding formwork and PLL principle by Hua Mo & PLL estimated position speed module estimates current rotor position angle and rotor speed.Calculating completes generation maskable interrupts, if enable, does not interrupt, and Park module and RePark module rotor used by same position angle are sliding formwork estimated position angle.If enable, interrupt, Park module and RePark module rotor used by same position angle are that software writes;
(10) according to the voltage U α obtaining in step (8), U β, according to SVPWM principle, by SVPWM duty ratio computing module, calculate three-phase duty ratio, calculated rear generation maskable interrupts.If do not enable, interrupt finally sending out ripple duty ratio used and be this duty ratio, if enable, interrupt, finally sending out ripple duty ratio used is that software writes.
Advantage of the present invention is:
1. the present invention, by complicated motor vector control algorithm Hardware, calls for CPU as a peripheral hardware, is equipped with special debugging acid, without programming, just can realize the vector control of motor, greatly reduce technical threshold, shorten the development time, and be more easily guaranteed in reliability.Hardware also brings a benefit, almost there is no software maintenance cost.
The MCE of 2.Yu IR company is different, and motor vector control algorithm module of the present invention is a peripheral hardware of CPU, rather than processor independently, therefore without other compiler and object code the Link tool, develops more convenient.
Except object described above, feature and advantage, the present invention also has other object, feature and advantage.Below with reference to figure, the present invention is further detailed explanation.
Accompanying drawing explanation
The accompanying drawing that forms the application's a part is used to provide a further understanding of the present invention, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.
In the accompanying drawings:
Fig. 1 is MCU block architecture diagram;
Fig. 2 is peripheral hardware algorithm computing block diagram.
Embodiment
Below with reference to the accompanying drawings and in conjunction with the embodiments, describe the present invention in detail.
With reference to figure 1 and Fig. 2, a kind of hardware based field orientation is as depicted in figs. 1 and 2 controlled (FOC) device, comprise a motor vector control algorithm module, it is characterized in that, described motor vector control algorithm module is an independent peripheral, rather than a processor independently, coordinates special debugging acid, only need configuration parameter, without programming, just can realize the vector control to motor.
Described motor vector control algorithm module Z is mainly by electric current reconstructing module, Clark conversion module, Park conversion module, Hua Mo & PLL estimated position speed module, speed PI ring module, d shaft current PI ring module, q shaft current PI ring module, Repark conversion module, SVPWM duty ratio computing module and software correction module form; Described electric current reconstructing module connects Clark conversion module; Described Clark conversion module connects Hua Mo & PLL estimated position speed module and Park conversion module; Described Hua Mo & PLL estimated position speed module connection speed PI encircles module; Described Park conversion module connects d shaft current PI ring module and q shaft current PI ring module; Described Repark conversion module connects d shaft current PI ring module and q shaft current PI ring module, and described Repark conversion module connects SVPWM duty ratio computing module and Hua Mo & PLL estimated position speed module; Described SVPWM duty ratio computing module connects software correction module.
Field orientation is controlled (FOC) method, comprises the following steps:
(1) user is by on-line debugging instrument input parameter information, and CPU directly carries out parameter configuration to motor peripheral hardware;
(2) analog quantity sampling module is by select automatic sample conversion list resistor current or two resistor current according to configuration mode;
(3) current value that motor peripheral hardware collects according to analog quantity sampling module, realizes FOC algorithm by computing;
(4) motor peripheral hardware, simultaneously by the process data of motor operation, by bus, is passed CPU back, then is fed back to user by on-line debugging instrument, and be convenient to user data are followed the tracks of, and corresponding adjustment;
(5), if user need to adjust parameter, can again to motor peripheral hardware, carry out parameter configuration by on-line debugging instrument;
(6) repeat the second to the 5th step.Finally reach the index request of user to Electric Machine Control.
The current value that described motor peripheral hardware collects according to analog quantity sampling module, by computing, realize FOC algorithm and comprise the following steps:
(1) analog quantity sampling module is sent the single resistance sampling or two resistance sampling current value into motor peripheral hardware according to different configurations;
(2) motor peripheral hardware selects single resistance or two resistance processing method to reconstruct electric machine phase current Ia, Ib according to configuration;
(3) electric machine phase current Ia, Ib are transformed to electric current I α, I β under α, β coordinate system by Clark conversion module;
(4) according to electric current I α, I β and rotor position angle θ under α, β coordinate system, by Park conversion module, be transformed to electric current I d, Iq under d, q coordinate system;
(5) if speed ring enables the PID result of computational speed set-point and speed feedback value and obtains torque current reference value, generation maskable interrupts after calculating completes, if do not enable, interrupting the reference value of follow-up d shaft current ring is that 0, q shaft current ring reference value is that torque current is with reference to calculating.If enable, interrupt, d shaft current reference value, q shaft current reference value are write by software.If speed ring does not enable, do not calculate this link.
(6) if calculating, electric current loop enables according to current q shaft current actual value Iq and the definite q shaft current ring reference value of step (5), by PID, to calculate q shaft voltage Uq.If calculating, electric current loop do not enable not calculate this link;
(7) if calculating, electric current loop enables according to current d shaft current actual value Id and the definite d shaft current ring reference value of step (5), by PID, to calculate d shaft voltage Ud.Generation maskable interrupts after calculating completes, the input value of interrupting if do not enable in RePark module is Ud, the Uq calculating, the input value of interrupting if enable in RePark module is that software writes.If calculating, electric current loop do not enable not calculate this link;
(8) the RePark module input value obtaining according to step (7) and rotor position angle θ calculate voltage U α, the U β under α, β coordinate system by RePark module, have calculated rear generation maskable interrupts.If enable, interrupt, follow-up SVPWM duty ratio computing module and sliding mode positioning estimation block be input as voltage U α, the β calculating, if enable, interrupt, follow-up SVPWM duty ratio computing module and Hua Mo & The software that is input as of PLL estimated position speed module writes;
(9) voltage U α, the U β that basis obtains and α, β shaft current I α, I β utilize sliding formwork and PLL principle by Hua Mo & PLL estimated position speed module estimates current rotor position angle and rotor speed.Calculating completes generation maskable interrupts, if enable, does not interrupt, and Park module and RePark module rotor used by same position angle are sliding formwork estimated position angle.If enable, interrupt, Park module and RePark module rotor used by same position angle are that software writes;
(10) according to the voltage U α obtaining in step (8), U β, according to SVPWM principle, by SVPWM duty ratio computing module, calculate three-phase duty ratio, calculated rear generation maskable interrupts.If do not enable, interrupt finally sending out ripple duty ratio used and be this duty ratio, if enable, interrupt, finally sending out ripple duty ratio used is that software writes.
As shown in Figure 1, analog quantity sampling module inner integrated AD modular converter and discharge circuit, sample conversion result is directly connected to Electric Machine Control peripheral hardware, and user is without especially designing sample circuit, saved PCB area and cost, on software also without especially writing again current of electric sampling section code.
As shown in Figure 1, MCU is accompanied with special-purpose exploitation debugging acid, and this instrument is by serial ports and MCU communication, simply efficient.Can realize the functions such as parameter configuration, the download of code compilation code, on-line debugging.Wherein under on-line debugging state, can realize motor startup, stop, the function such as brake, speed governing, expanded function application, algorithm parameter modification, and can show in real time the operation variable in motor operation course with oscillographic form, for user, debug.
As shown in Figure 1, MCU has attached the common mathematical function storehouse of the required use of Electric Machine Control, and user can directly call packaged function and make an excuse in personal code work and realize required function.Function library comprises that motor configuration function, electric motor starting function, motor stop function, motor brake function, weak magnetic control function, low-frequency torque penalty function, dead area compensation function etc.
In sum, a kind of hardware based field orientation of the present invention is controlled (FOC) apparatus and method, a peripheral hardware using motor vector control algorithm module as CPU, rather than using motor vector control algorithm module as a processor independently, therefore without other compiler and object code the Link tool, develop more convenient.
The foregoing is only the preferred embodiments of the present invention, the present invention includes but be not limited to this example, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.