User guide
運動控制功能原理介紹 109
PCI-8254 / PCI-8258
• 例 :
13h (19) PRA_HOME_ACC
Homing 加減速率設定
15h (21) PRA_HOME_VM
Homing 最大速率
17h (23) PRA_HOME_SHIFT
Home 位置和定位訊號的偏移距離
18h (24) PRA_HOME_EZA EZ alignment enable
19h (25) PRA_HOME_VO
Homing 離開 ORG 訊號的速率
1Bh (27) PRA_HOME_POS
Homing 完成後位置命令設定
Param. No. Define symbol Description
#include "APS168.h"
#include "APS_define.h"
#include "ErrorCodeDef.h"
void home_move_example()
{
//This example shows how home move operates
I32 axis_id = 0;
I32 return_code;
I32 msts;
// 1. Select home mode and config home parameters
APS_set_axis_param( axis_id, PRA_HOME_MODE, 0 ); //Set home mode
APS_set_axis_param( axis_id, PRA_HOME_DIR, 1 ); //Set home direction
APS_set_axis_param( axis_id, PRA_HOME_CURVE, 0 );
//
Set acceleration pattern (T-curve)
APS_set_axis_param( axis_id, PRA_HOME_ACC, 1000000 ); // Set homing acceleration rate
APS_set_axis_param( axis_id, PRA_HOME_VM, 100000 ); // Set homing maximum velocity.
APS_set_axis_param( axis_id, PRA_HOME_VO, 50000 ); // Set homing
APS_set_axis_param( axis_id, PRA_HOME_EZA, 0 ); // Set homing
APS_set_axis_param( axis_id, PRA_HOME_SHIFT, 0 ); // Set homing
APS_set_axis_param( axis_id, PRA_HOME_POS, 0 ); // Set homing
preliminary