Вы находитесь на странице: 1из 9

`

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

Experiment 6 - Analog PLC Instructions Prelab.


What is the analog to digital conversion? .. What are the Gain and the Offset used in the PLCs ADC? And why they added? What is the following function blocks do? Draw the timing diagram of each. The Analog Amplifier The Analog Comparator The Analog threshold trigger. The Analog Differential trigger .. The Analog Multiplexer

Objectives:
1. Being introduced to the analog functions of LOGO! PLC. 2. Use varies analog functions to design several problems. 3. Have the ability to construct the equivalent ladder diagram for the analog functions and to connect the analog sensors or potentiometer.

Theory:
Earlier PLCs were limited to discrete or digital I/O interfaces, which allowed only on/offtype devices to be connected. This limitation meant that the PLC could have only partial control of many process applications. Today, however, a complete range of both discrete and analog interfaces are available that will allow controllers to be applied to practically any type of control process. Discrete devices are inputs and outputs that have only two states: on and off. In comparison, analog devices represent physical quantities that can have an infinite number of values. Figure1 shows the different between the analog and digital signals. Typical analog inputs and outputs vary from 0 to 20 milliamps, 4 to 20 milliamps, or 0 to 10 volts.

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

Figure1: Digital and Analog signals To input an analog voltage (into a PLC or any other computer) the continuous analog voltage value must be sampled and then converted to a numerical value by an A/D converter. Figure2 shows a continuous voltage changing over time. There are three samples shown on the figure. The process of sampling the data is not instantaneous, so each sample has a start and stop time. The time required to acquire the sample is called the sampling time. A/D converters can only acquire a limited number of samples per second. The time between samples is called the sampling period T, and the inverse of the sampling period is the sampling frequency (also called sampling rate). The sampling time is often much smaller than the sampling period. The sampling frequency is specified when buying hardware, but for a PLC a maximum sampling rate might be 20Hz.

Figure2: Sampling process in analog to digital conversion If a sensor is connected to the analog input of a LOGO! It will convert the process variable it measure into an electrical signal e.g. a thermocouple will convert a temp degree to a voltage signal. This value of signal lies within the typical range of this sensor. LOGO! always converts the electrical signals at the analog input into digital values from 0 to 1000. A voltage of 0 to 10 V at input AI is transformed internally into a range of values from 0 to 1000. An input voltage exceeding 10 V is shown as internal value 1000. So to show the real process value (instead of the LOGO! predetermined value in a range from 0 to 1000) you can multiply the digital values by a gain factor and then shift the zero of the

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

range of values (offset). This allows you to output an analog value to the LOGO! display (as a massage text) and deals with the values as real process quantities. The offset and the gain can be determine by using equation1, Actual value Ax = (internal value at input Ax * gain) + offset The gain and offset is calculated based on the relevant high and low values of the function. Example 1: The available thermocouples have the following technical Data: -30C to +70 C . 0 to 10 V DC (i.e. 0 to 1000 in LOGO!) Actual value = (internal value * gain) + offset -30 = (0 * A) + B +70 = (1000 * A) 30 ..... i.e. offset B = -30 ...... i.e. gain A = 0.1

Analog Function in LOGO!


In this experiment we will discuss some of the analog functions and the student will have to study the rest of them alone. Here we will discuss the following functions.

The function fetches the analog signal at input Ax. Ax is multiplied by the value of the A (gain) parameter, and the value at parameter B (offset) is added to product, i.e. (Ax * gain) + offset = actual value of Ax. The values A and B are parameters designated by the programmer according to the sensor used. Also the ON and OFF thresholds designated by the programmer according to the application see the timing diagram at figure3.

Figure 3: Analog threshold Input and output timing diagram, If the On threshold > Off threshold, then:

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

o Q = 1, if the actual value Ax > On o Q = 0, if the actual value Ax < Off If the On threshold < Off threshold, then o Q = 1 if On < actual value Ax < Off.

The function fetches the analog signal at input Ax. Ax is multiplied by the value of the A (gain) parameter, and the value at parameter B (offset) is added to product, i.e. (Ax * gain) + offset = actual value of Ax. Output Q is set or reset, depending on the set (On) threshold and difference value. The function automatically calculates the Off parameter: Off = On + Dif, whereby Dif may be positive or negative. See the calculation rule below. When you set a negative differential value Delta, The On threshold >= Off threshold, and: Q = 1, if (the actual value Ax > On) Q = 0, if (the actual value Ax <= Off) When you set a positive differential value Delta, the On threshold < the Off threshold, and; Q= 1, if: (On <= the actual value Ax < Off). See the timing diagram in figure4.

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

Figure4: timing diagram for Differential trigger function

The function fetches the analog values from the inputs Ax and Ay. Ax and Ay are each multiplied by the value of the A (gain) parameter, and the value at parameter B (offset) is then added to the relevant product, i.e. (Ax _ gain) + offset = actual value Ax or (Ay _ gain) + offset = actual value Ay. The function forms the difference (-) between the actual values Ax Ay. Output Q is set or reset, depending on difference of the actual values Ax Ay and the set thresholds. See the calculation rule below

If threshold On >= threshold Off, then: Q = 1, if (actual value Ax - actual value Ay) > On Q = 0, if (actual value Ax - actual value Ay) <= Off.

If threshold On < threshold Off, then Q = 1, then: On <= (actual value Ax - actual value Ay) < Off. See figure 5 the illustration

Figure5: The analog comparator output for Ax-Ay where the off and on thresholds = 200

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

The function fetches the analog signal of input Ax. This value is multiplied by the value of the A (gain) parameter, and parameter B (offset) is then added to the product, i.e. (Ax _ gain) + offset = actual value Ax. The actual value Ax is output at AQ. If you interconnect this special function with a real analog output, note that the analog output can only process values between 0 and 1000. To do this, you may need to connect an additional amplifier between the analog output of the special function and the real analog output. Using this amplifier, you standardize the output range of the special function to a value range of 0 to 1000. See figure6 a and b.

Figure6.a: The output of the analog amplifier constant analog signal

Figure6.b: The output of the analog amplifier continues changing analog

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

If input En is set, then the function issues one of 4 possible analog values V1 to V4 at the output AQ according to the programmer set, depending on the value of S1 and S2. If the input En is not set, then the function issues the analog value 0 at output AQ. If you interconnect this special function with a real analog output, note that the analog output can only process values between 0 and 1000. To do this, you may need to connect an additional amplifier between the analog output of the special function and the real analog output. Using this amplifier, you standardize the output range of the special function to a value range of 0 to 1000. See the timing diagram in figure7 to understand the idea of multiplexer.

Figure7: Analog multiplexer timing diagram

Procedure:
Problem: A temperature control task involving a domestic central heating system, see Figure8. The central heating boiler is to be controlled and supply hot water to the radiator system in the house and also to the hot water tank to provide hot water from the taps in the house. Two pump motors have to be switched on to direct the hot water from the boiler to either, or both the radiator and hot water systems according to whether the temperature sensors for the room temperature and the hot water tank indicate that the radiators or tank need heating. The boiler

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

Design constrains: 1. The used temperature sensors output an analog voltage range (0-10) V corresponds to the temperatures (-20C to 60C). 2. Motorized pump M1 is turning on when the rooms temperature reaches less than 20C. 3. Motorized pump M2 is turning on when the water tanks temperature reaches less than 30C. 4. The boiler sensor is an on/off sensor indicates (1/0) if the boilers water heat is sufficient or not respectively. 5. Each motor should maintain on after the required heat reached for 5 sec. 6. The fuel motor have two speeds, a. Speed 1 when only the room or the tank required to be heated b. Speed 2 when both of the tank and room requires to be heated, or the sum of the temperatures reaches less than 30C. c. Otherwise it stops.

1. Design the problem using either the Ladder diagram or the Functional Blocks. 2. Simulate your design, to verify the solution. 3. Construct the wiring diagram. 4. Use the LOGO!, the push buttons and the lambs to implement the hardware circuit.

ME 4510 Programmable Logic Controller PLC LAB. Fall 2012-2013 Eng. Alaa Alsotari

Reports requirements: 1. Each of the procedure steps should be included at the report. 2. The simulation results will be corrected at the lab. References; 1. Bolton, w. (2006) Programmable logical controllers.UK: Elsevier Newnes. 2. http://www.plcs.net/

Вам также может понравиться