Hardware Reference
In-Depth Information
The main disadvantages of the both of these logic controllers is in the control of the output being discrete.
With the output control being just on or off, there is no prediction on the change of the output that will allow
us to determine how far they are from the setpoints. However, logic controllers are usually easier to set up and
implement than PID controllers, which is why it is more common to see these controllers in commercial products.
PID controllers, though, have a distinct advantage over logic controllers: if they are implemented properly, PID
controllers won't add more noise to a system and will have tighter control at a steady state. But after the math, it is the
implementations that make PID controllers a bit more difficult to work with.
PID Can Control
There are many ways to implement a PID with a proper match to a sensor and an output method. The math will
remain reliability constant. There may be a need for some added logic control to achieve a desired system, however.
This next section provides a glimpse of other PID implementations and some possible ideas.
It is common for PID controllers to be used in positioning for flight controls, balancing robots, and some CNC
systems. A common setup is to have a motor for the output and a potentiometer for the input, connected through a
series of gears, much the same way a servo is set up. Another common implementation is to use a light-break sensor
and a slotted disk as the input, as would be found in a printer. This implementation requires some extra logic to
count, store, and manipulate steps of the input. The logic would be added to control the motor's forward or reverse
motion when counts are changed. It is also possible to use rotary encoders or flex sensors for the input. Many types
of physical-manipulation system can be created from electric-type motors and linear actuators—for example, air and
hydraulic systems.
Systems that control speed need sensors that calculate speed to power output, such as in automotive cruise
control, where the speed is controlled by the throttle position. In an automotive application, a logic controller would
be impractical for smoothly controlling the throttle.
Controlling temperature systems may require other logic to control heating and cooling elements, with discrete
output such as relays. PID controllers are fairly simple to plan when the output is variable, but in systems that provide
only on-or-off output, this planning can be more complicated. This is accomplished in much the same way as PWM
charges a compositor to produce a voltage output that an ADC can read. The PID controller needs a bit of logic to
control the time at which the element is turned on. With temperature-based PID controllers, the gains may have to be
negative to achieve a controller that cools to a setpoint.
With a proper type of sensor and a way to control output, a PID can be implemented for chemical systems, such
as controlling the pH value of a pool or hot tub. When dealing with systems that work with chemicals, it is important
that the reaction time is taken into account for how and when the reagents are added.
Other PID systems can control flow rates for fluids, such as using electric valves and moisture meters to control
watering a garden or lawn. If there is a sensor that can measure and quantify, and a way to control, a PID can be
implemented.
Tuning
The tuning of a PID can be where most of the setup time is spent; entire semesters can be spent in classes on how to
tune and set up PID controllers. There are many methods and mathematical models for achieving a tune that will
work. In short, there is no absolute correct tuning, and what works for one implementation may not work for another.
How a particular setup works and reacts to changes will differ from one system to another, and the desired reactions of
the controller changes how everything is tuned. Once the output is controllable with the loopback and the algorithm,
there are three parameters that tune the controller: the gains of Kp , Ki , and Kd . Figures 7-5 through 7-7 show the
differences between low gain and high gain using the same setup from earlier in the chapter.
The proportional control gains control how aggressively the system reacts to error and the distance from the
setpoint at which the proportional component will settle. On the left of Figure 7-5 , using a gain of 1, the system
stabilizes at about 50 percent of the setpoint value. At a gain of 7 (the right side of Figure 7-5 ), the system becomes
unstable. To tune a decent gain for a fast-reacting system, start with the proportion, set the integral and the derivative
 
Search WWH ::




Custom Search