-
2020-07-02 02:59:17
#region JOG运动 /// <summary> /// JOG运动 /// </summary> /// <param name="axis">轴号</param> /// <param name="acc">加速度</param> /// <param name="dec">减速度</param> /// <param name="vel">目标速度 pulse/ms</param> /// <param name="smooth">平滑系数 0-1</param> public void JOGMovement(short axis, double acc, double dec, double vel = 50, double smooth = 0.9) { TJogPrm pPrm; //清除轴的报警和限位 GT_ClrSts(_cardNum, axis, 1); //伺服使能 GT_AxisOn(_cardNum, axis); //设置jog运动 GT_PrfJog(_cardNum, axis); GT_GetJogPrm(_cardNum, axis, out pPrm); pPrm.acc = acc;//加速度 pPrm.dec = dec;//减速度 pPrm.smooth = smooth;//平滑 GT_SetJogPrm(_cardNum, axis, ref pPrm); GT_SetVel(_cardNum, axis, vel); GT_Update(_cardNum, (1 << (axis - 1))); } #endregion
更多相关内容 -
固高运动卡的使用 <3> 运动之Jog运动
2019-10-01 16:12:59Jog运动是机器运动中的一种运动模式,它具备操作简单、独立性、没有目的性,常常被用于机器的测试和调试。 关于Jog运动的变速过程: 另外在Jog运动模式下,初始目标速度为 100pulse/ms。动态改变目标速度时,当...理论篇:
Jog运动是机器运动中的一种运动模式,它具备操作简单、独立性、没有目的性,常常被用于机器的测试和调试。
关于Jog运动的变速过程:
另外在Jog运动模式下,初始目标速度为 100pulse/ms。动态改变目标速度时,当规划位置超过 100000pulse 时,修改目标速度为 50 pulse/ms
关于脉冲与步进电机之间的关系:
步进电机脉冲频率与输出转速换算关系;
步进电机在整步是,1圈需要200个脉冲,即200Hz时,电机速度1rps,8000Hz时,转40rps。
半步时,1圈需要400个脉冲,即400Hz时,电机转速1rps,8000Hz时,转速20rps,
4细分时,1圈需要800个脉冲,即800Hz时,电机转速1rps,8000Hz时,转速10rps。
由上可知,电机运行速度=控制脉冲频率/(200*细分值)rp。
影响步进电机转速的条件有两个,脉冲频率和延时子程序的延时时间。脉冲频率越高,步进电机转速越快。延时子程序的延时时间越长,步进电机转速越快。
关于电机转动与实际机器轴位移关系:
丝杆转速与丝杆导程:
没有变速器的情况下丝杆转速 = 电机转子转速。
丝杆导程就是丝杆转一 圈螺母行走的直线距离,一般这个系数丝杆说明书上有,比如10mm和15mm等。实战篇:
关于固高运动控制卡的Jog运动:
在构建固高的Jog运动基本上只需要运用以下固高gts提供的方法
操作步骤即是:
1、打开伺服驱动
2、设置轴为Jog模式
3、设置Jog参数(加速度、减速度、平滑系数)
4、设置轴速度
5、启动Jog运动
实战代码篇:
前台样式:
代码:
public partial class Form1 : Form { //控制卡卡号 static short _cardNum = 0; //当前轴 short _axis; //速度 double _vel; //加速度 double _acc; //减速度 double _dec; //平滑系数 double _smooth; //导程 protected double _Pitch = 40; //齿轮比/细分 protected double _Divide = 40000; public Form1() { InitializeComponent(); //启动固高运动控制卡 new GT.GTS_Start(0, Application.StartupPath + "\\GTS800_1.cfg", -1, false, Application.StartupPath + "\\ExtModule.cfg"); } private void Form1_Load(object sender, EventArgs e) { //添加默认值 this.textBox1.Text = "1"; this.textBox2.Text = "5"; this.textBox3.Text = "0.5"; this.textBox4.Text = "0.5"; //smooth 平滑系数范围 [ 0, 1) this.comboBox1.Items.Add("0"); this.comboBox1.Items.Add("0.1"); this.comboBox1.Items.Add("0.2"); this.comboBox1.Items.Add("0.3"); this.comboBox1.Items.Add("0.4"); this.comboBox1.Items.Add("0.5"); this.comboBox1.Items.Add("0.6"); this.comboBox1.Items.Add("0.7"); this.comboBox1.Items.Add("0.8"); this.comboBox1.Items.Add("0.9"); this.comboBox1.Text = "0.9"; //添加but事件 this.button1.Click += button_Click; this.button2.Click += button_Click; this.button3.Click += button_Click; } private void button_Click(object sender, EventArgs e) { string text = (sender as Button).Text; if (text == "stop") { GTS.GT_Stop(_cardNum, (1 << (_axis - 1)), (Convert.ToInt32(false) << (_axis - 1))); return; } //轴号 _axis = short.Parse(this.textBox1.Text); //脉冲速度 _vel = double.Parse(this.textBox2.Text); //加速度 _acc = double.Parse(this.textBox3.Text); //减速度 _dec = double.Parse(this.textBox4.Text); //平滑系数 _smooth = double.Parse(this.comboBox1.Text); if (text == "后退") { _vel = -_vel; } Jog(_axis, _vel, _acc, _dec, _smooth); } //jog运动 public void Jog(short _axis, double _vel, double _acc, double _dec, double _smooth) { //实际速度与脉冲转换 //_vel = VelToPulse(_vel); //_acc = AccToPulse(_acc); //_dec = AccToPulse(_dec); //清除伺服状态 GTS.GT_ClrSts(1, _axis, _axis); //打开使能 GTS.GT_AxisOn(_cardNum, _axis); Thread.Sleep(50);//需要延时等待伺服使能完成 //位置归零 GTS.GT_ZeroPos(_cardNum, _axis, _axis); //设置为jog模式 GTS.GT_PrfJog(_cardNum, _axis); //声明参数参数 GTS.TJogPrm _jogPrm; //获取参数 GTS.GT_GetJogPrm(_cardNum, _axis, out _jogPrm); //设置参数 _jogPrm.acc = _acc; _jogPrm.dec = _dec; _jogPrm.smooth = _smooth; //设置参数 GTS.GT_SetJogPrm(_cardNum, _axis, ref _jogPrm); //设置目标速度,这个速度需要进行齿轮比换算的 GTS.GT_SetVel(_cardNum, _axis, _vel); //开启运动 GTS.GT_Update(_cardNum, (1 << (_axis - 1))); } public long MmToPulse(double mm) {//距离转脉冲 try { return Convert.ToInt64((mm * _Divide) / _Pitch); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message); return 0; } } public double VelToPulse(double vel) { return MmToPulse(vel) * 0.001; //mm/s 转换为pulse/ms } public double AccToPulse(double acc) { return MmToPulse(acc) * 0.000001; //mm/s2 转换为 pulse/ms2 } }
ps:运行所需环境参见:https://blog.csdn.net/weixin_44490080/article/details/101468746
-
Jog运动模式
2019-10-21 15:29:52在 Jog 运动模式下,各轴可以独立设置目标速度、加速度、减速度、平滑系数等运动参数,能 够独立运动或停止。 轴 1 运动在 Jog 模式下,初始目标速度为 100pulse/ms。动态改变目标速度,当规划位置超过 100000...Jog 运动,就是按住按键,电机一直走,弹起按键电机停止
在 Jog 运动模式下,各轴可以独立设置目标速度、加速度、减速度、平滑系数等运动参数,能 够独立运动或停止。
轴 1 运动在 Jog 模式下,初始目标速度为 100pulse/ms。动态改变目标速度,当规划位置超过
100000pulse 时,修改目标速度为 50 pulse/ms
设定平滑系数能够得到平滑的速度曲线,从而使加减速过程更加平稳。平滑系数的取值范围是
[0, 1),越接近 1,加速度变化越平稳。具体逻辑与点位运动一致。
-
固高jog运动和点位运动
2018-07-15 21:23:44if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED) //jog运动 { TJogPrm jog; GT_PrfJog(iAxis); // 读取Jog运动参数 GT_GetJogPrm(iAxis, &jog); jog.acc = 0.3; GT_SetJogPrm(iAxis, &...本文转载连接: http://buaagc.lofter.com/post/1cd54dda_b61e206
BOOL CDlgMove::PreTranslateMessage(MSG* pMsg)
{
CSingleton* pInfo = CSingleton::GetInstance();
if (pMsg->message == WM_KEYDOWN)
{
if (pMsg->wParam == VK_ESCAPE )
return TRUE;
int iAxis = 1;
if (m_bLeft)
iAxis += 2;
if (pMsg->wParam == 'A' && GetKeyState(VK_SHIFT) < 0 && m_bSingle == false) //按下shift和A键
{
m_bSingle = true;
if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED) //jog运动
{
TJogPrm jog;
GT_PrfJog(iAxis); // 读取Jog运动参数
GT_GetJogPrm(iAxis, &jog);
jog.acc = 0.3;
GT_SetJogPrm(iAxis, &jog); // 设置Jog运动参数
if (m_bLeft)
GT_SetVel(iAxis, pInfo->_iVel); // 设置AXIS轴的目标速度
else
GT_SetVel(iAxis, -1*pInfo->_iVel);
GT_Update(1<<(iAxis - 1)); // 启动AXIS轴的运动
}
else
{
TTrapPrm trap;
GT_PrfTrap(iAxis);
GT_GetTrapPrm(iAxis, &trap); // 读取点位运动参数
trap.acc = 0.3;
trap.smoothTime = 25;
GT_SetTrapPrm(iAxis, &trap);
DOUBLE fCurrPos;
GT_GetAxisEncPos(iAxis,&fCurrPos);
CString strMM;
GetDlgItemText(IDC_EDIT_P,strMM);
int iAdd = atof(strMM)*m_fPC;
GT_SetPos(iAxis,(long)(fCurrPos + abs(iAdd)));
GT_SetVel(iAxis, pInfo->_iVel);
GT_Update(1<<(iAxis -1));
}
}
if (pMsg->wParam == 'D' && GetKeyState(VK_SHIFT) < 0 && m_bSingle == false)
{
m_bSingle = true;
if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED) //jog运动
{
TJogPrm jog;
GT_PrfJog(iAxis); // 读取Jog运动参数
GT_GetJogPrm(iAxis, &jog);
jog.acc = 0.3;
GT_SetJogPrm(iAxis, &jog); // 设置Jog运动参数
if (m_bLeft)
GT_SetVel(iAxis, -1*pInfo->_iVel);
else
GT_SetVel(iAxis, pInfo->_iVel); // 设置AXIS轴的目标速度
GT_Update(1<<(iAxis - 1)); // 启动AXIS轴的运动
}
else
{
TTrapPrm trap;
GT_PrfTrap(iAxis);
GT_GetTrapPrm(iAxis, &trap); // 读取点位运动参数
trap.acc = 0.3;
trap.smoothTime = 25;
GT_SetTrapPrm(iAxis, &trap);
DOUBLE fCurrPos;
GT_GetAxisEncPos(iAxis,&fCurrPos);
CString strMM;
GetDlgItemText(IDC_EDIT_P,strMM);
int iAdd = atof(strMM)*m_fPC;
GT_SetPos(iAxis,(long)(fCurrPos - abs(iAdd)));
GT_SetVel(iAxis, pInfo->_iVel);
GT_Update(1<<(iAxis -1));
}
}
if (pMsg->wParam == 'W' && GetKeyState(VK_SHIFT) < 0 && m_bSingle == false)
{
m_bSingle = true;
iAxis++;
if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED) //jog运动
{
TJogPrm jog;
GT_PrfJog(iAxis); // 读取Jog运动参数
GT_GetJogPrm(iAxis, &jog);
jog.acc = 0.3;
GT_SetJogPrm(iAxis, &jog); // 设置Jog运动参数
GT_SetVel(iAxis, pInfo->_iVel); // 设置AXIS轴的目标速度
GT_Update(1<<(iAxis - 1)); // 启动AXIS轴的运动
}
else
{
TTrapPrm trap;
double prfPos;
GT_PrfTrap(iAxis);
GT_GetTrapPrm(iAxis, &trap); // 读取点位运动参数
trap.acc = 0.3;
trap.smoothTime = 25;
GT_SetTrapPrm(iAxis, &trap);
DOUBLE fCurrPos;
GT_GetAxisEncPos(iAxis,&fCurrPos);
CString strMM;
GetDlgItemText(IDC_EDIT_P,strMM);
int iAdd = atof(strMM)*m_fPC;
GT_SetPos(iAxis,(long)(fCurrPos + abs(iAdd)));
GT_SetVel(iAxis, pInfo->_iVel);
GT_Update(1<<(iAxis -1));
}
}
if (pMsg->wParam == 'S' && GetKeyState(VK_SHIFT) < 0 && m_bSingle == false)
{
m_bSingle = true;
iAxis++;
if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED) //jog运动
{
TJogPrm jog;
GT_PrfJog(iAxis); // 读取Jog运动参数
GT_GetJogPrm(iAxis, &jog);
jog.acc = 0.3;
GT_SetJogPrm(iAxis, &jog); // 设置Jog运动参数
GT_SetVel(iAxis, -1*pInfo->_iVel); // 设置AXIS轴的目标速度
GT_Update(1<<(iAxis - 1)); // 启动AXIS轴的运动
}
else
{
TTrapPrm trap;
GT_PrfTrap(iAxis);
GT_GetTrapPrm(iAxis, &trap); // 读取点位运动参数
trap.acc = 0.3;
trap.smoothTime = 25;
GT_SetTrapPrm(iAxis, &trap);
DOUBLE fCurrPos;
GT_GetAxisEncPos(iAxis,&fCurrPos);
CString strMM;
GetDlgItemText(IDC_EDIT_P,strMM);
int iAdd = atof(strMM)*m_fPC;
GT_SetPos(iAxis,(long)(fCurrPos - abs(iAdd)));
GT_SetVel(iAxis, pInfo->_iVel);
GT_Update(1<<(iAxis -1));
}
}
}
if (pMsg->message == WM_KEYUP)
{
if (pMsg->wParam == 'A' || pMsg->wParam == 'D' || pMsg->wParam == 'W' || pMsg->wParam == 'S')
{
m_bSingle = false;
int iAxis = 1;
if (m_bLeft)
iAxis += 2;
if (pMsg->wParam == 'W' || pMsg->wParam == 'S')
iAxis++;
if (((CButton*)GetDlgItem(IDC_RADIO3))->GetCheck() == BST_CHECKED)
{
for (int i = 0;i < 4;i++)
GT_Stop(1<<i,0);
}
}
}
return CDialogEx::PreTranslateMessage(pMsg);
}
-
机器人中的 jog运动
2018-10-19 10:01:25用户在操作工业机器人时经常会见到 jog 这个词,它一般翻译成“点动”[1][1],或者“单步运动”[2][2]。在有些时候,例如示教,用户需要手动控制机器人以时断时续的方式运动,而不是一直连续地运动,这时就需要... -
JOG运动参数设置
2015-06-09 22:34:00一、关于JOG运动的几个变量 Ixx13:电机xx的软件正位置限位 range:−235−235 units:counts default:0 Ixx13设置一个值后,比如为10000,电机转到位置10000的时候,碰到软件限位,开始以Ixx15设置的减速度... -
固高 Jog运动
2020-05-21 09:14:47// 设置Jog运动参数 sRtn = GT_SetVel(1, -m_Vel); // 设置X1轴的目标速度 sRtn = GT_Update(1(1-1)); // 启动X1轴的运动 break; } } } (14)双击“正向”按钮,添加代码如下: void CGTJogTestDlg::... -
JOG是什么运动方式
2021-02-25 22:40:121、在电机控制中,JOG模式是什么意思----https://zhidao.baidu.com/question/244473101.html 2、JOG设置-伺服控制器操作----https://jingyan.baidu.com/article/215817f78ed0c01eda1423d2.html 3、JOG无目标控制... -
固高运动控制卡学习1--运动模式介绍(1)--点位,Gear,Jog,插补
2018-05-08 11:34:48运动控制器支持的运动模式有点位运动模式、 Jog运动模式、电子齿轮(即 Gear) 运动模式和插补运动模式 GT_PrfTrap 设置指定轴为点位模式GT_PrfJog 设置指定轴为 Jog 模式GT_PrfGear 设置指定轴为电子齿轮模式GT_... -
c#winform开发运动控制卡实例
2014-12-04 16:48:27C#,MOTION CARD,ACCESS等应用实例 -
运动控制卡编程
2012-11-03 09:46:57运动控制卡编程源代码 -
运动控制功能块MC_Jog.scl
2021-09-15 21:04:54基于博图编写MC_JOG功能块源码 -
机器人中的 jog 是什么意思?
2017-03-23 11:17:06用户在操作机器人时经常见到 jog 这个词,它一般翻译成“点动”[1]^{[1]},或者“单步运动”[2]^{[2]}。在有些时候(例如示教或者标定),用户需要控制机器人以时断时续的方式运动,而不是一直连续的运动。这时,... -
三菱Q系列PLC简单的实现使用伺服连续定位JOG.gxw
2020-01-10 16:35:11三菱PLC定位模块JOG运行,版主新手哈,有其他问题欢迎私信我讨论 三菱PLC定位模块JOG运行,版主新手哈,有其他问题欢迎私信我讨论 -
ACS运动控制卡
2019-07-11 14:36:39ACS是一款以色列的运动控制卡,控制直线电机,运动精度到u级别。常用在工业领域。 1.使用: 运动控制卡的流程一般是先连接,其次轴回零,最后轴运动。各种不同类型的控制卡原理几乎是一样的。根据相应的控制... -
【CNC——第2篇】 运动模式学习 (固高GTS系列运动控制编程手册学习)
2019-05-14 21:01:18GTS 系列运动控制器每个轴都可以独立工作在点位、Jog、PT、PVT、电子齿轮或 Follow 运动模式(电子凸轮)下。 1 点位运动 在点位运动模式下,各轴可以独立设置目标位置、目标速度、加速度、减速度、起跳速度、平滑时间... -
QD77ms视频教程 MS2 ms4 MS16的JOG及原点程序讲解
2020-07-05 16:22:52第4集 QD77ms视频教程 MS2 ms4 MS16的JOG及原点程序讲解 第5集 定位控制的几种方式 第6集 让马达按规定速度一直转动 一直正转或者反转 第7集 中途走了一节 停止了 如何重新启动 第8集 当前定位数据监控 和如何将当前...