PLC three large quantities:switch quantity, analog quantity, pulse quantity. As long as you figure out the relationship between the three, you will be able to skillfully master the PLC
Calculation of switching quantities
1.A switching quantity, also known as a logic quantity, refers to a quantity that has only two values, 0 or 1, ON or OFF. it is the most commonly used control, and controlling it is the strength of the PLC, and is the most basic application of the PLC.
The purpose of switching control is to make the PLC produce the corresponding switching outputs according to the current input combination of the switching quantity and the historical input sequence, so that the system can work in a -defined order. Therefore, it is sometimes called sequential control.
Sequence control is also divided into manual, semi-automatic or automatic. The control principles used are decentralized, centralized and hybrid control.
2.Analog quantity refers to some continuously changing physical quantities, such as voltage, current, pressure, speed, flow rate, and so on.
PLC is developed by relay control after introducing microprocessor technology, which can be conveniently and reliably used for switching control. As analog can be converted to digital, digital is only a multi-bit switching, so the converted analog, PLC can also be completely reliable processing control.
Because continuous production processes often have analog, so analog control is sometimes called process control.
Analog is mostly non-electric, and PLC can only handle digital, electric. All that is needed to realize the conversion between them is a sensor, which converts the analog quantity into a digital electric quantity. If the amount of electricity is not standard, but also through the transmitter, the non-standard amount of electricity into a standard electrical signal, such as 4-20mA, 1-5V, 0-10V and so on.
At the same time there must be analog input unit (A/D), these standard electrical signals into digital signals; analog output unit (D / A), in order to PLC after processing the digital volume into analog is a standard electrical signals, so the standard electrical signals, digital conversion between the use of a variety of operations.
This requires clarification of the resolution of the analog unit and the standard electrical signals.
[For example]
The resolution of the PLC analog unit is 1/32767, the corresponding standard power is 0-10V, and what is to be detected is a temperature value of 0-100℃. Then 0-32767 corresponds to the temperature value of 0-100℃. Then calculate the digital quantity corresponding to 1℃ is 327.67. If you want to make the temperature value accurate to 0.1℃, put 327.67/10 can be. Analog control includes: feedback control, feed-forward control, proportional control, fuzzy control, etc. These are all digital quantities within the PLC. These are the process of calculating digital quantities inside the PLC.
3. Pulse is a digital quantity whose value is always changing between 0 (low level) and 1 (high level). The number of alternating pulse changes per second is called frequency.
PLC pulse quantity control purpose is mainly position control, motion control, trajectory control. For example:The number of pulses is used in angle control.
The subdivision of a stepper motor driver is 10000 per revolution, and the stepper motor is required to rotate 90 degrees, then the value of the pulses to be acted upon = 10000/(360/90)=2500.
Calculation of analog
1, -10-10V. -10V-10V voltage is converted to F448-0BB8Hex (-3000-3000) at 6000 resolution; E890-1770Hex (-6000-6000) at 12000 resolution.
2, 0-10V. 0-10V voltage is converted to 0-1770Hex(0-6000) at 12000 resolution; 0-2EE0Hex(0-12000) at 12000 resolution.
3, 0-20mA. 0-20mA current is converted to 0-1770Hex(0-6000) at 6000 resolution; it is converted to 0-2EE0Hex(0-12000) at 12000 resolution.
4, 4-20mA, 4-20mA current, in 6000 resolution is converted to 0-1770Hex (0-6000): 12000 resolution is converted to 0-2EE0Hex (0-12000).
The above is only a brief introduction, different PLCs have different resolutions, and the physical quantities you measure realize different ranges. The calculation results may have some differences.
Note:Requirements for wiring analog inputs
1.Use shielded twisted-pair cable, but do not connect the shield.
2. When an input is not in use, short the VIN and COM terminals.
3. Isolate the analog signal lines from the power lines (AC power lines, high voltage lines, etc.).
4. When there is interference on the power supply line, install an attenuator between the input section and the power supply unit.
5. After confirming the correct wiring, power up the CPU unit first and then the load.
6. When disconnecting the power supply, first disconnect the power supply of the load and then disconnect the power supply of the CPU.
Calculation of pulse volume
The control of the pulse amount is mostly used for the angle control, distance control, and position control of stepping motors and servo motors. The following is an example of the stepper motor to illustrate each control mode
1, Angle control of stepper motor. First of all, we must clarify the stepper motor's fine points, and then determine the total number of pulses required for the stepper motor to turn a circle, calculate the "Angle Percentage = Set Angle / 360 ° (i.e., a circle)" "Angle action pulses = a circle of the total number of pulses * Angle Percentage. Formula: Angle action pulse = - circle total pulse * (set angle / 360 °).
2, stepper motor distance control. First define the total number of pulses required for one revolution of the stepper motor. Then determine the diameter of the stepper motor roller, calculate the circumference of the roller to calculate each pulse running distance. Finally calculate the number of pulses to be run to set the distance traveled. The formula is: set distance pulse = set distance / [(wheel diameter * 3.14) / a circle of the total number of pulses]
3, stepper motor position control is the angle control and distance control of the integrated above is just a simple analysis of the stepper motor control, there may be discrepancies with the actual, for the reference of colleagues only, servo motor action with the same stepper motor, but take into account the servo motor's internal electronic gear ratio with the same service motor reduction ratio.




