2589439-0000 DSC 000 02
2589439-0000 DSC 000 02
2589439-0000 DSC 000 02
2. Abbreviations
3. Introduction
The MDCS19 program is intended for the TBA/19 filling machines, and the program runs on the
TMCC2, Tetra Pak Multi-purpose Compact Controller, hardware. The program reads the register mark
photocells at the paper tube and the machine angle encoder. From these parameters the output is
calculated via a PID-algorithm. The output value sets the new I/P Transducer pressure and the folding
flap position. Package specific parameters are sent from the PLC.
The current software release is intended for photocells provided with remote control function and
integrates an advanced management of the photocells allowing a easy setting, a powerful failure
diagnostic and an improved reading capability.
This program is one version in the family of design control programs running on the TMCC2. The other
versions are used on the TBA/21and TBA/22 filling machines. The basic function of these programs are
the same, the main difference is the output routines. The TBA/19 uses a twenty-six step motorized
cylinder system to control the folding flaps and an I/P Transducer.
This Functional Description is intended for users of the MDCS19 "function", i.e. electrical designers, test
engineers, service engineers and alike. Its purpose is to give a full understanding of the behaviour of
the MDCS19 program together with the TMCC2 as a system.
Photocells TMCC2
Read
Photocells
I/P Transducer
α Angle Encoder
Read
Angle Encoder
TPOP
Calculation
(PID)
Output to
Flexbox Fold. Flap Motorized Cylinder
I/P Transducer
And Folding Flap
PLC
Communication Terminal, (PC)
with PLC
and Terminal
Parameter
Settings
The connections and the functions are explained in the following pages. The MDCS19 program flow is
further explained in the "Basic Program Functions" chapter.
5. TMCC2 connections
The TMCC2 is a general purpose hardware and its inputs and outputs are fully controlled by the
software, in this case the MDCS19 program. The connections below have been chosen for the MDCS19
function (a pin connection diagram is available in the appendices):
1 TMCC2
+24V
2 Power Supply 25
Ground MDCS Right Step Pulse
26
MDCS Left Step Pulse
9 27
Angle Encoder, bit0 HighOut 0-5 MDCS Direction
10 28
29
MDCS Alarm
11
30
Not Used
12
Volume Acknowledge
13 LowIn0-7
14
15
16
Angle Encoder, bit7
7
Register Mark Photocell Q, (3bar) FastIn0-1
8
Register Mark Photocell Q, (4bar) AnalogOut1 6 I/P transducer Out Signal
17 31
Register Mark Photocell ET, (3bar) 18 Register Mark Photocell Pulse
HighIn0-1 HighOut6-7 32 Design OK
Register Mark Photocell ET, (4bar)
The functions of these signals are as follows (some functions are further explained in the
following chapters):
+24V +24 Volt power supply. From the Electrical Cabinet +24V supply.
Ground Ground power supply. From the Electrical Cabinet ground connection.
MDCS19 Enabled
24V input from the PLC. When this signal is:
• LOW (0V) - the MDCS19 sets the precorrection mode.
• HIGH (24V) - the MDCS19 runs in the regulating mode if possible.
(Refer to next chapters for explanation of the precorrection and regulating modes).
Volume Enable
Volume Clock
Volume Data
These 24V input signals are controlled from the PLC. They are used for transmitting the
Repeat Length, Production Angle and I/P Transducer constant pressure values to the
MDCS19 program. Refer to the chapter below describing this transmission protocol.
MDCS direction
24V output from the TMCC2. This signal is connected to the stepper motor drives and
determines the direction of both the motorized cylinders (Right or Left side).
MDCS alarm
24V output to the PLC. This signal is LOW (0V) as long as:
• the sensor is broken in status ON RH or LH cylinder;
• the sensor is broken in status OFF RH or LH cylinder.
The signal is ON when home position is done.
Design OK
24V output to the PLC. This signal is HIGH (24V) as long as:
• the design error of a package is less than ±1.5 mm, OR
• the mean design error of the two latest packages are less than ±1.5 mm.
The selection of the parameter to be monitored, is done through the MDCS19 menu
structure.
Refer to the "Menu Structure chapter" to know which commands have to be used to select
the desired parameter which have to be sent to the diagnostic output.
NOTE: that all the values (incl Design Adjustment) change only when the filling machine
is running (the values change for every package).
Volume Acknowledge
This is a 24V output to the PLC. Refer to the chapter below describing the transmission
protocol for volume parameters.
Not Used
These inputs and outputs are not used in the MDCS19 program. They should be left
unconnected.
Program flow:
At start-up or reset (the TMCC2 may be reset manually by pressing the DOWN and ENTER pushbuttons,
on the front panel, for a few seconds) the MDCS19 program initiates all its internal variables and reads
the volume parameters sent from the PLC. After this first step the program enters an eternal loop, i.e. it
repeats the program over and over again. This loop has the following basic functions:
• Wait for a valid photocell reading of the register mark. This routine decodes the edges of the
register mark (and of the other part of the design as well) and for every edge (black to white, white
to black) it stores the photocell values in a shift register. The shift register is a 26-bit single register
(compared to the first MultiStep routine that used two separate shift registers with 6 and 7 bits
respectively, which in some cases could cause a false decoding). This shift register is compared
with a special pattern that corresponds to a correct register mark. If they are equal a register mark
has been detected and the program can proceed with its calculations.
• When the register mark has been detected the MDCS19 program reads the machine angle encoder.
To get an acceptable accuracy of the machine angle an interpolation is done by comparing the
remaining time of the current angle (i.e. until the angle encoder changes to a new value) with the time
for a complete angle. This gives a decimal number (for example, 72.95) telling where the register
mark is in relation to the machine jaw system.
• When the register mark has been detected the MDCS19 program also sends the Register Mark
Photocell Pulse signal to the PLC. This signal is delayed a certain time from the actual register mark
detection. The delay time depends of the current machine speed and corresponds to a distance on
the paper tube. This distance is independent of volume settings. The delay is a constant 32.7 mm in
addition to a variable delay depending on the Design Adjustment position (±5 mm).
• The calculated register mark angle is now compared to the preferred design angle, i.e. the
production angle set from the PLC offset by the Design Adjustment value (for example, 74 - 1.25 =
72.75). The comparison gives the angle error and together with the repeat length it is possible to
calculate the design error in millimetres for the current package (the example: 72.95 - 72.75 = 0.20;
0,20 * 245(repeat length) / 128(no of angle degrees per package) = 0.38 mm design error). The
design error is positive if the register mark (the design) is too "high" in relation to the jaw system, and
vice versa.
• The design error is used as an input to the PID control algorithm. Actually, it is the mean design error
of the two latest packages that are used, this giving a more smooth running system in case of
different mechanical adjustments of the left and right side of the machine. The algorithm uses a
quadratic P-part, which means that it has a faster response for larger design errors. Otherwise, it is a
standard PID with integral and output range limitations. The P, I and D factors have been tested on
filling machines to give a well working design control in both normal production and start/stop
sequences.
• When the PID algorithm has calculated a new output value, ranging from 0 (precorrection), 1
(minimal paper pull) to 255 (maximal paper pull), this is converted into an analogue signal for the I/P
Transducer and a digital setting of the driver for the motorized cylinder controlling the folding flaps.
The conversion is illustrated in the chapter "Output Signal".
• From the calculated design error the MDCS19 program also decides whether it should accept the
package or not. If the package is accepted the DesignOK signal to the PLC is set. The decision is
based upon the following rules:
• The MDCS19 program then start again to search for a new register mark.
Besides this main program flow the MDCS19 program also checks if anything is sent from a terminal
through the RS-232 serial interface. If so, it returns the appropriate answers to the terminal, refer to the
"Terminal communication" chapter.
The MDCS19 program manages the display and the pushbuttons according to a built in menu structure.
Refer to the "Menu structure chapter" for more details.
• The precorrection mode is used when the paper tube is far out of design, to move it as fast as
possible to the correct position. The precorrection position lets the paper tube "move upwards" in
relation to the jaws, approx. 10 to 20 mm each jaw stroke (depends on volume and filling on/off).
• A normal production start always begins in the precorrection mode. A number of packages are
thrown away before the PLC starts its search for the filling position, i.e. when the Register Mark
Photocell Pulse is found in this position the filling is turned on. The filling position is chosen so that
when the paper tube is fully filled then the design control system has also found the correct design
position.
• The Filling Position is updated by the PLC to get the design time as close as possible to the filling
time. This function has to be selected in the Bit Parameter Register and is useful for reducing the
packages waste at start. The calculation of the filling position is done in this way: the 1st BC detected
closer to the design position is indicated to the PLC through the output Design OK in order to
calculate the time to get in design from start. Then the PLC compares the design time with the filling
time. If the design time is the same as the filling time within a window of ±1s the filling position is not
updated. If it is greater, the filling position is increased of 5 degrees (moved closer to the design
position), if it is lower, the filling position is reduced of 5 degrees. The filling position is also not
updated if the filling time is off the setpoint filling time of ±1s.
• The MDCS19 program continuously calculates the design error, also during precorrection mode.
When, in this mode, the design error becomes less than a certain value (-10mm ÷ 0mm) the
MDCS19 program prepares to switch into regulating mode. I.e. tries to find the correct motorized
cylinder position, one of the twenty-six possible positions and I/P transducer, to minimise the design
error.
• When in regulating mode the MDCS19 program tries to keep as low design error as possible. When:
• When the MDCS19 program runs in the regulating mode it continues in this mode until:
• more that three consecutive packages have a design error greater than ±20 mm,
• more than four Register Marks should have passed the photocells, i.e. they are missed,
• the PLC resets the MDCS19 Enable signal.
When one, or more, of these condition is true the MDCS19 program switches to precorrection mode.
• When the filling machine is in short stop the design control system remains in regulating mode.
When started again the MDCS19 program tries to keep the design control as good as possible, just
like in normal production mode.
• Every time the filling machine is in stop, the I/P transducer pressure is set to 0,5 bar to maintain the
packaging material tensioned.
Volume Parameters:
• Normally the volume parameters are sent from the PLC, refer to the "Volume Parameter Transfer"
chapter.
TMCC2
559810 Display / Led
"UP" Pushbutton S1
S2
S3
"DOWN" Pushbutton S4
S5
S6
"ENTER" Pushbutton S7
S8
The display can be used to send text messages or each character can be used as an Led to signal
program alarms and status.
When the program is in an idle status the display shows the program name and number. When the
program became active the each character is used as a Led with the following meaning:
LED Function
S1 MDCS Register mark decoded
S2 Design OK
S3 RH / LH motor step pulse.
S4 RH / LH motor direction ON=CW / OFF=CCW.
S5 Cylinder Position 19-25.
S6 Cylinder Position 12-18.
S7 Cylinder Position 6-11.
S8 Cylinder Position 0-5.
Note: if LEDs S5 and S6 are ON means that the sensor is broken in status ON. If LEDs S7 and S8
are ON means that the sensor is broken in status OFF.
The display can be indicates a malfunction in the program with the following meaning:
Display Meaning
Error in EEPROM This error indicates that there may be a hardware problem with
writing TMCC2.
Note: The card must be reset after an error, see instructions in the chapter 20 item 3 and 10.
At any time by pressing any pushbutton it is possible to enable a menu structure composed by
different levels and sub-menus. By using the "UP" and "DOWN" pushbuttons it is possible to navigate
through the menu items of a certain level and by pressing the "ENTER" pushbutton it is possible to
change the menu level or to execute a function associated to a menu item. The program functionality
is not influenced by accessing to the menu structure; if the menu allows to change some program
parameters then the program behavior can be influenced. Refer to the "Menu structure chapter" to
have more details about the menu structure and the functions that it is possible to activate through it.
9. Menu structure
The MDCS menu structure is shown by means of the following table:
Menu Level
1 2 3 4 Description
MONITOR Select what data to view on the display
DES ERR Displays the Design Error
MEAN DER Displays the Mean Design Error
OUTPUT Displays the Output to the I/P (0-255)
BACK Back to Level 1
Select what data to send to the analog
DIAG OUT
output on Pin 6 of the TMCC2
DES ERR Outputs the Design Error of every pack.
MEAN2 DE Outputs the Mean Design Error of the
last 2 pack.
MEAN DER Outputs a filter of the Mean Design Error
OUTPUT Outputs the output value to I/P
MEAN OUT Outputs the mean output value to I/P
DES ADJ Outputs the Design Adjustment Value
BACK Back to Level 1
PHOT. Photocells menu
CONF? Y Photocells configuration menu
GREEN Sets the photocells spot color to green
BLUE Sets the photocells spot color to blue
RED Sets the photocells spot color to red
CALIB. Manual calibration menu
USE CAL. Use previous manual calibration
RUN CAL. Start manual calibration
BACK Exit from manual calibration menu
BACK Exit from photocell configuration menu
CONF? N Exit from photocells configuration menu
MAX D OK Max allowed design error menu
DOK=±X.X Set the max allowed design error (∗)
PRESSURE Set the pressure I/P transducer WTC
MIN PRES Minimum pressure menu
MIN= X.X Set the minimum pressure (0-10 V)
MAX PRES Maximum pressure menu
MAX= X.X Set the maximum pressure (0-10 V)
BACK Back to Level 1
BACK Exit from menu structure
NOTE: the values XX=XX in the table can be changed by using the UP and DOWN pushbuttons and
the storage is performed after pressing the ENTER pushbutton.
Photocells setting:
The photocells can be set by using the menu structure of the MDCS19 program.
When register mark decoding errors occur the first thing to check is the photocells alignment and
distance.
Then it is possible to change the spot color of the photocell, keeping the Dynamic Threshold = 30 and
the Teach Button disabled, in order to optimize the contrast between the register mark color and the
white. The following table gives the suggested light spot color, related to the register mark color to obtain
the best detecting performances:
It is also possible to perform the setting of the photocells through a manual teaching procedure. This
procedure must be used only if the basic settings (GREEN, RED, BLUE) do not solve register mark
decoding problems and a finer adjustment is required:
1. Stop the machine.
2. Go to menu item "RUN CAL." and press the enter pushbutton. This command enables the teach
button of the photocells.
3. Position the packaging material at 12mm from the first photocell in order to have the light spot on
the white background.
4. Push the teach button on the rear of the first photocell.
5. Move the packaging material so that the light spot scans through the register code.
6. Release the teach button.
7. Perform the steps 3-6 for the second photocell.
8. Go to menu item "USE CAL." and press the enter pushbutton. This command sends the taught
values to the photocells.
9. Run the machine.
Note! If false bar-codes are detected is possible to change the sensitivity of the photocells. Use the
command PTH: the value (xx) must be entered as hexadecimal. Type as follows:
PTH= xx<enter> Changes the dynamic threshould of the photocells; higher values of xx means
lower sensibility of the photocells (default setting value is 30).
25
Max.
(2.5 bar)
13
Cylinder I/P transducer
position pressure (bar)
Min.
0 (0.5 bar)
0 1 10 128 255
1 Output value
Output value = 0 sets the precorrection position of the motorized cylinders and sets the maximum
pressure on the I/P Transducer.
The communication is a standard RS-232 serial interface. Use a cable suitable for the TMCC2 and the
PC (terminal). Necessary pin connections are:
If you are using a PC, a terminal program like HyperTerminal, windows 3.11 terminal etc. may be used.
Configure the program for:
• Baudrate: 9600
• Parity: None
• Bits: 8
• Stopbits: 1
• Flow Control: None
The commands and parameters, if any, to the MDCS19 program is entered on the keyboard, and the
command is executed when the RETURN key is entered. The functions described below are available:
Annn Angle nnn. The Production Angle (=machine angle) may be set with this command. nnn is
the new angle value, ranging from 0 to 255 decimal degrees. Normally the Production
Angle is set from the PLC, but this command overrides the PLC setting. It may be used in
test purpose to find the correct nominal Production Angler, which will later be set from the
PLC. Note that the Design Adjustment setting is added to this value.
For example: A72 sets the Production Angle to 72 degrees (110 octal).
Dddd D-constant: Sets the D parameter in the PID controller algorithm, in 1/100 units. The
original value will be restored after a TMCC2 reset.
E Displays the current Encoder value, first the hexadecimal Gray code, then converted to
octal.
Fooo Force ooo. This command forces the outputs, I/P Transducer pressure and Motorized
Cylinder position, to a certain value which is (ooo-1). F0 resets the forcing:
F0 Reset (disable) output force.
F1 Force to Precorrection output.
F2 Force to output = 1.
...
F255 Force to output = 254.
(This means that output=255 is not possible but since it is a small step in the upper region
of the output range this has no practical meaning.)
NOTE! This function is only available when the machine is running.
Iiii I-constant: Sets the I parameter in the PID controller algorithm, in 1/100 units. The original
value will be restored after a TMCC2 reset.
Mnn Change the Design OK window and the value is stored into the EEPROM, so kept even
after a shut down or a reset. The value is expressed in 1/10 of mm. (i.e. 20 means ± 2.0
mm).
Pppp P-constant: Sets the P parameter in the PID controller algorithm, in 1/100 units. The original
value will be restored after a TMCC2 reset.
PTH=xx Set photocells dynamic threshould, 00-F2 (hex value). See chapter “Photocell
Management”
Rn Reporting ON/OFF. This command enables and disables the automatic reporting of the
design error and output value for every package.
R0 Disable reporting.
R1 Enable reporting.
Note! When the monitoring is finished, remember to set R0, in order to avoid delays
in the scanning time.
S Status: This command displays a list of parameters that may be of interest for test and
service purposes:
Y Displays a detailed status of the photocells for test and service purposes:
- Restore to default values the photocell parameters (the values acquired during last teach
procedure are lost!)
- Reset the values of:
Commands Ok
Command Errors
Barcode decoded
Barcode errors
Note: only for internal used and when machine is stopped.
From PLC:
VolumeEnable
VolumeClock
VolumeData
From TMCC2:
VolumeAcknowledge
• The Repeat Length is in 1/10 of mm, i.e. a repeat length of 245 mm is sent as 2450.
• The Production Angle is in integer degrees, i.e. an angle of 123 is sent as 123. (Octal or decimal
degrees notation is irrelevant since the number is sent in bit format which is the same for both
alternatives).
• The WTC Constant Pressure is sent as the value air pressure / minute (bar).
• The 16 Bit Parameters register is used to select specified functions in the program.
Other features:
• The signal VolumeAcknowledge in the protocol is useful when, for example, the PLC starts up earlier
than the TMCC2 or if the TMCC2 is replaced or reset during power on. In these cases the
VolumeAcknowledge is reset to low and the PLC should start to send the message again.
• The MDCS19 program must receive at least two complete messages that are exactly the same
before it sets the VolumeAcknowledge signal.
MSB LSB
Bit Parameters 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Filling Poristionr
Calculation ON
With this function the TMCC2 card sends to the PLC the 1st BC in design within an error of ± 8mm during
precorrection. This lets the PLC to calculate the time to get the 1st BC in design after start so to adjust
the filling position in order to have the design time as close as possible to the filling time.
17. I/P Transducer Setting
The I/P Transducer pressure is set manually with TMCC2 push button, refer to the menu structure and
the following sequence are used (for more detailed instruction see MM book):
Z S G
Setting
Connector
1. Set the I/P Transducer minimum pressure (basic setting 0.5 bar) with “MIN PRES” using
Pushbotton “UP or DOWN” and check the pressure on the manometer.
2. When correct minimum pressure has been reached, set the I/P Transducer maximum pressure
(basic setting 2.5 bar) with “MAX PRES” using Pushbotton “UP or DOWN” and check the pressure
on the manometer.
3. Repeat item 1 and 2 until the pressure is correct.
4. Exit the menu on the TMCC2 see chapter “Menu Structure”.
It is also possible, as an alternative function set the WTC to a constant pressure from the PLC (for
example, value 10=1bar), which means the pressure will be fixed. When design OK is enable, the
pressure, in precorrection condition is set according the maximum value.
The motorized cylinder will work with twenty-six positions on both conditions.
PC command Function
C Calibration: full distance
H Home position
M Maximum forward movement in correction mode.
V View acceleration motor profile
E Exit
Note: View acceleration motor profile is only for internal use. If you press the «V» key, press it
repeatedly until the main menu is displayed.
Calibration Procedure:
1. Connect the cable between the PC and the TMCC2 front panel connector and start the
communication.
2. To enable the calibration of the Right Cylinder manually move the machine to 120°-220°
3. Type the command CAL to enter the menu calibration and the currently enabled cylinder will move
to its home position, then the full distance.
4. Press the «H» key to enter the home position. The cylinder will move to find the sensor.
5. Press the «C» key to enter the calibration full distance. The cylinder will move its full distance
42mm.
6. Go back to point 3 and repeat the point 4 and 5 until the setting is satisfactory. The operator can
adjust the sensor position and the cylinder by following the MM instructions.
Note: the cylinder must not touch the mechanical stops on the forward or backward movements.
7. From point 5 press the «M» key to enter the maximum forward movement. The cylinder will move
10mm (correction mode).
8. Press the «E» to exit from calibration.
9. To enable the calibration of the Left Cylinder manually move the machine to 301°-40° and repeat
the point from 4 to 7.
10. When both cylinders are calibrated repeat the point 8.
Download procedure:
1. Connect the cable between the PC and the TMCC2 RS232 connector.
2. Start the HyperTerminal program on the PC.
3. If there is an application running type STOP<enter> or keep DOWN and ENTER pushbutton
pressed for few seconds to stop it.
4. Insert the program diskette marked "2589438-0002” into the PC diskette station.
5. Type the command E FLASH<enter> to erase the TMCC2 flash memory.
6. When the erasing operation is completed type D<enter> to prepare the application download.
7. Select the menu Transfer and the menu item Send Text File.
8. Select the file 2589438.1002 on the diskette marked "2589438-0002.
9. The downloading starts and the progress of the download is shown with dots on the terminal
screen.
10.When the new program is downloaded without errors type RUN<enter> or ENTER pushbutton
pressed two time to start the application program.
11. Check the I/P transducer setting (refer to that chapter).