DIGITAL MOTOR CONTROLLER

Abstract: A digital motor controller (10) employs a digital signal processor (70) to generate commutation commands that drive and brake a motor (14). The commutation commands are pulse width modulated. To avoid shoot-through, the digital signal processor (70) automatically adjusts the widths of the pulses according to the amount of current being drawn by the motor (14). Motor speed is measured by taking the difference between consecutive samples from a position sensor and dividing the difference by the sampling time. The digital signal processor (70) also closes position, speed and current loops. The commands provided by each loop are limited between upper and lower limits. Further, the digital signal processor (70) automatically adjusts the upper and lower limits to compensate for changes in design characteristics due to viriations in temperature. The digital motor controller (10) can be used to control different motors (14) having different design characteristics simply by reprogramming the upper and lower limits. A plurality of digital motor controllers (10) can be used to control motors (14) operating in tandem.

Description: DIGITAL MOTOR CONTROLLER TECHNICAL FIELD The present invention relates generally to controllers for electric motors , and more particularly to a digital motor controller for DC brushless motors . BACKGROUND ART Control of electrical power has traditionally been accomplished with analog control loops and signals in conjunction with limited digital processing to provide both c l osed loop control and protection. Typically, such analog systems are comprised of a large number of discrete components . These controllers are large, costly and often unreliable. Further, prior art motor controllers cannot be adapted for use with different motors . In general, a motor control l er is configured for the design characteristics ( e.g. resistance and inductance) of a particular motor. D esign characteristics vary between different motors. P ower ratings also vary. Therefore, the same controller cannot be used for different motors. A dditionally, prior art motor controllers cannot provi d e f or changing physical characteristics of the motor itse lf . For example, during continued use, the resistance an d in d uctance of the motor are subject to change. . These changes may become increasingly more significant with increases in temperature and with time as the motor is cycled through a number of operating periods during the course of its operational life. The prior art motor controllers do not allow for changes within motor operating characteristics nor are they capable of operating the motor at peak efficiency with precise control of the operational parameters. In prior art controllers, a problem known as "shoot- through" occurs when controlling the inverter of the motor. An inverter 12 shown in Figure 2 comprises three pairs of complementary switches 24 and 30, 26 and 32, and 28 and 34. By turning "on" selected switches, two windings can be energized by a power supply. However, if a complementary pair of switches, such as 24 and 30, are conducting at the same time, a short across the power supply occurs. As a result, the power supply is damaged. For ideal switches, non-overlapping timing signals would prevent complementary switches from conducting at the same time. However, the switches are not ideal; they are formed by transistors, which have internal capacitances. Thus, as one transistor is charging and the other is discharging, the two transistors can conduct simultaneously. As a result, shoot-through occurs. The limitations of prior art motor controller systems are magnified in the case where two or more motors are physically coupled to a single output in an effort to increase the total power output of the system. For these types of systems, prior art controllers are not capable of communicating with one another to provide precise synchronized motor control. DISCLOSURE OF THE INVENTION The disadvantages of the prior art motor controllers are overcome by the present invention. Apparatus for controlling a brushless motor having a rotor and multiple stator windings comprises sensing means, digital signal processing means and inverter means. The sensing means determines the position of the rotor with respect to the multiple stator windings. The digital signal processor means processes the output signals provided by the sensing means to select the stator windings to be energized. In response to the outputs of the digital signal processor means, the inverter means energizes the windings selected by the digital signal processor means. Thus, the digital signal processor means generates commutation commands for the motor. By commanding commutation, the digital signal processor means allows for precise control of motor speed, output power and rotor position. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block diagram of a digital motor controller system. Figure 2 is a block diagram of a digital motor controller according to the present invention. Figure 3 is a depiction of analog signals provided by the rotor position sensors. Figure 4 depicts the envelopes of values sampled from the analog signals shown in Figure 3. Figure 5 is a depiction of modulated commutation signals. Figure 6 is a flow chart of an interrupt routine. which is performed by the DSP. Figure 7 is a graphic representation of the digital position signals and the commutation signals derived therefrom. Figure 8 is a flowchart of a DSP subroutine for deriving digital position signals from analog signals provided by the rotor position sensors. Figure 9 is a block diagram of a preferred embodiment of the commutation logic. Figure 10 is a timing diagram for the commutation logic shown in Figure 8. Figure 11 is a truth table for rotation of the motor in a clockwise direction. Figure 12 is a truth table for rotation of the motor in a counterclockwise direction. Figure 13 is a tabulation of positions for the digital position signals. Figure 14 depicts the states for the digital position signals. Figure 15 is a state diagram for clockwise rotation of the rotor. Figure 16 is a state diagram for counterclockwise rotation of the rotor. Figure 17 is a flowchart of a DSP subroutine for calculating direction, speed and position of the rotor. Figure 18 is a flowchart of a DSP subroutine for calculating current feedback. Figure 19 depicts a current sensing signal having a negative polarity. Figure 20 depicts a current sensing signal having a positive polarity. Figure 21 is a table for selecting a feedback current. Figures 22 and 23 are a flowchart of a DSP program for closed loop control of the motor. BEST MODE FOR CARRYING OUT THE INVENTION Referring to Figure 1, a digital motor controller (DMC) 10 provides commutation commands to an inverter 12, which cause selected stator windings of a motor 14 to be energized. Position sensors 16 provide position signals to the DMC 10. The DMC 10 processes these signals to generate commutation commands. The DMC 10 uses the processed signals to determine the relative angular position, direction, and speed of the motor 14. The DMC 10 receives digital position command signals on a data bus 18 and analog position command signals on conductor 20, and it uses these commands to close position and speed loops. Current sensors 22 provide data information concerning the excitation currents directed to the motor 14. The DMC 10 uses this data to close a current loop and perform diagnostic checks. Referring now to Figure 2, the motor 14 includes three stator windings A, B and C that are connected in a wye bipolar configuration. It should be noted that the DMC 10 can control a motor having any number of windings. Within the inverter 12, three upper switches 24, 26 and 28 and three lower switches 30, 32 and 34 are arranged in a standard three phase inverter configuration to commutate power to the stator windings A, B and C. Each switch is formed by a single transistor, or by several transistors connected in parallel. A positive operating potential is provided by DC link high 36 to the high side of switches 24, 26, and 28, which are actuated by commutation signals A+, B+ and C+, respectively, from the DMC 10. A negative operating potential is provided by DC link return 38 to the switches 30, 32 and 34, which are actuated by commutation signals, A-, B- and C-, respectively, from the DMC 10. The low side from switch 24 and the high side of switch 30 are both connected to winding A in common. Similarly the low side from switch 26 and high side of switch 32 are connected to winding B, and the low side from switch 28 and high side of switch 34 are connected to winding C. The inverter 12 and motor 14, which is a brushless DC motor, are well known to those skilled in the art. During motor driving operation, only one of the upper switches 24, 26 and 28 is "on" at any particular time, and only one of the lower switches 30, 32 and 34 is "on" at any particular time. Further, complimentary switches are never on at the same time; otherwise, shoot-through occurs. Thus, current will flow through a path which serially includes the DC link high 36, an upper switch 24, 26 or 28 that is "on", two of the stator windings A, B, or C, a lower switch 30, 32, or 34 that is on, and the DC link return 38. As the motor rotor is forced to a different orientation, the DMC 10 commands "on" a different pair of upper and lower switches to commutate the operating potential delivered to the windings A, B or C of the motor 14. Within the motor 14, the position sensor 16 includes motor position sensors 40, 42, and 44, which are positioned proximate to the windings A, B and C respectively. These sensors 40, 42 and 44 generate analog position signals APOSA, APOSB and APOSC, which provide the raw data position signals. The analog position signals, APOSA, APOSC, and APOSB are produced by sending a carrier signal to the sensors 40, 42 and 44, which then individually amplitude modulate their outputs to varying levels as the rotor shaft turns through 360 degrees. Accordingly, the signals APOSA, APOSB, APOSC appear to be sinusoidally varying signals which are phase displaced by 120°, respectively, and dependent upon motor rotor position (see Figure 3) . A frequency of 50 kHz for the carrier signal is sufficient to produce a number of positive and negative peaks for each cycle. Sinusoidally varying and amplitude modulated, the position signals APOSA, APOSB and APOSC are filtered by anti-aliasing filters 46, 48 and 50 to remove harmonics. The outputs of the anti-aliasing filters 46, 48 and 50 are supplied to sample and hold circuits 52, 54 and 56 respectively. Timing signals, issued over conductor 58, enable the sample and hold circuits 52, 54 and 56 to sample the analog signals APOSA, APOSB and APOSC at the same time. The sample and hold circuits 52, 54 and 56 are phase delayed by 90 degrees to trail the initiation of the of the 50 kHz carrier signal. Thus, the sample and hold circuits 52, 54 and 56 obtain the peak values of the analog signals APOSA, APOSB and APOSC. Envelopes GPOSA, GPOSB and GPOSC of the values from the analog signals APOSA, APOSB and APOSC are depicted in Figure 4. The values sampled by the sample and hold circuits 52, 54, and 56 are then routed to a multiplexer 60 which serially outputs the signals. The multiplexer 60 receives control signals via conductor 62, which control signals allow for correct sequencing of the multiplexer output signals. The output signals are supplied to a buffer 64. An output of the buffer 64 is supplied to sample and hold circuit 66, which allows the multiplexer 60 to settle on a new input value while the analog to digital converter 68 is converting the previous input. The output of the sample and hold circuit 66 is converted into a digital format by a flash analog to digital converter 68. The digitized samples from the envelopes GPOSA, GPOSB and GPOSC are then forwarded to a digital signal processor (DSP) 70 where they are processed into digital position signals DPOSA, DPOSB and DPOSC. The DSP 70 can be an ADSP 210X, which is sold by Analog Devices, or any equivalent microprocessor. Because such microprocessors are well known, a description of its architecture is not necessary. The selection of a particular microprocessor is left to a person skilled in the art. A program and scratch pad and tables and constants for the DSP 70 are stored in electronic memory 71. The program includes an interrupt program (Figure 6) , subroutines for deriving the digital position signals DPOSA, DPOSB and DPOSC (Figure 8), speed feedback (Figure 17), current feedback (Figure 18) and a program for loop control (Figures 22 and 23) . The digital position signals DPOSA, DPOSB and DPOSC are supplied, to a commutation logic cell 72 via data buses 74, 76 and 78, respectively. Over conductor 80, the DSP 70 provides a direction command DIRCMD , which indicates the commanded direction of motor rotation. In response to these signals, the commutation logic cell 72 provides the six commutation signals A+, B+, C+, A-, B-, and C- to the inverter 12. The commutation logic signals A+, A-, B+, B-, C+ and C- are modulated by a modulation frequency, such as an 18 kHz signal, which is selected by the DSP 70. The DSP 70 provides a duty cycle command DCCMD to the commutation logic cell 72 via data bus 82. The duty cycle command DCCMD varies the pulse width of the modulated frequency to control motor speed. Thus, the commutation logic cell 72 effectively modulates the commutation signals A+, A-, B+, B-, C+ and C- by varying the duration of the "on" time within the 18 kHz signal and thereby reducing the speed and power output of the motor 14. For example, the motor 14 can be operated near 100% power for the "on" time for phase A, 50% power for the "on" time for phase C, and 20% power for the time of phase B, due to the variation of the "on" duration within the 18 kHz signal, from 100% to 50% to 20% respectively (see Figure 5). Within the inverter 12, these commutation signals A+, A-, B+, B-, C+ and C- are applied to switches 24, 26, 28, 30, 32 and 34, respectively. Each of these commutation signals is basically an on/off signal for its respective switch. As described above, the switches 24, 26, 28, 30, 32 and 34 commutate the positive voltage potential and negative voltage potential into and out of the motor phase windings A, B and C. The current sensor 22 includes three saturable core type current sensing elements 84, 86 and 88, which are basically inductor coils wrapped about the electrical leads to motor windings A, B, and C, respectively. A 50 kHz square wave excitation voltage is applied to the sensing elements 84, 86 and 88. When a winding A, B, or C is energized, the associated current sensing element 84, 86, 88 will saturate rapidly. The 50 KHz excitation voltage then produces a square wave current output signal which lags the square wave voltage input by 90 degrees. The square wave current output signals from each of the three current sensing elements 84, 86, and 88 are the analog current phase signals ACURA, ACURB, and ACURC, respectively. The analog current phase signals ACURA, ACURB and ACURC are filtered by anti-aliasing filters 90, 92 and 94, respectively, and sampled by sample and hold circuits 96, 98 and 100, respectively. The sampling times are synchronized to the trailing edge of the 50 kHz excitation signal. In addition, an analog DC link current ACURDC is forwarded to an anti-aliasing filter 102 and sample and hold circuit 104. The outputs of the sample and hold circuits 96, 98, 100 and 104 are forwarded to the multiplexer 60, which outputs the signals in a serial stream. The analog to digital converter 68 converts these sampled analog currents to a digital DC link current DCURDC and to digital phase currents DCURA, DCURB and DCURC, whose values vary in magnitude based upon the input power to the associated winding A, B or C. Reference currents CURAREF, CURBREF and CURCREF are taken from center taps of the current sensor elements 84, 86, and 88 respectively. These currents are respectively received by three comparators 106, 108, and 110. The comparators 106, 108 and 110 also receive a voltage reference signal (VREF). Each of these comparators 106, 108, 110 compares the reference currents CURAREF, CURBREF, and CURCREF respectively, to the voltage reference signal VREF and produces an output which is directed to a buffer 112. Under control from the DSP 70, the buffer 112 settles on values for the reference currents. The values for the •reference currents are supplied to the DSP 70, where they are used in the current loop. Also, the currents are used for diagnostic checks. With the addition of an I/O controller (not shown) , the DMC 10 can be integrated into other systems, such as aircraft and spacecraft. The I/O controller provides interface capability between the DMC 10 and external electronics. The I/O controller receives and transmits the input commands so as to monitor the status of the DMC 10, incorporates a built-in test loop, and provides temperature and power supply voltage measurements. Further, the performance of the DMC 10 can be enhanced with the addition of the following elements: a -ii- "watchdog timer" which interrogates the DMC 10 to ensure that the system is healthy and fault-free; an interrupt timer, which notifies the DMC 10 of time to receive a position command POSCMD, and time to shut down in the event of a power failure; and a write discrete latch, whose contents notify the outside world of the reasons for system shutdown (e.g., overcurrent) . The DMC 10 can also be provided with a frequency divider, which divides a single clock signal into a number of lower-frequency clock signals. Thus, different timing signals can be provided to the DMC 10 by a single clock generator and the frequency divider. Referring now to Figure 6, there is shown a flowchart of an interrupt routine, which is entered (module 300) by the DSP 70 every twenty microseconds. Every twenty microseconds, the DSP 70 executes a subroutine for motor direction decoding (module 302) . This subroutine yields the digital position signals DPOSA, DPOSB and DPOSC. Thus, the digital position signals are updated 50,000 times per second. This subroutine is described in detail in connection with Figures 7 and 8. The interrupt routine provides an internal counter CUR__CNT, which is incremented every twenty microseconds (module 304), and reset every 100 microseconds (module 316) . When the counter CUR_CNT equals one, three and four (module 310) , the DSP 70 exits the interrupt routine (module 312) . When counter CUR__CNT equals two (module 306) , the DSP 70 performs speed feedback decoding (module 308) . Here, the DSP 70 uses the digital position signals DPOSA, DPOSB and DPOSC to determine speed feedback signals. Thus, the speed feedback signals are updated 10,000 times per second. The speed feedback signals are described in detail in connection with Figures 13-17. When counter CUR_CNT equals five (module 310) , the DSP 7 0 furnishes a current feedback signal (module 314) . The current feedback signal is determined from the digital position signals DPOSA, DPOSB and DPOSC, the current references CURAREF, CURBREF and CURCREF and the digital phase currents DCURA, DCURB and DCURC. Thus, the currents and feedback signals are updated 10,000 times per second. The current feedback signal is described in detail in connection with Figures 18-21. Figure 7 illustrates how the DSP 70 processes the samples from the envelopes GPOSA, GPOSC and GPOSB. To facilitate an understanding of the processing, the envelopes GPOSA, GPOSC and GPOSB are superimposed in Figure 7a. In general, the DSP 70 compares sampled values from consecutive envelopes. The digital signal for a position sensor goes high when the sampled value from its envelope is greater than the sampled value from the next envelope. In this manner, each digital signal indicates the proximity of the rotor relative to a corresponding winding and the adjacent winding. Figure 7b illustrates the digital signals DPOSA, DPOSC and DPOSB resulting from the comparison. Additionally, Figure 8 is a flowchart of a DSP 70 routine for processing sampled values from the envelopes GPOSA, GPOSB and GPOSC. First, the DSP 70 obtains data concerning the position of the rotor (module 400) . The DSP 70 sends the timing signal over conductor 58, which signal causes the sample and hold circuits 52, 54 and 56 to sample the analog position signals APOSA, APOSB and APOSC provided by the position sensor 20. Afterwards, the DSP 70 sends control signals over conductor 62 to the multiplexer 60, which control signals enable the multiplexer 60 to output the sampled values from envelopes GPOSA, GPOSB and GPOSC. The DSP 70 reads the output of the A/D converter 68. The digital position signal DPOSA is determined by comparing the value sampled from the envelope GPOSA to a value sampled from the envelope GPOSC (module 402) . When the sampled value of the envelope GPOSA is greater than that of envelope GPOSC, the digital position signal DPOSA is set high (module 404) . If the value sampled from the envelope GPOSA is less than that of envelope GPOSC, the digital position signal DPOSA is set low (module 406) . Similarly digital position signal DPOSC is determined by comparing the values sampled from envelope GPOSC to that of envelope GPOSB (module 408) , in that DPOSC is high when envelope GPOSC is greater than envelope GPOSB (module 410) and low when envelope GPOSB is less than envelope GPOSC (module 412) . Finally, digital position signal DPOSB is determined by comparing envelope GPOSB with envelope GPOSA (module 414) such that when envelope GPOSB is greater than envelope GPOSA, digital signal DPOSB is high (module 416) , and when envelope GPOSA is greater than envelope GPOSB, digital signal DPOSB is low (module 418) . These digital position signals DPOSA, DPOSB, DPOSC, which are shown in FIG 6b, are utilized in the DSP 70 to determine the rotor position and the actual direction of the motor, to provide current feedback, and to indicate position sensor failures. The commutation logic cell 72 utilizes the digital position signals DPOSA, DPOSB and DPOSC to provide commutation commands to the inverter 12. Referring now to Figure 9, there is shown a preferred embodiment of the commutation logic cell 72. The DSP 70 programs a modulation frequency by placing an 8-bit frequency command on the data bus 82 and strobing a first clock signal WR-PWM-FREQ, which sets bits D0-D7 of a first latch 114. The contents of the first latch 114 are loaded into a first counter 116, which is a free running counter. " The first counter 116 is clocked at 12 MHz. Whenever the first counter 116 reaches its terminal count, its carry out goes high, and it performs a parallel load of the contents of the first latch 114. Because the carry-out of the first counter 116 is coupled to its clear enable, the carry-out goes low on the next 12 MHz pulse. Thus, a pulse is provided on the carry-out. As the contents of the first latch 114 are increased in value, the frequency of pulses on the carry-out of the first counter increases, i.e. the terminal count is reached faster (see Figure 10a). In this manner, the carry-out of the first counter 116 furnishes a signal PWM-FREQ having the modulation frequency selected by the DSP 70. Bits D0-D11 of the duty cycle command DCCMD contain the duration of the duty cycle. When the duty cycle command DCCMD is placed on the data bus 82, the DSP 70 strobes a second clock signal WR-PWM-DC, which sets bits D0-D7 of a second latch 118 and bits D8-D11 of a third latch 120. With each parallel load, a second counter 122 counts up to the terminal count and then provides a pulse on its carry out. The pulse goes high at the parallel load and goes low as the terminal count is reached (see Figure 10b) . The carry-out of the second counter 122 furnishes a duty cycle DC. The DSP 70 adjusts the pulse width of the duty cycle DC to insure against shoot-through. The initial "on" time of a selected transistor (switch) in the inverter 12 is reduced by an interval EPS. The interval EPS is a short time interval of "off" time during which the base charge of a complementary transistor in the inverter 12 is removed. Thus, the selected transistor is not turned on until its complimentary transistor has had time to discharge. The duration of the interval EPS depends upon the current that the transistors conduct. Higher currents require more time for the removal of the base charge from the complementary transistor. To reduce "on" time, bits D12-D15 of the duty cycle command DCCMD, which contain a value for the interval EPS, are loaded into the third latch 120. A third counter 124 operates to count up to the terminal count and then stop until the next parallel load. A count enable CE is used to halt the third counter 124. The third counter 124 provides a pulse having a duration equal to the interval EPS (see Figure 10c) . The pulse coincides with the leading edge of each duty cycle DC. The number of possible pulse width modulated frequencies ranges from 5.9 KHz to 1.5 MHz The resolution of the pulse width modulated frequency is 83 nanoseconds. With the pulse width modulated frequency set at 18 KHz and the first counter 116 clocked at 12 MHz, the duty cycle can vary from 0-100 percent with a resolution of 0.15 percent. The interval EPS can be adjusted from 0.33 microseconds to 5.2 microseconds with a resolution of 83 nanoseconds. Because the first and second clock signals are not synchronized, double buffering is necessary to prevent the DSP 70 from writing into the second and third latches 118 and 122 while the second and third latches 118 and 120 are loading their respective counters 122 and 124. A third latch 126 is disposed between the first latch 118 and second counter 122, and a fourth latch 128 is disposed between the second latch 120 and the third counter 124. The third and fourth latches 126 and 128 are normally clocked by double buffering logic 130 just prior to the second and third counters 122 and 124 being parallel loaded. However, if the DSP 70 happens to be updating the first and second latches 118 and 120 at the same time, the clocking of the third and fourth latches 126 and 128 will be skipped until the next parallel load. Double buffering is well known to those skilled in the art. The duty cycle DC and interval EPS are supplied to drive/brake logic 132. The drive/brake logic 132 removes the interval EPS from the duty cycle DC (see Figure lOd) . Thus, the duty cycle DC goes low whenever the interval EPS goes high. The duty cycle DC is provided on a first output of the drive/brake logic 132. This signal is employed to drive the motor 14 (i.e., put power into the motor 14). The drive/brake logic 132 further provides an inverse duty cycle DCINV, which is used to brake the motor 14 (i.e., remove power from the motor 14) . Whenever the duty cycle DC is low and the output interval EPS goes low, the signal DCINV goes high (see Figure lOe) . Thus, the width of the inverse duty cycle DCINV is also controlled by the duty cycle command DCCMD. The drive/brake logic 132 can be realized by a person skilled in the art. The duty cycle DC and inverse duty cycle DCINV are supplied to respective inputs of a programmable logic array (PLA) 134. The digital position signals DPOSA, DPOSB and DPOSC and the direction command DIRCMD are also supplied to respective inputs of the PLA 134. The PLA 134 realizes the truth table shown in Figures 11 and 12. The truth table shown in Figure 11 corresponds to clockwise rotation of the motor 14. Note that the direction command DIRCMD is always high. Whenever the duty cycle DC and the inverse duty cycle DCINV have the same values, all the switches 24, 26, 28, 30, 32 and 34 in the inverter 12 are switched off. . Note that all three signals DPOSA, DPOSC and DPOSB do not go high simultaneously (state 7) , nor do they go low simultaneously (state 0) . If they do, a signal PSF indicating position sensor failure goes high. Thus, the DMC 10 provides an error flag when the position sensor 16 fails. Whenever the duty cycle DC is high and the inverse duty cycle DCINV is low, the motor 14 is driven in the clockwise direction. When only signal DPOSC is high, the commutation signals C+ and B- go high (state 1) . When only signals DPOSB is high, commutation signals B+ and A-go high (state 2) . When signals DPOSB and DPOSC are high. com utation signals C+ and A- go high (state 3) . When only the signal DPOSA is high, the commutation signals A+ and C- go high (state 4). When signals DPOSC and DPOSA are high, the commutation signals A+ and B- go high (state 5) . When signals DPOSB and DPOSA are high, commutation signals B+ and C- go high (state 6) . The set of inputs and corresponding commutation signals A+, A-, B+, B-, C+ and C- for clockwise drive are depicted in Figures 6b and 6c. Whenever the duty cycle DC is low and the inverse duty cycle DCINV is high, the motor is braked. Braking allows the back emf generated by the motor 14 to flow back into the power source. When only signal DPOSC is high, the commutation signals C- and B- go high (state 1) . When only signals DPOSB is high, commutation signals B- and A-go high (state 2) . When signals DPOSB and DPOSC are high, commutation signals C- and A- go high (state 3) . When only the signal-DPOSA is high, the commutation signals A-and C- go high (state 4) . When signals DPOSC and DPOSA are high, the commutation signals A- and B- go high (state 5) . When signals DPOSB and DPOSA are high, commutation signals B- and C- go high (state 6) . Thus, the DMC 10 controls the current arising from back emf. If the back emf goes very high, the power source can be damaged. Further, certain applications do not allow the back emf to flow into the power source. Thus a load resistor RL is provided to dissipate the back emf. The load resistor RL is coupled between the DC link high 36 and the collector of a transistor T, whose emitter is coupled to the DC Link return 38 (see Figure 3) . The transistor T has the same power rating as the transistors in the inverter 12. The DSP 70 causes the transistor T to conduct when the DC Link voltage exceeds the power rating of the transistors. Thus, the voltage on the DC Link high 36 is digitized and supplied to the DSP 70. When the DC link voltage is greater than power rating of the transistors (e.g. 300 VDC) , the DSP 70 sends a signal to the base of transistor T, which connects the load resistor RL between the DC Link high 36 and DC Link return 38. As a result, the load resistor dissipates the back emf. The truth table shown in Figure 12 corresponds to counterclockwise rotation of the motor 14. For the first and fourth sets of inputs, no power is supplied to the motor 14. For the second set of inputs, the motor 14 is driven in the counterclockwise direction. For the third set of inputs, the motor 14 is braked as it rotates in the counterclockwise direction. Referring now to Figures 13-16, the DSP 70 determines motor position, speed and direction of rotation from the digital position signals DPOSA, DPOSB, and DPOSC. As previously discussed, within any complete cycle (i.e., electrical rotation of 360°) there are six possible states (i.e., positions) for the three digital signals DPOSA, DPOSB, and DPOSC. These six active positions are designated SI, S2, S3, S4, S5, and S6. From Figures 13 and 14, it is apparent that each state represents the binary values of the digital signals DPOSB, DPOSC, and DPOSA. Also included in the tabulation are the two error positions SO and S7, which indicate position sensor failure PSF. Each of the six positions S1-S6 represents a known sixty degrees of motor rotor position. Thus, a determination of the present state gives a coarse indication of the motor orientation. A zero position or orientation (i.e. 0 β ) may be assigned at a selected transition point, for example, the S3-S1 transition point. Relative to this assigned zero position, the transition point SI to S5 will occur at 60 ® . Similarly, S5 to S4 will be at 120°, S4 to S6 will be at 180°, S6 to S2 will be at 240°, S2 to S3 will be at 300° and S3 to SI will be at 360° which is also the 0 β position. Thus a sequence for the position states S1-S5-S4-S6-S2-S3- Sl, or any portion thereof, represents rotation in the clockwise direction (see Figure 15) . Conversely a sequence of S1-S3-S2-S6-S4-S5-S1, or any portion thereof, represents rotation in the counter clockwise direction (see Figure 16) . It should be emphasized that only one such transition between position states is required to determine the direction of the motor 14. Referring now to Figure 17, there is shown a flowchart of a DSP subroutine for determining direction, speed and position of the rotor. By keeping track of the position states S1-S6, the coarse position of the motor 14 is always known (module 502) . The DSP 70 examines changes in the position states S1-S6 to determine the direction of the motor rotation (module 504) . Then, the DSP 70 looks at the slope and value of the envelopes GPOSA, GPOSB, and GPOSC to determine the instantaneous speed and fine position, respectively, of the motor 14. As described above, the envelopes GPOSA, GPOSB and GPOSC comprise a series of sampled values taken from the analog position signals APOSA, APOSB, and APOSC. The DSP 70 takes samples from the envelope having a non-zero slope (module 506) . For position state SI, the speed is determined from the slope of the envelope GPOSB. The remaining envelopes and their corresponding states are shown in Table 1. The slope of the envelope GPOSA, GPOSB or GPOSC is calculated as the difference between successive samples divided by sampling time (module 508) . As the sampling time approaches zero, the slope approaches the instantaneous speed. If the slope of the selected envelope GPOSA, GPOSB or GPOSC is negative, its sign is inverted such that the speed always has a positive value. The instantaneous speed can be used as a speed feedback signal. TABLE 1 Position state Motor Speed SI GPOSB S2 GPOSC 53 -GPOSA 54 GPOSA 55 -GPOSC 56 -GPOSB The instantaneous speed of the motor 14 is then integrated to determine the fine (i.e., precise angular) position of the motor 14 (module 510) . Instantaneous position is determined by combining coarse and fine position (module 512) . An example may best illustrate this procedure. When the motor 14 moves from position state S5 to position state SI, the DSP 70 can determine that the direction is counterclockwise. A determination of the slope of the selected envelope GPOSB yields a precise angular rotational speed, for example 1000 revolutions per second (rps) or 360,000 degrees per second. At any desired time between position state, for example, fifty-six microseconds after the switching from S5 to SI, the slope is integrated over the desired time. The integration indicates that the rotor has rotated -20 degrees from state S5. By adding the coarse position (60 degrees) to the fine position (-20 degrees) , a precise position (40 degrees) from the zero point is obtained. The DSP 70 continuously performs this computation. It updates changing speeds to recalculate the exact position of the motor 14. Updates are performed 10,000 times per second. Thus, the DSP 70 can keep track of the exact angular position of the motor rotor. Exact angular position is used as a position feedback signal. Referring now to Figure 18, there is shown a DSP subroutine for determining current feedback. The DSP 70 samples and reads the reference currents CURAREF, CURBREF and CURCREF from the buffer 112 (module 602). Then, the DSP 70 sends control signals to the multiplexer 60 over conductor 62 and reads the digital phase currents DCURA, DCURB and DCURC from the A/D converter 68 (module 604) . The digital phase currents DCURA, DCURB and DCURC do not reflect the polarity of the current that energizes associated phase winding A, B or C. Therefore, the DSP 70 must determine the polarity of each digital current DCURA, DCURB and DCURC. Because the sample and hold circuits 96, 98 and 100 are synchronized to sample the analog currents - ACURA, ACURB and ACURC at the trailing edge of the 50 KHz excitation signal, the polarity of the phase current is positive when the current reference is low (see Figure 19) and negative when the current reference is high (Figure 20) . The DSP 70 compares each digital current to its corresponding reference current. When the reference current is low and the digital current is high (module 606) , the DSP 70 assigns a positive value to the digital current (module 608) . When the reference current and the digital current are both high (module 610) , the DSP 70 assigns a negative value to the digital current (module 612). Knowing the polarity of the currents, the DSP 70 can check for motor unbalance. Motor unbalance can be caused by changes in temperature, which affect the impedance of the windings A, B and C. Unbalance can also be caused if a winding A, B or C is shorted to the chassis. To check for motor unbalance, the DSP 70 sums the currents (module 614) . If the sum is not approximately equal to zero (module 616) , the DSP 70 sets an error flag indicating that the motor is unbalanced (module 618) . Finally, the DSP 70 uses the digital position signals DPOSB, DPOSC and DPOPSA to select a reference current DCURA, DCURB or DCURC, which selection is used as the feedback current (module 620) . The selection is made according to the table shown in Figure 21. For example, when position state SI is detected for a clockwise rotation, the windings A and C are energized by commutation signals A+ and C-, respectively. Thus, the DSP 70 examines the current flowing out of the winding c and into the DC link return 38. If the current reference CURCREF for the winding C is high, the DSP 70 selects the positive absolute value of the digital current DCURC as the feedback current. The positive polarity indicates that the current ACURC is flowing in a positive direction. If, however, the current reference CURCREF is low, the DSP 70 selects the negative absolute value of the digital current DCURC. The negative polarity indicates that the current ACURC is flowing in a negative direction. Referring now to Figures 22 and 23, there is shown a flowchart of a DSP program for closed loop control of the motor 14. When the DMC 10 is turned on, the DSP 70 loads the program from memory 71, and begins to execute it (module 700) . The DSP 70 enables an interrupt, which occurs every twenty microseconds (module 702) . During each interrupt, the DSP 70 vectors to the interrupt routine (see Figure 6) . Otherwise, the DSP 70 reads the digital position command POSCMD and services the current, speed and position loops. It should be noted, however, that any one of these loops can be bypassed. For instance, the position loop can be bypassed by supplying external commands for direction and speed. The DSP 70 would supply the speed command directly to the speed loop and the direction command directly to the commutation logic cell 72. Alternately, the position and speed loops can be bypassed by supplying a current command and a direction command directly to the DSP 70. The DSP 70 would supply the current command directly to the current loop and the direction command directly to the commutation logic cell 72. The DSP 70 reads the digital position command POSCMD off the data bus 18 (module 704) . The digital position command POSCMD can have a maximum value of, for example, 360,000. Thus, a value of "0" would indicate the zero position of the rotor, and a value of "1" would correspond to one-one thousandth of a degree of rotation from the zero position. These exemplary values merely demonstrate the precision allowed by the present invention. Alternately, an analog position command can supplied to the DMC 10. The DMC 10 would simply convert the analog command into a digital signal. Further, these analog signals can be used as alternatives to the signals provided by the position and current sensors 16 and 20. The DSP 70 can be programmed to limit the position command POSCMD between maximum and minimum values. For example, if the DMC 10 controls the operation of a valve, which is closed at zero degrees and open at ninety degrees, the DSP 70 would limit the minimum and maximum values between zero and ninety degrees, respectively. The maximum and minimum values could be stored in memory 71. When position feedback is made available by the interrupt routine (module 706) , the DSP 70 closes the position loop. In module 708, the DSP 70 takes the difference of the position feedback and the position command POSCMD to derive a position error signal that indicates the direction of rotation and the position to which the rotor should be rotated. The polarity of the position error signal can be supplied to the commutation logic cell 72 as the direction command DIRCMD. The position error signal is regulated such that inconseguential deviations close to the zero output state are eliminated. Then, the position error signal is converted to a speed command. For example, The speed could be linearly proportional to the position error signal. In modules 710-716, the speed command is limited between upper and lower limits UP_LIM and LOW_LIM, thereby preventing damage to the motor 14 and drive components due to overspeed. When speed feedback is made available by the interrupt routine and a speed command is provided by the position loop (module 718) , the DSP 70 closes the speed loop. The DSP 70 takes the difference of the speed command and the speed feedback signal to derive a speed error signal, which is regulated and converted to a current command (module 720) . The current command is limited between upper and lower limits I_UP_LIM and I_LOW_LIM, thereby preventing motor overcurrent or undercurrent (modules 722-728) . When the current feedback is made available by the interrupt routine and when the current command is made available by the speed loop (module 730) , the DSP 70 closes the current loop. The DSP 70 takes the difference of the current command and the current feedback to derive a current error signal, which is regulated and converted to a commanded duty cycle VOUT (module 732) . The commanded duty cycle VOUT is limited by upper and lower limits UPPER_LIM and LOWER L.IM (modules 734-740) . The DSP 70 also performs interval EPS adjustment to prevent complementary switches from turning on at the same time (module 742) . Changes in temperature affect currents flowing through t_ιe windings A, - B and C. Increases in current indicated by the DC Link current DCURDC and the current feedback cause the transistors in the inverter 12 to take longer times to discharge. Therefore, the DSP 70 lengthens the interval EPS to allow the transistors time to discharge before the complimentary transistors are turned on. By automatically lengthening the interval EPS, the DSP 70 prevents shoot- through from occurring. Next, if necessary, the DSP 70 readjusts the upper and lower limits for speed, current and duty cycle, respectively (module 744). Temperature sensors are provided in the inverter 12 to indicate the temperature of the motor 14. The DSP 70 monitors the temperatures provided by the temperature sensors. In the event of overte perature, the DSP 70 can lower the upper limits UP_LIM, I_UP_LIM and UPPER_LIM. For example, when the inverter 12 gets hot, the DSP 70 lowers the upper limit I_UP_LIM from fifty amps to thirty amps. Unlike prior art system, the DMC 10 can adjust its limits without being shut down. In this manner, the DMC 10 is a self-adjusting controller. The DSP 70 combines the commanded duty cycle and interval EPS into the duty cycle command DCCMD, which is sent to the commutation cell logic 72 over data bus 82 (module 746) . Then, the DSP 70 reads a new digital position command POSCMD (module 704) . The digital motor controller 10 can be adapted to control motors of any size. For large motors, the DC link high requires a high operating potential. Normally, the current provided by the commutation logic 72 would not be sufficient to turn on the transistors that comprise the upper set of switches 24, 26 and 28 in the inverter 12. Therefore, the inverter 12 is provided with gate drivers, which allow low currents to turn on these transistors. The inputs of the gate drivers are supplied with commutation signals A+, B+ and C+, and the outputs of the gate drivers are coupled to the bases of the respective transistors that comprise the upper switches 24, 26 and 28. As a result, the commutation signals A+, B+ and C+ can turn on their associated transistors. Thus disclosed is a multi-loop controller that can be adapted for a wide range of servo applications. The DMC 10 provides protection for motor and circuits related to overspeed, overcurrent, overtemperature and position sensor failure. By adjusting the limits of speed, current and duty cycle and the interval EPS for changes in temperature, the DMC 10 is a self-adjusting controller that provides optimal control. Further, the DMC 10 is a four quadrant positioning controller that offers smooth transition from one quadrant to another, from brake to drive. Resulting is smooth control of the motor 14 for loads that are opposing as well as aiding. The braking results in greater dynamic stiffness of the rotor, i.e., greater ability to hold the rotor in place. Still further, the DMC 10 offers an advantageous method of measuring speed. Prior art speed converters must wait for a zero-crossing of a position signal to determine speed. In the present invention, however, speed can be determined over a single sampling period (e.g., twenty microseconds) . As a result, the DMC 10 can measure low speeds faster and with less ripple than the prior art speed converters. Still further, multiple DMCS 10 can operate in parallel to share a load. For parallel operation, both static and dynamic load sharing must occur between the multiple DMCS 10 such that force fight is minimized. A buck-boost regulator is employed in the position loop such that both DMCS 10 issue identical speed commands. Further, a buck-boost regulator is employed in the speed loop such that bdth DMCS 10 issue identical current commands. .In this manner, two or more DMCS 10 will be perfectly linear and can operate in parallel without force fight. Buck- boost regulators are well known to those skilled in the art. Although preferred embodiments are specifically illustrated and described herein, it will be appreciated that many modifications and variations of the present invention are possible in light of the above teaching to those skilled in the art. It is preferred, therefore, that the present invention be limited not by the specific disclosure herein, but only by the appended claims.

Claims: WHAT IS CLAIMED IS: 1. Apparatus for controlling a brushless motor (14) having a rotor and multiple stator windings (A,B,C), said apparatus including sensing means (16), responsive to said rotor, for sensing the position of said rotor, and inverter means (12) for energizing the windings, said apparatus characterized by digital signal processing means (10), responsive to outputs of said sensing means (16), for selecting said windings (A,B,C) to be energized, said inverter means (12) energizing the windings selected by said digital signal processing means (10). 2. Apparatus according to Claim 1, characterized in that said digital signal processing means (10) includes: position means (70), responsive to said outputs of said sensing means (16), for generating a plurality of position signals indicating the position of said rotor with respect to said multiple stator windings (A,B,C); and commutation means (72), responsive to said position signals, for generating commutation commands, said commutation commands being provided on said outputs of said digital signal processing means (10), said inverter means (12) energizing said windings in response to said commutation commands. 3. Apparatus according to Claim 2, characterized in that at least one position signal corresponds to each one of said windings, that said at least one position signal indicates the proximity of said rotor relative to said corresponding winding and an adjacent winding, and that said at least one signal goes to a first state when said rotor is closer in proximity to said corresponding winding, and wherein said at least one signal goes to a second state when said rotor is closer in proximity to said adjacent winding. 4. Apparatus according to Claim 3, said sensing means (16) including at least one position sensor (40, 42, 44) for each winding (A,B,C), each said position sensor (40, 42, 44) functioning to sense the proximity of said rotor to said 5 corresponding winding; characterized in that said digital signal processing means (10) further includes sampling means (52, 54, 56), responsive to said position means (70), for sampling signals on outputs of said position sensors (40, 42, 44) at times selected by said position means (70); and that 10 said position means (70) includes first comparing means (70) corresponding to each winding, each said first comparing means (70) functioning to compare values sampled from the position sensor (40, 42, 44) of said corresponding winding (A,B,C) to values sampled from the position sensor of said adjacent ! 5 winding, an output of said comparing means (70) going to said first state when said sampled value from said corresponding winding is greater than said value sampled from said adjacent winding, said output of said comparing means going to said second state when said value sampled from said corresponding 0 winding is less than said value sampled from said adjacent winding. 5. Apparatus according to Claim 4, characterized in 5 that said digital signal processing means (10) further includes command means (70) for providing a direction command that commands a direction of motor rotation; first drive means (72) for providing a first set of commutation commands that cause said rotor to be driven in a first direction, second drive 0 means (72) for providing a second set of commutation commands that cause said rotor to be driven in a second direction, and first selecting means (70), responsive to said direction command, for selecting either said first set or said second set of commutation commands to be provided on said outputs of said 5 digital signal processing means (10). 6. Apparatus according to claim 5, said comman means (70) further providing a drive command that commands sai motor to either drive or brake; said apparatus characterized i that said digital signal processing means (10) further include first brake means (72) for providing a third set of commutatio commands that cause said rotor to brake while said rotor i rotating in said first direction, and second brake means (72 for providing a fourth set of commutation commands that caus said rotor to brake while said rotor is rotating in said secon direction; and that said first selecting means (70) is als responsive to said drive command, said first selecting mean (70) selecting either said first, second, third or fourth set of commutation commands to be provided on said outputs of sai digital signal processing means (10). 7. Apparatus according to claim 6, a first termina of each winding (A,B,C) being connected in common, sai inverter means (12) having upper and lower switching means (24, 26, 28, 30, 32, 34) for each winding (A,B,C), each said uppe switching means (24, 26, 28) being coupled between a secon terminal of said associated winding and a DC link high (36), said lower switching means being coupled between said second terminal of said associated winding and a DC link return (38), said upper and lower switching means (24, 26, 28, 30, 32, 34) being conductive in response to said commutation commands supplied by said apparatus characterized in that said commutation means (72), said commutation means sends commutation commands to one of said upper switches (24, 26, 28) and one of said lower switches (30, 32, 34) when driving said motor (14), and wherein said commutation means (72) sends said commutation commands to at least two of said lower switches (30, 32, 34) when braking said motor. 8. Apparatus according to Claim 7, each one of said upper switches (24, 26, ' 28) including at least one upper transistor having its controlled current path coupled between said DC link high (36) and said second terminal of said associated winding (A,B,C); each one of said lower switches (30, 32, 34) including at least one lower transistor having its controlled current path coupled between said DC link return (38) and said second terminal of said associated winding (A,B,C), control terminals of said transistors being coupled to respective outputs of said commutation means (72), whereby said commutation commands cause said upper and lower transistors to conduct; said apparatus characterized in that said commutation means (72) further comprises interval means, responsive to said position means, for reducing the conducting time of said transistors such that upper and lower transistors associated with the same winding do not conduct at the same time. 9. Apparatus according to Claim 8, characterized in that said command means (70) provides a duty cycle command; and that said commutation means (72) includes pulse width modulating means, responsive to said duty cycle command, for pulse width modulating said commutation commands, whereby the conducting time of said upper and lower transistors is responsive to said duty cycle command. 10. Apparatus according to Claim 9, further including at least one current sensor (84, 86, 88) for each winding (A,B,C), each said current sensor (84, 86, 88) functioning to measure the current flowing through said associated winding (A,B,C); said apparatus characterized in that said digital signal processing means (10), further includes polarity means (70), responsive to said current sensors (84, 86, 88), for adding polarities to said currents measured by said current sensors, and second selecting means (70), responsive to outputs of said polarity means (70), for selecting a current measured by one of said current sensors as a feedback current, said second selecting means (70) also being responsive to said position means (70), selecting said feedback current in response to said position signals. 11. Apparatus according to claim 10, characterized i that said interval means (70) reduces said conducting time o said upper and lower transistors by an interval; and that sai command means (70) further includes comparing means (70) responsive to said DC link high (36), for indicating when current provided by said DC link high (36) exceeds a threshold and changing means (70), responsive to said comparing mean (70), for changing said interval. 12. Apparatus according to Claim 11, characterized i that values sampled by said sampling means (52, 54, 56) for envelopes for said position sensors (46, 48, 50), and that sai digital signal processing means (10) further includes spee feedback means (70), responsive to said sampling means (52, 54, 56), for determining a speed feedback of said motor (14), sai speed feedback means (70) including third selecting means (70), responsive to said position means, for selecting an envelop having a non-zero slope according to said position signals; difference means (70), responsive to said third selecting means (70), for taking difference of successive samples from sai selected envelope; and dividing means (70), responsive to an output of said difference means (70), for dividing said difference by a sampling time, an output of said dividing means indicating said feedback speed of said motor (14). 13. Apparatus according to Claim 12, said digital signal processing means (10) further characterized by position feedback means (70) for determining the position of said rotor, said position feedback means (70) including coarse means (70), responsive to said outputs of said position means (70), for indicating coarse position of said rotor according to said position signals; direction means (70) for indicating the direction of rotation of said motor (14), said direction means including lookup means (70), responsive to an output of said coarse position means (70), for looking up transitions in coarse positions, which transitions indicate direction of rotation; fine position means (70), responsive to said speed feedback means (70) and said direction means (70), for determining fine position from each said transition, said fine position means (70) including integrating means (70), responsive to said speed means (70), for integrating said speed feedback over a time period since said transition occurred; and adding means (70), responsive to outputs of said coarse means (70) and said fine means (70), for adding together said coarse position and said fine position, an output of said adding means (70) providing said position feedback. 14. Apparatus according to claim 13, characterized in that said command means (70) provides a current command that commands the current supplied to said motor (14); and that said command means further includes closed current loop means (70), responsive to said current command and said feedback current, for providing closed loop control of said current to said motor (14), said closed current loop means (70) providing said duty cycle command. 15. Apparatus according to Claim 14, characterized in that said command means (70) further provides a speed command for commanding the speed of said motor; that said command means (70) further includes closed loop speed means (70), responsive to said speed command and said speed feedback, for providing closed loop control of the speed of said motor, an output of said closed speed loop means (70) providing said current command. 16. Apparatus according to claim 15, a position command being supplied to said command means; said apparatus characterized in that said command means further includes closed loop position means (70), responsive to said position feedback and said position command, for providing closed loop control of said position of said motor (14), an output of said closed loop position control means (70) providing said speed command. 17. Apparatus according to Claim 16, characterized in that said command means further includes limiting means (70), for limiting said duty cycle, current and speed commands between upper and lower limits. 18. Apparatus according to Claim 17, said inverter means (12) further including temperature sensor means for indicating the temperature of said motor (14); said apparatus characterized in that said command means (70) further includes adjusting means (70), responsive to outputs of said temperature sensor means, for adjusting said upper and lower limits in response to changes in said temperature of said motor (14).

Inventors: LE DONG TUAN, LE, DONG, TUAN
Applicants: ALLIED SIGNAL INC, ALLIED-SIGNAL INC.
Application year: 1991
Main classification: H02P6
IPC codes: H02P6