1.关键数据结构
public enum AxisOperationType {
Enable, Disable, SetAsZero, Home,
Forward, Backward, Abort,
StopFreeRun, ConfirmFault, None
}
public struct AxisOpParam {
public AxisOperationType OperationType;
public bool IsMultiAxis; // 区分单/多轴操作
// ...
}
public struct AxisStatus {
// 使用Flags枚举组合状态
[Flags]
public enum StatusFlags {
PowerOn = 1 << 0,
Moving = 1 << 1,
InPosition = 1 << 2,
Homed = 1 << 3,
PosLimitHit = 1 << 4,
NegLimitHit = 1 << 5,
Faulted = 1 << 6
}
public StatusFlags Flags;
public Vector3 Position;
public AxisConfigParam Config;
public AxisMotionParam Motion;
}
2. 运动控制逻辑
(1) 运动参数校验
public bool ValidateMotionComman

最低0.47元/天 解锁文章
1578

被折叠的 条评论
为什么被折叠?



