ANPOS2 Device
1. Introduction
The internal device ANPOS2 allows the movement of an axis with position control and incremental encoder feedback. The main features of the device are:
-
programmable measurement resolution
-
software limit management
-
trajectory generation with trapezoidal and S-curve velocity profiles
-
programmable acceleration and deceleration
-
homing procedure
-
PID + FF regulator
-
position capture by interrupt
-
Calibration of analog output
-
work with open or closed position loop
-
JOGS movement
-
Management of a digital output to indicate one of the states of the positioning (still, tolerance, etc.).
2. Declaration
To use the device you should declare it in the INTDEVICE section of configuration unit.
;--------------------------------- ; Declaration internal devices ;--------------------------------- INTDEVICE ... <nome> ANPOS2 TCamp ICont IdxA HSwA IOutD IOutA
Where:
Field Name | Description | Example | Notes |
---|---|---|---|
<name> | Name assigned to the device | Axe | - |
ANPOS2 | Keyword that identifies the device ANPOS2 | - | - |
TCamp | Time sampling device in milliseconds | 4 | - |
ICont | Address of bidirectional incremental counter (check product hardware documentation to determine the right value). | 2.CNT01 | X.X Enter the value you will get a virtual count: the value of posit will coincide with that of posvirt . 1) |
IDXA | Address of interrupt used as index (zero) pulse in the homing procedure. | 1 | Enter the value X the field is ignored |
HSwA | Address of the digital input used as a home switch in homing procedure. | 3.INP09 | Enter the value X.X field is ignored |
IOutD | Coil address whose operation is determined by the parameter funout . | 3.OUT01 | Enter the value X.X the field is ignored |
IOutA | Address of analog output or pulse output for driving the actuator (check the product hardware documentation to set the right value). | 3.AN01 or 3.PULSE01 | Enter the value X.X field is ignored |
All fields of the declaration are mandatory and must be present on the same line. Set “X.X” or “X” if a resource is not available or is not used. Disabling a resource means disable all the functionality of the devices that use it. |
---|
3. Operation
3.1 Factors
The block “Factors” calculates the conversion factors of position and velocity.
The “position factor” (PF) is a coefficient for converting the position expressed by the unit of measurement of the transducer unit of measurement of the position (Um), and vice versa. Typically the unit of measurement of the position may be for example meters rather than millimeters rather than cents, while the unit of measurement of the transducer, the encoder is always pulses. The parameters that contribute to the calculation of the position factor are pulse and measure and is calculated as the ratio between these two.
The “velocity factor” (VF) is a coefficient for converting the speed expressed in the unit of measurement of the transducer unit of measurement of speed (Uv), and vice versa. Typically the unit of measurement of speed can be for example mt / min (meters per minute) rather than RPM (revolutions per minute), rather than mm / s (millimeters per second). Obviously, compared to the position factor, in the calculation of the VF also the unit of time and the position of the decimal point.
3.2 Trajectory generator
The block “Trajectory generator” generates the trajectory of positioning in respect of speed and acceleration set.
3.3 Closed loop position control
The block “closed loop position control” is composed mainly of the PID controller with the function of the integral windup and action antireset Feed forward. Also updates with the output value of the device IOutA implementation.
3.4 Following error control
The block “Following error control” set or clear the st_foller status depending on whether the difference between the commanded position ( posvirt ) and the current position ( posit ) in absolute value exceeds the programmed threshold ( follerrthresh ). It also update the values of mxnegfoller and mxposfoller which are the maximum values, positive and negative, achieved by the error tracking.
3.5 Homing sequence controller
The block “Homing sequence controller” manages the search mode of the “home position” as defined by the prsmode . These search modes provide the loading of the home position via the input home switch or via the input index (zero). The block “Homing sequence controller” interacts with the “Trajectory generator” to execute the sequence of movements of the axis provided for each search mode.
3.5.1 Description of the input data
It is possibleto specify the speed and manner of research. Also it is possible to establish an offset to make the zero coincides with the coordinate system desired. There are two speeds; On a typical sequence of a rapid speed search ( prsvel ) is used to search for the activation of the home switch, while a slow ( sprsvel ) is used to search the 'input index (zero).
It is possible to indicate whether the home switch input must be held active with logic level zero ( prsswlogic = 0 ) or with logic level one ( prsswlogic = 1 ).
It is possible to instruct if the search mode must be carried forward ( prsdir = 0 ) or back ( prsdir = 1 ).
The search mode is defined by the parameter prsmode described below.
In the following images, the speed of movement is represented as follows:
3.5.2 Description of the output data
The state st_prson Indicates that the search procedure is active. The state st_prsok indicates that the search procedure has been completed successfully. The deltaprspos is updated at each end of the search and indicates to what has been corrected the position of the axis.