Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Not blending in the right spot

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)
0 Kudos
Message 1 of 2
(3,201 Views)
A possible problem you may be gettings is in the wait for blend complete status. When you configured your blend factor for the moves, the mode you set it to was immediate. This bvasically sends the blend complete signal at the moment when the constant velocity section of your move is done, just before the deceleration section starts. For this reaso it might be possible that the wait on condition is returning before you expected and completing its move. Something you can try is to set the value of the blend factor to a higher number, this basically allows the blend to happen a certain number of milliseconds after the deceleration section starts and thus will return the blend complete status later.
Message 2 of 2
(3,201 Views)