TCP 5-axis kinematics

23 Sep 2017 10:35 #99316 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics

Im running this just as idea of functionality level.
Attached is xyzbc-trt-kins.c that is modified kinematics for xyzbc vismach simulation delivered with 2.8 pre.
M128 and M129 commands just activates and deactivated HAL pin that controls simple if/else function to select between
two different kinematics.

Normal kinematic mode is just independent axis, xyzbc, each represented by its own joint.
At TCP active, coordinate system rotates with table, and is fixed to table at B0. C0. position.
This is easiest way to make 5-axis kinematics, al so it has positive indirect implications like:
- correct feed rate when running full 5 axis.
- Supported by most CAM systems ( Special recommendation: NX CAM)
- easier hand programming possibility

At the moment it works well when rotary axes are at 0 position.

But will cause a sudden jump in position, if activated when rotary axis are not in 0 position.
Well its better than nothing.

To develop it further, transition between TCP ON/OFF, need to be corrected.
There is two possibilities (at my current knowledge) one is to calculate current position in rotated mode and update that upwards
when making a switch between modes.

Other option could be that there are duplicate axis that are run parallel Xf, Yf, Zf and Xr, Yr, Zr. (this I think is possible, i have seen UVW axis that works )
Nf axes been Fixed ones, meaning direct coupling joint to axis.
Nr been rotating.

Kinematics would just switch between these two axis system.
Ok, this last one just an idea, I have not even thought carefully could it be even possible to implement in linuxcnc.

M128.h and M129.h should have no .h at end, rename to M128 and M129 add them to linuxcnc/ncfiles location,
after that you should be able to command those from MDI or program.

I'm designing compressor wheels and other 5-axis parts, but currently im limited to make these at loan machines.
time with those are limited and expensive.
I have my on 5-axis machine, with Nikken 5-ax table, I would really liked to use this machine to produce these parts.

I could run these, but I need two different linux setup and two different postprosessors to make this possible.
Post processor is not problem I make those for living, but only for NX CAM.

I have already thought to run machine with two different setups, one with kinematic for TCP and one with axis per joint.
But Im too lazy to restart system for 5-axis and then back to 3+2 mode.
23 Sep 2017 13:05 #99332 by Shu
Replied by Shu on topic TCP 5-axis kinematics
I would investigate what happens if you press $ in axis to switch between world and joint mode. Then remap that to m128 if possible. Keep us updated!
23 Sep 2017 16:33 - 23 Sep 2017 16:36 #99346 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Joint mode Can not be run with program or MDI.
Other vice could work.
Also not all functionality are available in joint mode and I think trajectory planner had some limitations in joint mode.
Last edit: 23 Sep 2017 16:36 by jsskangas.
The following user(s) said Thank You: Shu
26 Sep 2017 13:09 - 26 Sep 2017 16:45 #99458 by dgarrett
Replied by dgarrett on topic TCP 5-axis kinematics
Switching kinematics methods must be done in a way
that preserves all joint.N.motor-pos-cmd values in
order to avoid a bump (and a likely following
error for a servo system).

I've made an experimental branch using a simple XYZ
kins module (altkins.c) to demonstrate switching
kinematics via a halpin (which could be controlled
by a user M command).

The branch dgarr/alternate_kins is based on the
current master branch with joints-axes updates.

The buildbot will make debs for this 'scratch'
branch for a limited number of days.

The branch can be built from git:
$ cd your_git_top_dir_for_LinuxCNC
$ git fetch
$ git co dgarr/alternate_kins
$ source scripts/rip-environment
$ cd src; make && sudo make setuid
$ cd ../configs/sim/axis/
$ linuxcnc altkins.ini

It seems to work and may serve as a starting point
for more complex kinematics.
(i have not tested on hardware)

Branch ref:

Usage info:
Last edit: 26 Sep 2017 16:45 by dgarrett. Reason: forgot rip-environment
The following user(s) said Thank You: Shu
30 Oct 2017 17:01 - 30 Oct 2017 17:42 #101022 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
dgarrett: thanks, I Will look will your method make any difference.

You have used two different kinematic "calls" and change between them.
Mine is done inside one.

I was too hasty....

I did look your solution more closely, this need more thinking....

I am still figuring out how your position correcting method works, but your method seems quite promising.
I'll get back when I have tried to apply this to 5-axis kinematics.
Last edit: 30 Oct 2017 17:42 by jsskangas.
31 Oct 2017 13:35 #101059 by cts1085
Replied by cts1085 on topic TCP 5-axis kinematics
This is of interest for me as well. I have a 4 axis mill/lathe (XZAB) and have the kinematics setup for TCP and for 2 different "heads" - I have a spindle at 0-degrees and a probe at 90-degrees on the "B" axis. I needed to implement the "W" axis to smooth the transition from one head to the other and when doing tool changes (the offsets change and the point then changes). I don't have this perfect as i still occasionally get following errors if i don't "back out" of one mode/tool before turning on a new mode/tool. For now my solution is to have the TLO mirror the "W" axis and when there is a mode/tool change i G0 W0 which then slowly engages the new mode. Let me know if you want details on the kinematics i am using (Note: The "Mode" is set with a particular tool number - T 100 is the probe - anything else is a tool in the spindle)
08 Dec 2017 14:20 - 08 Dec 2017 14:25 #102774 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
I made small progress last night.
I combined dgarrett's and Rudy's work related to kinematics.
I used Ruby's kinematics and Garrett's kinematic change method.

It works perfectly(switching between kinematics) when rotary axes are at 0 position.

Also it does not jump during kinematic change when rotary axes are rotated before transition.

But it loses it position.
This is not an error it is a mathematical problem that can be solved.
B and C axis positions need to be taken account at forward kinematics during change.

I will look in to this, but my time is limited so progress will be some what slow.
I attached latest files for testing and further improvement.
Last edit: 08 Dec 2017 14:25 by jsskangas.
08 Dec 2017 20:02 - 10 Dec 2017 12:28 #102793 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Small info about what should happen:

NC-code - axis values after command
G0 X0 Y30 Z0. - X=0.0 Y=30.0 Z0.0 B0.0 C0.0
C45. - X=0.0 Y=30.0 Z0.0 B0.0 C45.0
M128.(TCP on) - X=0.0 Y=30.0 Z0.0 B0.0 C45.0
M129 .(TCP off) - X=0.0 Y=30.0 Z0.0 B0.0 C45.0

TCP is turned on (M128) at machine coordinate location X=0.0 Y=30.0 Z0.0 B0.0 C45.0.
but we want to transfer from machine- to rotated coordinate system.
If our tool stays at same position, it will be located on rotated coordinate system at X=-21.21 Y=21.21 Z0.0 B0.0 C45.0
This is cause rotating coordinate system has rotated 45 degree and tool has stayed in place.

it should behave like this
NC-code - axis values after command
G0 X0 Y30 Z0. - X=0.0 Y=30.0 Z0.0 B0.0 C0.0
C45. - X=0.0 Y=30.0 Z0.0 B0.0 C45.0
M128.(TCP on) - X=21.21 Y=21.21 Z0.0 B0.0 C45.0
M129 .(TCP off) - X=0.0 Y=30.0 Z0.0 B0.0 C45.0

So I need to update my axis position to X=21.21 Y=21.21... but still maintain my current joint position.
Transformation back to machine coordinate system(M129), is to update current joint position to axis position.

Hopefully this will clarify what I'm trying to accomplish.
Last edit: 10 Dec 2017 12:28 by jsskangas.
10 Dec 2017 10:01 #102864 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
I need quick help.

Im trying to write out values from kinematics trough HAL pins:

this is located in" rtapi_app_main"
if((answer = hal_pin_float_new("xyzbc-trt-kins.oma",
HAL_OUT, &(haldata->oma), comp_id)) < 0) goto error;

this is in code:
*(haldata->oma) = 11.11;

when looking/watching from HAL configuration in linuxcnc only shows 0.0

it's compiled and im using this file.. and it does not give error when compiling.
Also I tried HAL_IO, HAL_IN no difference.

How can I write values to HAL pins????
12 Dec 2017 01:45 #102961 by andypugh
Replied by andypugh on topic TCP 5-axis kinematics
What you have ought to work, but there is a bit more you need too (You may be doing this, but haven't shown that part of the code) One thing is that the haldata struct needs to be hal_malloc-ed
Time to create page: 0.131 seconds
Powered by Kunena Forum