The slave axis is essentially handled by 4 successive steps (see stru_follow for keyword description):
•M_POSITIONING: the slave axis moves to the qParkSlave position, using the velocity parameters velMaxSlave and acceleration accMaxSlave.
•M_WAITING: the axis stands still. The right moment to start tracking is computed.Conditions allowing successful tracking are evaluated (master direction and speed, qSyncMaster position compared to the master current position, qsyncSlave position compared to the current slave position). If the slave acceleration is not sufficient the code M_LOW_ACCELERATION is issued.
•M_FOLLOWING: the axis moves in the direction specified by the slaveDirection parameter, performing a constant acceleration motion calculated to achieve the master axis speed at the slave quota qSyncSlave and the master quota qSyncMaster. Tracking also considers any changes in master speed during the cycle.
•M_REACHED: the slave axis keeps tracking with the master, based on its current speed, until the slave quota qSyncOut has been reached or exceeded. At this point, the unit qSyncMaster is incremented by masterCycle and units qPark, qSyncSlave, qSyncOut are incremented by slaveCycle, to prepare for the next cycle. The phase variable is set to M_POSITIONING and the cycle starts again.
The kSlaveMaster parameter results very useful in those cases where the unit of measurement of the slave axis is different from that of the master axis (typical case a master expressed in mm and a slave in degrees). By specifying the K factor existing between the two axes, it is possible to perform tracking as if the units were homogeneous with each other.
If cyclic tracking with monodirectional axes is desired (e.g., master conveyor, slave two-blade cutting jaw), a step value for both axes must be specified (in the example, MasterCycle = product length, SlaveCycle = 180 degrees). These values are used by the function to automatically increment the synchronism (master and slave), end tracking quota, and wait quota. The increments all occur at the same time when the synchronism phase is exited.
If, on the other hand, the slave axis has reciprocating motion (e.g., no-end screw cutting axis), SlaveCycle = 0 must be specified for it. In this way, at the end of the cycle, the slave axis returns to the qPark position (which is the same for all cycles) while the next synchronism on the master axis(qSyncMaster) is incremented.
If "one shot" tracking is desired, that is, without automatic repetition, simply specify MasterCycle = 0. This way, once the first tracking cycle is finished, the conditions for starting with a new cycle do not reoccur until the user directly enters an updated qSyncMaster value.
The first time the function is called, it is necessary to have previously loaded a set of appropriate values into the stru_follow structure. The status parameter must also have been initialized to M_POSITIONING (initial positioning). This parameter can be usefully consulted by the R3 application software during the course of the cycle. It is the responsibility of the application software to ensure that when the function is called, the tables contain consistent data.
|