|
Selecting a Controller
Selection tree
Background
Historically, servo controllers were analog devices. They were very expensive and required manual adjustment of gain and other parameters, which was a tedious and specialized operation. The microprocessor has changed all that. In the field of high-precision position control, analog controllers are extremely rare, if not extinct. The digital controller is superior is almost every possible way, with the lone exception of servo bandwidth. A digital PID filter operates by sampling the position error of a system at very high speeds. In order to approximate the action of an analog filter, the digital system must sample the error at much higher rates than the required bandwidth.
Calculation of the various elements (terms) of a PID loop involve several repetitions of multiplication and addition. Multiplication is a complex and slow operation in a general purpose computer architecture, so a circuit designed specifically for repeated multiply-and-add is sometimes used to implement servo loops. These devices were developed for the special purpose of implementing audio and RF filters and are called DSPs (Digital Signal Processors). They are capable of calculating a complex servo algorithm in a few microseconds, but most are very ill-suited to the remaining tasks of a complete motion control system.
Luckily, ordinary motion systems seldom require the computational speeds and servo bandwidths provided by a DSP. Most general purpose processors have processing capabilities that are more than adequate for flawless control. This allows the use of the same low cost circuit for all control functions in the system.
A compromise between the high performance/high cost DSP and the lower performance/lower cost general purpose microcontroller is the application-specific servo processor, which may be based on a general purpose microprocessor, but limited to specific servo control functions. Their cost is significantly higher than general purpose microcontrollers and are used in addition to a general purpose microcontroller which is required for program execution and interfacing.
From these considerations, it is clear that a general purpose microcontroller has the lowest possible cost of ownership, and special-purpose circuits or DSP have the highest bandwidth capabilities. We produce both low cost products for less demanding applications and higher performance products when the application justifies the additional cost.
8, 16 or 32 bits? Regardless of the hype associated with processor word width, the only significant difference between 8, 16 and 32-bit processors is the speed of execution. Any processor that is capable of performing the necessary calculations within the allowable time period is equivalent to any other in performance. If an update rate of 250 microseconds is chosen, then the ability to perform the calculations in 10 microseconds does not increase value or performance. It only adds to the idle time and the cost.
Trajectory Generation
The heart of a motion controller is the trajectory generation process. Using data previously stored to describe the desired acceleration, deceleration and velocity, as well as the distance to be moved, a trapezoidal trajectory is calculated that accelerates to the selected velocity and maintains this velocity until the position is reached at which deceleration must be begun in order to arrive at the target position at zero velocity. Some controllers implement an "S-curve" or sinusoidal acceleration instead of linear acceleration to minimize "jerk", or the rate of change of acceleration. The SuprMotr V9 utilizes a unique asymptotic approach technique that slows motion logarithmically to prevent overshoot and enhance damping.
The trajectory generator generates the ideal position to be achieved at each sampling interval. The PID loop adjusts the output drive to cause the motor to position as closely as possible to the ideal position at all times.
PID loops
Motor current in a closed servo loop is roughly proportional to the difference between where the motor is and where it should be, similar to the restoring force of a spring. If there is a high degree of "stiction" friction in the system, the magnitude of current required to cause onset of motion may also be high enough to cause the motor to move much further than desired before the electronics can measure the changed error and reverse the polarity of the current to return to the desired position.
This is the basis for the well known PID servo filter algorithm in modern motor controls. The name is derived from the three main components involved in the filter calculation. A portion of the drive to the motor is Proportional to the distance to be moved to achieve the desired position, hence the Pterm. Another portion is dependent on the length of time the error has continued to exist. We Integrate the error to calculate this correction, hence the I term. In order to prevent oscillation, caused by inertia, we Differentiate the error signal, hence the D term. The effects of all three calculations are summed to generate a PID-type of response.
A fourth element is normally added to this equation to prevent the I term from building to dangerous levels. This is called "windup". Without a limit imposed on windup, the motor drive current could build to the maximum capability of the system. If a temporary obstruction were to be removed, dangerous conditions might apply if the total contribution of the I term were not limited.. Other terms are used in high-end controllers to further improve performance. Typical additions are velocity-feed-forward (VFF), acceleration-feed-forward (AFF),and D' (second derivative of error)..
Without VFF, a system moving at a constant velocity will lag behind the ideal trajectory curve by some degree, (Following error) depending on the gain of the loop and the amount of friction. Ideally, this constant error will be corrected by the action of the I term. However, at the start of deceleration, the inertia of the system and load will cause the error to abruptly change from a lag condition to a lead condition. The percentage of the output contributed by the I term is now acting against us instead of for us. Due to the nature of the I term, it responds slowly to changes, therefore it must decrease to zero, then build again in the opposite polarity.
The effect of the error reversal and the attempt to cope with it by the I term can be reduced by the addition of a bias to the output, dependent on the value of commanded velocity. Faster velocities result in larger lag errors, so VFF simply adds a percentage of the velocity directly to the calculated output of the PID loop.
Likewise,AFF helps to correct errors caused by the sudden changes in polarity of error generated by system inertia. The system will not begin motion instantaneously, creating a large lag error. VFF is not much help at this point because the velocity at start is zero and any percentage of zero is very small. Therefore, we can add additional drive to the output based on the value of the commanded acceleration, which will help to reduce inertial lag. When the system has attained the commanded velocity, the acceleration value drops to zero, which removes the AFF bias from the output. VFF has been steadily increasing its contribution and will be the major bias until deceleration has begun.
A stable DC servo system will measure the position error 1000 to 10,000 times per second, depending on the dynamic response of the system. This is called the "update rate". Up to a point, faster update rates result in smoother control. Systems with higher dynamic rates require faster update rates, but an update rate too much faster than the system mechanical response time can be less effective than a properly matched rate.
Ease of use
Although the PID loop is the most effective technique in widespread use in servo control, it can also be extremely difficult to set up for real world applications when the explanation is presented in mathematical terms. That is why we try to relate each term to mechanical and electrical characteristics, which are more readily understood by many people who find themselves thrust into the role of system integrator.
|