Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Blending movements with diferent blend factors

I want to perform a series of XY moves but with diferent blend factor between some target positions but I'm not sure about the correct order of functions calls using FlexMotion API.
In the following example:
- all target positions are in a vector space with same velocity, acceleration/deceleration and same direction of movement;
- when motion completes at target position 2 I want a dwell time of 1ms before starting motion of target position 3;
- all other movements should be blended with a blend factor of -1.

flex_load_blend_fact(-1);
flex_load_vs_pos(X1, Y1);
flex_blend();
flex_wait_for_blend_complete();

flex_load_blend_fact(1);
flex_load_vs_pos(X2, Y2);
flex_blend();
flex_wait_for_blend_complete();

fl
ex_load_blend_fact(-1);
flex_load_vs_pos(X3, Y3);
flex_blend();
flex_wait_for_blend_complete();

Are this sequence of functions calls (in particular flex_load_blend_fact) correct ?

Thanks !
0 Kudos
Message 1 of 2
(3,367 Views)
Tulio,

The way you present your code is correct. When blending, the order of functions should start with the parameters being set (e.g. Blend Factor, Target Position, etc.), then you will start the motion (e.g. Blend). For sequencing multiple moves with blends, FlexMotion must complete one blend before parameters for the next move are loaded. So by calling Wait For Blend Complete you are satisfying this requirement. After the Blend is complete upload any new parameters and call Blend.

I don't see any mistake with the code you present here, it should work properly. Good luck!

Best Regards,

Nestor S.
IMAQ/Motion Support
National Instruments
Nestor
0 Kudos
Message 2 of 2
(3,367 Views)