Kinematics Module for ijk Gcode

More
28 Aug 2019 17:06 #143455 by jaxonusa
I would like to get linuxcnc to understand the following gcode:

G01 X35.18 Y88.176 Z-17.485 I-0.318138 J-0.256624 K0.912651

The ijk's above are not the same ijk's as used in G02 and G03 arc motions.

The idea is, if I can use ijk to command the orientation of the tool, my gcode is machine portable. This is not the case with abc gcode. For example, if my machine is xyzbc, but the gcode is xyzac, then I should be able to hit the same toolpaths, but my machine won't act correctly. If both machines understood ijk gcode, they could both run the same program.

The math is very close to being the same for all 5 axis configs and spindle orientations. With just a little touch up, this same math can be used for all 5 axis machines, or even made into a single kinematics module for all 5 axis ijk machining.

I would like some help with compiling a kinematics module. I know the math. Or most of it. I don't know C++ or Linuxcnc. I've looked around for help with the kinematics module, but, not being a programmer, I can't figure it out. I have attached pseudo code. It's very pseudo.

The main outline is this:

1, "read in" machine specific dimensions from a config or ini file.
2, calculate b and c (or whatever your machine needs) from ijk
3, create quaternion rotations for b and c (or whatever your machine needs)
4, sum vectors in the b frame that are to be rotated by b
5, rotate b vectors by b quaternion
6, sum vectors in the c frame that are to be rotated by c
7, rotate c vectors by a "total" quaternion
8, sum all the rotated vectors
9, cause the machine to move to resulting xyzbc.

for inspration:


blog.hurco.com/blog/bid/309807/5-Axis-Pr...ng-with-tool-vectors

stretch goal:
I've looked at this. I really need help if the a,b, or c axes aren't perfectly aligned with x,y, or z. In fact, I know what i'm posting now will not work if a,b, or c aren't perfectly aligned with x, y, or z.

Attachments:

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

More
28 Aug 2019 18:03 #143459 by pl7i92
its done in stretch Master 2.9
with G12.1
you can have TCP
without the IJK
it siimply connects the kinetic with tha axes
so under M128 As of Hermle you see all joints moving while only on Gcode axis is programmed
it is a real Toolcenter positioning system as of 2.9 master relese

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

More
28 Aug 2019 19:46 #143472 by jaxonusa

without the IJK


ijk is the whole point of my post. I'd like to use the same 5 axis gcode on different machines.

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

More
28 Aug 2019 21:05 #143484 by Todd Zuercher
Are you trying to invent a totally new G-code system, or replicate a system used by another machine?

It isn't nessisary with Linuxcnc now. It can calculate the tools orientation and position with ordinary industry standard 5 axis g-code.

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

More
28 Aug 2019 21:28 #143488 by jaxonusa
Hurco and Fanuc use the gcode I show how I would like to use it. It's described in the links. I'm not sure if others do or don't. So, I guess it's not totally new gcode, it's probably running somewhere as I type. I think Fanuc calls it vector programming.

Yes, it's true it isn't necessary. To run 5 axis gcode on different machines, all you have to do is reconfigure your post processor to have it generate the proper abc combinations unique to the machine you intend to use, and choose a very strategic origin. The added benefit of ijk is we can all email our 5 axis code to each other without regard to how anyone's machine is configured.

I'm not asking anyone to help me raise the Titanic. I have the math mostly figured out, I'd just like help with C++ and compiling a kinematics module. I really truly did try hard to figure it out myself reading the documentation. It's time for me to reach out of help. I don't mind doing the hard work. I'm sure I'll be reading all about C++ tonight. I've never done it. Sure, I've compiled things before, but not a kinematics module to Linuxcnc.

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

More
28 Aug 2019 23:27 #143505 by andypugh
To use IJK to control TCP angles you would need to change the _interpreter_ rather than the kinematics module.

This might not be as hard as it sounds, LinuxCNC supports pluggable interpreters. You would just need to edit the valid words associated with G01 ad G00 in a copy of the existing interpreter.

there is a demo config sim/axis/canterp that uses a simple example of an alternative interpreter. It takes input files that look like this:
github.com/LinuxCNC/linuxcnc/blob/master.../canterp_example.can
Try the sim, it ought to run despite not using anything at all like G-code.

But: A simpler solution would be to make an input filter that converts G01 IJK and G00 IJK to ABC.
linuxcnc.org/docs/2.8/html/config/ini-co...html#_filter_section

What does the IJK code look like for arc moves?
The following user(s) said Thank You: jaxonusa

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

More
28 Aug 2019 23:48 #143507 by jaxonusa
Thanks Andy, I'll take a look at the demo you mentioned.

For arc moves, I think you don't. The code I'm used to seeing is small linear moves to the next point/orientation. You set how close or far apart these points are before you generate your toolpath in cam software. I don't have any handbooks or information about what Hurco or Fanuc does for 3d arcs. I've used 6 axis robots that have 3d arcs, but they never ever tell you how they do it. It's proprietary. What the user does, is set the starting point/orientation, the ending point/orientation, and some auxilliary point/orientation along the path. There's all kinds of notes to not "trust" what's going on between these points. There are some brilliant people over at robot forums that might know.

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

More
30 Aug 2019 20:57 #143693 by jaxonusa
With regard to filters, I have a spreadsheet I can paste xyzijk code on one side, and copy xyzbc code from the other side. Then I can paste it into a new file to run. I guess that's filter enough if I'm going the filter route. Looking at the filter page, it looks like I can use some python. I've put all the math I'd like to do in a python script. It has three functions. The first, input work xyzijk, the output is machine xyzbc. The second is, input machine xyzbc, the output is work xyzijk. The third is a type of tcp where the input is work xyz, machine bc, and the output is machine xyzbc. The script is 68 lines long. Not very big or complicated.

When you said "try the sim," I heard vismach :-P This might be a better place to try out my python maths. I read some forum and wiki things, but I'm still ignorant. Again, I don't mind doing the leg work, but I'm having a hard time figuring out vismach. What's the current path to understanding it? For example, one issue I have is, my machine config won't run unless it's hooked up to my Mesa, and all the stuff is powered up. Can I somehow get the Axis sim to run a vismach? I got to the point where it the wiki says

set up own script
Type in a Terminal (where "my_machine stands" for your deserved name):

sudo su
cp /usr/bin/5axisgui /usr/bin/my_machine_gui
chmod +x /usr/bin/my_machine_gui


But it won't work form me because LinuxCNC won't run my machine unless it's all physically plugged in and powered up. I tried to pncconf with no boards, thinking I would get a simulator, but that didn't work.

Does it make any sense to involve vismach? It might be possible to get it to understand my python. I'd like to learn it at some point anyhow. So, any help in understanding vismach would be greatly appreciated. In fact, I wouldn't mind "paying" for vismach help with giving back some Haas vismachs. They put a lot of cad of their machines online. If I knew vismach, I wouldn't mind getting it running for a Hass or two.

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

More
31 Aug 2019 15:02 #143729 by pl7i92
all you need to know is that it workes perfect for so many 5Axis and more with all the axis joint combos you can imagine
so its only up to you to get the G-code for the part to the mashine you build
This means your CAM and Cam output words in combination
Dont frear the build
it is easy if you can decide the Axis combination and posithon // sutch as Bottem Center zero
but the new master will also do main offsets

www.youtube.com/results?search_query=linuxcnc+5axis+offset

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

More
01 Sep 2019 19:24 #143801 by andypugh

Does it make any sense to involve vismach?


Only if you want a virtual machine to visualise what you are working on. It is probably as much work again to make the Vismach as it is to get the real machine working, but it cost less when it goes wrong.

The Vismach docs are here:
linuxcnc.org/docs/devel/html/gui/vismach.html
Though the basis if that page was pretty much just the notes I made, and the things I discovered, when making my own Vismach model to demonstrate the carousel component.
The following user(s) said Thank You: jaxonusa

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

Time to create page: 0.081 seconds
Powered by Kunena Forum