Need a HELP on G-Code

but now we needed to setup acceleration and deceleration of the robot when navigating,
right now we know there is a function to setup acceleration.but
Q1)how to setup deceleration?
Q2)we are currently using 3 parallel ports in the system.is it not good to use the parallel port for this application.(we mean ,is there any data propagation issues,like delays,data misplacements,etc)
Q3)what are the advantages of the MESA card over the parallel port.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Boarder
-
- Posts: 3813
- Karma: 148
- Thank you received: 770
SKH wrote: Thank you for all your support, guys.......We did manage to manipulate the robot successfully
.
but now we needed to setup acceleration and deceleration of the robot when navigating,
right now we know there is a function to setup acceleration.but
Q1)how to setup deceleration?
Q2)we are currently using 3 parallel ports in the system.is it not good to use the parallel port for this application.(we mean ,is there any data propagation issues,like delays,data misplacements,etc)
Q3)what are the advantages of the MESA card over the parallel port.
A1) Deceleration is just negative acceleration, and is handled by the same code as the acceleration. (once you set up one you have both)
A2) The limitation of a parallel port is in the rate that it can be serviced by the software, (your base thread speed)
A3) The advantages of a 5i25, are:
1-Hardware step and pulse generation at up to MHz speeds. (as opposed to software stepping at the base thread rate and its associated granularity)
2-Hardware encoder reading at up to MHz speeds .(same as above)
3-Mesa's daughter card selection offering specialized io (analog, digital, differential,...), and huge quantities of GPIO(general purpose I/O) options
Please Log in or Create an account to join the conversation.
- marq_torque
-
- Offline
- Expert Boarder
-
- Posts: 107
- Thank you received: 1
Thanks for Script first, i am stuck at how to capture code in file ? can you help modding this script ? i need axis letters which i got from your modified lines but its also throwing 0 0 1 0 at the end of each line and not sure where file is being saved !
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...54;hb=refs/heads/2.7
#!/usr/bin/python
"""Usage:
python teach.py nmlfile outputfile
If outputfile is not specified, writes to standard output.
You must ". scripts/rip-environment" before running this script, if you use
run-in-place.
"""
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import linuxcnc
import Tkinter
import sys
linenumber = 1;
if len(sys.argv) > 1:
linuxcnc.nmlfile = sys.argv[1]
if len(sys.argv) > 2:
outfile = sys.argv[2]
sys.stdout = open(outfile, 'w')
s = linuxcnc.stat()
def get_cart():
s.poll()
position = " ".join(["%-8.4f"] * s.axes)
return position % s.position[:s.axes]
def get_joint():
s.poll()
position = " ".join(["%-8.4f"] * s.axes)
return position % s.joint_actual_position[:s.axes]
def log():
global linenumber;
if world.get():
p = get_cart()
else:
p = get_joint()
label1.configure(text='Learned: %s' % p)
print linenumber, p, s.flood, s.mist, s.lube, s.spindle_enabled;
linenumber += 1;
def show():
s.poll()
if world.get():
p = get_cart()
else:
p = get_joint()
label2.configure(text='Position: %s' % p)
app.after(100, show)
app = Tkinter.Tk(); app.wm_title('LinuxCNC Teach-In')
world = Tkinter.IntVar(app)
button = Tkinter.Button(app, command=log, text='Learn', font=("helvetica", 14))
button.pack(side='left')
label2 = Tkinter.Label(app, width=60, font='fixed', anchor="w")
label2.pack(side='top')
label1 = Tkinter.Label(app, width=60, font='fixed', text="Learned: (nothing yet)", anchor="w")
label1.pack(side='top')
r1 = Tkinter.Radiobutton(app, text="Joint", variable=world, value=0)
r1.pack(side='left')
r2 = Tkinter.Radiobutton(app, text="World", variable=world, value=1)
r2.pack(side='left')
show()
app.mainloop()
Please Log in or Create an account to join the conversation.
How can I see the output file "train.ngc"?
or
How can I generate it?
#!/usr/bin/python
"""Usage:
python train.py
You must ". scripts/emc-environment" before running this script, if you use
run-in-place.
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import hal
import sys
import linuxcnc
s = linuxcnc.stat()
def get_cart():
s.poll()
position = "G01 X%-8.4f Y%-8.4f Z%-8.4f A%-8.4f B%-8.4f C%-8.4f\n" % ( s.position[0], s.position[1], s.position[2], s.position[3], s.position[4], s.position[5] )
return position
h = hal.component("train")
h.newpin ("record", hal.HAL_BIT, hal.HAL_IN)
outfile = "train.ngc"
h.ready()
try:
while 1:
if h["record"] == 1:
f = open(outfile, 'a')
pos = get_cart()
f.write(pos)
f.close()
except KeyboardInterrupt:
raise SystemExit
I tried "python train.py /tmp/train.ngc", but the file doesn't exist.
Thanks.
Please Log in or Create an account to join the conversation.
train.py does not take any arguments."""Usage:
python train.py
JT
Please Log in or Create an account to join the conversation.
Thanks for the reply.
Then, How can I see or generate the output file of that script?
h = hal.component("train")
h.newpin ("record", hal.HAL_BIT, hal.HAL_IN)
outfile = "train.ngc"
h.ready()
try:
while 1:
if h["record"] == 1:
f = open(outfile, 'a')
pos = get_cart()
f.write(pos)
f.close()
Thanks.
Please Log in or Create an account to join the conversation.
- thefabricator03
-
- Offline
- Platinum Boarder
-
- Posts: 504
- Thank you received: 127
This might be a long shot since this thread is thee years old but do you have any more pictures of you robotic arm? It is a very interesting design.
Please Log in or Create an account to join the conversation.