This invention pertains to the control of motors, and in particular to the control of electric motors.
There are a variety of “electronic” control systems that have been developed for motors that are commonly referred to as motor or motion controllers. They can be divided into two kinds: analog based systems and digital based systems. However, it is common to intermix analog and digital circuits in varying degrees in most such motor controllers. The primary purpose of these devices is to control the position, velocity and/or acceleration of the motor. Simpler motor controllers perform only velocity (speed) control, while more complex motion controllers enable control of all three parameters. The digital based systems employ microprocessors and software to perform the control functions, including in more complex motion controllers what is well known in the field as “PID” control. [PID stands for the Proportional error, the Integral of the proportional error, and the Derivative of the proportional error.] The digital based systems also vary from simple circuits that only control speed to complex circuit systems that control position, velocity and acceleration and implement PID control over the motor.
The following is a description of a typical example of the present digital based art in the field.
First, there is a microprocessor and related computer circuits (depending upon the complexity of the particular motor controller) such as memory circuits, disk drives, displays and screens, communication ports, and keyboards or keypads.
Second, there is a software operating system that is responsible for managing all of the digital and/or analog circuitry. These management functions include issuing commands to obtain the motor position from an encoder, set the motor to a desired velocity, change the acceleration of the motor, stop the motor at a particular point in time or at a particular location (based upon the encoder), and to compare the motor's actual position with the assumed (or projected) position.
Third, there is an electronic feedback circuit that runs from an encoder mounted on the end of the motor or on a shaft that the motor turns (typically of an optical type, but the encoder can be resistive, capacitive, magnetic, or mechanical) to a decoder circuit and then to a comparator circuit that compares the value obtained from the position encoder against the position value calculated by the software operating system. The feedback system is often an analog based circuit, together with an analog to digital converter used to convert the feedback signal to digital number useable by the microprocessor.
Fourth, the microprocessor circuit and software operating system performs a PID calculation based upon the desired position (and speed) set by the input control command and the actual position (and speed) as determined by the encoder feedback loop. This PID calculation is often done by means of software computation. The software computation is often replaced by analog circuits that employ operational amplifiers and filters that perform the PID functions. A variety of analog filters are also often employed to solve various problems in the software's PID loop calculation that arise from such as factors as noise, motor operating limits, and the gain value given to various PID loop values.
Fifth, there may be a digital to analog converter circuit that takes digital input signals (typically in the form of 16 bit position values) and converts them to analog voltages for use as the analog control signals for the motor driver circuit.
The following is a description of a typical example of the present analog based art in the field.
First, there is an analog voltage or current input circuit that translates the input voltage or current into a motor velocity. In simple analog motor controllers, the input voltage level controls the motor speed, usually with a linear correlation between voltage and velocity. The input voltage is used to directly control a power amplifier circuit that sends the commutation signals to the motor.
Second, in analog motion controllers that control position and acceleration, as well as velocity, there will be a feedback circuit that runs from an encoder mounted on the end of the motor or on a shaft that the motor turns (typically of an optical type, but the encoder can be resistive, capacitive, magnetic, or mechanical) to a decoder circuit that converts the feedback signal to a representative voltage or current value. Then an analog comparator circuit (typically employing comparator type operational amplifiers) compares the value obtained from the position encoder against the position value (also in analog form as a voltage or current value) sent to the other comparator input by the end user.
Fourth, the analog comparator's output (which will be zero or a relative positive or negative voltage) will be either directly used to drive the analog power output circuit, increasing or decreasing the power drive signal commutating the motor to adjust the velocity (in simple speed controller) or it will be sent to a more complex analog circuit (typically comprised of operational amplifiers and analog filters) that performs a PID function to adjust the velocity of the motor not just to set the speed, but to adjust the position and/or acceleration of the motor. This type of analog motor controller employs operational amplifiers and filters that perform the PID functions. In sophisticated analog motion controllers, there are numerous analog filter circuits that correct for noise, motor operating limits, and the gain values given to various PID loop values.
The foregoing are meant to be examples of typical digital and analog motor controllers. Some of the specific aspects may vary from system to system, such as the combination of one or more of the electronic hardware circuits onto one circuit board and whether that circuit board is a stand-alone design or in the form of a personal computer plug-in card. In some variations, there are digital circuits mixed with analog circuits.
The existing state of the art in digital motor control systems is prone to a number of serious drawbacks. To date, digital systems have relied on software intensive microprocessors for control of the desired motor position, velocity, and/or acceleration value at any particular moment. These have inherent errors due to latency, inaccuracies caused by any circuits that convert between digital and analog representations of values (e.g., D/A and A/D converters), and the use of analog filter circuits to provide compensation for noise, motor operating characteristics, environmental conditions, etc.
The existing state of the art in analog motor control systems is also prone to a number of serious drawbacks. For example, in systems that employ analog circuits for compensation, these analog circuits are very sensitive to the “tuning” of the various analog filters they contain to compensate for errors. De-tuning can occur from a variety of causes such as component ageing, environmental changes, increases or decreases in motor friction, changes in load inertia, etc. If one or more of these filters goes out of “tune”, there is no electronic means inherent in such motor control systems that enables self-correction. As a result, as a system de-tunes from optimal values, the values used in the PID computation become increasingly inaccurate and the system is no longer able to accurately know or predict the future position of the motor. When this happens, the motor will malfunction in a variety of ways, including stalling, undershoot or overshoot, unwanted vibration and noise, and loss of known position. As a result, current art generally requires a skilled technician to manually turn variable resistors and/or variable capacitors on the controller's circuit board to attempt to optimize tuning.
In addition to the errors that build up over a relatively short time in such digital and analog motor control systems, there are often physical installation issues involving the signal cabling, power supply cabling, and the encoder feedback cabling. Because these control systems are based upon sensitive measurements of small and easily affected voltages, all wiring has to be short and the power supplies typically have to be much more expensive “split rail” designs that provide sizeable amounts of plus and minus voltage and current with very little noise. All of these factors add to the cost and make such motor control systems more expensive to manufacture, install, and maintain.
According to one aspect of the invention, there is provided a controller for controlling an electric motor comprising an input for receiving the value of a parameter for said motor, said parameter comprising any one of position, velocity, acceleration and rate of change of acceleration; a digital circuit for determining an error correction value based on the value of said parameter received at said input and a value indicative of a measured value of said parameter, and generating means for generating a drive signal for driving said motor based on said error correction value.
According to another aspect of the invention, there is provided an error correction unit for a controller for controlling an electric motor, comprising a digital circuit for receiving a digital input value indicative of the value of a parameter for said motor and a second digital value indicative of a measured value of said parameter, said digital circuit being adapted to operate on said digital values to generate a digital error correction value for controlling said motor.
According to another aspect of the invention, there is provided a generator for generating one or more drive signals for driving an electric motor, comprising a circuit for receiving a control signal and for generating one or more pulsed drive signals based on said control signal.
According to another aspect of the invention, there is provided a method of configuring a controller for a motor, the controller comprising a position input translator, a detector for measuring the position of an output drive of said motor, and a generator for generating a drive signal for driving said motor, the method comprising the steps of: (a) inputting a predetermined position input value to said position input translator; (b) providing an open loop value to said generator for causing said output drive to move to a position corresponding to said predetermined position input value, as measured by said detector; and (c) configuring said position input translator based on said open loop value.
Embodiments of the invention provide a controller for controlling a motor, in which the controller is implemented by means of an all digital circuit, PID loop, numerical motor controller. “Motor” includes, but is not limited to, DC galvanometers, DC brushless motors, DC brush type motors (2 or 3 pole), DC three pole servo motors, DC rotary solenoids, and AC servo motors. Embodiments of the invention do not contain a microprocessor or utilize any software and do not contain any analog circuits. Typically, embodiments of the invention can be implemented in a single, high density logic semiconductor such as an ASIC, FPGA, or CPLD.
Embodiments of the invention comprise combinatorial and state logic circuits comprising any one or more of five primary elements: (a) a position input translator; (b) a digital error correction unit; (c) a digital adder; (d) a digital feedback decoder and counter; and (e) a digital drive signal generator required to commutate the particular type of motor used (e.g., a digital PWM (Pulse Width Modulation) signal generator). These elements operate to achieve such motor driving purposes.
Compared to existing motor control systems with comparable functions which are based largely upon microprocessors, software, and/or analog circuits, embodiments of the controller can be much lower in cost, can have equal or greater accuracy, can have significantly reduced latency between user command and motor function, can be more reliable, and can have auto tuning capability to optimize the performance of the controller for the particular motor used.
Embodiments of the invention utilize a novel digital design concept that eliminates most of the troublesome aspects of the present state of the art of digital and analog motor control systems that employ software and/or analog circuits to perform the PID functions. Unlike other such control systems, embodiments of the controller are entirely based upon digital circuitry that does not employ software or microprocessors to operate. In particular, the all digital design using only combinatorial and state logic has the following advantages: (1) eliminates analog filters that frequently go out of tune and cause malfunction or failure; (2) uses a more accurate digital comparator in place of software and/or analog amplifiers; and (3) is able to employ much higher resolution motor position encoders; (4) the latency resulting from the use of software for performing PID calculations is eliminated; (5) the effects of noise throughout the motor control system is minimized; (6) the overall control of a motor is simplified by allowing direct interface to the end user, thereby eliminating the need for digital to analog conversion circuitry; and (7) allows the use of a variety of different motor types. The end result is a more robust and versatile motor control system at a significantly reduced cost.
Embodiments of the controller comprise a digital numerical engine having five main parts that together perform all of the operations necessary to receive a position value from a system operator and to translate that position value into the drive signals necessary to make a particular motor go to that position at a velocity and with an acceleration that is optimal for the particular installation.
The first part of the Numerical Engine is the Position Input Translator. This circuit receives control inputs and output signals to the system user interface (typically a personal computer). This circuit translates the position input into an open loop control value. This translation can be accomplished in a variety of ways. For simple applications, one or more adder and multiplier circuits, with pre-loaded coefficients) would suffice. In a preferred embodiment, a look-up table is used. In cases where a look-up table would be undesirably large, a hybrid approach could be utilized wherein adder and/or multiplier circuits would interpolate between periodically spaced values stored in a look-up table. There are other circuits that could be devised to accomplish a specific subset or range of operation for a particular type of motor operation (e.g., only partial motor rotation).
The second part of the Numerical Engine is an Adder circuit which performs a summation of the position value received from the look-up table and adds (or subtracts) a correction value from the third digital circuit, which is the Error Correction unit.
The third part of the Numerical Engine is an Error Correction circuit which receives inputs from the system Position Input, the system Control I/O, and from the Encoder Feedback Decoder and Counter circuit. The Error Correction circuit compares the desired position (sent by the system user) with the actual position detected by the Feedback Decoder and Counter circuit, and creates an error correction value. In turn, this error correction value is sent to the Adder circuit which makes the necessary correction on the original position value entered by the system user.
Once a corrected position value is obtained from the Adder, it is sent to the fifth part of the Numerical Engine which is the Motor Commutation Engine that translates this position value into the logic level drive signals necessary to drive a power drive circuit appropriate for the particular type of motor.
An object of embodiments of the invention is to provide an apparatus and method to control a motor's position, velocity and acceleration with very high accuracy and repeatability. Further details of embodiments of the invention will be described in the following portions of the specification, wherein the description is for the purpose of fully disclosing preferred embodiments of the invention without placing any limitations thereon, and are for illustrative purposes only.
Examples of embodiments of the invention will now be described with reference to the following drawings, in which:
a is a diagrammatic representation of an embodiment of the Position Input Translator 9.
b is a diagrammatic representation of an embodiment of the Feedback Decoder and Counter 16.
c is a diagrammatic representation of an embodiment of the Error Correction Unit 11.
a is a diagrammatic representation of waveforms generated by an embodiment of the Motor Commutation Engine for use in driving the motors as shown in
b is a diagrammatic representation of waveforms generated by an embodiment of the Motor Commutation Engine for use in driving the motors as shown in
a is a diagrammatic representation of an embodiment of the Power Control Circuit for a two pole motor.
b is a diagrammatic representation of an embodiment of the Power Control Circuit for a three pole motor.
a is a diagrammatic representation of the connections for a single coil motor using a two pole driver circuit.
b is a diagrammatic representation of the connections for a dual coil motor using a two pole driver circuit.
c is a diagrammatic representation of the connections for a dual coil motor using a two pole driver circuit.
d is a diagrammatic representation of the connections for a dual coil motor, with a center tap, using a three pole driver circuit.
e is a diagrammatic representation of the connections for a three coil motor using a three pole driver circuit.
f is a diagrammatic representation of the connections for a three coil, “wye-connected” motor using a three pole driver circuit.
Referring more specifically to the drawings, for illustrative purposes the present invention is embodied in the apparatus generally shown in
Referring to
Referring to
In one example, Position Input 3 value is a numerical representation of an angular position scaled according to the resolution of the Rotary Encoder 7. For example, if the Rotary Encoder 7 has a resolution of 36,000 counts (15+ bits) per revolution, the number of counts per degree is equal to 36,000 divided by 360. In this example, that would be 100 counts per degree. Thus, the Position Input 3 value would be a number equal to the desired angular position (from a designated physical zero or reference point) multiplied by 100. If an angular position of 4.28 degrees is desired, the Position Input 3 value would be 428. The value of 428 then, in this case, would also be an input of both Position Input Translator 9 and Error Correction Unit 11.
After initialization, typical system operation begins with the end user inputting Position Input 3 value. The Position Input Translator 9 translates the Position Input 3 value into an Open Loop Control Value 10 which is a representation of the amount of force that will be required to move to the position indicated by the Position Input 3 value, such representation typically in the form of an rms voltage that will generate enough motor movement to reach the desired position. The amount of the force required to actualize a particular movement will, of course, depend upon a variety of factors such as the particular motor, drive circuit, and load to be moved. If, by way of example, the Position Input Translator 9 were comprised of a look-up table implemented with a dual-port memory (as shown in
Position Input 3 value, as described above, is also simultaneously sent to the Error Correction Unit 11. There, it is utilized (along with the Feedback Position 15) as a variable in the computation of the Error Correction Value 12. While other means of computing an Error Correction Value 12 could be used without departing from the scope of this invention, the preferred embodiment utilizes PID control, the principles of which are familiar to one skilled in the art.
The following is an example of computing the Error Correction Value 12 using PID control and is represented by the formula:
Error Correction Value 12=(P*Kp)+(I*Ki)−+(D*Kd)
Where the subject variables have the following definitions:
P=the Proportional Error Value 25 which is Position Input 3 value, minus Feedback Position 15 value.
I=the integral of the Proportional Error Value 25, this can be obtained as the value from an integrating summing register, the value of which increases or decreases in response to the magnitude of the Proportional Error Value 25 over time. When the Proportional Error Value 25 is zero, the value of the integrating register will remain unchanged.
D=the derivative of the Proportional Error Value 25. It represents the rate of change of the Proportional Error Value 25, and can be obtained as the difference between the present value of the Proportional Error Value 25 (
Kp (represented as the Kp Value 30 in
Ki is the gain constant of the integral Error Correction Value 28 (
Kd is the gain constant of the Derivative Error Correction Value 29. In the preferred embodiment it is implemented as a combination of a value (represented in
The Proportional Error Correction Value 26 is the Error Value 25 multiplied by the proportional gain constant Kp Value 30 as set via Control I/O 2. The Integral Error Correction Value 28 is the sum over time of the Error Value 25 multiplied by the integral gain constant Ki Value 31. The magnitude of the Integral Error Correction Value 28 is also affected by the rate of summation, as set by the Ki Clock 34 rate, which is set via Control I/O 2. The Derivative Error Correction Value 29 is the result of multiplying the derivative gain constant Kd Value 32 (as set by Control I/O 2) by the difference of the then current Proportional Error Value 25 and the Proportional Error Value 25 registered at a prior time as determined by the Kd Clock 33 rate (as set by Control I/O 2).
The Adder 13 comprises or consists of logic which sums the Open Loop Control Value 10 and the Error Correction Value 12 to yield the Closed Loop Control Value 14. The Closed Loop Control Value 14 is sent to Commutation Control Engine 17. One skilled in the art can appreciate that the Commutation Control Engine 17 could be replaced with a digital to analog converter (DAC) and a conventional servo amplifier to form a hybrid digital/analog version of the invention. This in not the preferred embodiment, but is within the scope of the invention claimed by applicant.
Referring to
The Comparator 22 compares the Free Running Counter Value 21 against the Closed Loop Control Value 14. If the Free Running Counter Value 21 is greater than the Closed Loop Control Value 14, then Comparator Output 22c is asserted. If the Free Running Counter Value 21 is equal to the Closed Loop Control Value 14, then Comparator Output 22b is asserted. If the Free Running Counter Value 21 is less than the Closed Loop Control Value 14, then Comparator Output 22a is asserted. The result of the foregoing operation of Comparator 22 is a square wave of various duty cycles. Examples of the square waves and the duty cycles that are outputted by the Comparator 22 are shown in
Referring to
Auto Tuning Capability
As mentioned above, with an appropriate command sequence sent to the Numerical Engine 1 via Control I/O 2, the digital control system according to embodiments of the invention can be automatically tuned to provide optimum speed and accuracy for a particular Motor 8. This would involve the following process. [Note: Although the following description refers to the case where the Position Input Translator 9 comprises a look-up table, one skilled in the art can appreciate that a similar procedure would be used for the case of coefficients for the Position Input translator comprised of adder and multiplier circuits, or for the case of coefficients and look-up table values for a hybrid circuit. For Example, in some embodiments, coefficients could be determined by collecting data for each position or a number of different positions, determining a mathematical relationship between input value and open loop control value, and then implementing the derived function by digital, i.e. logic circuitry.
The first step is to disable the Error Correction Unit 11 (i.e., force the Error Correction Value 12 to zero) by a command via Control I/O 2. Then, the values in a look-up table in the Position Input Translator would be set to zero (or to values obtained from a prior tuning). The desired Commutation Logic 23a circuit is selected from the possible choices in the Commutation Control Engine 17. Next, the Position Input 3 value would be set to one and the value (i.e. the open loop control value) of the first position in the look-up table would be incremented until the Feedback Position 15 equals one.
The incrementing of the Position Input 3 values in the look-up table is done from a user interface connected to the Control I/O 2 and can be accomplished by a variety of methods including manual entry of a value for each Position Input 3 value, or by a variety of semi-automated or full-automated external programs or digital logic that enters each Position Input 3 value. Initial values could be zeros or values that are based upon a model of the motor, drive circuit, and load, or values that are based upon empirical data that are the results of experimental testing. The incrementing of the Position Input 3 value location in a look-up table, for example, could be done by direct addressing or by the use of an auto-incrementing counter. The values representing the motor position as detected by the Feedback Decoder and Counter 16 are sent back to the user interface (of whatever design) by way of the Control I/O 2 bus. The external user interface, by manual, semi-automatic, or fully automatic means finds the Open Loop 10 value that best achieves the originally desired motor position. Then the Position Input 3 value would be set to two, and the second location in the look-up table would be incremented until the Feedback Position 15 equals two. This process would generally be repeated for all locations in the look-up table until each such location is loaded with a value that causes the Feedback Position 15 to be equal to the Position Input 3 value for each location in the look-up table.
Even further optimization to correct for hysteresis and friction in the Motor 8 may be accomplished by externally recording all of the values stored in the look-up table during the above described ascending value determination, and averaging such values with new values obtained from doing a descending value determination. Since friction values tend to be unpredictable, repeated iterations of the foregoing process can provide a more optimized set of values for the look-up table. In embodiments, the procedure may be performed in either direction, i.e. with ascending values first followed by descending values, or vice versa. Furthermore, for some motor types, values may be determined in a non-sequential, or random order, if desired.
After all values for each location in the look-up table have been established, then the Error Correction Unit 11 can be optimized. The first gain constant that should be initialized is Kp Value 30. An initial value for Kp Value 30 could be a function of the possible magnitude Open Loop Control Value 10. For example, if the open Loop Control Value 10 is a 16 bit value, then Kp Value 30 would not be expected to be larger than 8 bits, and four bits (24) is a likely starting value (alternatively, an initial value of one could be used). The initial value for Ki Value 31 should be zero. A reasonable initial value for Kd Value 32 would be zero. To optimize Kp Value 30, Ki Value 31, and Kd Value 32, the Position Input 3 value can be changed while the Feedback Position 15 value is monitored via Control I/O 2 from the Feedback Decoder and Counter 16. When a change in Position Input 3 value causes Feedback Position 15 to change, the response time, settling time, overshoot, and final accuracy can be recorded. Then, small changes would be made to Kp Value 30, Ki Value 31, and Kd Value 32 and the monitoring of Feedback Position 15 would reveal whether the response time, settling time, overshoot, and final accuracy are improved. This process would be repeated until the best response time, settling time, overshoot, and final accuracy are found, and then the corresponding values of Kp Value 30, Ki Value 31, and Kd Value 32 would be stored in the Error Correction Unit 11. Depending upon the particular Motor 8 used and desired performance specifications, this process may be done once upon initial system setup and/or it can be done as often as desired to correct for changes in the operating characteristics of the Motor 8 and/or its operating environment. For certain applications, all tuning could be performed at the time of manufacture, and in this case, the only functions that would be required of the Control I/O 2 would be the power-up initialization of the zero position.
Other aspects and embodiments of the controller comprise any one or more feature(s) disclosed herein in combination with any one or more other feature(s) or a variant or equivalent thereof. In any of the embodiments described herein, any one or more features may be omitted altogether or replaced or substituted by another feature disclosed herein or a variant or equivalent thereof.
Numerous modifications and changes to the embodiments described above will be apparent to those skilled in the art.