【正文】
that tends to maintain a prescribed relationship of one system variable to another by paring functions of these variables and using the difference as a means of control.OutputComparisonControllerProcessDesire outputresponseMeasurementFigure Closeloop control systemClosedloop control systems derive their valuable accurate reproduction of the input from feedback parison. An error detector derives a signal proportional to the differences between the input and output.The closedloop control system drives the output until it equals the input and the error is zero.Any differences between the actual and desired output will be automatically corrected in a closedloop control system.Through proper design the system can be made relatively independent of secondary inputs and changes in ponent characteristics.Figure illustrates an automatic tanklevel control version of the system shown in Figure . It can maintain the desired tank level h within quite accurate tolerances even through the output flow rate through value V1 is varied. If the tank level is not correct,an error voltage is developed.This is amplified and applied to a motor drive that adjusts value V2 in order to restore the desired tank level by adjusting the inlet flow rate.A block diagram analogous to this system is shown in Figure . Because feedback parison is present,the term closedloop is used to describe the system’s operation. Input(desiredtank level)h+vvPoweramplifierMotordriveFloatErrorFigure Automatic tanklevel control systemPower amplifierTankFloatMotordriveFigure Black diagram of automatic tanklevel control systemOutput(actual tank level)Error+Due to the increasing plexity of the system under control and the interest in achieving optimum performance, the importance of control system engineering has grown in the past decade. Furthermore, as the system bee more plex, the interrelationship of many controlled variables must be considered in the control scheme. A block diagram depicting a multivariable control system is shown in Figure .The introduction of feedback enables us to control a desired output and can improve accuracy, but it requires attention to the issue of stability of response.ControllerProcessMeasurementDesiredoutputresponseOutputvariablesFigure Mulutivariable control systemMicrocontrollerA microcontroller (sometimes abbreviated 181。C, uC or MCU) is a small puter on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal puters or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. By reducing the size and cost pared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are mon, integrating analog ponents needed to control nondigital electronic systems.Some microcontrollers may use fourbit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (milliwattsor microwatts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt。 for example: 12bit instructions used with 8bit data registers. The decision of which peripheral to integrate is often difficult. The microcontroller vendors often trade operating frequencies and system design flexibility against timetomarket requirements from their customers and overall lower system cost. Manufacturers have to balance the need to minimize the chip size against additional functionality. Microcontroller architectures vary widely. Some designs include generalpurpose microprocessor cores, with one or more ROM, RAM, or I/O functions integrated onto the package. Other designs are purpose built for control applications. A microcontroller instruction set usually has many instructions intended for bitwise operations to make control programs more pact. For example, a general purpose processor might require several instructions to test a bit in a register and branch if the bit is set, where a microcontroller could have a single instruction to provide that monlyrequired function. Microcontrollers typically do not have a math coprocessor, so floating point arithmetic is performed by software.Programming environments Microcontrollers were originally programmed only in assembly language, but various highlevel programming languages are now also in mon use to target microcontrollers. These languages are either designed specially for the purpose, or versions of general purpose languages such as the C programming language. Compilers for general purpose languages will typically have some restrictions as well as enhancements to better support the unique characteristics of microcontrollers. Some microcontrollers have environments to aid developing certain types of applications. Microcontroller vendors often make tools freely available to make it easier to adopt their hardware. Many microcontrollers are so quirky that they effectively require their own nonstandard dialects of C, such as SDCC for the 8051, which prevent using standard tools (such as code libraries or static analysis tools) even for code unrelated to hardware features. Interpreters are often used to hide such low level quirks. Interpreter firmware is also available for some microcontrollers. For example, BASIC on the early microcontrollers Intel 8