Understanding and Implementing Analog Scaling in Programmable Logic Controllers (PLCs)
When working with Programmable Logic Controllers (PLCs), analog scaling is a crucial technique that converts analog input signals like voltage (0-10 V or 4-20 mA) or current (0-10 V or 4-20 mA) into a digital format, and vice versa. This process ensures that the analog signals are accurately represented in the digital world within the control systems. This article will explore the principles and implementation of analog scaling, using the context of PLCs as an illustrative example.
What is Analog Scaling?
Analog scaling is the process of converting analog input or output signals into a format that is more suitable for digital processing. This involves converting voltage or current signals to a digital format and scaling the digital value to match the desired transducer range. Conversely, scaling is performed to translate digital values back to analog signals.
Converting Analog Inputs to Digital
The typical method of converting an analog input, such as a voltage (0-10 V or 4-20 mA) or current (0-10 V or 4-20 mA), into a digital format is by using analog-to-digital (AD) modules. These modules sample the analog input and convert it into a digital output that can be processed within the PLC's memory.
For instance, in a Mitsubishi PLC, the AD module can resolve different ranges. An example using the Mitsubishi UnG400 4AD or 8 AD module would have a resolution of:
0-32000 for a 10 V signal 0-4000 for a 4-20 mA signal inbuilt in the SD6020 module 0-30000 for a 10 V signal in an Omron AD2608 moduleOnce the analog signal is converted to a digital format, it must be scaled to match the specific range required for the transducer. The process of scaling involves the following steps:
Identify the input range of the PLC's AD module. Identify the desired output range of the transducer. Apply the scaling formula to convert the digital value to the analog output range.Scaling Digital Output to Analog
The reverse process of scaling involves taking a digital output from the PLC's memory and converting it into an analog signal. This is often achieved using a digital-to-analog (DA) module. Similarly, the DA module has a specific resolution depending on the PLC model.
Special Considerations for Analog Transducer Inputs
For certain transducers that output current (4-20 mA) and are connected to an analog-to-digital (AD) module with separate ports for voltage (V) and current (I), special consideration is required. In this case, the V and I ports must be short-circuited externally, and the transducer output should be connected to the I port.
Implementing the Scaling Formula
The formula for analog scaling can be represented as:
Output_Value (Output_Max - Output_Min) / (Input_Max - Input_Min) * (Input_Value - Input_Min) Output_Min Scale_offset
All variables should be defined as Real data types in the PLC program. An example function block for this formula is available in the ScaleTrans function block of Omron Sysmac Studio.
Additional Considerations
For more complex scaling, such as converting temperature units (Fahrenheit to Celsius), a different equation should be used. This is because the relationship between these two temperature scales is nonlinear, and a linear equation like y mx c will not suffice.
Conclusion
Analog scaling is a fundamental method in PLC programming, allowing for the accurate conversion of analog signals to digital and vice versa. By understanding the principles and applying the appropriate formulas, engineers can ensure that their control systems operate efficiently and precisely.