You are on page 1of 20

Motor Control:

Using a Variable Frequency Drive, PLC


and HMI
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Important User Information


This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended
for use only as a learning aid when using Rockwell Automation approved demonstration hardware, software and
firmware. The Documentation should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this
Documentation, mandates that those responsible for the application and use of those Products must satisfy
themselves that all necessary steps have been taken to ensure that each application and actual use meets all
performance and safety requirements, including any applicable laws, regulations, codes and standards in addition
to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell
Automation”) be responsible or liable for any indirect or consequential damages resulting from the use or
application of the Products described in this Documentation. Rockwell Automation does not assume
responsibility or liability for damages of any kind based on the alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or
software described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are
responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell
Automation or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and • all other
factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell
Automation is prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous
environment, which may lead to personal injury or death, damage,
property or economic loss.

Identifies information that isalcritic


for successful
application and understanding of the product.

Identifies information about practices or circumstances


that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drivepeople


to alert
that dangerous voltage may
esent.
be pr

Labels may be located on or inside the drivepeople


to alert
that surfaces may be dangerous temperatures.

4 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Section 3: Controlling the VFD with PLC and HMI code.


Before you begin
About this lab
The following indication is used throughout this lab to identify action or input required by the student.

The Rockwell PowerFlex Variable Frequency Drive (VFD) can be used as a ‘stand-alone’ device where all control and status
can be viewed locally or it can be hard wired to receive commands and status via push buttons and indicator lights.

In this part of the lab we will use the PLC and the controller for the PanelView display panel (HMI) to control and display the
status of the VFD.

All PLC’s receive Input data, act upon it and write Output data. The I/O points are time critical and need to be read IN and
written OUT on every scan of its I/O.

However long it takes to read in the Inputs, execute the logic and write the Outputs is called the Scan Time of the
Processor. The time is measured in milliseconds (.ms) and can get longer as the PLC code gets longer or more
complicated. The duration of the scan time becomes critical when it takes too long to get through and changes to machine
inputs could be missed.

The I/O attached (or local) to the frame of the Micro850 (Base I/O, Plug-In and Expansion I/O) are its #1 priority to service
and scan. This is called Class I Messaging or-priority read/writes.

After The I/O and PLC code are updated in 1 Scan Time then the PLC takes care of some internal updating (clearing
internal buffers, zero registers and scratchpads, etc.).
Internal updates are called Class II messaging, or CPU housekeeping.

So for every (1) Processor Scan Time the PLC executes Class I and Class II messaging. Whatever this time is (in ms)
there is a % of time (called Overhead Time Slice) set aside for background communications- or Class III Messaging.
Although other Input/Output devices can be added to this Micro800 model PLC (HMI, VFD, and remote I/O via a network),
the PLC only treats its ‘local’ I/O as Class I. All other non-local I/O devices (or background communications) use Class III
Messaging.

Class III Messaging only gets executed after Class I and II have finished and only run during that percentage of
Overhead Time Slice. Here’s how a Class III differs from Class I and II:
Let’s just say that it takes a M850 CPU 20ms to complete Class I and II messaging. If the Overhead Time Slice is 10%,
the actual time the PLC will allow for all (3) message scanning will be 22ms.
This means that after Class I and II there is only 2ms left for Class III messages to occur. At the end of 22ms even if the
read/write to the HMI or VFD haven’t completed, the PLC marks where it left off on that Class III message and returns to
take cake of Class I and II, then picks up where it left off on the Class III data.
This is why (sometimes) the HMI may appear to be slow to respond to data changes on a screen. Class III messaging is
not of high priority and because of that depending on how much data is being requested in a Class III, it could take several
scans to finish.

So that the CPU Scan Time and Overhead Time slice are not constantly running all these Class III messages- the Class
III type messages require a trigger to execute them. This way, a request for a Class III message to use the Overhead
Time Slice only occurs when the Message requests an update, not an update on every scan.
The HMI and VFD are Class III messaging devices. While the HMI does not need an instruction to be triggered the VFD
does.

In the PLC code a messaging Function Block called MSG_CIPGENERIC is used to read/write to the VFD. It is a Common
Industrial Protocol (CIP) Generic Message that can communicates EXPLICITLY to a particular device (as long as that device
as well is CIP capable.
An EXPLICIT message writes and reads to a specifically targeted addressed device. An Inexplicit message just throws data
out on the network and it’s the responsibility of other network devices to grab it.
The PLC code in this lab identifies a target IP address of the device, the type of data to read/write and what data (or tags)
within that block are to access. Then ‘triggers’ this Class III.
In this lab we use a load up a MSG_CIPGENERIC Function Block that will send data into and read data out of the VFD with.
It will be triggered on every scan.

5 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

The message code will be stored in the area called User-Defined Function Blocks. In doing so, if we had multiple VFD’s
we wanted to control, we write this (custom) Function Block once, store it in the UDFB area and we can run the (1) UDFB
instruction with multiple VFD’s if we wanted to. All we would need to do is change the IP address of the VFD that we
wanted to Write & Read from.

Tools & Prerequisites


Tools
Software programs required
The following software is required to complete this lab.
• Connected Components Workbench (CCW)

Hardware devices required


The following hardware is required for this lab.
• PowerFlex 525 Variable Frequency Drive (VFD)
• Motor connected to the VFD
• Micro 850 PLC connected to the Switch via EtherNet cable.
• PanelView (T6T or T7T) connected to the Switch via Ethernet cable
• WorkStation PC connected to the Switch via Ethernet cable
• Optional: USB memory stick (for transferring application files to the T6T PanelView).

Prerequisites
 Understanding of the Rockwell Automation Connected Components Workbench (CCW)
Software:
o PLC Programming

o VFD Programming

o PanelView Programming (basics)


 Attending the lecture entitled “VFD basic fundamentals”.  Network Configuration for this
part of the Lab:

PanelView 800 Main Drive VFD Micro850 PLC


2711R-T7T or 2711-T6T

USB
Cable

EtherNet/IP Switch
Stratix 2000
(no IP Address) Desktop PC

6 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

3.1 Importing the PLC and HMI code.


The PLC ladder and Class III messaging- as well as the HMI code have already been created for you to
download and experience controlling the VFD via the HMI.
Once you’re accustom with it, you can go into the HMI or VFD message and its User-Defined Function Block
and try a few changes on your own.
But first- let’s load up a working program and look at what’s going on.

From the previous Section 2, you’ll either have CCW showing you your VFD project called Tuned_VFD. If so
 (F1) Save it
 Then (F1) and select Close to close out this project from Section 2

 Next, (F1) and select ‘Import Project’


 Go to the location on your PC hard drive where this lap and support documentation was stored
(Contact your Instructor if you need help locating it)
 If you’re using a PanelView T7T- choose PLC_VFD_pvT7T.ccwarc
 If you’re using a PanelView T6T choose PLC_VFD_pvT6T.ccwarc

Once the Import is complete, you should have the following project called VfdControlWithPV_7T7 (or 6T6)
displayed.

The PLC code in this Project does not use any of the I/O that is connected to your Micro850 PLC
(2080-LC50-24QBB) so it won’t be showing any I/O modules in the Project Configuration of the PLC.
You can always install and program I/O later.
The PLC communications is already set for an EtherNet IP
There are (2) Program files, (1) User Defined Function Block (UDFB), (1) PanelView file (either T7t or
T6T) and (1) VFD file.

7 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Take a moment to review the following in this Project:


 Change nothing at this time

AutoManual Mode is the Ladder Code that will interface to the


HMI to switch the VFD from Auto to Manual control at the HMI

Main_Drive_StsCmd is the Ladder Code that loads up the data


from the HMI that we want to send to the VFD and returns the
Status of the VFD to display on the HMI. This loading/Unloading
writes to a MSG_CIPGENERIC Function Block we have saved in
the UDFB section

Where the MSG_CIPGENERIC Function Block reads/executes and


writes data from and to the Main_Drive_StsCmd file. This was
saved as RA_PFx_ENET_STS_CMD. If there were multiple PF525
VFD’s all we would need to do is write another Program File (i.e.
FanMotor) load it with the FanMotor VFD’s IP address and
command info and use the same UDFB as the Main_Drive does.

HMI Code for Auto/Manual Control and Status of the VFD.

VFD Configuration File. Should be the same as the last Lab.

Open up each of the Program files and review what’s going on:
AutoManualMode:
Simple toggling between the Auto / Manual command from the HMI.
Main_Drive_StsCmd:
Simple control of Start/Stop, source of speed reference and publishing data to the HMI.
 Take a look at Rung 10

This is the User_Defined Function Block that we’re loading up


for Command and Status specific to the Main_Drive.

If we were to add another VFD (i.e. FanMotor) we would use


the same UDFB (RA_PFx_ENET_STS_CMD) but the data fed
into it would reflect data specific to the Fan. (i.e. IP address,
Start/Stop tag addresses for the Fan, ect.). And Data read out
of it would have to be addressed to be specific to FanMotor
data on the HMI screens.

8 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

 Take a look at the User-Defined Function Block in the tree called RA_PFx_ENET_STS_CMD
While the UDFB can be written in Ladder Logic Code, this particular UDFB was written in
Structured Text.
 Notice line 54 is where the text starts to pull in data from the Main_Drive_StsCmd Program

9 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

 Scroll down to line 211.


Line 211 looks at what the model # of VFD is- and will pick the correct VFD Status Parameters to
display on the HMI.
Parameter #’s may vary from the several versions of the PowerFlex VFD.
This UDFB looks at for all various PowerFlex VFD versions and picks the correct Parameter #’s to
display on the HMI. This makes programming very easy as only one UDFB is needed to cover a range
of different PowerFlex VFD’s.

 Next, you can look at the Main_Drive (VFD)


file if you like, but it’s the same as it was in
the previous lab.

 Next look at the PanelView (T7T or T6T)

 Take a quick look at the Tags file just to


familiarize yourself with the Tags of this HMI
to the PLC

 Now in the Screens folder, open screens


1,2 & 3 and see what they look like.

Just look at the display pages for now to get


accustom as to how they look.
We’ll shortly download these to your HMI and go through the
operation on each.

10 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

This is the first display page that will appear when the HMI starts up

PanelView T6T PanelView T7T


MC_MachineFunctions

Main_Drive_StsCmd

Main_Drive_FaultHelp

11 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI
3.2 Downloading the Project Code

Your hardware should already be set up with the following IP addresses


 Check IP Addresses set from Tutorial 2 Motor, Powerflex, and HMI
Tutorial

Device IP address Mask Edit via:

PC Windows Network Config

Micro850 PLC CCW Software

PanelView (HMI) HMI Communication Config

VFD (Drive) CCW Software

Remember, you can use RSLinx Classic Gateway to see the network configuration you already have

If you open RSLinx Classis to review your Network, if you’re using the PanelView T6T it will not show up in the
Ethernet tree, but the T7T will

T6T HMI T7T HMI

12 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Downloading the PLC Code


:
 Right click on the processor name in the tree
 Build the program

 Then select Download.


This can be done using CCW Ethernet connection
or the USB connection.

Note: If your PC is connected to the PLC via a USB


Connection then you do not have to identify the
target PLC (as only 1 PLC can be connected via
USB)
If you’re connected via Ethernet, the Linx tree will
appear requiring you to highlight your target PLC.

When prompted that “Downloading will overwrite the project in the controller….”
 Select Download with Project Values

 When prompted, change the controller to Remote Run

13 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Downloading the VFD Code:


 Click on the VFD file called Main_Drive
 Click on Download

 When you get the following prompt-

 Verify the IP address

Note- If you click on ‘Change’ Linx will appear and show


you the devices on the Ethernet Network.
This allows you to load this VFD code to other VFD’s
if need be.

 Select Download Entire Device.

Notice that on the VFD Keypad display panel the Fault light is flashing and there is an F073 Fault Code.
This is due to the download- the DRIVE reboots and Ethernet communications to the PLC are broken.

 Press the ‘STOP’ button on the VFD panel to reset the fault.

14 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

Downloading the PanelView Code:

 Click on the PanelView T6T (or T7T)


file

 Right click on the folder and select


Download (you may get warnings that there are
objects that overlap- this is normal if there are 2
or more objects that touch or are stacked on top
of each other.

If using a PanelView T6T If using a PanelView T6T


This window will appear This window will appear

 For the T6T, if the IP address is For the T7T select the T6T from the
tree and click
correct select Download on O

 Go into the File Manager AT the HMI and select this application to Run

15 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI

3.3 Running the VFD from the HMI


The first screen that appears on the HMI should look like this (this is the T6T version)
 Review the following in the order listed: (1)
(1) Shut Down
This shuts down the HMI code and returns the
HMI to the File Management Menu.
(don’t hit it- you’ll have to start over)
(7)
(2) Start
Starts the VFD
 Press it to Start the VFD

(2) (5)
(3) Set Speed Ref
(3)
Displays and sets the Speed Cmd.

 Touch the blue box to open the Numeric


keypad and enter a speed reference. (6)
(4)

Once you hit the enter key, notice the action of


the motor and the frequency display on the VFD Display

(4) Stop
Stops the VFD
 Press it to Stop the VFD

(5) Current
Displays the current ‘state’ of control

(6) Switch to
Switch’s between Auto and Manual modes of operation.
 While on this page Switch to Manual and notice what happens to the display.
The Current state changes from Auto to Manual and the Start, Stop and Set Speed Ref disappear
This is because they are not part of “Manual” operation
If you look at the objects for this display page in the CCW programming software you’ll see that Start,
Stop and Set Speed Ref have “visibility’ attributes set to only be visible when the system is in Auto
mode

 Put it back into the Current state of Auto

16 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI
 While in Auto…press
(7) Main Drive Status & Command This
launches page 2 of our HMI display screens and
displays information of the VFD while operating
in Auto mode

Note what the state of the indicators on this page


and the values are showing.
(will vary depending if the VFD is running or not)

 Press the X in the upper top corner- of the Main Drive:Status and Command page, this returns
you to page 1 Machine Functions

 On the Machine Functions display change the Set Speed ref (3) to 0.00 and press the Stop
button (4)

 Next, change the Set Speed Ref (3)


to 55.00, press Start (2)

 Then press the


Machine Drive Status and Command button to see the Command and Status while in Auto mode.

17 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI
Your Machine Drive Status and
(1)
Command page will show the current
status of your VFD based on the Auto
Speed reference you entered.

(7)

(you’ll have some values displayed in


the right column)

(2) (5)
(3)

(4) (6)

 Now go back to page 1 Machine


Functions
 page and Switch to: Manual

Again- notice there are some objects on this


page that
Are no longer visible when you switch from Auto
to Manual, but reappear when you switch back
from Manual to Auto.

In CCW look at the properties of these objects


that are disappearing. There’s a Boolean
attribute in them called Visibility that when
True, the object is visible on the screen. When
False it is not visible.

18 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI
In Manual mode- the Machine Functions page doesn’t give us any operational control. It’s now all in Main
Drive & Status Command.

 Now press Main Drive & Status Command


You’ll see that there are additional Objects on
screen 2 that will allow you to operate the
VFD Manually.

The objects are the same as before but some new


ones have appeared because their Visibility
attributes
have been set to be visible only when in Manual
Mode.

 Run the VFD while on this screen, the blue


boxes are Numeric Input objects that will allow
you to change the Speed Reference, Acceleration and Deceleration time.

 Try several values and monitor the motion of the motor, the Keypad display and the Status of this
display.

3.4 VFD Faults and Fault Help:


We can’t really force a VFD fault with this particular system.

Typical VFD faults would be Over Current, Buss Voltage Fault, Over/Under Volts, (reference pg 159 of
the VFD Users Manual)

One simple Fault we can generate is a Communications Fault.


 To do this- while the VFD is running, at the Ethernet Switch unplug the Ethernet cable for the
VFD.
 You’ll see a Drive Communications Loss appear on the screen
 Plug the cable back in
 In a moment the Drive Communications Loss will disappear, but this page will show a Drive Fault
Code of 073
 Go to the Fault Help page for a description of the fault

This page describes what happened and what corrective action needs to be done.
The VFD fault codes are stored in the VFD. All the PLC cares about is whether communications to the VFD is
good or not
That’s why- when you unplug Ethernet cable of the VFD, the data from the PLC (on the right side of the Status
and Command page) is still being displayed. That’s because the HMI is reading the data on this screen from
the PLC, not the VFD.
But the Status of the VFD on the left side of the page goes blank- the PLC can’t read any status (or specific fault
data) from the VFD because its disconnected.
Plugging the cable back in- re-establishes the communication to the PLC so that it can read what’s going on with
the VFD and display the status again
19 of 20
Motor Control: Using the Variable Frequency Drive, PLC and HMI
(this particular code only latches fault if the VFD is running.)

End of this Lab

3.5 (optional) Editing the System to provide RPM values, not Frequency

(to be delivered)

20 of 20

You might also like