Coordinated Motion and Single axis motion
Posted: Wed Nov 11, 2020 2:17 am
I am having trouble going between Coordinatied Motion and Single axis motion. It seems I am not setting Accel and Decel with results.
I have listed the code I used in DYN_AxisGroup.cs to init(...).
I have changed the following with no effect:
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelX = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelY = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelZ = 600;
and
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelX = axes[0].MaxVel;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelY = axes[1].MaxVel;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelZ = axes[2].MaxVel;
Thank you,
David Taylor
//******************************************************************************************************************
public void Init(List<AxisNodeContainer> axes, int devicenumber, string name,
double vvel, double vacc, double vdec, double v_Jerk)
{
axisNum = 0;
foreach (AxisNodeContainer axis in _Axes)
{
if (axis.Node.Inverted)
invert = -1D;
else
invert = 1D;
_CPU[axisNum] = axis.Node.CountsPerUnit * invert;
_AxisNums[axisNum] = axis.Node.AxisData.NodeId;
_MaxAccel[axisNum] = axis.Node.MaxAccel;
_MaxDecel[axisNum] = axis.Node.MaxDecel;
_MaxJerk[axisNum] = axis.Node.JerkPercentage;
axisNum++;
}
_AccelCounts = AxisUtil.AccelToCounts(_MaxAccel, _CPU);
_DecelCounts = AxisUtil.AccelToCounts(_MaxDecel, _CPU);
_Jerk = _MaxJerk;
_VectorVelocity = vvel;
_VectorAccel = vacc;
_VectorDecel = vdec;
_VectorJerk = v_Jerk;
var axislist = from a in _Axes select a.GetDevice() as KM_Axis;
_AxisGroupObject = new KM_AxisGroup(DYN_Controller.Instance.Controller, axislist.ToArray());
DYN_Controller.Instance.Controller.CoordMotion.Abort();
DYN_Controller.Instance.Controller.CoordMotion.ClearAbort();
DYN_Controller.Instance.Controller.WriteLine(String.Format("DefineCS = {0} {1} {2} {3} {4} {5}", 0, 1, 2, -1, -1, -1));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 0));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 1));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 2));
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.BreakAngle = 30;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusA = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusB = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusC = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelX = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelY = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelZ = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelA = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelB = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelC = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelA = 100;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelB = 100;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelC = 100;
....
I have listed the code I used in DYN_AxisGroup.cs to init(...).
I have changed the following with no effect:
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelX = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelY = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelZ = 600;
and
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelX = axes[0].MaxVel;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelY = axes[1].MaxVel;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelZ = axes[2].MaxVel;
Thank you,
David Taylor
//******************************************************************************************************************
public void Init(List<AxisNodeContainer> axes, int devicenumber, string name,
double vvel, double vacc, double vdec, double v_Jerk)
{
axisNum = 0;
foreach (AxisNodeContainer axis in _Axes)
{
if (axis.Node.Inverted)
invert = -1D;
else
invert = 1D;
_CPU[axisNum] = axis.Node.CountsPerUnit * invert;
_AxisNums[axisNum] = axis.Node.AxisData.NodeId;
_MaxAccel[axisNum] = axis.Node.MaxAccel;
_MaxDecel[axisNum] = axis.Node.MaxDecel;
_MaxJerk[axisNum] = axis.Node.JerkPercentage;
axisNum++;
}
_AccelCounts = AxisUtil.AccelToCounts(_MaxAccel, _CPU);
_DecelCounts = AxisUtil.AccelToCounts(_MaxDecel, _CPU);
_Jerk = _MaxJerk;
_VectorVelocity = vvel;
_VectorAccel = vacc;
_VectorDecel = vdec;
_VectorJerk = v_Jerk;
var axislist = from a in _Axes select a.GetDevice() as KM_Axis;
_AxisGroupObject = new KM_AxisGroup(DYN_Controller.Instance.Controller, axislist.ToArray());
DYN_Controller.Instance.Controller.CoordMotion.Abort();
DYN_Controller.Instance.Controller.CoordMotion.ClearAbort();
DYN_Controller.Instance.Controller.WriteLine(String.Format("DefineCS = {0} {1} {2} {3} {4} {5}", 0, 1, 2, -1, -1, -1));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 0));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 1));
DYN_Controller.Instance.Controller.WriteLine(String.Format("EnableAxis{0}", 2));
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.BreakAngle = 30;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusA = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusB = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.RadiusC = 5;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelX = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelY = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelZ = 600;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelA = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelB = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxAccelC = 3000;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelA = 100;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelB = 100;
DYN_Controller.Instance.Controller.CoordMotion.MotionParams.MaxVelC = 100;
....