ADLINK AMP-208C User Manual
Page 109
![background image](/manuals/733461/109/background.png)
Motion Control Theory
95
AMP-204C / AMP-208C
• Example 1:
Set up parameters and start up velocity movement. See below
for example process:
1. Change maximum speed after 2 seconds
2. Change maximum speed after 2 seconds
3. Stop by deceleration after 2 seconds
#include
"APS168.h"
#include
"APS_define.h"
#include
"ErrorCodeDef.h"
void
velocity_move_example()
{
I32 axis_id =
0
;
F64 speed_1 =
500.0
;
F64 speed_2 =
1000.0
;
F64 speed_3 =
600.0
;
APS_set_axis_param_f( axis_id, PRA_STP_DEC,
10000.0
);
APS_set_axis_param_f( axis_id, PRA_CURVE,
0.5
);
//Set acceleration rate
APS_set_axis_param_f( axis_id, PRA_ACC,
10000.0
);
//Set acceleration rate
APS_set_axis_param_f( axis_id, PRA_DEC,
10000.0
);
//Set deceleration rate
APS_vel( axis_id,
0
, speed_1,
0
);
// Start a velocity move
Sleep(
2000
);
// Wait 2 second
APS_vel( axis_id,
0
, speed_2,
0
);
// Change speed on the fly
Sleep(
2000
);
// Wait 2 second
APS_vel( axis_id,
0
, speed_3,
0
);
// Change speed on the fly
Sleep(
2000
);
// Wait 2 second
APS_stop_move( axis_id );
// Stop
}