Difference between revisions of "Program Examples:Setting Up an Axis"
(Created page with "The following example demonstrate how to setup an axis. It will configure basic setup of a rotary axis, with 32000 encoder counts per degree with velocity in deg/sec and accle...") |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages|Program_Examples:Setting_Up_an_Axis}} | ||
The following example demonstrate how to setup an axis. It will configure basic setup of a rotary axis, with 32000 encoder counts per degree with velocity in deg/sec and accleration in deg/sec<sup>2</sup>. | The following example demonstrate how to setup an axis. It will configure basic setup of a rotary axis, with 32000 encoder counts per degree with velocity in deg/sec and accleration in deg/sec<sup>2</sup>. | ||
Position of this axis will be limited in the range of -1000 to +1000 degrees. | Position of this axis will be limited in the range of -1000 to +1000 degrees. | ||
− | < | + | <syntaxhighlight lang="vb"> |
common shared pos_unit as long = 32000 | common shared pos_unit as long = 32000 | ||
Program | Program | ||
− | |||
Call SetRotAxis(A1,-1000,1000) | Call SetRotAxis(A1,-1000,1000) | ||
End Program | End Program | ||
+ | |||
sub SetRotAxis(ax as generic axis, byval minval as double , byval maxval as double) | sub SetRotAxis(ax as generic axis, byval minval as double , byval maxval as double) | ||
with ax | with ax | ||
Line 41: | Line 42: | ||
− | </ | + | </syntaxhighlight> |
Latest revision as of 06:02, 17 July 2017
Language: | English • 中文(简体) |
---|
The following example demonstrate how to setup an axis. It will configure basic setup of a rotary axis, with 32000 encoder counts per degree with velocity in deg/sec and accleration in deg/sec2. Position of this axis will be limited in the range of -1000 to +1000 degrees.
common shared pos_unit as long = 32000
Program
Call SetRotAxis(A1,-1000,1000)
End Program
sub SetRotAxis(ax as generic axis, byval minval as double , byval maxval as double)
with ax
attach
En = 0
AxisType = 1
PositionFactor = pos_unit/360
VelocityFactor = PositionFactor /1000
AccelerationFactor = VelocityFactor /1000
Jerkfactor = AccelerationFactor /1000
VelocityMax = 1000
AccelerationMax = 10000
DecelerationMax= 10000
JerkMax = 20*amax
VelocityCruise = 0.5*VelocityMax
Acceleration = AccelerationMax
Deceleration = DecelerationMax
Jerk = JerkMax
PrfType = -1
Smooth = -1
VelocityOverspeed = 1.2*VelocityMax
VelocitySafetyLimit = 10*VelocityMax
PositionErrorDelay = 2
PositionErrorMax = 1
PositionMax = maxval
PositionMin = minval
PositionMaxEn = 1
PositionMinEn = 1
PositionRolloverEnable = 0
detach
end with
end sub