Indice

AN009 - Example of using and calibrating the OOPOS3 device

In this section you want to describe the first operations that you will be doing the user in his first approach with the EANPOS device. You also want to provide a simple example where using the OOPOS3 device to implement a positioner.

We can divide the procedure into the following sections:

Device declaration in the configuration unit

As has already been explained in the Description section of the OOPOS3 device, You must program correctly the configuration unit of the application. It is very important that the code portion where device is declared, here you will need to indicate the hardware resources to be used to ensure proper operation. It will be the task of the programmer to identify and choose the most appropriate inputs and outputs. For example, with the following line of code:

;--------------------------------- 
; Internal device declaration 
;--------------------------------- 
INTDEVICE 
Axis  OOPOS3  0004  2.CNT01 1 3.INP01 2.OUT01 2.OUT02 X.X X.X 2.OUT3  X.X

You define a OOPOS3 device with the name “axis” whose sampling time is 4 ms. Have been declared the following hardware resources: the input of the bidirectional counter, the digital input number for interruption dedicated to the encoder zero pulse, a digital input of enabling for the acquisition of the zero pulse. The movement outputs that have been declared are: 2.OUT01 as forward output, 2.OUT02 as backward output and 2.OUT03 as slow-down output.

An application that only has the device declaration within the configuration unit and a QCL unit that does not execute any operation (Except WAIT forced) It already allows you to do the first steps using the features of the device. After you download the application on the instrument and having it run, you will can already change the parameters, observe the states or give commands to the device via the monitor provided by Qview.
This is very convenient in the early stages of programming when you just want to check for some operations or when you're debugging.

Connecting the hardware

The OOPOS3 device requires some hardware resources such as an input counter for two-way transducer (CNTxx) and the digital outputs.

Verifying how the Counter resource works

The following procedure is used to verify the operation of the counter input.

Verifica del funzionamento delle uscite digitali

:important:Attention:
Before handling the axis, verify proper operation of emergency equipment and protection.

The following procedure is used to verify the operation of the digital outputs of forward, backward and slow-down moving the axis with manual device controls.
To continue, verify that the Axis device is initialized and with the measure and pulse value correct.

Correct parameterization of the device

After you correctly declare the hardware resources to use you must set some parameters based on the components that are attached to the Qmove product.

Measure and pulse introduction

Let us consider the case In which the bidirectional transducer is a digital encoder. Suppose that the encoder is directly keyed on a motor that must move the axis. You will need to set correctly the measure and pulseparameters of the device so that it can interpret the pulses arriving at QMove, the instrument will then calculate the position of the axis. The measure and pulse introduction Establishes a match between a space in a selected unit of measure and a certain number of pulses. In the event that the user already knows the path space in a encoder round Then you can proceed directly to the input of the values.
We clarify this concept with an example: If the encoder generates 1000 pulses turn and you know that the axis moves about 5 cm when the encoder execute a complete precisely round then you can enter the following values:

AxisX:measure = 50;
AxisX:pulse = 4000

The measure value introduced It also implies the choice of a unit of measure of millimeter to measure the positions, in the pulse parameter A value equal to the number of encoder pulses has been introduced multiplied x 4. You remember that the measure/pulse ratio must have a value between 0.00935 and 1. It is important to emphasize that the values just described are taken as a reference: it's not necessary to introduce the parameters taking as reference an encoder lap as you will describe below.

When the user does not know in advance the measurement parameters, you can still correct the calibration by following these steps:

The encoder resolution is now correctly set.

A further important task to do is set the maxpos and minpos parameters that respectively, define the maximum and minimum position to be reached by the axis.

Choosing the speed measurement unit

The unit of measurement of the instantaneous axis speed is chosen using the unitvel and decpt parameters. You can choose the speed time unit with the unitvel parameter: if this is 0 the speed is measured in Um/min, if is to 1 is measured in Um/s. The decpt parameter Instead it determines whether to measure the speed values in multiples of the fundamental unit of measure Um. For example, if the fundamental unit of measure Um=mm, and unitvel=1 You get the speed show in the vel in variable:
mm/s (with decpt = 0),
cm/s (with decpt = 1),
dm/s (with decpt = 2),
m/s (with decpt = 3).
Later, if necessary, you should to properly configure the display on the operator terminal to adjust the correct position of the decimal point.

Basic parameterizations

To operate the device OOPOS3 properly, you must enter some basic parameters.

Setting maxvel parameter

If you are not aware of the declared maximum motor speed, you must do so:

Now you can enter the maximum speed value in the maxvel parameter.

Handling

The procedures described here have allowed to complete the steps of defining the hardware resources necessary for the device, verification of electrical connections, setting the device's fundamental parameters.
Now it is possible to carry out a simple movement of the.

Development of an application that implements a positioner

In the previous section was explained what are the first steps to follow for an axis handling procedure. This example only uses a narrow spectrum of settable parameters of the device, In this section we insert a sample code, commented, from which the user can take a cue to develop an application.
The way the device should be declared is explained previously, Therefore, this section omits the configuration unit. See here.

;*************************************************************************************
; Configuration unit (are reported only the declarations of variables and 
; the bus and device declarations are omitted)
;*************************************************************************************
;-------------------------------------------------------------------------------------
; SYSTEM variables definition
;-------------------------------------------------------------------------------------
SYSTEM
slQuotaPos L                  ;Variable for placement quota
;-------------------------------------------------------------------------------------
; GLOBAL variables definition
;-------------------------------------------------------------------------------------
GLOBAL
gfMovMan F                    ;Flag reporting manual movements in progress
gfMovAuto F                   ;Flag reporting automatic movements in progress
;-------------------------------------------------------------------------------------
; INPUT variables definition
;-------------------------------------------------------------------------------------
INPUT
ifAvMan F 2.INP01             ;Manual forward Input
ifInMan F 2.INP02             ;Manual backward input
ifStart F 2.INP03             ;START input axis
ifStop  F 2.INP04             ;STOP input axis
;-------------------------------------------------------------------------------------
; OUTPUT variables definition
;-------------------------------------------------------------------------------------
OUTPUT
ofToll F 2.OUT01              ;Axis Output in tolerance
 
;*************************************************************************************
; Unit qcl
;*************************************************************************************
;-------------------------------------------------------------------------------------
; Device parameterization Operations
;-------------------------------------------------------------------------------------
Axis:measure = 10000        
Axis:pulse = 40000            ;how to calculate measure and pulse is explained in the appropriate section.*
Axis:maxvel = 100000          ;How to calculate Maxvel is explained in the appropriate section.*
Axis:maxpos = 999999          ;Maximum quota
Axis:minpos = -999999         ;Minimum quota
Axis:slowpos = 100            ;Slow-down quota
Axis:tollp = 10               ;Positive tolerance
Axis:tolln = 50               ;Negative tolerance
Axis:slowdly = 50             ;Slow-down time
Axis:tbrake = 30              ;Brake Intervention Time
Axis:overpos = 0              ;Over-quota Recovery play
Axis:bklashmode = 0           ;Mode Recovery play
Axis:ninert = 1               ;Number of inertia bands
Axis:maxiner = 100            ;Maximum inertia after recalculation
Axis:inertmode = 1            ;Mode inertia recalculation
Axis:tool = 0                 ;Tool thickness
Axis:dobiner = 0              ;Mode forward/backward inertia
Axis:enstol = 0               ;Enable START with axis in tolerance
Axis:unitvel = 0              ;Speed Time Unit (speed in Um/min)
Axis:decpt = 0                ;Decimal digits in speed calculation
Axis:tinv = 50                ;Axis inversion Time
Axis:toll = 5                 ;Tolerance (set in Um)
Axis:toldly = 10              ;Time Delay activation tolerance status
Axis:prsmode = 0              ;Homing function mode
Axis:prspos = 0               ;Homing offset
Axis:prsdir = 0               ;Direction of movement for home location search
Axis:prsvel = (20 * Axis:maxvel)/100  ;Search speed for activation digital input enabling (20% of the max.vel.)
Axis:sprsvel = (10 * Axis:maxvel)/100 ;Search speed of the home position (10% of the max.vel.)
Axis:breaktype = 0            ;Brake Intervention Logic
Axis:slowtype = 0             ;Slow-down calculation type
Axis:maxslow = 8              ;Slow-down Maximum calculated
Axis:minslow = 80             ;Slow-down Minimum calculated
 
INIT Axis                     ;Initializes the device
WAIT Axis:st_init             ;Wait for the device to be initialized
CNTUNLOCK Axis                ;Unlock location capture
WAIT NOT Axis:st_cntlock      ;Wait for the capture of the location to be unlocked
CNTDIR Axis                   ;Sets the way of position acquisition
WAIT NOT Axis:st_cntrev       ;Wait for the way of position acquisition to be set
REGON Axis                    ;Enable adjustment
WAIT NOT Axis:st_regoff       ;Wait for the adjustment to be enabled
 
IF (slQuotaPos EQ 0)          ;If the axis placement quota is zero
  slQuotaPos = 2000           ;Set a placement quota
ENDIF
 
;-------------------------------------------------------------------------------------
; Positioning operations
;-------------------------------------------------------------------------------------
; ---------------------------------- Used Variables ----------------------------------
; slQuotaPos: Settable variable representing the axis placement dimension
; ------------------------------------- Used flags -----------------------------------
; gfMovMan:   Manual movement in progress
; gfMovAuto:  Automatic movement in progress
;-------------------------------------------------------------------------------------
 
MAIN:
;-------------------------------------------------------------------------------------
; Outputs management
;-------------------------------------------------------------------------------------
ofToll = Axis:st_toll         ;Set the tolerance output as the tolerance status
 
;-------------------------------------------------------------------------------------
; Automatic movement management
;-------------------------------------------------------------------------------------
IF ifStart                          ;Waits for the START input
  IF NOT gfMovMan                   ;Check that there are no manual movements
    IF Axis:st_still                ;Check that the axis is stopped
      Axis:setpos = slQuotaPos      ;Set the placement quota
      START Axis                    ;Executes the start of the axis
      gfMovAuto = 1                 ;Report automatic movement in progress
    ENDIF
  ENDIF
ENDIF
IF ifStop                           ;Waits for the STOP input
  IF NOT Axis:st_still              ;Check that the axle is NOT stopped
    STOP Axis                       ;Executes the axis STOP
  ENDIF
ENDIF
IF gfMovAuto                        ;Check automatic motion reporting in progress
  IF Axis:st_still                  ;Check that the axle is stopped
    gfMovAuto = 0                   ;Reset Automatic Motion Status
  ENDIF
ENDIF
 
;-------------------------------------------------------------------------------------
; Manual movement management (JOG)
;-------------------------------------------------------------------------------------
IF ifAvMan                          ;Wait for manual motion input
  IF NOT (gfMovAuto OR gfMovMan)    ;Check that there are no automatic or manual movements in progress
    IF Axis:st_still                ;Check that the axle is stopped
      MANFFW Axis                   ;Forward axis in manual
      gfMovMan = 1                  ;Manual movement in progress reports
    ENDIF
  ENDIF
ENDIF
IF ifInMan                          ;Wait for manual motion input
  IF NOT (gfMovAuto OR gfMovMan)    ;Check that there are no automatic or manual movements in progress
    IF Axis:st_still                ;Check that the axle is stopped
      MANFBW Axis                   ;Forward axis in manual
      gfMovMan = 1                  ;Report Manual movement in progress
    ENDIF
  ENDIF
ENDIF
IF gfMovMan                         ;If the axis moves in manual
  IF NOT (ifAvMan OR ifInMan)       ;If the manual forward and backward inputs are off
    STOP Axis                       ;Stop the axis
    gfMovMan = 0                    ;Remove the manual moving axis signal
  ENDIF
ENDIF
 
;-------------------------------------------------------------------------------------
; Final operations
;-------------------------------------------------------------------------------------
WAIT 1
JUMP MAIN
END

How to calculate measure and pulse is explained in the appropriate section.