Overview
PLC signals fall into three main types: switch (digital) signals, analog signals, and pulse signals. Understanding the relationships among these three types is fundamental to working with PLCs.
Switch (digital) Signals
Switch signals, also called logical signals, have only two values: 0 or 1, ON or OFF. They are the most common form of control and are a primary application of PLCs.
The purpose of switch-signal control is to produce appropriate digital outputs based on the current combination of inputs and the historical sequence of inputs so that the system operates in a defined order. This is often referred to as sequence control.
Sequence control can be manual, semi-automatic, or automatic. Control architectures typically use decentralized, centralized, or hybrid principles.
Analog Signals
Analog signals are continuously varying physical quantities such as voltage, current, pressure, speed, and flow rate. PLCs evolved from relay control with microprocessor technology and are well-suited for digital (switch) control. Because analog signals can be converted to digital values, PLCs can also handle analog control after conversion.
Continuous processes commonly include analog variables, so analog control is often called process control. Most analog quantities are non-electrical and must be converted into electrical signals by sensors. If the resulting electrical signal is not a standard signal, a transmitter is used to convert it into a standard electrical signal such as 4–20 mA, 1–5 V, or 0–10 V.
Analog input modules (A/D) convert these standard electrical signals into digital signals for PLC processing; analog output modules (D/A) convert processed digital values back into analog standard electrical signals. Converting between standard electrical signals and digital values requires calculation, so it is important to understand the resolution of the analog module and the standard signal range.
Example
If a PLC analog module has a resolution of 1/32767 and the standard electrical range is 0–10 V, and the measured quantity is temperature from 0–100 °C, then the digital range 0–32767 corresponds to 0–100 °C. One degree Celsius corresponds to 327.67 digital counts. To obtain resolution of 0.1 °C, divide 327.67 by 10.
Analog control methods include feedback control, feedforward control, proportional control, fuzzy control, and others. All of these are implemented as digital calculations inside the PLC.
Pulse Signals
Pulse signals are digital values that alternate between 0 (low) and 1 (high). The number of alternations per second is the frequency. Pulse control is mainly used for position control, motion control, and trajectory control. For example, pulse counts are used in angular control.
If a stepper motor driver has a subdivision of 10,000 pulses per revolution and the required rotation is 90 degrees, the required pulse count is:
pulses = 10000 / (360 / 90) = 2500
Analog Signal Calculations
Examples of how analog electrical ranges map to digital values at different module resolutions:
- -10–10 V. At 6000-resolution this maps to F448–0BB8 Hex (representing -3000 to 3000); at 12000-resolution this maps to E890–1770 Hex (representing -6000 to 6000).
- 0–10 V. At 12000-resolution this maps to 0–1770 Hex (0–6000); at 24000-resolution this maps to 0–2EE0 Hex (0–12000).
- 0–20 mA. At 6000-resolution this maps to 0–1770 Hex (0–6000); at 12000-resolution this maps to 0–2EE0 Hex (0–12000).
- 4–20 mA. At 6000-resolution this maps to 0–1770 Hex (0–6000); at 12000-resolution this maps to 0–2EE0 Hex (0–12000).
The above is a basic introduction. Different PLCs have different resolutions, and the physical measurement ranges you implement may vary, so calculation results can differ.
Analog Input Wiring Requirements
- Use shielded twisted-pair cable, but do not connect the shield to the shield layer.
- If an input channel is unused, short V IN and COM terminals.
- Keep analog signal lines isolated from power lines (for example AC mains or high-voltage lines).
- If there is interference on the power lines, install a filter between the input section and the power module.
- After confirming correct wiring, power the CPU module first, then power the loads.
- When powering down, cut off the load power first, then power down the CPU.
Pulse Signal Calculations for Motors
Pulse control is commonly used for stepper motors and servo motors for angular, distance, and position control. The examples below use a stepper motor.
1. Angle control for stepper motors
Determine the subdivision (pulses per revolution) for the stepper motor, then calculate the total pulses required for one revolution.
Angle percentage = target angle / 360°
Angle motion pulse count = pulses per revolution * angle percentage
Formula: pulses = pulses_per_revolution * (target_angle / 360°)
2. Distance control for stepper motors
Determine pulses per revolution and the roller diameter, then calculate the roller circumference. Calculate the distance per pulse, then compute the pulses required for the target distance.
Formula: pulses_for_distance = target_distance / [(roller_diameter * 3.14) / pulses_per_revolution]
3. Position control
Position control combines angle control and distance control logic.
The control approach for servo motors is similar to that for stepper motors, but you must also account for the servo motor's internal electronic gear ratio and any gearbox reduction ratio.