MCO 305 Design Guide
Contents
How to Read this MCO 305 Design Guide.................................. |
3 |
How to Read this Design Guide ...................................................................... |
3 |
Symbols and Conventions ............................................................................. |
5 |
Abbreviations .............................................................................................. |
5 |
Definitions .................................................................................................. |
6 |
Introduction to VLT Motion Control Option MCO 305 .............. |
11 |
What is VLT Motion Control Option MCO 305?................................................. |
11 |
System Overview....................................................................................... |
12 |
Configuration Examples .............................................................................. |
13 |
Interface between MCO 305, FC 300, and other Option Modules........................ |
14 |
Control Loops ............................................................................................ |
14 |
Encoder.................................................................................................... |
15 |
Program Execution ..................................................................................... |
15 |
Functions and Examples ......................................................... |
17 |
Positioning ................................................................................................ |
17 |
Synchronizing............................................................................................ |
24 |
CAM Control.............................................................................................. |
35 |
CAM Box................................................................................................... |
46 |
Mechanical Brake Control ............................................................................ |
47 |
Limited-Jerk .............................................................................................. |
49 |
PC Software Interface ............................................................ |
55 |
Specifics of the User Interface ..................................................................... |
55 |
The APOSS Window.................................................................................... |
56 |
The Edit Window........................................................................................ |
58 |
File Menu.................................................................................................. |
61 |
Edit Menu ................................................................................................. |
62 |
Development Menu .................................................................................... |
64 |
Controller Menu ......................................................................................... |
70 |
Tools Menu................................................................................................ |
78 |
Settings Menu ........................................................................................... |
79 |
Window Menu............................................................................................ |
83 |
Help Menu ................................................................................................ |
83 |
Download Menu ......................................................................................... |
84 |
Debugging Programs .................................................................................. |
86 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
1 |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
|
APOSS Tools ........................................................................... |
89 |
|
CAM-Editor ............................................................................................... |
89 |
|
Array Editor ............................................................................................ |
105 |
|
APOSS Oscilloscope.................................................................................. |
116 |
|
How to Program ................................................................... |
157 |
|
Programming the MCO with the APOSS Macro-language................................. |
157 |
|
Basics .................................................................................................... |
157 |
|
Preprocessor ........................................................................................... |
172 |
|
APOSS Command Groups.......................................................................... |
175 |
|
Get a General Idea of Program Samples ...................................................... |
191 |
|
Parameter Reference............................................................ |
195 |
|
FC 300, MCO 305, and Application Parameters ............................................. |
195 |
|
FC 300 Parameters Overview ..................................................................... |
197 |
|
Application Settings.................................................................................. |
199 |
|
MCO Parameters ...................................................................................... |
200 |
|
MCO Basics Settings................................................................................. |
201 |
|
MCO Advanced Settings ............................................................................ |
217 |
|
MCO Data Readouts.................................................................................. |
238 |
|
Parameter Lists........................................................................................ |
242 |
|
Troubleshooting ................................................................... |
251 |
|
Warnings and Error Messages .................................................................... |
251 |
|
APOSS Software Messages ........................................................................ |
259 |
|
Index.................................................................................... |
261 |
Copyright |
© Danfoss A/S, 2010 |
|
Trademarks |
VLT is a registered Danfoss trademark. |
|
|
Hiperface® is a registered trademark used for Rotational Position Sensors, Namely, Electronic Feedback Systems |
|
|
For Motors and owned by Sick Stegmann GmbH, Max Stegmann GmbH Antriebstechnik-Elektronik. |
|
|
Microsoft, Windows 2000, and Windows XP are either registered trademarks or trademarks of the Microsoft |
|
|
Corporation in the USA and other countries. |
|
2 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
How to Read this Design Guide
This Design Guide will introduce all aspects of your MCO 305. Please read also the Operating Instructions, in order to be able to work with the system safely and professionally, particularly observe the hints and cautionary remarks.
Chapter How to Read this Design Guide introduces the design guide and informs you about the symbols, abbreviations, and definitions used in this manual.
Page divider for ‘How to Read this Design Guide’.
Chapter Introduction to MCO 305 informs you about the functionality and features of the
MCO 305, gives a system overview including configuration examples, and informs you about some basic topics like encoder and program execution.
Page divider for ‘Introduction’.
Chapter Functions and Examples guides you through some applications examples from simple positioning to different synchronizations as well as CAM controls. Setting the parameters, programming of controls, and editing of curves can be reconstructed in detail with these examples.
Page divider for ‘Functions and Examples’.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
3 |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
Chapter PC Software Interface informs you about the APOSS specific menus and functions. Click on → Help in the APOSS menu bar for more details. Chapter APOSS Tools provides detailed information about the CAM-Editor, Array-Editor as well as the APOSS Oscilloscope.
Page divider for ‘PC Software Interface’.
Chapter How to Program shows you how to program controls for the Frequency Converter using MCO 305. This chapter provides a description of all commands arranged in groups and all parameters in the Parameter Reference.
Page divider for ‘How to Program’.
Chapter Troubleshooting assists you in solving problems that may occur when using the frequency converter with MCO 305. The next section explains the most important messages from the PC user interface.
Page divider for ‘Troubleshooting’.
The manual ends with an index.
The Online Help provides in Chapter Program Samples almost 50 program samples which you can use to familiarize yourself with the program or copy directly into your program.
Available Literature for FC 300, MCO 305, and MCT 10 Motion Control Tool
−The MCO 305 Operating Instructions provide the necessary information for built-in, set-up, and optimize the controller.
−The MCO 305 Design Guide entails all technical information about the option board and customer design and applications.
−This MCO 305 Command Reference completes the MCO 305 Design Guide with the detailed description of all commands.
−The VLT® AutomationDrive FC 300 Operating Instructions provide the necessary information for getting the drive up and running.
−The VLT® AutomationDrive FC 300 Design Guide entails all technical information about the drive and customer design and applications.
−The VLT® AutomationDrive FC 300 MCT 10 Operating Instructions provide information for installation and use of the software on a PC.
Danfoss Drives technical literature is also available online at www.danfoss.com/drives.
4 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
Symbols and Conventions
Symbols used in this manual:
NB!:
Indicates something to be noted by the reader.
Indicates a general warning.
Indicates a high-voltage warning.
*Indicates default setting.
Conventions
The information in this manual follows the system and uses the typographical features described below to the greatest extent possible:
Menus and Functions
Menus and functions are printed italics, for example: Controller → Parameters. Commands and Parameters
Commands and parameter names are written in capitals, for example: AXEND and KPROP; Parameters are printed in italics, for example: Proportional factor.
Parameter Options
Values for use to select the parameter options are written in brackets, e.g. [3]. Keys
The names of keys and function keys are printed in brackets, for example the control key [Cntl] key, or just [Cntl], the [Esc] key or the [F1] key.
Abbreviations
|
|
|
|
|
Automatic Motor Adaptation |
AMA |
|
|
Control word |
CTW |
|
|
|
|
|
|
Direct Current |
DC |
|
|
Digital Signal Processor |
DSP |
|
|
|
|
|
|
Frequency Converter |
FC |
|
|
Local Control Panel |
LCP |
|
|
|
|
|
|
Least significant bit |
LSB |
|
|
Main actual value |
MAV |
|
|
|
|
|
|
Motion Control Option |
MCO |
|
|
Motion Control Tool |
MCT |
|
|
|
|
|
|
Minute |
min |
|
|
Most significant bit |
MSB |
|
|
|
|
|
|
Main Reference |
MRV |
|
|
Master Unit |
MU |
|
|
|
|
|
|
Digital output switching to high side. |
NPN |
|
|
|
|
|
|
Switch normally closed |
nc |
|
|
|
|
|
|
Switch normally open |
no |
|
|
Parameter |
par. |
|
|
|
|
|
|
Position Control Loop |
PID |
|
|
Digital output switching to low side. |
PNP |
|
|
|
|
|
|
Pulses per Revolution |
PPR |
|
|
Quad-counts |
qc |
|
|
|
|
|
|
Reference |
REF |
|
|
Revolutions per Minute |
RPM |
|
|
|
|
|
|
Second, Millisecond |
s, ms |
|
|
Sample time |
st |
|
|
|
|
|
|
Status word |
STW |
|
|
User Unit |
UU |
|
|
|
|
|
|
Volts |
V |
|
|
|
|
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
5 |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
Definitions
MLONG
An upper or lower limit for many parameters: -MLONG = -1,073,741,824
MLONG = 1,073,741,823
Online / Offline Parameters
Changes to online parameters are activated immediately after the data value is changed. Changes to offline parameters are not activated until you enter [OK] on the LCP.
Quad-counts
Incremental encoders: 4 quad-counts correspond to one sensor unit.
Absolute encoders: 1:1 (1 qc correspond to one sensor unit).
Through edge detection, a quadrupling of the increments is produced by both tracks (A/B) of the incremental encoder. This improves the resolution.
Derivation of quad counts
Encoder Direction
The direction of encoder is determined by which order the pulses are entering the drive.
Clockwise direction means channel A is 90 electrical degrees before channel B.
Counter Clockwise direction means channel B is 90 electrical degrees before A.
The direction determined by looking into the shaft end.
6 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
Virtual Master
Virtual master is an encoder simulation which serves as a common master signal for synchronization of up-to 32 axes.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
7 |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
User Units
The units for the drive or the slave and the master, respectively, can be defined by the user in any way desired so that the user can work with meaningful measurements.
Starting with MCO 5.00 the factors SYNCFACTM / SYNCFACTS, POSFACT_Z / POSFACT_N are no longer limited to small values
Internally, it is act as follows: Whenever a value must be multiplied by the gear factor (i.e. master increments per ms), at first it is looked if a multiplication will result in an overflow. If so, a factor (64 bit) is used which consists of
SYNCFACTS/SYNCFACTM to multiply the delta_master.
If no overflow occurs, first it is multiplied by SYNCFACTS and then divided by SYNCFACTM. Concerning the error we are dealing with, this means:
Normal case
Multiplying by SYNCFACTS has no error, but dividing by SYNCFACTM means that the result may be wrong by 1/2³² . That means that (worst case) such an error occurs every ms, i.e. that after 1193 hours (49,71 days) we made an error of 1 qc (Slave).
Big factors
In that case, the used factor (SYNCFACTS/SYNCFACTM) itself could be wrong by 1/2³² . This means that in the worst case an error of delta_master * 1/2³² occurs every ms. Assume that we have an encoder with 1000 counts (4000 qc) per revolution. Assume further, that we drive with 2000 rpm, i.e. we have a velocity of 133 qc/ms. This means we make an error of 133 * 1/2³² per ms. From this follows that in worst case (maximum error every ms always in same direction) we could have an error of 1 qc after 9 hours.
This should not be relevant in most applications.
All path information in motion commands are made in user units and are converted to quad-counts internally. These also have an effect on all commands for the positioning: e.g. APOS.
The user can also select meaningful units for the CAM control in order to describe the curve for the master and the slave, for example 1/100 mm, or 1/10 degrees in applications where a revolution is being observed.
In the CAM control, the maximum run distance of the slave or the slave cycle length are indicated in User Units UU (qc).
You can standardize the unit with a factor. This factor is a fraction which consists of a numerator and denominator:
1 User Unit UU = par. 32 -12 User Unit Numerator par. 32 -11 User Unit Denomintor
par. 32-12 User Unit Numerator POSFACT_Z par. 32-11 User Unit Denominator POSFACT_N
Scaling determines how many quad-counts make up a user unit. For example, if it is 50375/1000, then one UU corresponds to exactly 50.375 qc.
NB!:
When user units are transferred into qc, then they get truncated. When qc are transferred into user units, then they get rounded.
8 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ How to Read this MCO 305 Design Guide __
A factor (fraction) is used for the conversion into qc, as with the user unit:
1 Master Unit MU = par.33 −10 Synchronization Factor Master par.33 −11 Synchronization Factor Slave
par. 33-10 Synchronization Factor Master SYNCFACTM par. 33-11 Synchronization Factor Slave SYNCFACTS
Open Loop vs. Closed Loop
Open loop is control without feedback. Closed loop control compares velocity or position feedback with the commanded velocity or position and generates a modified command to make the error smaller. The error is the difference between the required speed and the actual speed.
Open loop can be used on systems where motor velocity is not critical, and where accurate positioning is not necessary. Applications such as fan and blower control, pump control, and some low-end home appliances are examples.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
9 |
MCO 305 Design Guide
What is VLT Motion Control Option MCO 305?
MCO 305 is an integrated programmable Motion Controller for VLT Automation Drive FC 312 and FC 312; it adds functionality and flexibility to the already very comprehensive standard functionality of these drives.
FC 312 and FC 312 with MCO 305 is an intelligent drive offering highly accurate and dynamic motion control featuring, Synchronization (electronic shaft), Positioning and electronic CAM control. In addition the programmability offers the possibility to implement a variety of application functions such as monitoring and intelligent error handling.
Development of application programs for MCO 305 and configuration/commissioning is done via easy to use PC software tools integrated in VLT Motion Control Tools MCT 10. The PC software tools includes programming editor with program examples, CAM profile editor as well as “test-run” and “scope” function for controller optimizing. MCO 305 is based on event controlled programming using a structured text programming language developed and optimized for this application.
FC 312 can be delivered as an “all-in-one” drive with the MCO 305 module preinstalled or MCO 305 can be delivered as option module for field installation.
Basic Features and specifications:
–Home function.
–Absolute and relative positioning.
–Software and Hardware end limits.
–Velocity, Position and Marker synchronizing.
–CAM control.
–Virtual master function for synchronizing of multiple slaves.
–On-line adjustable gear-ratio.
–On-line adjustable offset.
–Definition of application parameters accessible via FC 300 local control panel.
–Read/Write access to all FC 300 parameters.
–Sending and receiving data via Field-bus interface (requires Field-bus option).
–Interrupts triggered by various events: Digital input, position, Field-bus data, parameter change, status change and time.
–Calculation, comparison, bit manipulation and logical gating.
–Conditional and unconditional jumps.
–Graphical PID optimizing tool.
–Debugging tools.
–Supported encoder types: 5V Incremental RS422 and SSI absolute singleand multi-turn, Gray code, adjustable clock frequency and data length.
–3 supply voltages: 5V, 8V and 24V.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
11 |
MCO 305 Design Guide
__ Introduction to VLT Motion Control Option MCO 305 __
System Overview
The MCO 305 system includes at least the following elements:
–FC 300.
–MCO 305 module.
–Motor/geared motor.
–Feedback encoder. Encoder must be mounted on motor shaft when operating FC 300 in Flux closed loop, feedback encoder for positioning and synchronizing can be mounted anywhere in the application. See “Encoders in applications” for more details.
–Master encoder (only for synchronizing).
–PC with MCT 10 for programming.
The following might also be required:
–Brake resistor for dynamic braking.
–Mechanical brake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
|
|
|
|
|
MCO 305 Design Guide
__ Introduction to VLT Motion Control Option MCO 305 __
Configuration Examples
One encoder used as motor feedback for closed loop Flux control as well as position feedback.
One encoder used as motor feedback for closed loop Flux control (connected via encoder option MCB 102), linear encoder used as slave position feedback and a third encoder as master.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
13 |
MCO 305 Design Guide
__ Introduction to VLT Motion Control Option MCO 305 __
Interface between MCO 305, FC 300, and other Option Modules
The Interface between MCO 305 and the FC 300 control card provides read/write access to all parameters as well as reading status of all inputs and the possibility to control all outputs. In addition various process data such as status word and actual motor current can be read by the MCO 305 application program.
MCO 305 is controlling FC 300 via the speed/torque reference; see section “Control loops” for further details.
Field-bus interface (e.g. PROFIBUS and
DeviceNet): MCO 305 has read/write access to data received/send via the various Field-bus
interfaces (requires optional Field-bus option module).
Relay option MCB 105: The relay outputs of MCB 105 can be controlled by the MCO 305 application
program.
General purpose I/O option MCB 103: Status of inputs can be read and outputs can be controlled via the MCO 305 application program.
Up-/download of MCO 305 application programs and configuration data is done via the FC 300 interfaces (RS485 or USB) or via PROFIBUS DPV1 (requires optional PROFIBUS module). The same applies for the online PC software functions such as test-run and debugging.
Control Loops
MCO 305 has a PID (Proportional, Integral, Derivative) controller for position control based on actual position (encoder feedback) and commanded position (calculated). The MCO 305 PID is controlling the position in all modes of operation except velocity synchronizing where the velocity is controlled instead. FC 300 is an “amplifier” in the MCO 305 control loop and it must therefore be optimized for the connected motor and load before the MCO 305 PID can be set-up. FC 300 can be operated in open loop or closed loop within the MCO 305 control loop, see example below:
Guideline for optimizing MCO 305 PID can be found in MCO 305 Operating Instructions. Guideline for optimizing FC 300 can be found in FC 300 Operating Instructions.
14 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Introduction to VLT Motion Control Option MCO 305 __
Encoder
MCO 305 supports various encoder types:
–Incremental encoder with RS422 signal type.
–Incremental encoder with sine–cosine signal type.
–Absolute encoder with SSI interface.
Master and feedback/slave encoder type can be selected independently; encoders can be rotary or linear. Selection of encoder type depends on application requirements and general preferences. Attention must however be paid to the resolution of the selected encoder. There are 3 important selection criteria:
–Maximum position accuracy is +/- 1 encoder increment.
–To ensure stable and dynamic control a minimum of 20 encoder increments per PID controller sample period (default is 1 millisecond) is needed at the minimum application velocity.
–Maximum frequency of the MCO 305 encoder inputs must not be exceeded at maximum velocity.
The feedback encoder can be mounted directly on the motor shaft or behind gearboxes and/or other types of transmissions. There are how ever some important issues to be aware of when mounting the encoder:
–There should be a firm connection between motor and encoder. Slip, backlash, and elasticity will reduce control accuracy and stability.
–When the encoder is running at a low speed it must have a high resolution in order to meet the above requirement (minimum 20 encoder increments per controller sample).
Program Execution
MCO 305 can store multiple programs, up-to 90. Only one of these programs can be executed at a time, there are three ways to control which program to execute:
−Via parameter 33-80 Activated Program Number.
−Via digital inputs (parameters 33-50 through 33-59, 33-61 and 33-62).
−Via PC software.
One program must be defined as Autostart program, the Autostart program is automatically executed after power up. Without Autostart program it is only possible to execute a program via PC software.
The Autostart program is always executed first, if the Autostart program is terminated (no loop or by EXIT command) the following can happen:
1.When parameter 33-80 (Activated Program Number) = -1 and no input (parameters 33-50 through 3359, 33-61 and 33-62) is selected as Start program execution ([13] or [14]). The Autostart program will restart.
2.When parameter 33-80 (Activated Program Number) ≠ -1 and no input (parameters 33-50 through 3359, 33-61 and 33-62) is selected as Start program execution ([13] or [14]). The selected program (par. 33-80) will be executed.
3.When an input (parameters 33-50 through 33-59, 33-61 and 33-62) is selected as Start program execution ([13] or [14]) and one or more inputs are selected as Program select ([15]). The selected program (Program select inputs) will be executed when the Start program execution input is activated.
The active program can be aborted via a digital input when defining an input as Break program execution (Option [9] or [10] in 33-50 through 33-59, 33-61 and 33-62). The aborted program can be restarted via a digital input when defining an input as Continue program execution (Option [11] or [12] in 33-50 through 33-59, 33-61 and 33-62).
Starting the Autostart program after power-up can be avoided by pressing the [Cancel] key of the FC 300 LCP during power-up. The key must be pressed until the message User abort (error 119) appears in the display.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
15 |
MCO 305 Design Guide
__ Introduction to VLT Motion Control Option MCO 305 __
A temporary program can be executed from the program editor (MCT10/APOSS), temporary programs are only stored in RAM and are thus lost at power-down. The temporary program can also be executed in a special Debug mode where it is possible to influence the program execution as well as reading out data and variables, see on-line help of APOSS for further details.
When connecting a PC with MCT 10 to the drive, the active program might be aborted e.g. when downloading a new program or when working with the program editor ([Esc] will abort program execution).
NB!:
In case of an error the active program will be terminated if no error handler (ON ERROR GOSUB xxxx) is defined and the program will not be restarted.
16 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
Positioning
Basically the term positioning in connection with drives means moving the shaft to a specific position. In order to obtain accurate positioning it is necessary to use a closed loop system to control the actual position, based on position feedback from an encoder.
A positioning procedure with a closed loop positioning controller requires the following: Set velocity, acceleration, deceleration and a target position; a velocity profile is calculated based on the actual position of the shaft as well as the before mentioned parameters; the shaft is moved according to the velocity profile until the target position is reached.
Typical applications where accurate positioning is required:
−Palletizers, for example stacking boxes on a pallet.
−Index tables, for example filling material into trays on a rotating table.
−Conveyors, for example when cutting material to length.
−Hoists, for example a lift stopping at different levels.
MCO 305 offers three main positioning types
−Absolute
−Relative
−Touch Probe
Absolute Positioning
Absolute positioning always relates to the absolute zero point of the system, this also means that the absolute zero point must be defined before an absolute positioning procedure can be conducted. When using incremental encoders the zero point is defined by means of a Home function, where the drive approaches a reference switch, stops and defines the actual position as zero. When using absolute encoders the zero point is given by the encoder.
If the starting position is 0 and with an absolute positioning to 150.000 the target position is 150.000, the drive will thus move a distance of 150.000. If on the other hand the starting position is 100.000 and with an absolute positioning to 150.000 the target position is still 150.000 but the drive will only move a distance of 50.000 because it moves to position 150.000 related to the zero point.
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
17 |
MCO 305 Design Guide
__ Functions and Examples __
Relative Positioning
Relative positioning is always relating to the actual position, it is therefore possible to execute a positioning procedure without defining the absolute zero point.
If the starting position is 100.000, with a relative positioning to 150.000 the target position is 250.000 (100.000 + 150.000), the moving distance is thus 150.000.
Touch Probe Positioning
With touch probe positioning, the positioning is related to the actual position when the touch probe input is activated, that means the target position is the position of the touch probe + the positioning distance. Touch probe positioning is thus relative positioning relating to a touch probe instead of the actual starting position.
The touch probe is a sensing device; it can be a mechanical switch, a proximity sensor, an optical sensor or the like. Once the touch probe is activated, for example by a box moved on a conveyor belt, the reference for the positioning is set.
With touch probe positioning to position 50.000 the drive is running until the touch probe is activated for example at position 200.000 and it continues to a target position of 250.000 (200.000 + 50.000). Touch probe positioning is also called “marker related positioning”.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
|
MCO 305 Design Guide
__ Functions and Examples __
Application Example: A Bottle Box Palletizer
The following samples show a palletizer stacking boxes with bottles. The boxes are unloaded using a pack gripper. The three positioning modes are used in this sample and explained in three steps.
NOTE: The following are just examples and the presented settings and programs might not cover the complete functionality required by a real application.
It is assumed that the motor and encoder connections are checked and that all basic parameter settings such as motor data, encoder data and PID controller are done. Instructions for setting up parameters can be found in FC 300 Operating Instructions and MCO 305 Operating Instructions.
Absolute Positioning
Absolute Positioning is explained with following function of the palletizer: The horizontal axis has two fixed target positions; one is above the pick-up and the other one is above the pallet. The horizontal axis is controlled with absolute positioning between the pick-up position and the deliver position.
Parameter Settings and Commands for Palletizer Application |
|
|
|
|
|
|||||
The following MCO 305 parameters are relevant for |
32-0* |
Encoder 2 – Slave |
page 201 |
|||||||
absolute positioning: |
32-6* PID-Controller |
|
page 210 |
|||||||
|
|
|
|
|
||||||
|
|
|
|
32-8* |
Velocity & Acceleration |
page 213 |
||||
|
|
|
|
33-0* |
Home Motion |
|
page 217 |
|||
|
|
|
|
33-4* |
Limit Handling |
|
page 229 |
|||
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
||
|
|
Command |
Description |
|
Syntax |
Parameter |
|
|
||
|
|
Absolute Positioning (ABS) |
|
|
|
|
|
|
|
|
|
|
ACC |
Sets acceleration |
|
ACC a |
a = |
acceleration |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEC |
Sets deceleration |
|
DEC a |
a = |
deceleration |
|
|
|
|
|
HOME |
Move to device zero point (reference switch) and set |
HOME |
– |
|
|
|
||
|
|
|
as the real zero point. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
POSA |
Positions axis absolutely |
|
POSA p |
p = |
position in UU |
|
|
|
|
|
VEL |
Sets velocity for relative and absolute motions and |
VEL v |
v = |
scaled velocity value |
||||
|
|
|
set maximum allowed velocity for synchronizing |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
19 |
MCO 305 Design Guide
__ Functions and Examples __
/********************** Absolute Positioning program sample **************************/
//Inputs: 1 Go to pick up position
//2 Goto deliver position
//3 Home switch
//8 Clear Error
//Outputs: 1 In pick up position
//2 In deliver position
//8 Error
/****************************** Interrupts **************************************/
ON ERROR GOSUB errhandle
// In case of error go to error handler routine, this must always be included /**************************** Basic settings ***********************************/
VEL 80 |
// Sets positioning velocity related to par. 32-80 Maximum velocity |
ACC 100 |
// Sets positioning acceleration related to par. 32-81 Shortest ramp |
DEC 100 |
// Sets positioning deceleration related to par. 32-81 Shortest ramp |
/*********************** Define application parameters *****************************/
LINKGPAR 1900 "Pick up Position" 0 1073741823 0 LINKGPAR 1901 "Deliver Position" 0 1073741823 0
/****************** |
Define Home(0) position after power up *************************/ |
SET I_FUNCTION_3 1 |
// Define input 3 as Home switch input |
HOME |
// Go to Home and set position to 0 |
/****************************** main loop **************************************/
MAIN: |
|
|
IF (IN 1 == 1) AND (IN 2 == 0) THEN |
// Go to pick up position when only input 1 is high |
|
OUT 2 0 |
// Reset "In deliver position" output |
|
POSA (GET 1900) |
// Go to position |
|
OUT 1 1 |
// Set "In pick up position" output |
|
ELSEIF (IN 1 == 0) AND (IN 2 == 1) THEN |
// Go to deliver position when only input 2 is high |
|
OUT 1 0 |
// Reset "In pick up position" output |
|
POSA (GET 1901) |
// Go to position |
|
OUT 2 1 |
// Set "In deliver position" output |
|
ELSE |
|
|
MOTOR STOP |
// Stop if both inputs are low or high. |
ENDIF GOTO MAIN
/*********************** Sub programs start *************************************/
SUBMAINPROG
/************************* Error handler ****************************************/
SUBPROG errhandle
err = 1 |
// Set error flag to remain in error handler until error is reset. |
OUT 8 1 |
// Set error output |
WHILE err DO |
// Remain in error handler until the reset is received |
IF IN 8 THEN |
// Reset error when Input 8 is high. |
ERRCLR |
// Clear error |
err=0 |
// Reset error flag |
ENDIF |
|
ENDWHILE |
|
OUT 8 0 |
// Reset error output |
RETURN /*****************************************************************************/ ENDPROG
/*************************** End of program ************************************/
20 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Functions and Examples __
Relative Positioning
Relative Positioning is explained with following function of the palletizer: When leaving the deliver position the vertical axis just needs to move up one box height so that it is clear of the stack before the horizontal axis can move back to the pick-up position. This is done by relative positioning to “box height” in the “updirection”.
The following MCO 305 parameters are relevant for |
32-0* |
Encoder 2 – Slave |
page 201 |
|
|||||
relative positioning: |
32-6* |
PID-Controller |
page 210 |
|
|||||
|
|
|
|
|
|||||
|
|
|
|
32-8* |
Velocity & Acceleration |
page 213 |
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command |
Description |
Syntax |
Parameter |
|
|
|
|
|
|
Relative Positioning (REL) |
|
|
|
|
|
|
|
|
|
ACC |
Sets acceleration |
ACC a |
a = |
acceleration |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEC |
Sets deceleration |
DEC a |
a = |
deceleration |
|
|
|
|
|
POSR |
Positioning relative to the actual position |
POSR d |
d = |
distance to actual position in UU |
|
||
|
|
|
|
|
|
|
|
|
|
|
|
VEL |
Sets velocity |
VEL v |
v = |
scaled velocity value |
|
|
|
|
|
|
|
|
|
||||
Program Example: Relative Positioning for Palletizer Application |
|
|
|
|
|||||
|
|
|
|
|
|||||
|
/********** Relative positioning sample program for palletizer application example **********/ |
|
|
|
|||||
// |
Inputs: |
1 Go to position |
|
|
|
|
|
|
//8 Clear Error
// |
Outputs: |
1 |
In position |
//8 Error
/*************************** Interrupts *****************************************/ |
|
||
ON ERROR GOSUB errhandle |
|
||
// In case of error go to error handler routine, this must always be included |
|
||
/************************ Define flags *****************************************/ |
|
||
flag = 0 |
|
|
|
/********************* |
Basic settings ****************************************/ |
|
|
VEL 80 |
// Sets positioning velocity related to par. 32-80 Maximum velocity. |
|
|
ACC 100 |
// Sets positioning acceleration related to par. 32-81 Shortest ramp. |
|
|
DEC 100 |
// Sets positioning deceleration related to par. 32-81 Shortest ramp. |
|
|
/******************* Define application parameters *********************************/ |
|
||
LINKGPAR 1900 "Box high" 0 1073741823 0 |
|
||
/************************** main loop *****************************************/ |
|
||
MAIN: |
|
|
|
IF (IN 1 == 1) AND (flag == 0) THEN // Go to position once (ensured by flag) when input 1 is high. |
|
||
OUT 1 0 |
|
// Reset "In position" output. |
|
POSR (GET 1900) |
// Go to position. |
|
|
OUT 1 1 |
|
// Set "In position" output. |
|
flag = 1 |
|
// Set "flag" to ensure that distance is only traveled once. |
|
ELSE |
|
|
|
MOTOR STOP // Stop if input is low. |
|
||
flag = 0 |
|
// Reset "flag" to enable new positioning. |
|
ENDIF |
|
|
|
GOTO MAIN |
|
|
|
/********************** Sub programs start **************************************/ |
|
||
SUBMAINPROG |
|
|
|
/************************ Error handler *****************************************/ |
|
||
SUBPROG errhandle |
|
|
|
|
|
|
|
|
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
21 |
MCO 305 Design Guide
__ Functions and Examples __
err = 1 |
// Set error flag to remain in error handler until error is reset. |
OUT 8 1 |
// Set error output. |
WHILE err DO |
// Remain in error handler until the reset is received. |
IF IN 8 THEN |
// Reset error when Input 8 is high. |
ERRCLR |
// Clear error. |
err=0 |
// Reset error flag. |
ENDIF |
|
ENDWHILE |
|
OUT 8 0 |
// Reset error output. |
flag = 0 |
// Reset "flag" to enable new positioning. |
RETURN /*****************************************************************************/ ENDPROG
/********************* End of program *****************************************/
Touch Probe Positioning
Touch Probe is explained with following function of the palletizer:
When the horizontal axis is in the deliver position the vertical axis has numerous target positions depending on the height of the already stacked boxes, which again depends on the box height and the number of layers of boxes. This is controlled with Touch probe positioning where the touch probe detects the top of the stack in order to calculate the deliver position on top of the stack.
Parameter Settings and Commands for Touch Probe Application |
|
|
||||||
The following MCO 305 parameters are relevant for |
32-0* |
Encoder 2 – Slave |
page 201 |
|||||
touch probe positioning: |
|
32-6* |
PID-Controller |
page 210 |
||||
|
|
|
|
|
||||
|
|
|
|
|
32-8* |
Velocity & Acceleration |
page 213 |
|
|
|
|
|
|
33-4* |
Limit Handling |
page 229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command |
Description |
Syntax |
Parameter |
|
|
|
|
|
Touch Probe |
|
|
|
|
|
|
|
|
ON INT |
Defining an interrupt input. |
ON INT n |
n = number of the input to be monitored |
|
||
|
|
|
|
GOSUB name |
1 - 8 = reaction to the rising edge |
|||
|
|
|
|
|
|
–1 - 8 = reaction to the falling edge |
||
|
|
|
|
|
name = subroutine name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ACC |
Sets acceleration. |
ACC a |
a = acceleration |
|
|
|
|
|
DEC |
Sets deceleration. |
DEC a |
a = deceleration |
|
|
|
|
|
|
|
|
|
|||
|
|
POSR |
Positioning relative to the actual |
POSR d |
d = distance to actual position in UU |
|
||
|
|
|
position. |
|
|
|
|
|
|
|
CVEL |
Sets velocity for speed controlled |
CVEL v |
v = velocity value (negative value for |
|||
|
|
|
motor movements. |
|
|
reversing) |
|
|
|
|
|
|
|
|
|
|
|
|
|
CSTART |
Starts the speed mode. |
– |
– |
|
|
|
|
|
|
|
|
|
|
|
|
22 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Functions and Examples __
/******** Touch probe positioning sample program for palletizer application example *********/
// Inputs: 1 Go to position
//2 Touch probe
//8 Clear Error
// |
Outputs: |
1 |
In position |
//8 Error
/********************************* Interrupts ************************************/
ON ERROR GOSUB errhandle |
// In case of error go to error handler routine, this must always be included |
|||
ON INT 2 GOSUB tp_handler |
// Call touch probe handler on positive edge of input 2. |
|||
/******************************* |
Define flags |
***********************************/ |
||
flag = 0 |
|
|
|
|
tp_active = 0 |
|
|
|
|
/***************************** |
Basic settings |
**********************************/ |
||
VEL 80 |
// Sets positioning velocity related to parameter 32-80 Maximum velocity. |
|||
ACC 100 |
// Sets positioning acceleration related to parameter 32-81 Shortest ramp. |
|||
DEC 100 |
// Sets positioning deceleration related to parameter 32-81 Shortest ramp. |
/************************** Define application parameters ***************************/
LINKGPAR 1900 "Touch probe distance" 0 1073741823 0
/******************************* main loop **************************************/
MAIN:
IF (IN 1 == 1) AND (flag == 0) THEN |
// Start movement once (ensured by flag) when input 1 is high. |
|
OUT 1 0 |
// Reset "In position" output. |
|
CVEL 80 |
// Set constant velocity. |
|
CSTART |
// Start with constant velocity. |
|
tp_active = 0 |
// Reset "tp_active" to enable new touch probe positioning. |
|
flag = 1 |
// Set "flag" to ensure that distance is only traveled once. |
|
ELSE |
|
|
MOTOR STOP |
// Stop if input is low. |
|
flag = 0 |
// Reset "flag" to enable new start. |
ENDIF GOTO MAIN
/****************************** Sub programs start *******************************/
SUBMAINPROG
/****************************** Touch probe handler ******************************/
SUBPROG tp_handler
IF (tp_active == 0) THEN
POSR (GET 1900) |
// Go to touch probe target position |
WAITAX |
// Halt program execution until position is reached (This is necessary as |
|
// NOWAIT ON is automatically set in a subroutine called by interrupt). |
OUT 1 1 |
// Set "In position" output. |
tp_active = 1 |
// Set "tp_active" to ensure that touch probe positioning is done only once |
ENDIF |
|
RETURN
/******************************** Error handler *********************************/
SUBPROG errhandle |
|
err = 1 |
// Set error flag to remain in error handler until error is reset. |
OUT 8 1 |
// Set error output. |
WHILE err DO |
// Remain in error handler until the reset is received. |
IF IN 8 THEN |
// Reset error when Input 8 is high. |
ERRCLR |
// Clear error. |
err=0 |
// Reset error flag. |
ENDIF |
|
ENDWHILE |
|
OUT 8 0 |
// Reset error output. |
flag = 0 |
// Reset "flag" to enable new positioning. |
RETURN |
|
/*****************************************************************************/ ENDPROG
/******************************** End of program ********************************/
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
23 |
MCO 305 Design Guide
__ Functions and Examples __
Synchronizing
Synchronizing is used in applications where 2 or more shafts need to follow each other in velocity or position. It can be a simple master-slave system where a slave is following the velocity or position of a master or it can be a multi-axis system where multiple slaves are following the velocity or position of a common master signal. Electronic synchronization is very flexible compared to a mechanical shaft, belt or chain as the gear-ratio and position offset can be adjusted during operation. Velocity and position of the slave drive is controlled based on a master encoder signal, a feedback encoder signal as well as the set gear-ratio.
During synchronization the slave is always restricted by maximum velocity and acceleration/ deceleration (parameter group 33-8*). In addition the allowed deviation between master and slave velocity can be restricted by parameter 33-14, e.g. 33-14 = 5% means that the slave can only be 5% faster or slower than actual master velocity when doing position corrections.
MCO 305 offers 3 basic types of synchronization:
For synchronous operation of two or more drives you can use
−Velocity synchronization
−Position synchronization
−Marker synchronization
Velocity Synchronization (SYNCV)
Velocity synchronization (SYNCV) is closed loop velocity control where the set-point is the master velocity multiplied by the gear-ratio and the actual velocity is measured by the slave encoder; position deviations will not be corrected. Note however that using the Integral part of the PID controller will lead to some level of position correction as the integral sum of velocity is equal to position.
The slave must be at least as fast and dynamic as the master in order to maintain accurate synchronization, i.e. the slave must be able to match the maximum velocity, acceleration and deceleration of the master. Already during the design phase it is thus important to consider making the least dynamic shaft the master as this shaft will anyway be the limiting factor for the system performance.
Typical applications are:
−Synchronizing of two or more conveyors
−Material stretching
−Mixing
Application Example: Suit Case Conveyor Belt
Two or more conveyor belts must run at the same speed in order to get a smooth transfer of the suit case from one conveyor belt to the next.
In addition to start and stop of velocity synchronizing the sample program has a manual mode with the possibility to increase and decrease the velocity via digital inputs.
Control behavior with velocity synchronization.
NOTE: The following is just an example and the presented settings and programs might not cover the complete functionality required by a real application.
It is assumed that the motor and encoder connections are checked and that all basic parameter settings such as motor data, encoder data and PID controller are done. Instructions for setting up parameters can be found in FC 300 Operating Instructions and MCO 305 Operating Instructions.
24 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Functions and Examples __
Parameter Settings and Commands for Conveyor Belt Application |
|
|
|
|||||||
The following MCO 305 parameters are relevant for |
32-0* |
Encoder 2 – Slave |
page 201 |
|
||||||
velocity synchronization: |
32-3* |
Encoder 1 – Master |
page 205 |
|
||||||
|
|
|
|
|
|
|||||
|
|
|
|
|
32-6* |
PID-Controller |
page 210 |
|
||
|
|
|
|
|
32-8* |
Velocity & Acceleration |
page 213 |
|
||
|
|
|
|
|
33-1* |
Synchronization |
page 218 |
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Command |
|
Description |
Syntax |
|
Parameter |
|
|
|
|
|
SYNCV |
|
Synchronization of velocity |
SYNCV |
|
– |
|
|
|
|
|
|
|
|
|
|
||||
|
|
ON ERROR GOSUB |
Definition of an error subroutine |
ON ERROR GOSUB |
name = name of the subroutine |
|
|
|||
|
|
|
|
|
name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
Program Example: Velocity Synchronizing |
|
|
|
|
|
|
||||
|
|
|
|
|
||||||
|
/************************ Velocity synchronizing sample program ***********************/ |
|
|
|
||||||
|
// Inputs: |
1 |
Start/stop synchronization |
|
|
|
|
|
|
//2 Start manual mode
//3 Increase manual velocity
//4 Decrease manual velocity
//8 Clear Error
// Outputs: |
1 |
In synchronizing mode |
//2 In manual mode
//8 Error
/********************************* Interrupts **************************************/ |
|
|||
ON ERROR GOSUB errhandle |
// In case of error go to error handler routine, this must always be included |
|
||
/***************************** Basic settings *************************************/ |
|
|||
VEL 100 |
// Sets maximum slave velocity related to parameter 32-80 Maximum velocity |
|
||
ACC 100 |
// Sets slave acceleration related to parameter 32-81 Shortest ramp |
|
||
DEC 100 |
// Sets slave deceleration related to parameter 32-81 Shortest ramp |
|
||
/************************** Define application parameters *****************************/ |
|
|||
LINKGPAR 1900 "Manual velocity" 0 100 0 |
|
|
||
LINKGPAR 1901 "Velocity step" 0 10 0 |
|
|
||
/*************************** Define flags and variables *******************************/ |
|
|||
sync_flag = 0 |
|
|
|
|
done = 0 |
|
|
|
|
err = 0 |
|
|
|
|
man_vel = 0 |
|
|
|
|
/********************************** main loop *************************************/ |
|
|||
MAIN: |
|
|
|
|
IF (IN 1 == 1) AND (sync_flag == 0) THEN |
// Start synchronizing once when input 1 is high |
|
||
SYNCV |
// Start velocity synchronizing mode |
|
||
sync_flag = 1 |
// Set sync_flag to ensure synchronizing is only started once. |
|
||
OUT 1 1 |
// Set "In synchronizing mode" output |
|
||
ELSE |
|
|
|
|
MOTOR STOP |
// Stop if input 1 is low. |
|
||
sync_flag = 0 |
// Reset sync_flag after stop |
|
||
OUT 1 0 |
// Reset "In synchronizing mode" output |
|
||
ENDIF |
|
|
|
|
IF (IN 2 == 1) AND (sync_flag == 0) THEN |
// Start manual mode if input 2 high and not synchronizing |
|
||
OUT 2 1 |
// Set "In manual mode" output |
|
||
man_vel = GET 1900 // Set manual velocity to parameter 1900 |
|
|||
CVEL man_vel |
|
|
|
|
CSTART |
|
// Start constant velocity mode |
|
|
WHILE (IN 2 == 1) DO |
// Stay in manual mode while input 2 is high |
|
||
CVEL man_vel |
|
// Update manual velocity |
|
|
IF (IN 3 == 1) AND (done == 0) THEN |
// Increase manual velocity by one step when input 3 is set |
|
||
|
|
|
|
|
|
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
25 |
MCO 305 Design Guide
__ Functions and Examples __
man_vel = man_vel + GET 1901 |
|
|
done = 1 |
|
|
ELSEIF (IN 4 == 1) AND (done == 0) THEN |
// Decrease manual velocity by 1 step when input 3 is set |
|
man_vel = man_vel - GET 1901 |
|
|
done = 1 |
|
|
ELSE |
|
|
done = 0 |
|
|
ENDIF |
|
|
ENDWHILE |
|
|
CSTOP |
// Stop when leaving manual mode |
|
OUT 2 0 |
// Reset "In manual mode" output when leaving manual mode |
|
ENDIF |
|
|
GOTO MAIN |
|
|
/****************************** Sub programs start ********************************/ |
||
SUBMAINPROG |
|
|
/******************************** Error handler ***********************************/ |
||
SUBPROG errhandle |
|
|
err = 1 |
// Set error flag to remain in error handler until error is reset. |
|
OUT 8 1 |
// Set error output |
|
OUT 1 0 |
// Reset "In synchronizing mode" output in case of error |
|
OUT 2 0 |
// Reset "In manual mode" output in case of error |
|
WHILE err DO |
// Remain in error handler until the reset is received |
|
IF (IN 8) AND NOT (IN 1) AND NOT (IN 2) THEN |
|
|
|
// Reset error when Input 8 is high and input 1+2 is low. |
|
ERRCLR |
// Clear error |
|
err=0 |
// Reset error flag |
|
ENDIF |
|
|
ENDWHILE |
|
|
OUT 8 0 |
// Reset error output |
|
sync_flag = 0 |
// Reset sync_flag after an error |
|
done = 0 |
// Reset done flag after an error |
|
RETURN |
|
|
/*******************************************************************************/ ENDPROG
/******************************* End of program **********************************/
Position/Angle Synchronization (SYNCP)
Position synchronization (SYNCP) is closed loop position control with a moving target where the set-point (commanded position) is the master position multiplied by the gear-ratio also considering any position offset. The slave position is controlled based on this set-point and the actual position feedback from the slave encoder. Any position deviation will continuously be corrected considering maximum velocity, acceleration and deceleration of the slave. The gear-ratio is set as a fraction (numerator and denominator) to avoid rounding errors e.g. when using prime numbers. The gear-ratio must be 100% correct, even the smallest rounding error will lead to position drifting over time.
When starting position synchronizing the actual slave position will be locked to the actual master position, it is thus necessary to bring the slave into the right physical position with respect to the physical position of the master. This can be done manually or be means of an automatic homing procedure (requires external reference switches or absolute encoders).
The slave must be faster and more dynamic than the master in order to maintain accurate synchronization both at maximum master velocity and during acceleration/deceleration. I.e. the slave must be able to exceed the maximum velocity, acceleration and deceleration of the master to allow it to catch up if getting behind the master. Already during the design phase it is thus important to consider making the least dynamic shaft the master as this shaft will anyway be the limiting factor for the system performance.
26 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Functions and Examples __
Typical applications are:
−Bottle washing machines.
−Foil wrapping.
−Packaging machines.
−Conveyors.
−Multi axis hoists.
−Filling.
−Printing.
−Cut on the fly.
Control behavior with position synchronization
Application Example: Packaging with Fixed Product Distances
This application consists of two conveyors, 1 carrying empty boxes another one carrying teddy bears; the purpose of the machine is to put teddies into the boxes. Both boxes and teddies come with a fixed distance and it is ensured that there is no slip between the encoders and the boxes and teddies. It is thus sufficient to position synchronize based on the encoders. At start it is ensured that the master (box conveyor) it always in the same position, the teddy conveyor needs to be homed prior to starting synchronization. There are 3 ways to ensure that the teddies are aligned with the boxes when starting:
−Adjust the physical position of the home/reference switch.
−Adjust home offset in parameter 33-01.
−Adjust position offset for synchronization in parameter 33-12.
NOTE: The following is just an example and the presented settings and programs might not cover the complete functionality required by a real application.
It is assumed that the motor and encoder connections are checked and that all basic parameter settings such as motor data, encoder data and PID controller are done. Instructions for setting up parameters can be found in FC 300 Operating Instructions and MCO 305 Operating Instructions.
The following MCO 305 parameters are relevant for position synchronization:
32-0* Encoder 2 |
– Slave |
page 201 |
|
32-3* |
Encoder 1 |
– Master |
page 205 |
32-6* |
PID-Controller |
page 210 |
|
32-8* |
Velocity & Acceleration |
page 213 |
|
33-1* |
Synchronization |
page 218 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
27 |
MCO 305 Design Guide
__ Functions and Examples __
Command |
Description |
Syntax |
Parameter |
DEFSYNCORIGIN |
Defines master-slave relation for the |
DEFSYNCORIGIN |
master = reference position in qc |
|
next SYNCP or SYNCM command |
master slave |
slave = reference position |
|
|
|
|
MOVESYNCORIGIN |
Relative shifting of the origin of |
MOVESYNCORIGIN |
mvalue = Relative offset |
|
synchronization |
mvalue |
|
PULSACC |
Sets acceleration for master |
PULSACC a |
a = acceleration in Hz/s |
|
simulation |
|
|
|
|
|
|
PULSVEL |
Sets velocity for master simulation |
PULSVEL v |
v = velocity in pulses per second |
|
|
|
(Hz) |
SYNCP |
Synchronization of angle/position |
SYNCP |
– |
|
|
|
|
SYNCSTAT |
Queries flag for synchronization |
res = SYNCSTAT |
– |
|
status |
|
|
SYNCERR |
Queries actual synchronization error |
res = SYNCERR |
– |
|
of the slave |
|
|
/************************* Position Synchronizing Sample Program ***********************/
//Inputs: 1 Start/stop synchronization
//2 Start homing
//3 Home switch
//4 Increase offset
//5 Decrease offset
//8 Clear Error
//Outputs: 1 Within synchronizing accuracy, set accuracy window in par. 33-13
//2 Homing done
//8 Error
/****************************** Interrupts **************************************/
ON ERROR GOSUB errhandle
// In case of error go to error handler routine, this must always be included
/************************** Basic settings ************************************/ |
|
VEL 100 |
// Sets maximum slave velocity related to par. 32-80 Maximum velocity |
ACC 100 |
// Sets slave acceleration related to par. 32-81 Shortest ramp |
DEC 100 |
// Sets slave deceleration related to par. 32-81 Shortest ramp |
/*********************** Define application parameters *****************************/
LINKGPAR 1900 "Offset step" 0 10000 0 LINKGPAR 1901 "Offset type" 0 1 0
/********************** Set parameters and flags ********************************/
SET I_FUNCTION_3 1 |
// Define input 3 as Home switch input |
next_step = 0 |
|
home_done = 0 new_offset = 0
/************************************* main loop ******************************/
MAIN: |
|
IF (IN 2 == 1) THEN |
// Start homing if input 2 high |
HOME |
// Go to Home and set position to 0 |
home_done = 1 |
// Set home_done flag |
OUT 2 1 |
// Set home done output |
ENDIF |
|
|
IF (IN 1 == 1) AND |
(home_done == 1) THEN |
// Start synchronizing when input 1 = 1 and homing done. |
SYNCP |
|
// Start position synchronizing mode |
|
|
|
28 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
MCO 305 Design Guide
__ Functions and Examples __
old_offset = GET SYNCPOSOFFS |
|
|
|
|
WHILE (IN 1 == 1) DO |
|
// Stay in synchronizing mode while input 1 = 1 |
|
|
IF (IN 4 == 1) THEN |
|
|
|
|
GOSUB increase_offset |
|
|
|
|
ELSEIF (IN 5 == 1) THEN |
|
|
|
|
GOSUB decrease_offset |
|
|
|
|
ENDIF |
|
|
|
|
IF (SYNCSTAT & 4) THEN |
|
|
|
|
OUT 1 1 |
|
|
|
|
ELSE |
|
|
|
|
OUT 1 0 |
|
|
|
|
ENDIF |
|
|
|
|
ENDWHILE |
|
|
|
|
MOTOR STOP |
// Stop if input 1 is low. |
|
|
|
home_done = 0 |
// Reset home_done flag after stop |
|
||
OUT 1 0 |
|
|
|
|
OUT 2 0 |
// Reset home done output after stop |
|
||
IF (new_offset != old_offset) AND (GET 132 == 0) THEN |
// Save absolute offset if changed |
|
||
SAVE AXPARS |
// NOTE: Saving more that 10000 times can damage flash PROM |
|
||
ENDIF |
|
|
|
|
ENDIF |
|
|
|
|
GOTO MAIN |
|
|
|
|
/*************************** Sub programs start *********************************/ |
|
|||
SUBMAINPROG |
|
|
|
|
/***************************** Increase offset **********************************/ |
|
|||
SUBPROG increase_offset |
|
|
|
|
IF (Next_step) THEN |
// Check if next offset step is enabled |
|
||
IF (GET 1901 == 0) THEN |
// Absolute offset |
|
|
|
new_offset = old_offset + GET 1900 |
// Read existing offset and add step value |
|
||
SET SYNCPOSOFFS new_offset |
// Set new position offset |
|
||
ELSE |
|
// Relative offset |
|
|
MOVESYNCORIGIN GET 1900 |
// Execute relative offset with offset step |
|
||
ENDIF |
|
|
|
|
ENDIF |
|
|
|
|
Next_step=0 |
// Disable next offset step |
|
||
ON TIME 500 GOSUB Enb_Step |
// Enable next offset step after 500 ms |
|
||
RETURN |
|
|
|
|
/*************************** Decrease offset ***********************************/ |
|
|||
SUBPROG decrease_offset |
|
|
|
|
IF (Next_step) THEN |
// Check if next offset step is enabled |
|
||
IF (GET 1901 == 0) THEN |
// Absolute offset |
|
|
|
new_offset = GET SYNCPOSOFFS - GET 1900 |
|
|
||
// Read existing offset and subtract step value |
|
|
||
SET SYNCPOSOFFS new_offset |
// Set new position offset |
|
||
ELSE |
|
// Relative offset |
|
|
MOVESYNCORIGIN (- GET 1900) |
// Execute relative offset with - offset step |
|
||
ENDIF |
|
|
|
|
ENDIF |
|
|
|
|
Next_step=0 |
// Disable next offset step |
|
||
ON TIME 500 GOSUB Enb_Step |
// Enable next offset step after 500 ms |
|
||
RETURN |
|
|
|
|
/************************* Enable new offset step *******************************/ |
|
|||
SUBPROG Enb_step |
|
|
|
|
|
|
|
||
|
MG.33.L5.02 – VLT® is a registered Danfoss trademark |
29 |
MCO 305 Design Guide
__ Functions and Examples __
Next_step = 1 // Enable next offset step RETURN
/***************************** Error handler ***********************************/
SUBPROG errhandle
err = 1 |
// Set error flag to remain in error handler until error is reset. |
OUT 8 1 |
// Set error output |
OUT 2 0 |
// Reset home done output in case of error |
WHILE err DO |
// Remain in error handler until the reset is received |
IF (IN 8) AND NOT (IN 1) THEN // Reset error when Input 8 is high and input 1 low. |
|
ERRCLR |
// Clear error |
err=0 |
// Reset error flag |
ENDIF |
|
ENDWHILE |
|
OUT 8 0 |
// Reset error output |
home_done = 0 |
// Reset home_done flag after an error |
RETURN /****************************************************************************/ ENDPROG
/***************************** End of program *********************************/
30 |
MG.33.L5.02 – VLT® is a registered Danfoss trademark |