• No results found

Sitrain s7-1200 Pwm_pid

N/A
N/A
Protected

Academic year: 2021

Share "Sitrain s7-1200 Pwm_pid"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

Content

Pulse Width Modulation (PMW) PID Controfler

Ctosed Loop Controlled System Controller Bufid

Add Cyclic Interrupt OB Add PID Controller

Compact and Expanded View Formal Parameter - Input Formal parameter- Output Formal Parameter - Slate Define Variable Configuration Input Scaling Input Monitoring Set PWM Hysteresis Output Limits Manual PID parameter Variable for Warning Limits Commissioning - Workflow Commissioning

Commissioning - Kind of Commissioning Commissioning - Online

PID Exercise ... Exercise - PID Controller

Exercise 8-1: Add Ne~v Project with Hardware Exercise 8-1: Setup PLC tags

Exercise 8-1: Add program and OB Exercise 8-1: Add P]D Controller Exercise 8-1: Parametefize PID Controller Exercise 8-1: Scale the Inputs

Exercise 8-1: Download whole project Exercise 8-1: Commissioning PID Controfler

Page 3 6 7 9 12 13 14 15 16 18 21 22 23 24 25 26 27 34 35 38 39 4O 42 43 44 45 46 47

SITRAIN Training for $7-1200 TIA System

(2)

PID Controller

Exercise PID

SITRAIN Training for $7-1200 TIA System

(3)

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.

$7-1200 TIA System SITRAIN Training for Page 3 Pulse Width Modulation & PID Controller Automation and industrial Solutions

(4)

Pulse Width Modulation (PWM)

SIEMENS

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.

$7-1200 TIA Syste[’n SITRAIN Training for

(5)

PID Controller

, Pulse Width Modulation (PWM)

¯ PID Controller

, Exercise PID

$7-1200 TIA System SlTRAIN Training for Page 5 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(6)

Closed Loop Controlled System

Controller

w e

actuator

Controller PWM

SIEMENS

Controlled

(disturbanCe) z 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.

$7-1200 TIA System SITRAIN Training for Page 6 Pulse W~dth Modulation & PID Controller Automation and Industrial Solutions

(7)

Closed Loop Controlled System

actuator

(disturbance)Z

Controlled

Controller 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.

$7-1200 TIA System S TRAIN Tra n ng for Page 7 Pulse Width Modulation & PID Controller Automation and ndustda~ Solutons

(8)

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.

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

SITRAIN Train ng for Page 8

(9)

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.

$7-1200 TIA System SITRAIN Training for Page 9 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(10)

Add Cyclic Interrupt OB

SIEMENS

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 Page 10 Pulse W]dth Modulation & PID Controller Automation and ndustdal So utons

(11)

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.

$7-1200 TIA System SlTRAIN Training for Page t 1 Pulse Width Modulation & PID Controller Automat[on and Industrial Sotutlons

(12)

Compact and Expanded View

SIEMENS

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.

$7-1200 TIA System SlTRA~N Training for page 12 Pulse W~dth Modulation & PID Controller Automation and Industrial Solutions

(13)

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.

$7-1200 TIA System SlTRAIN Training for Page 13 Pulse Width Modulation & PID Controller Automation and Industrial So~utlons

(14)

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.

$7-1200 TIA System SITRAIN Training for Page 14 Pulse ~Mdth Modulation & PID Controller Automation and Industrial Solutions

(15)

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.

$7-1200 TIA System SITRAIN Training for Page 15 Pulse W~dth Modulation & PID Controller Automation and Industrial Solutions

(16)

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.

$7-1200 TIA System SlTRAIN Tra n ng for Page 16 Pulse Width Modulation & PID Controller Automation and Industrial So u ons

(17)

stores the loop tuning parameters for the pID_Compact box instruction.

$7-1200 TIA System SITRAIN Training for Page 17 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(18)

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.

$7-1200 TIA System SITRAIN Training for Page 18 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(19)

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 with the max raw data value of 27648 and the value entered at the lower limit is nowassociated with the minimum raw data value of 0 or -27648. This is dependent on the type of analog

signal entering the analog card.

S7-1200 TIA System SITRAIN Training for Page t9 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(20)

Input Monitoring

SIEMENS

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.

$7-1200 TIA System SITRAIN Training for Page 20 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(21)

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.

$7-1200 TIA System SITRAIN Training for Page 21 Pulse W~dth Modulation & PID Controller Automation and Industrial Solutions

(22)

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 Page 22 Pulse W~dth ModuLation & PID Controller Automation and Industrial So utions

(23)

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 Page 23 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(24)

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 Page 24 Pulse Width Modulation & PID Controller Automation and Indus dal So utions

(25)

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.

$7-1200 TIA System SlTRAIN Training for Page 25 Pulse Width ModuLation & PID Controller Automation and Indus~a! Solutions

(26)

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 Page 26 Pulse Width Modulation & PID Controller Automation and In6ustda~ Solutions

(27)

$7-1200 TIA System SITRAIN Training for Page 27 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(28)

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

$7-1200 TIA System SITRA N Train ng for Page 28 Pulse W~dth Modulation & PID Controller Automation and Indus dal So u ions

(29)

S7-1200 TiA System SITRAIN Training for Page 29 Pulse W~dth Modulation & PID Controller AulornalJon and Industrial Solutions

(30)

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

$7-1200 TIA System SITRAIN Training for Page 30 Pulse V~dth Modulation & PID Controller Automat(on and Industrial Solutions

(31)

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

$7-1200 TIA System SITRAIN Training for Page 31 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(32)

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.

$7-1200 TIA System SITRAIN Training for Page 32 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(33)

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.

$7-1200 TIA System SITRAIN Training for Page 33 Pulse Width Modulation & PID Controller Automation and Industda! Solutions

(34)

’ 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.

$7-1200 TIA System SITRAIN Training for Page 34 Pulse V~dth Modulation & PID Controller Automation and In(~ustdal Solutions

(35)

$7-1200 TIA System SlTRAIN Training for Page 35 Pulse W~dth Modulation & PID Controller Automation and Industrial Solutions

(36)

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.

$7-1200 TIA System S TRA N Tra n ng for Page 36 Pulse V~dth Modulation & PID Controller Automation and Indus dal So u ons

(37)

PID Exercise

, Pulse Width Modulation (PWM)

,, PID Controller

¯ Exercise PID

$7-1200 TIA Systen~ SlTRAIN Training for

(38)

Exercise - PID Controller

SIEMENS

Hands-on

Let’s just do it ... the lab for you

$7-1200 TIA System SITRAIN Training for Page 38 Pulse V~dth Modulation & PID Controller Automation and Industrial Solutions

(39)

Process

2. 3. 4. 5.

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"

S7-’1200 TIA System SITRAIN Training for Page 39 Pulse Width Modulation & PID Controller Automation and Industrial Solutions

(40)

Task

ProceSs

Define variable

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

$7-1200 TIA System S TRAIN Tra n ng for Page 40 Pulse Width Modulation & PID Controller Automation and ndustdal So u ions

(41)

Task Process

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

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

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"

SITRAIN Training for $7-1200 TIA System

(42)

Task

Process

Add PID Controller

16. 17. 18.

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.

$7-1200 TIA System SlTRAIN Training for

(43)

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

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.

SITRAIN Training for $7-1200 TIA System

(44)

Exercise 8-1: Scale the Inputs

SIEMENS

Task Input scaling Process 27.

28. 29. 30.

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.

SITRAIN Training for $7-1200 T]A System

(45)

Hands-o~}

Task Download the whole project

Process 31. 32.

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

SITRAIN Training for S7-1200 TIA System

(46)

SIEMENS

Task Commissioning the PID Controller

Process 33. 34. 35. 36.

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.

SITRAIN Training for $7-1200 TIA System

References

Related documents

Basically cloud computing is a set of services that provide Infrastructure resources using Internet media and data storage on a third party server[3].. It has three

Richard has worked for Hitachi Capital Invoice Finance for over 9 years, and during this time has helped improve the cash flow for over 150 businesses in the Midlands area If

License: Attribution-NonCommercial-ShareAlike (by-nc-sa) Instructable: Make A Guitar Pickup.. Author:

Compiled by: Seetal daas BBA(Hons)-2k13 University of Sindh Laar Campus @ Badin Page

The results indicate that, besides improving both LCTM and CBTM scores with respect to the original MOSA and Evosuite’s default search strategy (Whole Suite), our quality-based

Medical Leave Act, 112 YALE L.J.. neutral laws would discourage men from sharing greater child- care responsibilities with their female partners. 7 3 Feminist groups and

In this work, we investigate the initial interaction of water and oxygen with different surface reconstructions of GaP(100) applying photoelectron spectroscopy, low-energy

We demonstrate that for an analysis of Planck data, such modeling is necessary to avoid significant biases in cosmological parameter estimates, but that marginalization over even a