Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Control CSE 421.

Similar presentations


Presentation on theme: "Digital Control CSE 421."— Presentation transcript:

1 Digital Control CSE 421

2 Grading scheme References:
50 Semester work 100 Final 150 Total References: G. Starr, Introduction to Applied Digital Control, Course notes, 2006. M. Sami Fadali and A. Visioli, Digital Control Engineering Analysis and Design, 2nd Edition, Elsevier, 2012. D. Ibrahim, Microcontroller Based Applied Digital Control. Wiley, 2006. Course webpage:

3 Topics to be covered: Linear Discrete Systems Sampling and aliasing
The z-transform Block diagrams Stability Controller design using transfer functions System identification Case study State-space description of continuous & discrete systems State-space design of digital control systems

4 Control systems The aim of CONTROL system is to keep a certain variable at a certain value. Two approaches for control: Open loop control. Closed-loop (feedback) control.

5 Open-loop control Keep the output as close as possible to some desired value by a suitable adjustment of the input. However, due to unknowns in the system model and the effects of external disturbances open-loop control is not accurate. A better solution is to use feedback.

6 Closed-loop (Feedback) control
A measurement of the output of the plant is used to modify its input. The controller receives the measurement of the plant output, then generates a suitable value of the plant input, hence closing the loop.

7 Advantages of closed-loop control
Isolate the output from unwanted disturbance inputs or minimize their effect (Disturbance Rejection). The model of the plant is not required to be exactly known. In other words feedback control reduces sensitivity of the output to variations in plant parameters. If the plant is unstable, then feedback control is necessary. Open-loop control can not be used in this case! The output can track the reference input closely (Command Tracking).

8 Continuous-time control systems
Generally, plant inputs and outputs are continuous signals both in time and in amplitude. For example, consider the plant to be controlled is a motor. The motor input (current or voltage) and output (speed) are defined and may change at every instant in time (continuous in time). These variable can take any value within certain range (continuous in amplitude). In continuous-time control system, the output is fed back, the error is calculated, the controller generates a control signal, and so on. This occurs at every time instant.

9 Digital control system
Computers and microcontrollers are widely used in control systems. To control a physical system or process (which is analog) using a digital controller, digital-to-analog converter (DAC) and analog-to-digital converter (ADC) are required.

10 Analog-to-digital (A/D) converter
Samples analog signal (typically voltage), and then converts them into integer numbers suitable for processing by digital computer. A/Ds typically have unipolar ranges of 0–5 V, 0–10 V, or bipolar ranges of ± 5 V, or ± 10 V. A/D conversion causes quantization error q given by the resolution of the converter in bits. Common resolutions are 8 bits (256 levels), and 12 bits (4096 levels). A 12-bit A/D of range ±10 volts would have a conversion quantum of q = 20/4096 = 4.88 mV. The A/D converter is usually approximated as a sampler (a switch).

11 Digital-to-analog (D/A) converter
D/A converts a digital (integer) number calculated by the computer into a voltage so as to drive the output of the plant as desired. The voltage ranges and converter resolutions are the same as for the A/D converter. A D/A converter functions as a zero-order hold (ZOH), holding its output at a constant value until it receives the next discrete input. Many microcontrollers incorporate built-in A/D and D/A converter circuits. These microcontrollers can be connected directly to analog signals.

12 Sampling The computer periodically samples the error signal every time interval T called the sampling period. This is represented by the clock in the block diagram of the digital control system (slide 9). The sampling frequency in Hz is 1/T. When a continuous signal e(t) is sampled, it becomes a discrete signal denoted by e(kT), e(k) or ek. Discrete signals are only mathematically defined at the sample instants t = kT, where k = 0,1,2,…. Digital control systems can sometimes be called discrete-time or sampled-data systems.

13 Continuous, discrete, and ZOH (output of D/A) signals

14 Digital vs. Analog Control
Digital control systems are so widely used that it is rare to see a completely continuous control system (Starr, 2006). Intuitively, one would think that controllers that continuously monitor the output of a system and accordingly change their control signal continuously would be superior to those that base their control on sampled values of the output. This is in fact true! Had all other factors been identical for digital and analog control, analog control would be superior to digital control. What, then, is the reason behind the change from analog to digital that has occurred over the past few decades?

15 Digital vs. analog control
The processing speed of computer hardware makes it possible to sample signals at very high speeds (i.e. very small sampling periods). Therefore, digital controllers achieve performance that is essentially the same as that based on continuous monitoring of the controlled variable. Digital controller is implemented in software and so is easy to modify and to implement complex controller methods such as adaptive control. Analog control is difficult to modify once implemented in hardware and is restricted to simple forms such as PID controllers. Digital control is economical even for small, low-cost applications.

16 Computer Control Algorithm
The control algorithm in a computer is implemented as a program which runs continuously in a loop executed at the start of every sampling instant: Repeat Forever When it is time for next sampling instant: Read the desired value, R, from A/D converter Read the actual plant output, Y, from the A/D converter Calculate the error signal, E = R − Y Calculate the controller output, U Send the controller output to D/A converter Wait for the next sampling instant End

17 Computer Control Algorithm
The algorithm, once starts, runs continuously and can only be stopped manually by an operator or if some abnormal event or condition occurs. Note that the loop is run exactly at the sampling instants. Two approaches to achieve this is timer interrupt and ballast coding.

18 Timer Interrupts A popular way to perform accurate sampling with constant sampling period is to use timer interrupts available on most microcontrollers. The controller algorithm is written inside the timer interrupt service routine (ISR), and the timer is programmed to generate interrupts at regular intervals, equal to the sampling time. At the end of the ISR algorithm, control returns to the main program, which either waits for the occurrence of the next interrupt or performs other tasks (e.g. displaying data on an LCD). The use of interrupts has the advantage that the computer can do other tasks between the sampling instants.

19 Timer Interrupts Main program: Wait for a timer interrupt (or perform some other tasks) End Interrupt service routine (ISR): Read the desired value, R Read the actual plant output, Y Calculate the error signal, E = R − Y Calculate the controller output, U Send the controller output to D/A converter Return from interrupt

20 Ballast Coding This method is so simple. It involves finding the execution time of each instruction inside the loop and then adding dummy code to make the loop execution time equal to the required sampling interval. Do Forever: Read the desired value, R Read the actual plant output, Y Calculate the error signal, E = R − Y Calculate the controller output, U Send the controller output to D/A converter Add dummy code . . . End The disadvantage is that if the code inside the loop is changed, or if the CPU clock rate of the microcontroller is changed, then it will be necessary to readjust the execution timing of the loop.


Download ppt "Digital Control CSE 421."

Similar presentations


Ads by Google