Sitrain s7-1200 Pwm_pid

October 14, 2017 | Author: leningfe | Category: Automation, Systems Theory, Systems Science, Cybernetics, Control Theory
Share Embed Donate


Short Description

Download Sitrain s7-1200 Pwm_pid...

Description

SIEMENS

Page Content 3 Pulse Width Modulation (PMW) 6 PID Controfler 7 Ctosed Loop Controlled System 9 Controller Bufid Add Cyclic Interrupt OB 12 Add PID Controller 13 Compact and Expanded View 14 Formal Parameter - Input 15 Formal parameter- Output 16 Formal Parameter - Slate Define Variable 18 Configuration Input Scaling 21 Input Monitoring 22 Set PWM Hysteresis 23 Output Limits 24 Manual PID parameter 25 Variable for Warning Limits 26 Commissioning - Workflow 27 Commissioning 34 Commissioning - Kind of Commissioning 35 Commissioning - Online 38 PID Exercise .................................................................................................................................... 39 Exercise - PID Controller 4O Exercise 8-1: Add Ne~v Project with Hardware Exercise 8-1: Setup PLC tags 42 Exercise 8-1: Add program and OB 43 Exercise 8-1: Add P]D Controller 44 Exercise 8-1: Parametefize PID Controller 45 Exercise 8-1: Scale the Inputs 46 Exercise 8-1: Download whole project 47 Exercise 8-1: Commissioning PID Controfler

SITRAIN Training for Automation and Industrial Solutions

Page 1

$7-1200 TIA System Pulse Width Modulation & PID Controller

PID Controller Exercise PID

SITRAIN Training for Automation and Industrial Solutions

Page 2

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Pulse Width Modulation (PWM)

CTRL_PWM Instruction The CTRL_PWM Pulse Width Modulation (PWM) instruction provides a fixed cycle time output with a variable duty cycle. The PWM output runs continuously after being started at the specified frequency (cycle time). The pulse width is varied as required to effect the desired control. Duty cycle can be expressed as a percentage of the cycle time (0 - 100%), as thousandths (0 - 1000), as ten thousandths (0 - 10000), or as $7 analog format. The pulse width can vary from 0 (no pulse, always off) to full scale (no pulse, always on). Since the PWM output can be varied from 0 to full scale, it provides a digital output that in many ways is the same as an analog output. For example, the PWM output can be used to control the speed of a motor from stop to full speed, or it can be used to control position of a valve from closed to fully opened.

SITRAIN Training for Automation and industrial Solutions

Page 3

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Pulse Width Modulation (PWM)

Two pulse generators are available for controlling high-speed pulse output functions: PWM and Pulse train output (PTO). PTO is used by the motion contro~ instructions. You can assign each pulse generator to either PWM or PTO, but not both at the same time. The two pulse generators are mapped to specific digital outputs as shown in the above table. You can use onboard CPU outputs, oryou can use the optional signal board outputs. The output point numbers are shown in the above table (assuming the default output configuration). If you have changed the output point numbering, then the output point numbers will be those you assigned. Regardless, PTOI/PWM1 uses the first two digital outputs, and PTO2/PWM2 uses the next two digital outputs, either on the CPU or on the attached signal board. Note that PWM requires only one output, while PTO can optionally use two outputs per channel. If an output is not required for a pulse function, it is available for other uses.

SITRAIN Training for Automation and Indus~al Solutions

Page 4

$7-1200 TIA Syste[’n Pulse W~dth Modulation & PID Controller

SIEMENS PID Controller

, Pulse Width Modulation (PWM) ¯ PID Controller , Exercise PID

SlTRAIN Training for Automation and Industrial Solutions

Page 5

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Closed Loop Controlled System

actuator

Controller w

(disturbanCe)

Controlled

z

e

Controller

PWM

Fan

High Speed Counter

A block diagram showing a PID closed loop control implementation where the measured feedback is compared with the setpoint to determine the error. The error is then used by the PID loop algorithm to adjust the PID output to eliminate the error.

SITRAIN Training for Automation and Industrial Solutions

Page 6

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

SIEMENS Closed Loop Controlled System

actuator

Controller

(disturbance)

Controlled

Z

PWM

Fan

High Speed Counter

The PID controller is implemented in the 1200 CPU by the PID Compact instruction box located in the Extended Instruction Task Card. This PID control loop will use-a PWM instruction and a High Speed Counter instruction to control the speed of the fan motor on the training simulator.

S TRAIN Tra n ng for Automation and ndustda~ Solutons

Page 7

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Controller Build

PID Loop Controller The PID Compact instruction provides the CPU 1200 user with a PID loop control algorithm that has automati’~ and manual mode available along with self tuning optimization ¯ The pID_Compact instruction box has inputs where the setpoint and process variable (actual value) are connected. The input connections provide process data for the PID algorithm which then drives the output to the final element.

SITRAIN Train ng for Automation and Industrial So utions

Page 8

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Controller Build

The PiD Compact instruction is programmed in a Cyclic Interrupt OB for execution which executes at a specifie~-cycle time. The cycle time can be viewed or changed in the prope[ties of the Cyclic Interrupt OB. During the programming of the PID_Compact instruction a data block is created and automatically placed in the Technological Object folder.

SITRAIN Training for Automation and Industrial Solutions

Page 9

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Add Cyclic Interrupt OB

Adding and configuring the Cyclic Interrupt OB through the Add new block prompt in the Program blocks folder. When the Add new block dialog box opens, the OB button is selected followed by selecting the Cyclic interrupt, the program language, the OB number, and cyclic execution time; click OK to complete the configuration.

S7-1200 TIA System S TRAIN Tra n ng for Automation and ndustdal So utons

Page 10

Pulse W]dth Modulation & PID Controller

SIEMENS Add PID Controller

Open the Cyclic Interrupt OB to view the LAD networks, then open the Extended Instructions and drag and drop the PID Compact instruction on to the open LAD network. A dialog box will open where an instance data bloc-k will be configured and be attached to the pID_Compact instruction box.

SlTRAIN Training for Automat[on and Industrial Sotutlons

Page t 1

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Compact and Expanded View

PID Compact instruction box can be expanded or collapsed by clicking on the little arrow head at the bottom of the PID_Compact instruction box. tn the expanded state, additional inputs/outputs are exposed and connections can be made then the instruction box can be collapsed to conserve space.

SlTRA~N Training for Automation and Industrial Solutions

page 12

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

SIEMENS

input: "Automatic Mode" .= from the user program Analog Input := "Manual mode"

~dable for °Manuat Mode" restart counter := "inactive Mode"

The PID Compact instruction inputs not only provide connection points for the controlled process setpoint-~nd measured feedback, it also provides an input connection to change the state of the controller mode. 1he PID controller can be in manual mode, which is the default mode, or auto mode. When the PID controller is in auto mode, the P[D controller automatically adjusts the loop output to maintains the loop’s setpoint value, such as a desired temperature.

SlTRAIN Training for Automation and Industrial So~utlons

Page 13

$7-1200 TIA System Pulse Width Modulation & PID Controller

The PID Compact instruction outputs not only provides a connection point for the controlled process final element-~ut it also provides different types of output connections to match what it is driving, such as an output for pWM or an output as a Real number data type. Limit and warning alarm bits can be configured along with locations that record the mode of the controller and displays error codes in the event of an error condition which makes troubleshooting easier.

SITRAIN Training for Automation and Industrial Solutions

Page 14

$7-1200 TIA System Pulse ~Mdth Modulation & PID Controller

SIEMENS Formal Parameter - State

The chart above shows the numerical codes that are displayed in the State output which describes the Status of the PID controller. A memory location must be configured to State output in order for the numerical codes to be displayed.

SITRAIN Training for Automation and Industrial Solutions

Page 15

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

SIEMENS Define Variable

Symbolic programming provides an advantage, you will find the program much clearer and easier to read if you use symbols (for example fan) instead of the absolute addresses. To allow the use of symbols, you can enter a name, the absolute address, the data type and a comment for every address used. Once you have defined a symbol, it can be used throughout the entire user program of a programmable module; symbolic names are entered in the PLC tags folder.

SlTRAIN Tra n ng for Automation and Industrial So u ons

Page 16

$7-1200 TIA System Pulse Width Modulation & PID Controller

Clicking on the Configuration button in the upper right hand corner of the pID_Compact instruction box opens to the configuration topics such as Basic parameters, Input scaling, and Advanced settings which stores the loop tuning parameters for the pID_Compact box instruction.

SITRAIN Training for Automation and Industrial Solutions

Page 17

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Input Scaling

Configuring the Input/Output fields in the dialog box is made easier by the following special features, The Intellisence feature aids in configuration by providing a list of Intellisense and automatic connection, slide only valid possible connection variables (symbolic names) like the Input value input shown in the above. The automatically connection feature then connects that symbolic variable to the correct input or output of the pID_Compact box instruction.

SITRAIN Training for Automation and Industrial Solutions

Page 18

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Input Scaling

The input scaling takes the raw data value from the analog input signal such as 0 to 27648 or -27648 to +27648 and assigns the desired engineering units. So that the value entered at the upper limit is now associated raw data of 27648 the value entered at the lower limittype is now associated with with the themax minimum rawvalue data value of 0and or -27648. This is dependent on the of analog signal entering the analog card.

S7-1200 TIA System SITRAIN Training for Automation and Industrial Solutions

Page t9

Pulse Width Modulation & PID Controller

SIEMENS Input Monitoring

Numerical alarm warning points are entered into the input monitoring menu prompt and will be used to set alarm bits that can be configured on the pID_Compact instruction box.

SITRAIN Training for Automation and Industrial Solutions

Page 20

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Set PWM Hysteresis

Edit the PWM limits menu prompt to enter the minimum on time and the minimum off time of the output signal of the piD_Compact instruction. PID_Compact instruction will not change the signal Time-on or the signal Time-off past these limits.

SITRAIN Training for Automation and Industrial Solutions

Page 21

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

Edit the Output limit menu prompt to enter an upper limit and a low limit for the PID_Compact instruction to use in the function calculation.

$7-1200 TIA System SITRAIN Train ng for Automation and Industrial So utions

Page 22

Pulse W~dth ModuLation & PID Controller

SIEMENS

If the PID tuning parameters are known, the PID tuning parameters values can be set manually through this configuration dialog box and then the check box should be checked in order to utilize those parameters, as shown in the slide. The PID tuning parameters can be determined by using the auto-tune feature.

$7-’1200 TIA System SITp~&.IN Training for Automation and Industrial Solutions

Page 23

Pulse Width Modulation & PID Controller

Optional warning alarm bit variable can be configured in the piD_Compact instruction box to provide inputs to logic operation and/or drive animation on the HML

$7-1200 TIA System SlTRA N Train ng for Automation and Indus dal So utions

Page 24

Pulse Width Modulation & PID Controller

SIEMENS Commissioning - Workflow ¯ Download Projected controller + technological object ¯ start commissioning ¯ start scope , Run "Startup Tuning" (turn-over tangent method) ¯ Run "Tuning in Run" (Step response)

¯ Upload PiD-parameter to project ¯ activate automatic mode Set [oPID_compact-DB°’sRet’i-M°de] to mode 3

After the PID Compact instruction box has been configured and compiled, the program can be download to the 1200 C-PU then tested through the Commissioning function as listed in the slide.

SlTRAIN Training for Automation and Indus~a! Solutions

Page 25

$7-1200 TIA System Pulse Width ModuLation & PID Controller

Invoke the Commissioning function by clicking the Commissioning button in the upper right hand corner of pID_Compact instruction box,

$7-1200 TIA System SlTRAIN Training for Automation and In6ustda~ Solutions

Page 26

Pulse Width Modulation & PID Controller

The Scope has buttons where you can start/stop the measurement and the ability to select the sample time in ms through the provided sample time field.

$7-1200 TIA System SITRAIN Training for Automation and Industrial Solutions

Page 27

Pulse Width Modulation & PID Controller

The Commissioning scope has several very useful features such as fix scale.

$7-1200 TIA System SITRA N Train ng for Automation and Indus dal So u ions

Page 28

Pulse W~dth Modulation & PID Controller

The Commissioning scope has several very useful features such as the tool to Zoom in.

SITRAIN Training for AulornalJon and Industrial Solutions

Page 29

S7-1200 TiA System Pulse W~dth Modulation & PID Controller

The Commissioning scope has several ve~ useful features such as the too[ to Zoom out.

SITRAIN Training for Automat(on and Industrial Solutions

Page 30

$7-1200 TIA System Pulse V~dth Modulation & PID Controller

SIEMENS

The Commissioning scope has several very useful features such as a window that displays the current values.

SITRAIN Training for Automation and Industrial Solutions

Page 31

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Commissioning

The Commissioning Scope has several features such as the auto tuner function which calculates the PiD loop tuning parameter then uploads them to the PID loop controller, Clicking the button in the optimization window begins the process.

SITRAIN Training for Automation and Industrial Solutions

Page 32

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Commissioning - Kind of Commissioning

]he auto tuner creates a step change in the process them monitors the response of the process to determine to determine the PID loop tuning parameters. The step change causes the process to oscillate as illustrated in the graphic above and illustrated in the slides that follow.

SITRAIN Training for Automation and Industda! Solutions

Page 33

$7-1200 TIA System Pulse Width Modulation & PID Controller

’ The auto tuner creates a step change in the process them monitors the response of the process to determine the PID loop tuning parameters. After looking at the setpoint, input, and output, in the graph you notice that the PID setpoint was changed and the PID input and PID output react to the change. A progress bar displays the progress time until the function is completed.

SITRAIN Training for Automation and In(~ustdal Solutions

Page 34

$7-1200 TIA System Pulse V~dth Modulation & PID Controller

"The step change causes the process to oscillate as illustrated in the graphic above.

SlTRAIN Training for Automation and Industrial Solutions

Page 35

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

SIEMENS Commissioning - Online

The auto tuner calculates the PID tuning parameters then it stores them in PID_Compact data block that has been associated with PID instruction.

S TRA N Tra n ng for Automation and Indus dal So u ons

Page 36

$7-1200 TIA System Pulse V~dth Modulation & PID Controller

SIEMENS PID Exercise

, Pulse Width Modulation (PWM) ,, PID Controller ¯ Exercise PID

SlTRAIN Training for Automation and Industrial So~ulions

Page 37

$7-1200 TIA Systen~ Pulse W~dth Modulation & PID Controller

SIEMENS Exercise - PID Controller

Let’s just do it ..... the lab for you Hands-on

SITRAIN Training for Automation and Industrial Solutions

Page 38

$7-1200 TIA System Pulse V~dth Modulation & PID Controller

Task

Add new project

Process 2. 3. 4. 5.

SITRAIN Training for Automation and Industrial Solutions

Click in the Task menu Project > New Name the project ,,Project_exemise_PID_loop" Start "Add new device" Add "Unspecific CPU" Detect (upload) "hardware configuration"

Page 39

S7-’1200 TIA System Pulse Width Modulation & PID Controller

Task

Define variable

ProceSs

6. 7,

Start Tag-Editor with a double click Set up the displayed tags.

$7-1200 TIA System S TRAIN Tra n ng for Automation and ndustdal So u ions

Page 40

Pulse Width Modulation & PID Controller

Hands-on

Task

Implement program code n Ma’n and add ’cycl’c OB’

Process 9, 10. 11. 12, 13. 14. 15.

SITRAIN Training for Automatlon and Industrial Solutions

Open "Main" (OB1) Add program code like displayed Add new block out of the project tree Select "cyclic interrupt OB" Type in the name "cyclic interrupt._PID controlleF’ Give the OB the manual block number "300" Define the scan time with "lOOms" Hit the Checkbox "Add new and open"

Page 41

$7-1200 TIA System Pulse Width Modulation & PID Controller

Task

Add PID Controller

Process

16. 17. 18.

SlTRAIN Training for Automation and industrial Solutions

Add "PID_Compact" block out of the extended instructions in the "cyclic interrupt_PID controller’ (OB300). Give the "InstanceDB / Technological object" a name. Add "Instance DB/Technological object" by hitting OK Button.

Page 42

$7-1200 TIA System Pulse W~dth Modulation & PID Controller

Task

Parameterize the PID Controller

Process

19. 20. 21. 22. 23. 24. 25. 26.

SITRAIN Training for Automation and Industrial Solullons

Mark the "PID_Compact" block Select the point §basic settings" Select as controller type "Temperature" Select as unit "C°". Activate the checkbox "Invert PID-Controller output." Set the Set-point to "85." Select "Input_PER" for the Input value and type in the variable "heat_sensor" (IW66), Select "OutpuLPER" for the Output value and type in the variable "fan" (QWS0) an.

Page 43

$7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS Exercise 8-1: Scale the Inputs

Task

Input scaling

Process

27. 28. 29. 30.

SITRAIN Training for Automation and Industrial Solutions

Select the point "input scaling". Select for the Scaled upper value "100°C.’’ Select for the Scaled lower value "0°C." Select for the analog/d{gital converter the values "0" for the lower limit and "27648" for the upper limit.

Page 44

$7-1200 T]A System Pulse Width Modulation & PID Controller

Exercise 8-1: Download whole project

SIEMENS

Hands-o~}

Task

Download the whole project

Process

31. 32.

SITRAIN Training for Automation and Industrial Solutions

"Save" the project. Download "All" to the PLC

Page 45

S7-1200 TIA System Pulse Width Modulation & PID Controller

SIEMENS

Task

Commissioning the PID Controller

Process

33. 34. 35. 36.

SITRAIN Training for Automation and industrial Solutions

Start the "Commissioning" Start the scope. Select "Tuning in run" and hit the "Start tuning" button After successful commissioning hit the button "Upload PID parameters to project" and save the project.

Page 46

$7-1200 TIA System Pulse Width Modulation & PID Controller

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF