Program Examples:Setting Up an Axis/zh-hans

From SoftMC-Wiki
Jump to: navigation, search
语言: English  • 中文(简体)‎

以下示例演示如何设置轴。它将配置旋转轴的基本设置,每度32000个编码器计数,速度以deg / sec为单位,加速度以deg / sec2表示。 该轴的位置将限制在-1000至+1000度的范围内。

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