Вы находитесь на странице: 1из 9

In this chapter we will make a description of the Siemens TIA PORTAL v13

software that we will use to


create the program that the PLC will execute. We have to take into account
that we must configure the inverter
frequency to work with this configuration (see Annex I)
This software allows us to define the hardware that we will use in addition
to the connections between the different
teams. We also use it for the creation of the program (in this case we will
use KOP language) and for the
simulation of it (PLCSim software is required for the simulation). In addition,
the software will allow us
include a touch screen (HMI, Human-Machine Interface) with which to
manage the program more
simple and visual.
6.1 Hardware configuration
The first thing we must do when creating the project is to include the
equipment we are going to use and its connections. In our software we find
this tool in the equipment configuration tab.
First we include the equipment of the automaton described in section 4.4.2,
each in its position correspondent. They also have to be placed next to
each other so that the power supply can bring energy to all teams.
The position 3 of the rack (see in the following figure) is reserved to
connect PLCs to each other, so that the we will use in our project.
In the Catalog area we can choose all the components that we need for our
equipment in addition to give us information about each of them.
Then we include the Micromaster 420 drive that we will find in the catalog.
We also have to choose the type of frame that will be used when
communicating with the PLC via PROFIBUS. In our case we will select the
PPO1 option that allows us to control the engine and also access the
parameters of the variator.
The different transmission modes of the telegram differ in the amount of
data sent in each one of them. There are two zones: PKW and PZD.
PKW. Parameter area. They allow the user to access all the parameters of
the fieldbus via the fieldbus converter, so that these parameters can be
read / written remotely.
PZD. Process area. It is used to transmit command words or master set
point values to the converter or status words and real or measured values
from the converter to the master.
For our case of PPO1 we have the following division;

PKE: Parameter identifier. This word is used to indicate to the converter a


number of parameter, and the action that must be done with it, either read it
or modify it.
he drive parameter
indicated in PKE had, the number of the subscript of it. In micro /midi
master there are currently no indexes, what its value will always be 0. In
case there is some parameter with subscripts, the number of they are
stored in the high byte of the word, that is, in the bits from 8 to 15, the byte
low to 0.
-bit
double word stores a value that, in the case that we are writing a parameter
indicates the data to which we will have to write it. In case of parameter
readings, even if we place any value in this double word will have no effect.
It is important to take into account the number of decimals that accept said
parameter. There are parameters with two decimals and parameters with
one, so it is important consult the manual before entering this parameter.

behave. Each one of the bits that compose it will indicate a state of it.
his word, the set point value is indicated
in hexadecimal frequency to which we want the inverter to run.
The entry / exit address for our PPO1 packages will be:
PKW: 256-263
PZD: 264-257
Once the frequency inverter is configured, we include the touch screen with
which we can work more easily. We select the KTP1000 Basic panel. Their
characteristics are:

6.2 Program edition


Our program will be structured in the main block (OB1) and in three
functions that will control on one side the motor and on the other hand the
parameters of the frequency inverter. For communication with the inverter
we will do use of data blocks, where we will structure the information, to
make it easier to understand our Program.
6.2.1 Motor control
The first thing that we have to take into account for this section is the
structure of the information that we are going to transmistir We will use the
command and status words implemented in the drive to communicate with
the. Next to the control word we will send the frequency reference for our
motor. All this information we will structure it in a block of data to be able to
see the value of each of its bits and thus obtain information of the current
state of the variator.
The structure of the command word can be seen in the manual of the
frequency inverter, and is as follows:
We must bear in mind that first the high byte goes and then the low byte
when structuring this data in the DB.
In the same way, our status word has the following form:

In this case we also have to take into account the layout of the bytes.
Therefore, we can now create the data block that we will use when
transmitting the information. Further we include the variables for the
frequency reference in their corresponding place.
In the following image we see highlighted the command word along with its
frequency set point variable.
This frequency reference should have a value between -100% and + 100%,
but in our case we will give it values between 0% and 100% and the
direction of rotation will be controlled with its corresponding variables.

Then the status word would be placed taking into account the arrangement
of the high byte and the low byte. By means of this word we obtain
information of the state of the variator.
Now we would have to edit the function associated with the motor control
so that it obtains the data of the inverter and dump them to the DB that we
have created.
It is necessary to be clear about the entry / exit directions of the data. In
this case we will only use the PZD zone of the plot.
This function is composed of the following segments:

The frequency value that we send to the inverter is scaled between 0 and
16384 (4000 in Hex.) So if introduce a percentage we must make an
adjustment and multiply it by 164 (we make an approximation). The Highest
value corresponds to 100% of the frequency stored in the drive parameter.
By default this value is 50 Hz but we can modify it when we need it.

6.2.2 Control of the parameters


In order to modify and read the inverter parameters, we will use the PKW
zone of the PPO1 telegram.
As we saw earlier, this area is composed of three fields (two of WORD size
and one of DWORD size).
Requests to the Variator
In the first word of the frame (PKE) we define the parameter and the action
to be performed. To make the request to teacher we use the following
format:
CODE + PARAMETER
The most used codes are:
(0) There is no PLC request to the drive
(1) We request the value of the parameter to the inverter
(2) We modify the value of a drive parameter. The parameter is a word (it is
changed in RAM)
(3) We modify the value of a drive parameter. The parameter is a double
word (it is changed in
RAM)
(13) We modify the value of a drive parameter. The parameter is a double
word (it is changed in
the EEPROM)
(14) We modify the value of a drive parameter. The parameter is a word (it
is changed in the
EEPROM)
To enter the parameter must be done in hexadecimal form.
For example, if we want to read the value of parameter P0700, we should
send the word 12BC in the word.
Drive response
The drive uses the same CODE + PARAMETER format but in this case the
codes it uses are different The response codes are:
(0) No response
(1) Transmit parameter value (word)
(2) Transmit parameter value (double word)
(3) Transmit description item 1
(4) Transmit parameter value (word) 2
(5) Transmit parameter value (double word) 2
(6) Transmit number of elements of the array or array
(7) Request not executable (with fault code)
(8) Lack of permission to intervene in the PKW interface
1) The desired element of the parameter description is indicated in IND
(2nd word)
2) The desired element of the indexed parameter is indicated in IND (2nd
Word)
The following codes accompany the previous code of "Non-enforceable
Petition" (7)
Below are some examples of PLC-variator communication so we can
understand better how it works:
Example 1: Parameter reading P0700: "Command source selection"
(700 = 2BC (hex))
PKE IND PWE
PLC => MICROMASTER: 12BC 0000 0000 0000, value of P0700 is
requested
MICROMASTER => PLC: 12BC 0000 0000 0002, depending on the
answer, it is a simple word with the value 0002 (hex).
Example 2: Parameter reading P1082: "Maximum frequency" (1082 =
43A (hex))
PKE IND PWE
PLC => MICROMASTER: 143A 0000 0000 0000, the value of P1082 is
requested.
MICROMASTER => PLC: 243A 0000 4248 0000.
According to the answer, it is a double word with the value 4248 0000
(IEEE Float Value), with a value in 50.0 decimal.

Example 3: Change the value of P1082 to 40.00 (RAM only)


To write a parameter you must know if it has a single or double word
parameter value. For find out if it is a single or double word, you can read
the parameter value first and observe the answer (this information can also
be found in the list of parameters):
Read the value
PKE IND PWE
PLC => MICROMASTER: 143A 0000 0000 0000
MICROMASTER => PLC: 243A 0000 4248 0000
According to the answer we see that it is a double word, therefore we make
the modification with the code of
Writing 3: "We modify the value of a drive parameter. The parameter is a
double word (it is changed in RAM)”
Set the parameter value to 40.00 (= 4220 0000 (IEEE Float Value))
PKE IND PWE
PLC => MICROMASTER: 343A 0000 4220 0000
MICROMASTER => PLC: 243A 0000 4220 0000, this confirms the
modification of the value.
Example 4: Evaluation of an error response
In example 3, it was assumed that the inverter was not operating when
changing the parameter
P1082. If it had been in operation the inverter would respond with a
telegram with coding (7): "Request not executable. “The error number goes
inside the PWE field, in the following way:
PKE IND PWE
PLC => MICROMASTER: 343A 0000 4220 0000
MICROMASTER => PLC: 743A 0000 0000 0011
The error number is 11 in hexadecimal = 17 Dec: "NON-EXECUTABLE
PETITION DUE TO STATE OF SERVICE".

The exchange of the 8 bytes (PKE, IND and PWE) between the PLC and
the inverter must be done in a single message, it is not possible to do it as
in the motor control function. For this case we must use the DPWR_DAT
instruction to write (send) the data to the drive, and the DPRD_DAT
instruction to read them.
The data that we will send will be stored in the DB Parameters_send (DB2)
and those that we read from the drive. We will save in the DB
Parameters_Get (DB3).
The function to read the parameters is the following:

Вам также может понравиться