Need a HELP on G-Code

More
10 years 9 months ago - 10 years 9 months ago #68670 by ArcEye
Replied by ArcEye on topic Need a HELP on G-Code
Home and Touch it off.

Having found out what DH parameters are, they are nothing that Axis understands

You need to establish a Cartesian home position that Axis understands as G53 X0 Y0 Z0 A0 B0 C0.
You can just set the ini file so that all homing values are 0 and it will home without movement to wherever you are happy with as a home position with your DH parameters set as you require.
This is your base position.

Then move to a position where you are in the centre (ish) of your arm's working area and touch off to 0 under G54 in the various axes, so that you are offset from machine positioning.
(This might conceivably be the same place, but I would have expected an arm to home in a fully retracted position out of the way, but I may be completely wrong)

If your axis figures in your ini file are correct, you should now be able to reach to the extent of your arm in its various planes without exceeding the working area limits.
If the axis can move in both directions from the home position, this range needs to be in the ini file settings.
(or you could just hack it and change MAX_LIMIT and MIN_LIMIT to 9999 and -9999 respectively and be untroubled by limits :laugh: )

You still need to ensure that your collected data is from a homed and touched off arm and it matches the coordinate system you try to run it in, eg collect G54 coordinates and run them under G54, not G53.

Any coordinates you have collected so far will be completely arbitrary insofar as their origin is concerned.

regards
Last edit: 10 years 9 months ago by ArcEye.
The following user(s) said Thank You: SKH

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #68684 by andypugh
Replied by andypugh on topic Need a HELP on G-Code

ArcEye wrote: Having found out what DH parameters are, they are nothing that Axis understands

No, but they are crucial to the relationship between the joint angles and the machine cartesian position.

Are you using a Joint_axes branch of LinuxCNC? That separates the joint limits and the cartesian limits. You probably want that.

regardless of that, does the robot home accurately to a fixed point in space, and does this point in space correspond to the HOME position? You won't get anywhere unless the actual machine positions and the internal software model of the machine match.

If you jog in a straight line in the X axis, does the tool point move in a straight line along the X axis? If it doesn't then you still have configuration and homing details to get right.

Experiment with the sim/axis/vismach/puma configuration to see how a properly set-up robot jogs in cartesian space.
The following user(s) said Thank You: SKH, bodhi_94

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #68797 by SKH
Replied by SKH on topic Need a HELP on G-Code
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.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago - 10 years 9 months ago #68815 by Todd Zuercher
Replied by Todd Zuercher on topic Need a HELP on G-Code

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
Last edit: 10 years 9 months ago by Todd Zuercher.
The following user(s) said Thank You: SKH

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #74330 by marq_torque
Replied by marq_torque on topic Need a HELP on G-Code
Hello ArcEye,

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

Code:
#!/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()
Last edit: 10 years 5 months ago by BigJohnT. Reason: add code tags

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #74858 by jstoquica
Replied by jstoquica on topic Need a HELP on G-Code
Hi,

How can I see the output file "train.ngc"?

or

How can I generate it?
Code:
#!/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.
Last edit: 10 years 5 months ago by jstoquica.

Please Log in or Create an account to join the conversation.

Time to create page: 0.230 seconds
Powered by Kunena Forum