How to Add a Structured VFD Control to your TIA Portal PLC Application (4 Step Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi friends in today's video I'm going to share with you how to add a structured vfd control to your own Tia portal applications and if you like structured programming if you'd like to create better PLC applications in Tia portal then I have a special gift for you today I have created a downloadable free guide for you in which I share five steps to instantly improve the structure of your PLC applications in Tia portal if you'd like to go and download the guide then go and check the description below the video and click on the link all right so nowadays frequency controls are used in a wide range of Industry applications and one of the major strength of using vfds or variable frequency controls is that you can precisely control the speed of devices like pumps valves or conveyor belts seen Tia portal offers a wide range of vfds that you can integrate into your PLC applications and today I'm going to share with you how to add a seens g20c frequency converter to your own PLC application this is a very versatile low voltage frequency converter from seens I've seen it used on many production lines out there while I'm doing my commissionings it's a very popular frequency converter and in our example here I'm going to use those frequency converters to control the speed of two process pumps all right that's it for this short introduction let's jump right into it [Music] so we are going to add a vfd to our PLC application using the following four steps first we're going to add a vfd from the hardware configuration to the profinet network then afterwards we're going to set up which data communication we are going to have between the vfd and the PLC third step we're going to create structured inputs and outputs using udts userdefined data types and last finally we're going to build a standardized function block which will encapsulate all the logic necessary to control the vfd I believe these steps are pretty straightforward and pretty easy to follow so if you follow them precisely you will be up and running with vfd controls in your own applications in no time all right so let's start with the first step we're going to add a vfd from the hardware configuration or the device configuration as it's called in Tia portal to our profinet Network so right here we are in a sample application which is part of my premium bundle Tia portal all Basics pack and in this refill application we will use the vfd to precisely control the speed of two process pumps for pumping water from a supply tank to two process tanks to add vfds to the profinet network we first need to open the device configuration which is right here now we go to the network View and here you can see a nice overview of the different devices that are connected to our profinet Network at the moment we have a PLC we have an HMI and we have three communication nodes for inputs and outputs so here we are going to add the two frequency converters for the pumps the first thing we need to do is we go to the hardware catalog here on the right side and we search for the frequency converter that we want to add as I explained to you in the beginning of this video we are going to add a g20c frequency converter which is a popular frequency converter I've seen it used on many different production lines so here I've typed it into the catalog I've pressed enter and our first search result takes us to the camic g20c folder here under the camic drive main folder now if we open up this folder you can see that there's different networks we can choose from we are going to use a profinet network which is PN so we open this folder right here now this opens up an extensive list of different types of g20c drives and they're neatly organized by power rating for example 0.55 KW 1.1 kwatt Etc and the type of filter fa means filtered which means an EMC filter has been built in and UF means unfiltered which means an EMC filter has not been built in now for this example I'm going to select a 1.5 kwatt drive with an EMC filter so I select that right here and I drag it over to the network view here we go and now it's on our Network view the drive is not assigned yet so we click right here and we assign it to our PLC device there we go let me just drag that down here to have a nice overview so so let's give this one a name as well so this will be the frequency converter for pump refill process one so I type in pump refill one so that takes care of the first vfd so now we need a second one as well for the second pump so we do exactly the same we drag it over we put it into place we assign it to the PLC device and we rename it to pump refill to there we go so let's put this one aside a bit so we have a nice overview so now we have our two frequency drives connected to the profinet network the only thing left to do here before we go to the next step is assigning an IP address to each drive to assign an IP address we first click on the drive itself here it's important that you click on the drive and not on the gray area next to it and now we go to ethernet addresses and now we select an Ethernet address that is in the same range as the profinet network so for this device for example I will choose 100 for the last number and I have a habit to do the same to the device number so I'll use device number 100 for this one and now let's do the same for our second vfd this one will be 101 with Device number 101 okay that takes care of the first step we have added the vfd to the profinet network the main idea behind having a frequency drive on a network like profinet is to be able to control the vfd directly via software we don't want the hassle of time consuming wiring or IO testing we would like everything to be set up directly in the P application and the only thing that we need to do as a programmer in our application is programming the logic for the commands to the vfd and interpreting the status signals coming from the vfd but how do we know which data is being transferred between vfd and PLC and how do we set this up how do we configure this well Tia portal uses telegrams to Define which data is being communicated between PLC and vfd and we configure our telegrams by going first to the general configuration and then selecting the telegram configuration right here here you can see under the telegram tab which types of telegrams you can select there's a standard telegram one standard t 20 Etc there's even a free Telegram in the end we are going to select here standard telegram one which is two words of length in the send Direction and two wordss in the receive Direction and it contains all the necessary communication data that we need for a simple vfd control of a pump so we leave it like that one last thing I would like to set up here before talking more into depth about this telegram is to set up the input and the output area for this telegram so this we do by going to the end right here under partner data area and for the inputs I'm going to select input area 500 so that basically means that our inputs start at input by 500 and ends at input by 53 which means we will have two words or four bytes of input data and for the outputs I'm selecting output 500 for the area so that means that we're going to have 500 to 53 is again four bytes two words of Al out put data in the same way we go to the second pump we check the telegram standard telegram 1 so that's correct and we set up the input and the output area and here it's already set up correct to input 510 and output 510 I already did this before the video so first pump input output 500 second pump input output area 510 all right so now let's have a look which data is being communicated with standard telegram 1 we do this by clicking on the Green Arrow here under the link Tab and this takes us to the parameters for this vfd and more precise it takes us to the communication area for the receive and the transmit Direction so let's open this up a little bit and make it more clear okay so here we are in the transmit direction as you can see at the top and the first thing you'll notice is that you can again select your telegram so this is still displaying standard telegram 1 because this is what we just configured before in the device configuration and you can choose any of the other telegrams right here as well below this is the area for the proy save configuration I am not going to go into detail here because it's a whole different subject that only Mak sense if you're using stto or any other safety feature on your vfd and it's not the main topic of this video so we'll leave that for now maybe that's a topic for another video what's more interesting for us is the proy drive configuration underneath the first thing you can see here is that there are two words configured for the transmit direction of standard telegram 1 the first word is the Zs W1 word which is a German abbreviation for status word and the second word is the actual speed of the drive which here is displayed with the word nistore a which again is a German abbreviation to be honest I'm not really sure why seens decides to keep these German words in the English version of Tia portal but hey that's the way it is right now I hope they maybe transition to only using English words in an English version of T portal in the future but we'll see so we have a status word Zs W1 and we have an actual speed of the drive nistore a now the status words is a collection of flags collection of bits that comes from the drive and if we would like to see which bits are in this word we simply click on the word itself and the popup screen shows us the 16 Flags which are part of the status word so you have ready for switching on ready operation enabled fault present Etc these are all status signals coming from the frequency drive to the PLC all right now if we go and have a look at the receive Direction the receive direction is which data the frequency converter receives from the PLC so these are actually the commands from the PLC and we can see what those are by clicking right here again standard telegram one is configured the propy save we're not going to go into right now and here on the profy drive you can see that two words are configured for the standard telegram one our first word is called stw1 which is a German abbreviation for control word and the second word right here is called _ a which means the speed set point for the drive so what we will send from the PLC to the vfd are in the first word the control flags and in the second word the set point speed for the drive make sense all right just like before if we want to know which flags are part of the control word we click on the control word right here and here you get a nice overview in the popup screen of all 16 flags all 16 controls bits part of that control word some important flag some important control bits to mention here is control Bit Zero which is the onoff control bit this one is used to actually start your drive so to actually make your drive start moving control bit seven the first acknowledge faults is used to reset any faults you would have on the drive and another interesting control bit would be bit number 11 the Seto inversion so if for example your drive is running in the wrong direction you can change this bit from false to true or true to false to change the direction of the drive all right just one thing I would like to show you before we go on to the next step where we're going to build structured inputs and outputs for the drive is that each telegram contains their own configuration of words if we go back to the top here and we select a different telegram than standard telegram 1 for example seens telegram 354 then you can see when we scroll down when we go down right here that we have six control words now instead of two we still have the same two that we had before the sdw1 the control word one and the set point speed and soore a but on top of that we have four configurable user words sent from the PLC to the vfd so each telegram is different each telegram has a different setup of which words it's communicating in each Direction receive or transmit but as I mentioned before we are going to go with standard telegram one here because it has the necessary communication for a simple vfd control one final remark here the telegram that you select for the receive and the transmit direction is always the same so you cannot for example select standard telegram one for the reive direction and seen telegram 354 for the transmit Direction so the telegram for receive and transmit direction is the same so now that you know about telegrams and how to set up which data to communicate between your vfd and your PLC let's go and have a look at how we can pour all that data into an awesome data structure that we can then use in our PLC [Music] application by now you probably know from watching some of my other YouTube videos or maybe some of my courses that you followed that I am always very passionate about creating structured PLC applications in my opinion striving to become a structured and organized PLC programmer is probably the best education that you can give to yourself and it can open up a lot of new and exciting career opportunities as well so this brings us to The Next Step the third step in this vfd implementation tutorial we are going to create structured inputs and outputs for our drives I mean if we look back so far we have added a vfd to our Pro roinet Network in the device configuration and we have specified which data we would like to communicate between our PLC and our vfd using a telegram now we are going to structure that telegram data we are going to map it into userdefined data types and afterwards we will declare inputs and outputs for each Drive using those unities so if we have a quick look back here at the telegram configuration of our receive Direction which is open still right here we can see that we have two words set up which is one control word with 16 control Flags 16 control bits and a set point speed for sending the desired set point from the PLC to the vfd so it's these two words that we are going to map to a userdefined data type and afterwards we are going to map the words from the transmit Direction which is a status word and a word containing the actual speed to a second userdefined data type okay so let's get started to add a new data type to our PLC application we go to the PLC data types group right here and you can see that we already added some different groups here one for machine one for equipment and we added a library group since our vfd control is going to be a universal control block that we can use for different modules in our application we are going to add these new data types under the library so we open up the library right here I've already created a folder for seens UDS and for user UDS and here you see we already have a UD for PID control this is a feature which is as well available in the Premium Edition of my Tia portal all Basics pack which is a training bundle and again if you're interested in this training bundle go and check the link in the description below the video so we have a PID control and we would like to add two unities one step status and one command for our vfd control first off I'm going to create two new groups just to make this a little bit more organized one group called p and another group called vfd and I will move this PID control nicely under the P ID group and here for the vfd group I'm going to create two new UDS one for the command data which is the receive direction from the vfd point of view and one for the status data which is the transmit direction from the vfd point of view so to add a new UDT I rightclick and I press add new data type so let's start with the command so I'll rename this one to UDT vfd command and the data that I'm going to be added is the data right here under the parameters for for the receive Direction so we're going to have a control word with these flags with these control bits and we're going to have a second word for the set point speed so the first word will be a control word which I will Define as a structure of 16 bits and the second word will be the set point [Music] speed for the control word we have 16 bits so I will quickly add them right here and then afterwards we can have a look at the overview and there we go so we got a first word which is a control word with 16 control flags and we have a second word with the set point speed so what we did write here is pretty simple we just mirrored the data from standard telegram 1 the receive direction to a userdefined data type in the PLC called UD vfd command now we are going to do exactly the same for the status words so let's have a look again this is the transmit direction from the vfd point of view where we said we have two words of status which is the status word one right here with 16 status Flags status bits and we have a second status word for the actual speed so we create a new data type we call it UDT vfd status and we mirror the communication from the telegram and that's it for the status words so we have two status words the first one are 16 status bits and the second one is the actual speed and again the only thing we did is we mirrored the telegram communication in the transmit direction from the vfd point of view so what we have right now are two brand new userdefined data types for the vfd control one for the command direction from PLC to vfd and one for the status direction from vfd to PLC the only thing left to do now is to create structured inputs and outputs for our vfds using these userdefined data types so creation of inputs and outputs is done under the PLC Tex group right here and since we are creating a frequency control for our process pumps which are part of the equipment modules it means that we are going to create our inputs and outputs under the equipment group and what you can see right here under the equipment group is that I've already created tag tables for inputs equipment and outputs equipment these contain the inputs and the outputs of the other examples the other features that I'm using here in this training bundle right now we're going to add vfd inputs and outputs to this equipment group and what I like to do for vfds is create a separate tag table to make it clear that these are inputs and outputs for vfds so I right click right here and I select new tag table which I will call vfd equipment now we open the tag table and I will first start by adding the inputs and outputs of the first process pump so for the inputs of the refill pump of process one I will use the data type UD vfd status the address for this input is the same input range that we declared in the device configuration so if we quickly head back and we check out the telegram configuration for the first pump then you can see that we have declared the input and the output area as input area 500 and output area 500 so we enter the same range right here under address so input area 500 and for the vfd outputs of refill pump process one we select the udity vfd command as the data type and the output address 500 okay so now we configured the input area and the output area for the vfd of our first pump for our second pump it's really easy we copy paste this we change the names to process two that's what the P stands for process and we change the input and the output address accordingly and that's really all you need to do to set up structured inputs and outputs for your variable frequency drives you start by creating userdefined data types udts that mirror the telegram communication that you set up and afterwards you add inputs and outputs using those data types it's actually quite simple all right so so far we have added vfds to our device configuration to our profinet Network we have defined which data we would like to communicate between the vfd and the PLC using our telegram configuration and now in this step we have created structured inputs and outputs for the vfds using userdefined data types we've covered a lot already but we're not totally there yet we just have one final step left but this might be the most interesting step of them all in this final step I'm going to share with you how to build a a standardized function block for a vfd control or any type of control for that matter and how to integrate this block into your PLC application so as I've mentioned before this vfd control block is a multi-use control block that can be called in different parts of your application in different modules so for that reason I have decided to classify the control block the vfd control Block in the library folder so if we have a look here under my Library folder and under the user folder you can see that I've created a FB vfd control which is a standardized control block encapsulating all logic necessary for controlling the vfd so this block is used to control the pumps of the refill application the process pumps of the refill application the refill application is part of the equipment group so if we open this group and we look at equipment modules which is the main function block that calls all the function blocks for the equipment modules you can see that we have four networks here under the equipment modules one for the configuration one for the supply module that's another module in this sample application and two modules for refill process one and refill process 2 so the vfd control for our pumps are part of this refill process one and refill process to one pump for each process now if we check the logic in this network you can see that we're calling a function block FB em refill em standing for equipment module and if we open this function block then we can find our vfd control block right here under Network 8 so the FB vfd control is a standardized control block for controlling a vfd with standard Telegram one and it is called here using a multi- instance in the FB em refill so I'd like to point out a couple of interesting inputs and outputs on this FB vfd control block if we have a look at the inputs which are situated right here on the left side of the function block you can see that we have a set point speed input a real and this is typically a variable that comes directly from the HMI most likely it would be an input field that the operator uses for entering a pump speed between 0o and 100% as we seen in the previous step the vfd will receive the set point speed through control wart 2 another interesting input here on the Block is the Run input and this is the actual signal that will start moving the drive now if we have a look on the right side of the function block the outputs you can see that we have status information for Drive ready Drive running Drive faed set point reached and the actual speed so these First Status outputs Drive ready Drive running drive faulted and set point reached are coming from the vfd through status word one the actual speed status you might remember that that comes from status word 2 and one last thing here before we actually have a look inside the block itself is the way that our input and output structures are connected to the block well that is done right here through the inout parameters of the block the vfd status is the two status words that's being sent from the vfd to the PLC and the vfd command are the two command words that we sent from the PLC to the vfd and as you might remember these are exactly the inputs and the outputs that we defined in the previous step now let's go and dive inside the control block itself and see how logic is organized inside okay so let's start by minimizing the networks so we get an overview and as you can see here we have three main parts in our Logic the first part which is Network one contains logic to validate the speed set point it will check if the speed set point is within acceptable limits I mean this is my recommendation here if you're building a standardized block for any kind of control you should always start by validating the parameters going into the block this will typically be parameters from input fields on the HMI and by making sure that these parameters are within limits in the beginning of your control block you will avoid many troubleshooting hours later on when you're commissioning the machine or when the machine is running production the second block of logic which are networks 2 to network 7 contain all the logic necessary to command the vfd so if we look here for example in network 4 we can see that here we have a fault logic a reset fault Logic for acknowledging faults inside the vfd so if the input for fault reset goes High we will send a p of two seconds to the command bit number seven of the vfd command word if we go for example to network 6 where the run signal is generated we can see that if the input for run is high the status word bit three indicates there's no fault present and Status word Bit Zero indicates that the vfd is ready for switching on then we energize Bit Zero of the control W and finally let's have a quick look at Network number seven this is the speed set point and here you can see that our set point speed is being converted from a 0 to 100% input field on the HMI to a analog value 0 to 16,383 which is being sent to the vfd okay so that's it for the second block of logic related to the vfd command and now the third block of logic is related to the status signals from the vfd to the PLC right here in networks 8 and n so if we open network 8 here for example you can see that we are mapping the different status bits of our status word one to the outputs of the control block and finally in network 9 we are converting the actual speed which comes through status word 2 from the vfd to the PLC we are converting this from a 0 to 16,383 analog value to a 0 to 100% output on our control block so if you would like to work with the logic in this sample application with the vfd control the PID control and dozens of other Advanced features for your PLC and HMI applications please go and check the description below the video as I've mentioned before this sample application is part of the Premium Edition of my Tia portal all Basics pack training bundle you will get this full TI portal sample project including a PLC and an HMI application and it comes with a huge how-to guide including step-by-step instructions on how to integrate each one of these Advanced features into your own PLC and HMI applications so go check that out whoa that was a lot of information to digest right well now that we've reached the end of this tutorial I hope that you feel more confident implementing a seens variable frequency drive into your own PC applications and I hope that you got a clearer understanding of how to add a vfd to your device configuration how to configure which data to communicate between PLC and vfd using telegrams how to properly structure vfd inputs and outputs and how to build a standardized control block for your vfd that you can call in different parts different modules of your application and as I mentioned in the beginning of the video if you're really committed to creating structured PLC applications in DIA portal then go and download my free guide by clicking the link in the description below this video I hope you enjoyed this tutorial and I'll see you on the next [Music] video
Info
Channel: PLCskilltree
Views: 16,601
Rating: undefined out of 5
Keywords:
Id: GLF3QJ5gW84
Channel Id: undefined
Length: 34min 11sec (2051 seconds)
Published: Sun Oct 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.