Page 50 - The Mechatronics Handbook
P. 50
3.5 Microprocessor Control
PID Control
A closed loop control system is one that determines a difference in the desired and actual condition (the
error) and creates a correction control command to remove this error. PID control demonstrates three ways
of looking at this error and correcting it. The first way is the P of PID, the proportional term. This term
represents the control action made by the microcontroller in proportion to the error. In other words, the
bigger the error, the bigger the correction. The I in PID is for the integral of the error over time. The
integral term produces a correction that considers the time the error has been present. Stated in other words,
the longer the error continues, the bigger the correction. Lastly, the D in PID stands for derivative. In the
derivative term, the corrective action is related to the derivative or change of the error with respect to time.
Stated in other words, the faster the error is changing, the bigger the correction. Control systems can use P,
PI, PD, or PID in creating corrective actions. The problem generally is “tuning” the system by selecting the
proper values in the terms. For more information on control design, see Chapter 31.
Programmable Logic Controllers
Any discussion of control systems and microprocessor control should start with the first type of “mecha-
tronic” control, the programmable logic controller or PLC. A PLC is a simpler, more rugged microcon-
troller designed for environments like a factory floor. Input is usually from switches such as push buttons
controlled by machine operators or position sensors. Timers can also be programmed in the PLC to run
a particular process for a set amount of time. Outputs include lamps, solenoid valves, and motors, with
the input–output interfacing done within the controller. A simple programming language used with a
PLC is called ladder logic or ladder programming. Ladder logic is a graphical language showing logic as
a combination of series (and’s) and parallel (or’s) blocks. Additional information can be found in
Chapter 43 and in the book Programmable Logic Controllers by W. Bolton (Newnes 1996).
Microprocessors
A full explanation of a microprocessor is found in section 5.8. For this discussion of microprocessors
and control, we need only know a few of the component parts of computer architecture. RAM, or random
access memory, is the set of memory locations the computer uses for fast temporary storage. The radio
station presets selected by the driver (or passenger) in the car radio are stored in RAM. A small electrical
current maintains these stored frequencies, so disconnection of the radio from the battery will result in
their loss. ROM, or read only memory, is the static memory that contains the program to run the
microcontroller. Thus the radio’s embedded program will not be lost when the battery is disconnected.
There are several types of ROM, including erasable programmable ROM (EPROM), electrically erasable
programmable ROM (EEPROM), and flash memory (a newer type of EEPROM). These types will be
explained later in this handbook. There are also special memory areas in a microprocessor called registers.
Registers are very fast memory locations that temporarily store the address of the program instruction
being executed, intermediate values needed to complete a calculation, data needed for comparison, and
data that need to be input or output. Addresses and data are moved from one point to another in RAM,
ROM, and registers using a bus, a set of lines transmitting data multiple bits simultaneously.
3.6 Microprocessor Numerical Control
Fixed-Point Mathematics
The microprocessors in an embedded controller are generally quite small in comparison to a personal
computer or computer workstation. Adding processing power in the form of a floating-point processor
and additional RAM or ROM is not always an option. This means that sometimes the complex mathematical
©2002 CRC Press LLC