This is a four axis gantry palletizer. I am blending xyz axis. After picking up the boxes it goes up(z), then horiz (x,y),
then down to pos abs 298,200 counts on z, then a tuck move of 9940 counts in x, y, and z. On the first layer of the pallet, it is not waiting for z down to nearly complete before the tuck move starts. In other words the tuck move starts about 12" before it should, however it does finish the move. On the rest of the layers it works fine. The only thing different on the first layer is a larger Z pos abs move, as it repeats the pattern on the other layers.
The encoders are scaled (in cnts/inch) X= 3175, Y= -3175, Z= -4970
gnRet = flex_flush_rdb(gnBrdID)
'Reset bit 15 (user status bit 3) in the Motion complete status
register which shows that the program has completed
mustOn = 0
mustOff = &H80
status = flex_set_status_momo(gnBrdID, mustOn, mustOff)
gnRet = flex_begin_store(gnBrdID, 1)
gnRet = flex_config_vect_spc(gnBrdID, &H11, 1, 2, 3)
gnRet = flex_set_op_mode(gnBrdID, &H11, 0) '0=PosAbs
gnRet = flex_load_accel(gnBrdID, &H11, Acl&, &HFF)
gnRet = flex_load_decel(gnBrdID, &H11, Acl&, &HFF)
gnRet = flex_load_vel(gnBrdID, &H11, Spd&, &HFF)
gnRet = flex_load_blend_fact(gnBrdID, &H11, -1, &HFF) '-1=immediate
PlaceXYZ:
Call ZCruisePosition(Zpos&) 'get the ZPosition (varies by the layer)
Zpos& = Zpos& * glCpi&(3)
'Go up to ZCruisePosition (keep X and Y stationary, move Z)
mustOn = 2: mustOff = 0: timeout = 3000 'timeout of 30 seconds
gnRet = flex_wait_on_condition(gnBrdID, &H10, 0, 15, mustOn, mustOff, 0, timeout, 0)
gnRet = flex_load_vs_pos(gnBrdID, &H11, glEncoder&(1), glEncoder&(2), Zpos&, &HFF)
gnRet = flex_start(gnBrdID, &H11, 2) 'start VS1
'Go horiz over Place (move X and Y, keep Z stationary)
gnRet = flex_wait_on_condition(gnBrdID, &H10, 0, 15, mustOn, mustOff, 0, timeout, 0)
gnRet = flex_load_vs_pos(gnBrdID, &H11, glPlc&(1), glPlc&(2), Zpos&, &HFF)
gnRet = flex_blend(gnBrdID, &H11, 2)
'Go down to Place (keep X and Y stationary, move Z)
gnRet = flex_wait_on_condition(gnBrdID, &H10, 0, 15, mustOn, mustOff, 0, timeout, 0)
gnRet = flex_load_vs_pos(gnBrdID, &H11, glPlc&(1), glPlc&(2), glPlc&(3), &HFF)
gnRet = flex_blend(gnBrdID, &H11, 2)
'Do the 2" tuck (move X, Y and Z 2")
gnRet = flex_wait_on_condition(gnBrdID, &H10, 0, 15, mustOn, mustOff, 0, timeout, 0)
gnRet = flex_load_vs_pos(gnBrdID, &H11, glDt&(1), glDt&(2), glDt&(3), &HFF)
gnRet = flex_blend(gnBrdID, &H11, 2)
'Set bit 15 (status bit 3) in the Motion complete status register
'which shows that the program has completed
mustOn = &H80
mustOff = 0
gnRet = flex_set_status_momo(gnBrdID, mustOn, mustOff)
gnRet = flex_end_store(gnBrdID, 1)
gnRet = flex_run_prog(gnBrdID, 1)