1. Overview of PID loop control
PID controller is the most widely used closed-loop controller. It calculates the output of the controller according to the deviation between the given value and the measured value of the controlled object according to the PID algorithm, controls the actuator to adjust, makes the controlled object follow the given value, and makes the system stable. It automatically eliminates the influence of various interferences on the control process. PID stands for proportional, integral and differential.
There are three ways to implement the PID function in S7-200 SMART:
PID instruction block: Exchanges data through a PID loop table and only accepts real numbers between 0.0 and 1.0 (actually percentages) as valid values for feedback, given and control output.
PID Wizard: Conveniently complete input/output signal conversion/standardization. PID instructions will be automatically called at the same time.
Program yourself according to PID algorithm
S7-200 SMART CPU can support up to 8 PID control loops (8 PID instruction function blocks). There is no specific limit on the number of PID control loops that can be programmed by yourself according to the PID algorithm, but we need to consider the impact of PLC storage space and scan cycle.
PID control is a negative feedback closed-loop control that can suppress disturbances caused by various factors within the system closed loop and make the feedback follow the given changes.
The PID control algorithm has several key parameters Kc (Gain), Ti (integral time constant), Td (differential time constant) and Ts (sampling time). In S7-200 SMART, the PID function is implemented through the PID instruction function block. The PID function block is executed at a fixed time (according to the sampling time), and the control quantity is calculated according to the given, feedback, proportional-integral-differential data at that time according to the PID operation rules.
Since PID can control many objects such as temperature and pressure, each of which is represented by an engineering quantity, there must be a universal data representation method that can be recognized by the PID function block.
The PID function in S7-200 SMART uses the percentage of the adjustment range to abstractly represent the numerical value of the controlled object. In actual engineering, this adjustment range is often considered to be consistent with the measurement range (range) of the controlled object (feedback).
The PID function block only accepts real numbers between 0.0 and 1.0 (actually 0%--100%) as valid values for feedback, given and control output. If you use the PID function block directly for programming, you must ensure that the data is within this range, otherwise an error will occur. Others such as gain, sampling time, integral time, and differential time are all real numbers. Therefore, it is necessary to convert the actual physical quantity of the periphery to the data required (or output) by the PID function block. This is the so-called input/output conversion and standardization processing.
2. PID main parameters
Sampling time: The CPU must sample the feedback at a certain time interval to perform PID control calculations. The sampling time is the interval for sampling the feedback. Signal changes that are shorter than the sampling time interval cannot be measured. Too short a sampling time is unnecessary, and too long a sampling interval obviously cannot meet the occasions where the disturbance changes quickly or the speed response requirements are high.
Gain (Gain, amplification factor, proportional constant) The product of gain and deviation (the difference between given and feedback) is used as the proportional part of the controller output. It improves the response speed and reduces the error, but cannot eliminate the steady-state error. When the proportional action is too large, the stability of the system decreases. Integral time: When the deviation value is constant, the integral time determines the rate of change of the controller output. The shorter the integral time, the faster the deviation is corrected. Too short an integral time may cause instability. The length of the integral time is equivalent to the time required for the output change to be equal to the deviation value when the gain is "1" under the step setting, that is, the time for the output to change to twice the initial step deviation. If the integral time is set to the maximum value, it is equivalent to no integral action.
Derivative time: When the deviation value changes, the derivative action will add a spike to the output, which decreases over time. The longer the derivative time, the greater the change in the output. Derivatives increase the sensitivity of the control to disturbances, that is, the greater the rate of change of the deviation, the stronger the derivative control effect. Derivatives are equivalent to predictive adjustments to the feedback change trend. If the derivative time is set to 0, it will not work and the controller will work as a PI regulator.
Proportional adjustment: improve response speed and reduce error, but cannot eliminate steady-state error. When the proportional effect is too large, the stability of the system decreases. (Adjust individually from small to large)
Integral adjustment: Eliminate steady-state errors and slow down the dynamic response of the system. The smaller the integral time, the greater the integral effect and the faster the deviation is corrected. Too short an integral time may cause instability. (After adjusting the adjusted proportional gain to 50%~80%, reduce the integral time from large to small)
Differential regulation: Advanced regulation can predict the trend of error changes and suppress the control effect of errors in advance, thus avoiding serious overshoot of the controlled quantity. It can improve the response speed and stability of the system and amplify noise interference. For controlled objects with lag properties, differential links should be added.
1. Select PID Wizard from the Tools menu in Micro/WIN SMART 3. The S7-200 SMART CPU can support up to 8 PID control loops (8 PID instruction function blocks) 6. Gain: proportional constant Integral time: If you don’t want the integral effect, you can set this value to a large value (such as 10000.0) Derivative time: If you don’t want a differential loop, you can set the differential time to 0 Sampling time: The time interval between the PID control loop sampling the feedback and recalculating the output value
8. Unipolar: 0-27648 Bipolar -27648 to 27648 Temperature x10° is the temperature value of the PT100 thermal resistor or thermocouple °C represents Celsius °F represents Fahrenheit Select 20% offset: If the input is 4-20mA, select this option. 4mA is 20% of the 0-20mA signal, so select 20% offset, that is, 4mA corresponds to 5530, 20mA corresponds to 27648 11. Output type: You can choose analog output or digital output. Analog output is used to control some devices that require analog quantity, such as proportional valves, frequency converters, etc. Digital output actually controls the on and off state of the output point according to a certain duty cycle, which can control solid-state relays (heating rods, etc.)
12. Range: When it is unipolar, the default value is 0 to 27648. When it is bipolar, the value is -27648 to 27648. When it is 20% offset, the value is 5530 - 27648, which cannot be changed. 14. Alarm when the feedback value is 10% of the lower limit. 15. Alarm when the feedback value is higher than 90% of the upper limit. 16. Analog module error alarm. "EM0" is the position of the first expansion module.
18. You can choose to add PID manual control mode 20. The PID function block uses a 120-byte V zone address to perform control loop operations; and the input/output standardization program generated by the PID wizard also requires an operation data storage area. Make sure that the bytes starting from this address are not reused elsewhere in the program. 24. The wizard completes the generated subroutine 25. The wizard generates the data block
The address of the data block needs to be configured to be retained after power failure. 4. PID instruction
5. Programming
Use the PID Wizard to write a program to keep the temperature at a given value and tune the PID parameters
6. Download and debug
The download operation is not explained here.
1. Debugging instructions:
(1) Proportional gain: increases the adjustment speed and reduces the error, but cannot eliminate the steady-state error;
Reference methods can be adjusted individually from small to large
(2) Integral effect: Eliminate steady-state errors and slow down the dynamic response of the system. Too large an integral will affect the stability of the system. Adjustment reference method: Adjust the adjusted proportional coefficient to 50%--80%; from large to small, increase the integral effect
(3) Differential effect: advanced control, reducing adjustment time, and amplifying interference
Reference for adjustment method: Adjust individually from small to large, and adjust the proportion and integral accordingly to pursue the change rate of the adjustment deviation
(4) PID adjustment method: first turn off the integral and differential, adjust the proportion first, and then add the integral when the proportion is similar. Generally, the larger the proportional value, the faster the output result; the larger the integral value, the slower the output result; the differential is used when adjusting the temperature control, and it is generally not needed.
2. The given value, manual and automatic status, PWM output settings, etc. can be monitored and modified through the status chart.
But it can also be debugged through the PID control panel, as shown below:
Previous article:Analysis of ten common faults of servo motors
Next article:5 examples to help you get started with PLC step by step
Recommended ReadingLatest update time:2024-11-16 21:55
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Prize live broadcast: TI takes you to learn mobile robots. This Friday at 10 am, make an appointment to watch and there will be a surprise~
- Altium Designer AD special-shaped plate layout skills
- Download Win Gift | Artesyn PMBus Interface Non-Isolated Digital DC-DC Converter
- TO92S enclosed 3-pin direct plug-in components have a pin spacing of only 0.45mm, and occasionally a short circuit will occur between the two pins after soldering
- [Erha Image Recognition Artificial Intelligence Vision Sensor] 3: Erha Image Recognition Vision Sensor and STM32 Communication to Realize Color Recognition Experiment
- The actual circuit does not match the simulation circuit. I don't know why. Please tell me. Thank you. The actual op amp is OP297.
- ADI or TI blood glucose meter solution
- How should the size of the drone be determined?
- Medical beauty industry, ultrasonic transducer
- Introduction to the Internet of Things Protocol Coap Protocol