There are essentially three types of large quantities in a PLC: digital signals, analog signals, and pulse signals. Once you understand the relationship between these three, you can master PLC operation.
I. Brief Description
1. Switch quantities, also known as logic quantities, refer to quantities that have only two values: 0 or 1, ON or OFF. They are the most commonly used control quantities, and controlling them is an advantage of PLCs and their most basic application.
The purpose of digital input control is to enable the PLC to generate corresponding digital outputs based on the current input combination and the historical input sequence, so that the system can operate in a certain sequence. Therefore, it is sometimes also called sequential control.
Sequential control can be further divided into manual, semi-automatic, or automatic. The control principles employed can be categorized into three types: decentralized, centralized, and hybrid control.
2. Analog quantities refer to continuously changing physical quantities, such as voltage, current, pressure, speed, and flow rate.
PLCs evolved from relay control with the introduction of microprocessor technology and can be conveniently and reliably used for switching control. Since analog signals can be converted into digital signals, and digital signals are simply multi-bit switching signals, PLCs can also reliably process and control the converted analog signals.
Since continuous production processes often involve analog quantities, analog quantity control is sometimes also called process control.
Analog signals are mostly non-electrical quantities, while PLCs can only handle digital and electrical quantities. Therefore, to achieve the conversion between them, sensors are needed to convert analog signals into digital electrical quantities. If this electrical quantity is not standard, it must also pass through a transmitter to convert the non-standard electrical quantity into a standard electrical signal, such as 4-20mA, 1-5V, 0-10V, etc.
It also needs to have an analog input unit (A/D) to convert these standard electrical signals into digital signals; and an analog output unit (D/A) to convert the digital quantities processed by the PLC into analog quantities—standard electrical signals.
Therefore, the conversion between standard electrical signals and digital quantities requires various calculations. This necessitates understanding the resolution of analog signal units and standard electrical signals. For example:
The PLC analog unit has a resolution of 1/32767, corresponding to a standard voltage of 0-10V. The desired temperature range is 0-100℃. Therefore, 0-32767 corresponds to a temperature range of 0-100℃. The digital value corresponding to 1℃ is then calculated to be 327.67 . To obtain a temperature value accurate to 0.1 ℃, simply divide 327.67 by 10.
Analog control includes feedback control, feedforward control, proportional control, fuzzy control, etc. These are all digital quantity calculation processes within the PLC.
3. A pulse quantity is a digital quantity whose value constantly alternates between 0 (low level) and 1 (high level). The number of pulse alternations per second is called the frequency.
The main purposes of PLC pulse quantity control are position control, motion control, and trajectory control. For example, pulse count is used in angle control. If a stepper motor driver has a microstepping setting of 10,000 pulses per revolution and requires the stepper motor to rotate 90 degrees, then the required pulse count is 10,000 / (360 / 90) = 2,500.
II. Calculation of Analog Quantities
1. -10 to 10V. When the voltage is -10V to 10V, it is converted to F448-0BB8Hex (-3000 to 3000) at 6000 resolution; and to E890-1770Hex (-6000 to 6000) at 12000 resolution.
2. 0-10V. At a voltage of 0-10V, it is converted to 0-1770Hex (0-6000) at a resolution of 12000; at a resolution of 12000, it is converted to 0-2EE0Hex (0-12000).
3. 0-20mA. At a current of 0-20mA, it is converted to 0-1770Hex (0-6000) at a resolution of 6000; and to 0-2EE0Hex (0-12000) at a resolution of 12000.
4. 4-20mA. At a current of 4-20mA, it is converted to 0-1770Hex (0-6000) at a resolution of 6000; and to 0-2EE0Hex (0-12000) at a resolution of 12000.
The above is just a brief introduction. Different PLCs have different resolutions, and the measurement range of the physical quantity you are measuring may vary. Therefore, the calculation results may differ.
Note: Wiring requirements for analog inputs:
1. Use shielded twisted pair cable, but do not connect the shielding layer.
2. When an input is not in use, short-circuit the VIN and COM terminals.
3. Analog signal lines are isolated from power lines (AC power lines, high-voltage lines, etc.).
4. When there is interference on the power line, install a filter between the input section and the power supply unit.
5. After confirming the correct wiring, power on the CPU unit first, and then power on the load.
6. When powering off, first disconnect the power supply to the load, and then disconnect the power supply to the CPU.
III. Calculation of Pulse Quantity
Pulse quantity control is often used for angle control, distance control, and position control of stepper motors and servo motors. The following uses a stepper motor as an example to illustrate the various control methods.
1. Angle control of stepper motors. First, determine the microstepping setting of the stepper motor, and then determine the total number of pulses required for one revolution of the stepper motor. Calculate "Angle percentage = Set angle / 360° (i.e., one revolution)" and "Angle action pulse count = Total pulse count per revolution * Angle percentage".
The formula is: Number of angle action pulses = Total number of pulses per revolution * (Set angle / 360°).
2. Stepper motor distance control. First, determine the total number of pulses required for one revolution of the stepper motor. Then, determine the diameter of the stepper motor roller and calculate the roller circumference. Calculate the travel distance per pulse. Finally, calculate the number of pulses required to travel the set distance.
The formula is: Set distance pulse count = Set distance / [(roller diameter * 3.14 ) / total pulse count per revolution]
3. The position control of a stepper motor is a combination of angle control and distance control.
The above is just a simple analysis of the control method of stepper motors, which may differ from the actual situation and is for reference only.
4. The operation of a servo motor is the same as that of a stepper motor, but the internal electronic gear ratio and reduction ratio of the servo motor must be considered.