Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:appnote:an009 [2017/05/04 15:15] – [AN009 - Example of using and calibrating the OOPOS3 device] qem103 | en:appnote:an009 [2019/08/29 17:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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 | ||
+ | * introduction of parameters to calibrate inputs and outputs | ||
+ | * application Development as required | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== 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: | ||
+ | |||
+ | <code QCl> | ||
+ | ; | ||
+ | ; Internal device declaration | ||
+ | ; | ||
+ | INTDEVICE | ||
+ | Axis OOPOS3 | ||
+ | </ | ||
+ | |||
+ | You define a OOPOS3 device with the name " | ||
+ | |||
+ | 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. | ||
+ | |||
+ | * Initialize the Axis device with the //INIT// command | ||
+ | <code QCL> | ||
+ | INIT Axis | ||
+ | </ | ||
+ | * Check //st_init// status activation | ||
+ | <code QCL> | ||
+ | WAIT Axis: | ||
+ | </ | ||
+ | * Enter the values for //measure// and // | ||
+ | <code QCL> | ||
+ | Axis: | ||
+ | Axis:pulse = 4000 | ||
+ | </ | ||
+ | * Reset the value of the //posit// parameter | ||
+ | <code QCL> | ||
+ | Axis:posit = 0 | ||
+ | </ | ||
+ | * Move the Axis forward Running a complete turn to the encoder: verify that the value of the // | ||
+ | * If the value of // | ||
+ | * If the value of // | ||
+ | |||
+ | === Verifica del funzionamento delle uscite digitali === | ||
+ | |||
+ | ^: | ||
+ | |||
+ | 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. | ||
+ | |||
+ | * Set the device software limits to the maximum value.\\ Enter the 999999 value in the //maxpos// parameter and the -999999 value in the //minpos// parameter. | ||
+ | <code QCL> | ||
+ | Axis:maxpos = 999999 | ||
+ | Axis:minpos = -999999sse: | ||
+ | </ | ||
+ | * Give the //MANFFW// command to make turn the only forward output | ||
+ | <code QCL> | ||
+ | MANFFW Axis | ||
+ | </ | ||
+ | * To verify the correctly execution of the command, check that // | ||
+ | <code QCL> | ||
+ | WAIT NOT Axis: | ||
+ | </ | ||
+ | * Check if the axis moves forward and that the count shown in // | ||
+ | <code QCL> | ||
+ | STOP Axis | ||
+ | </ | ||
+ | * If the forward output, corresponding for example to the 2.OUT01 resource, does not activate, check the electrical connection | ||
+ | * Give the MANFBW command To activate the backward output only | ||
+ | <code QCL> | ||
+ | MANFBW Axis | ||
+ | </ | ||
+ | * To verify that the command is running correctly, check that // | ||
+ | <code QCL> | ||
+ | WAIT NOT Axis: | ||
+ | </ | ||
+ | * Check if the axle moves backward and that the count showed in // | ||
+ | <code QCL> | ||
+ | STOP Axis | ||
+ | </ | ||
+ | * If the backward output, for example the resource 2.OUT02, does not activate, check the electrical connection | ||
+ | * Give the MANSFW command to enable the forward outputs and slow-down | ||
+ | <code QCL> | ||
+ | MANSFW Axis | ||
+ | </ | ||
+ | * To verify that the command is running correctly, check that the // | ||
+ | <code QCL> | ||
+ | WAIT NOT Axis: | ||
+ | </ | ||
+ | * Check if the axis moves forward at a speed lower than the previous and that the count showed in Axis:posit increase, then end the movement with the STOP command | ||
+ | <code QCL> | ||
+ | STOP Axis | ||
+ | </ | ||
+ | * If the slow-down output, for example the resource 2.OUT03, does not activate, check the electrical connection. | ||
+ | |||
+ | ==== 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 // | ||
+ | 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: | ||
+ | |||
+ | <code QCL> | ||
+ | AxisX: | ||
+ | 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 // | ||
+ | |||
+ | When the user does not know in advance the measurement parameters, you can still correct the calibration by following these steps: | ||
+ | * give the //INIT// command to device, check that the //st_init// state switch to 1 | ||
+ | * through the " | ||
+ | * set //measure// and //pulse// both to 1 value | ||
+ | * move the axis manually making it a move of an easily measurable position | ||
+ | * read the //posit// value | ||
+ | * now insert with the desired measurement unit the measured value in the //measure// parameter and the value of the //posit// parameter in the //pulse// parameter | ||
+ | |||
+ | The encoder resolution is now correctly set. | ||
+ | |||
+ | A further important task to do is set the //maxpos// and //minpos// parameters that respectively, | ||
+ | |||
+ | === 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. | ||
+ | |||
+ | * Determine the software limits to be introduced in the //maxpos// and //minpos// parameters | ||
+ | <code QCL> | ||
+ | Axis:minpos = xxx (xxx = minimum value of the axis expressed in Um) | ||
+ | Axis:maxpos = yyy (yyy = maximum value of the axis expressed in Um) | ||
+ | </ | ||
+ | * If you are using a two-speed system, set the required space for the axis to move from high speed to slow speed to the activation of the deceleration output; enter the data in the // | ||
+ | <code QCL> | ||
+ | Axis: | ||
+ | </ | ||
+ | * Set the off time of the motion output when the axis enters the deceleration band so that the activation of the slow-down output does not cause electrical failure. Insert the data in the //slowdly// parameter. | ||
+ | <code QCL> | ||
+ | Axis: | ||
+ | </ | ||
+ | * Set the tolerance limits that you want to achieve during placement in the //tollp// and //tolln// parameters. As the first setting, introduce higher values to the required accuracy. | ||
+ | <code QCL> | ||
+ | Axis:tollp = tpx (tpx = positive tolerance Value expressed in Um/10) | ||
+ | Axis:tolln = tnx (tpn = negative tolerance Value expressed in Um/10) | ||
+ | </ | ||
+ | * Set the reverse time of axis in //tinv// parameter | ||
+ | <code QCL> | ||
+ | Axis:tinv = inversion time expressed in s/100 | ||
+ | </ | ||
+ | * Consider a single inertia band throughout the axis, then set the //ninert// parameter to 1 | ||
+ | <code QCL> | ||
+ | Axis:ninert = 1 | ||
+ | </ | ||
+ | * Enable inertia recalculation When the positioning ends out tolerance: then set the // | ||
+ | <code QCL> | ||
+ | Axis: | ||
+ | </ | ||
+ | * Set the tolerance activation delay time, considering the time it takes the axle to decelerate until it stops; then set the //toldly// parameter | ||
+ | <code QCL> | ||
+ | Axis:toldly = tdly (tdly = time delay activation tolerance expressed in ms) | ||
+ | </ | ||
+ | |||
+ | === Setting maxvel parameter === | ||
+ | |||
+ | If you are not aware of the declared maximum motor speed, you must do so: | ||
+ | |||
+ | * enter in calibration mode (as described above) | ||
+ | * if the system allows it to supply to the drive the voltage and read the value of the //vel// parameter | ||
+ | * calculate the maximum speed with the proportion //vout// : 10 V = //vel// : //maxvel// | ||
+ | |||
+ | 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, | ||
+ | Now it is possible to carry out a simple movement of the. | ||
+ | |||
+ | * Move the axis to a position so that it can make a certain space without meeting the maximum limit switches | ||
+ | * Reset the counter (//posit// = 0 parameter) | ||
+ | * Set the placement quota (//setpos// parameter) | ||
+ | <code QCL> | ||
+ | Axis:setpos = Placement Quota (in Um Included between minpos and maxpos) | ||
+ | Start positioning (START command) | ||
+ | START Axis | ||
+ | </ | ||
+ | * To interrupt the positioning use the STOP command | ||
+ | |||
+ | ==== 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. [[#Device declaration in the configuration unit|See here.]] | ||
+ | |||
+ | <code QCL> | ||
+ | ; | ||
+ | ; 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 | ||
+ | ifInMan F 2.INP02 | ||
+ | ifStart F 2.INP03 | ||
+ | ifStop | ||
+ | ; | ||
+ | ; OUTPUT variables definition | ||
+ | ; | ||
+ | OUTPUT | ||
+ | ofToll F 2.OUT01 | ||
+ | |||
+ | ; | ||
+ | ; Unit qcl | ||
+ | ; | ||
+ | ; | ||
+ | ; Device parameterization Operations | ||
+ | ; | ||
+ | Axis: | ||
+ | Axis:pulse = 40000 ;how to calculate measure and pulse is explained in the appropriate section.* | ||
+ | Axis:maxvel = 100000 | ||
+ | Axis:maxpos = 999999 | ||
+ | Axis:minpos = -999999 | ||
+ | Axis: | ||
+ | Axis:tollp = 10 ; | ||
+ | Axis:tolln = 50 ; | ||
+ | Axis: | ||
+ | Axis:tbrake = 30 ;Brake Intervention Time | ||
+ | Axis: | ||
+ | Axis: | ||
+ | Axis:ninert = 1 ; | ||
+ | Axis: | ||
+ | Axis: | ||
+ | Axis:tool = 0 ;Tool thickness | ||
+ | Axis: | ||
+ | Axis:enstol = 0 ; | ||
+ | Axis: | ||
+ | Axis:decpt = 0 ;Decimal digits in speed calculation | ||
+ | Axis:tinv = 50 ;Axis inversion Time | ||
+ | Axis:toll = 5 ; | ||
+ | Axis:toldly = 10 ;Time Delay activation tolerance status | ||
+ | Axis: | ||
+ | Axis:prspos = 0 ; | ||
+ | Axis:prsdir = 0 ; | ||
+ | Axis:prsvel = (20 * Axis: | ||
+ | Axis: | ||
+ | Axis: | ||
+ | Axis: | ||
+ | Axis: | ||
+ | Axis: | ||
+ | |||
+ | INIT Axis ; | ||
+ | WAIT Axis: | ||
+ | CNTUNLOCK Axis ;Unlock location capture | ||
+ | WAIT NOT Axis: | ||
+ | CNTDIR Axis ;Sets the way of position acquisition | ||
+ | WAIT NOT Axis: | ||
+ | REGON Axis ;Enable adjustment | ||
+ | WAIT NOT Axis: | ||
+ | |||
+ | 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: | ||
+ | ; gfMovAuto: | ||
+ | ; | ||
+ | |||
+ | MAIN: | ||
+ | ; | ||
+ | ; Outputs management | ||
+ | ; | ||
+ | ofToll = Axis: | ||
+ | |||
+ | ; | ||
+ | ; Automatic movement management | ||
+ | ; | ||
+ | IF ifStart | ||
+ | IF NOT gfMovMan | ||
+ | IF Axis: | ||
+ | Axis:setpos = slQuotaPos | ||
+ | START Axis ;Executes the start of the axis | ||
+ | gfMovAuto = 1 ; | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | IF ifStop | ||
+ | IF NOT Axis: | ||
+ | STOP Axis ; | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | IF gfMovAuto | ||
+ | IF Axis: | ||
+ | gfMovAuto = 0 ; | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | |||
+ | ; | ||
+ | ; Manual movement management (JOG) | ||
+ | ; | ||
+ | IF ifAvMan | ||
+ | IF NOT (gfMovAuto OR gfMovMan) | ||
+ | IF Axis: | ||
+ | MANFFW Axis ; | ||
+ | gfMovMan = 1 ;Manual movement in progress reports | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | IF ifInMan | ||
+ | IF NOT (gfMovAuto OR gfMovMan) | ||
+ | IF Axis: | ||
+ | MANFBW Axis ; | ||
+ | gfMovMan = 1 ;Report Manual movement in progress | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | IF gfMovMan | ||
+ | IF NOT (ifAvMan OR ifInMan) | ||
+ | STOP Axis ;Stop the axis | ||
+ | gfMovMan = 0 ;Remove the manual moving axis signal | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | |||
+ | ; | ||
+ | ; Final operations | ||
+ | ; | ||
+ | WAIT 1 | ||
+ | JUMP MAIN | ||
+ | END | ||
+ | </ | ||
+ | |||
+ | [[#Measure and pulse introduction|How to calculate measure and pulse is explained in the appropriate section.]] |