#0010:三轴根据输入轨迹点做插补运动

This commit is contained in:
zhengxuan.zhang
2024-08-08 17:47:35 +08:00
parent 3211cdbb13
commit d4f1ec2cf9
7 changed files with 695 additions and 240 deletions
+30
View File
@@ -2424,6 +2424,8 @@ HSI_STATUS HSI_Motion::StopJog()
g_pLogger->SendAndFlushWithTime(L"[StopJog] ACS acsc_HaltM error!\n");
ErrorsHandler();
}
//
g_pLogger->SendAndFlushWithTime(L"[StopJog] ACS acsc_HaltM success!\n");
}
m_Thread_StateJOGStop = HSI_THREAD_PAUSED;
@@ -5503,6 +5505,34 @@ HSI_STATUS HSI_Motion::DCCPPStartPoint(double* startPoint)
return rStatus;
}
//===========================================================================
/*
*
* @param AxisTypes XYZ
* @param speed
* @param points
* @param numPoints
*/
HSI_STATUS HSI_Motion::DCCScanSetDataWithPoints(UINT AxisTypes, double speed, Point3D* points, UINT numPoints)
{
auto rStatus = HSI_STATUS_NORMAL;
// 处理传入的三维坐标点数组
for (UINT i = 0; i < numPoints; ++i)
{
Point3D point = points[i];
// 在这里处理每个点,例如打印或存储
printf("Point %u: x = %f, y = %f, z = %f\n", i, point.x, point.y, point.z);
}
// 控制平台的运动,(安全限位的问题,导入100个点,判断是否在运动空间内)
// 其他处理逻辑
// ...
return rStatus;
}
//===========================================================================
HSI_STATUS HSI_Motion::DCCScanSetDataOld(UINT AxisTypes, HSI_SCAN_MOTION_TYPE eType, UINT lTrigNumber, double* dTrigDis)
{
+16 -26
View File
@@ -139,6 +139,12 @@ using TCPIP_RETURN_CODE = enum
TCPIP_CONNECT_STATUS_UNKNOWN
};
struct Point3D {
double x;
double y;
double z;
};
class HSI_Motion : public HSI
{
public:
@@ -307,41 +313,25 @@ public:
HSI_STATUS SetPositionStep(UINT AxisTypes, double Position, HSI_MOTION_MOVE_TYPE eType, double dSpeedGear);
HSI_STATUS SetPositionEx(UINT AxisTypes, double Position, HSI_MOTION_MOVE_TYPE eType, double dSpeedGear);
HSI_STATUS GetSpeedEx(UINT AxisTypes, double& Speed);
/**
* \brief 设置单轴运动速度
* \param AxisTypes
* \param Speed
* \return
*/
HSI_STATUS SetSpeedEx(UINT AxisTypes, double Speed);
HSI_STATUS SetSpeedEx(UINT AxisTypes, double Speed);//设置单轴运动速度
HSI_STATUS SetSpeedExOld(UINT AxisTypes, double Speed);
HSI_STATUS GetAccelerationEx(UINT AxisTypes, double& Accel);
HSI_STATUS SetAccelerationEx(UINT AxisTypes, double Accel);
HSI_STATUS SetTriggerLight(int triggleNum, int delayLighting, int delayLightBefor, int triggleMode,
double* Intensities);
HSI_STATUS DCCPPStartPoint(double* startPoint);
/**
* \brief 下发触发间距
* \param AxisTypes 轴
* \param eType 等间距或者等时间
* \param lTrigNumber 触发数量
* \param dTrigDis 间距
* \return
*/
HSI_STATUS DCCScanSetData(UINT AxisTypes, HSI_SCAN_MOTION_TYPE eType, UINT lTrigNumber, double* dTrigDis);
HSI_STATUS DCCScanSetData(UINT AxisTypes, HSI_SCAN_MOTION_TYPE eType, UINT lTrigNumber, double* dTrigDis);// 下发触发间距,轴、等间距或者等时间、触发数量、间距
HSI_STATUS DCCScanSetDataOld(UINT AxisTypes, HSI_SCAN_MOTION_TYPE eType, UINT lTrigNumber, double* dTrigDis);
/**
* \brief 开始扫描
* \return
*/
HSI_STATUS DCCScanStart();
HSI_STATUS DCCScanStart(); //开始扫描
HSI_STATUS DCCScanStartOld();
/**
* \brief 停止扫描
* \return
*/
HSI_STATUS DCCScanStop();
HSI_STATUS DCCScanStop(); //停止扫描
HSI_STATUS DCCScanStopOld();
HSI_STATUS DCCScanSetDataWithPoints(UINT AxisTypes, double speed, Point3D* points, UINT numPoints); // 直线电机平台新增,三轴轨迹规划
HSI_STATUS DCCForLightPlate();
HSI_STATUS IOStep(bool RunSts);
+2 -2
View File
@@ -12,5 +12,5 @@
#define HSI_VERSION_REVNUM
#define HSI_VERSION_BUILD_DATE _T(__DATE__ )
#define HSI_VERSION_BUILD_TIME _T(__TIME__ )
#define HSI_FILE_DESCRIPTION "周 2.24.07 / 10:59 "
#define HSI_FILE_CSDESCRIPTION _T("周 2.24.07 / 10:59 ")
#define HSI_FILE_DESCRIPTION "周 2.24.08 / 13:09 "
#define HSI_FILE_CSDESCRIPTION _T("周 2.24.08 / 13:09 ")
+110 -4
View File
@@ -171,7 +171,14 @@
this.btnEventMotionEnd = new System.Windows.Forms.Button();
this.rtxtTerminal = new System.Windows.Forms.RichTextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.button17 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.button15 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.btnSend = new System.Windows.Forms.Button();
this.button11 = new System.Windows.Forms.Button();
this.txtCommand = new System.Windows.Forms.TextBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
@@ -210,6 +217,7 @@
this.checkBox4 = new System.Windows.Forms.CheckBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.button18 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.grpMotionTest.SuspendLayout();
this.grpMst.SuspendLayout();
@@ -261,7 +269,7 @@
this.txtIP.Name = "txtIP";
this.txtIP.Size = new System.Drawing.Size(91, 21);
this.txtIP.TabIndex = 16;
this.txtIP.Text = "10.0.0.100";
this.txtIP.Text = "100.0.0.100";
//
// btnClose
//
@@ -1672,16 +1680,84 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.button18);
this.groupBox4.Controls.Add(this.button17);
this.groupBox4.Controls.Add(this.button16);
this.groupBox4.Controls.Add(this.button15);
this.groupBox4.Controls.Add(this.button14);
this.groupBox4.Controls.Add(this.button13);
this.groupBox4.Controls.Add(this.button12);
this.groupBox4.Controls.Add(this.btnSend);
this.groupBox4.Controls.Add(this.button11);
this.groupBox4.Controls.Add(this.txtCommand);
this.groupBox4.Controls.Add(this.rtxtTerminal);
this.groupBox4.Location = new System.Drawing.Point(11, 493);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(892, 220);
this.groupBox4.Size = new System.Drawing.Size(892, 256);
this.groupBox4.TabIndex = 7;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "命令行通讯";
//
// button17
//
this.button17.Location = new System.Drawing.Point(527, 218);
this.button17.Name = "button17";
this.button17.Size = new System.Drawing.Size(85, 30);
this.button17.TabIndex = 14;
this.button17.Text = "MoveM";
this.button17.UseVisualStyleBackColor = true;
this.button17.Click += new System.EventHandler(this.button17_Click);
//
// button16
//
this.button16.Location = new System.Drawing.Point(291, 218);
this.button16.Name = "button16";
this.button16.Size = new System.Drawing.Size(85, 30);
this.button16.TabIndex = 13;
this.button16.Text = "BlendedLine";
this.button16.UseVisualStyleBackColor = true;
this.button16.Click += new System.EventHandler(this.button16_Click);
//
// button15
//
this.button15.Location = new System.Drawing.Point(196, 218);
this.button15.Name = "button15";
this.button15.Size = new System.Drawing.Size(85, 30);
this.button15.TabIndex = 12;
this.button15.Text = "ExtLine";
this.button15.UseVisualStyleBackColor = true;
this.button15.Click += new System.EventHandler(this.button15_Click);
//
// button14
//
this.button14.Location = new System.Drawing.Point(98, 218);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(85, 30);
this.button14.TabIndex = 11;
this.button14.Text = "SegmentLine";
this.button14.UseVisualStyleBackColor = true;
this.button14.Click += new System.EventHandler(this.button14_Click);
//
// button13
//
this.button13.Location = new System.Drawing.Point(759, 218);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(85, 30);
this.button13.TabIndex = 10;
this.button13.Text = "AddPVTPointM";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
//
// button12
//
this.button12.Location = new System.Drawing.Point(628, 218);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(85, 30);
this.button12.TabIndex = 9;
this.button12.Text = "SplineM";
this.button12.UseVisualStyleBackColor = true;
this.button12.Click += new System.EventHandler(this.button12_Click);
//
// btnSend
//
this.btnSend.Location = new System.Drawing.Point(784, 20);
@@ -1692,6 +1768,16 @@
this.btnSend.UseVisualStyleBackColor = true;
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
//
// button11
//
this.button11.Location = new System.Drawing.Point(9, 218);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(85, 30);
this.button11.TabIndex = 8;
this.button11.Text = "MultiPointM";
this.button11.UseVisualStyleBackColor = true;
this.button11.Click += new System.EventHandler(this.button11_Click);
//
// txtCommand
//
this.txtCommand.Location = new System.Drawing.Point(9, 20);
@@ -1984,6 +2070,7 @@
this.button1.TabIndex = 0;
this.button1.Text = "开始";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox10
//
@@ -1996,7 +2083,7 @@
this.groupBox10.Controls.Add(this.checkBox2);
this.groupBox10.Location = new System.Drawing.Point(919, 610);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(295, 103);
this.groupBox10.Size = new System.Drawing.Size(295, 139);
this.groupBox10.TabIndex = 9;
this.groupBox10.TabStop = false;
this.groupBox10.Text = "XYZ循环";
@@ -2066,10 +2153,20 @@
this.checkBox2.Text = "X";
this.checkBox2.UseVisualStyleBackColor = true;
//
// button18
//
this.button18.Location = new System.Drawing.Point(400, 215);
this.button18.Name = "button18";
this.button18.Size = new System.Drawing.Size(85, 30);
this.button18.TabIndex = 15;
this.button18.Text = "记录";
this.button18.UseVisualStyleBackColor = true;
this.button18.Click += new System.EventHandler(this.button18_Click);
//
// MainForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1226, 725);
this.ClientSize = new System.Drawing.Size(1226, 761);
this.Controls.Add(this.groupBox10);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
@@ -2080,6 +2177,7 @@
this.Controls.Add(this.grpMotionTest);
this.Controls.Add(this.groupBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(1242, 800);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "以色列ACS 运动控制器";
@@ -2302,6 +2400,14 @@
private System.Windows.Forms.Label label50;
private System.Windows.Forms.Label label49;
private System.Windows.Forms.Label label47;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button16;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.Button button18;
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.