TCP 5-axis kinematics

More
16 Nov 2019 18:33 #150489 by 3D-Master
Replied by 3D-Master on topic TCP 5-axis kinematics

Since I can't test it now, I see only two ways forward, you reproduce it in the Vismach configuration and then I can test it as well, or you attach your config files and I have a look at it .... other ideas?


maybe if i replace all changed files with the original ones and then re-changing them to suit switchKins the error will be gone.

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

More
20 Nov 2019 19:04 #150781 by dgarrett
Replied by dgarrett on topic TCP 5-axis kinematics
I've created a branch to test/demonstrate kinematics
switching (xyzac & trivkins, xyzbc & trivkins).

The branch is based on the original work of Rudy du Preez
and subsequent modifications by Rushabh, JSKangas, Plopes
(and probably others). The branch supplies kinematics
modules (xyzac-trt-switchkins,xyzbc-trt-switchkins) and
modifies the motion module.

The branch incorporates a simplified approach that
avoids changes to the interpreter, task, and nml.
Kinematics switching uses a new hal pin and existing
interpreter synching commands.

Summary:

1) A new hal pin (motion.switchkins-type) instructs a
candidate kinematics module to switch to a specified
kinematics type.

2) A gcode subroutine (switchkins.ngc) sets a motion analog
output pin netted to motion.switchkins-type and issues M66
(wait-on-input) commands to synchronize task and motion.

Since the code changes are limited to the motion module,
this branch presents a low risk for incorporation into the
master branch (if it survives user testing).

The branch is on github as dgarr/s_kins and includes
sim configs:
configs/sim/axis/vismach/5axis/table-rotating-tilting/xyzac-trt-switchkins.ini
configs/sim/axis/vismach/5axis/table-rotating-tilting/xyzbc-trt-switchkins.ini

Many aspects can be tested with the sim configs but
I lack equipment to do hardware tests. Interested
users are encouraged to respond to this thread with
testing results (or email me d g a r r e t t at panix dot com)


Ref: github.com/LinuxCNC/linuxcnc/commits/dgarr/s_kins

Attachments:
The following user(s) said Thank You: tommylight, plopes9000

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

More
21 Nov 2019 21:49 #150860 by plopes9000
Replied by plopes9000 on topic TCP 5-axis kinematics
Thank you dgarret. The other approach was more elegant but I understand that this makes it more likely to get included.

I very much appreciate your effort to get it in.

I just had a quick look but will have a more thorough look at the weekend.

Unfortunately my machine is dismantled atm (I’m scraping the ways) so I can’t really do hardware testing but will certainly try the simulation.

Thanks again for trying to push this.

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

More
22 Nov 2019 12:05 #150901 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Hello

I also took a look at it.
I did not find any indication of defining a rotary point what is a one of the essential point in this.

For me it looks like in this you need to define your machine zero and zero point in center of rotation axis's?

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

More
22 Nov 2019 17:30 #150954 by dgarrett
Replied by dgarrett on topic TCP 5-axis kinematics

I did not find any indication of defining a rotary
point what is a one of the essential point in this.


Not an expert on the math but the XYZAC
(xyzac-trt-switchkins.c) code includes
*_rot_point halpins used in the forward
and inverse non-triv calculations:

Ref: github.com/LinuxCNC/linuxcnc/blob/dgarr/...zac-trt-switchkins.c
Lines: 105 ... xyzacKinematicsForward()
Lines: 179 ... xyzacKinematicsInverse()

This switchkins xyzac-trt-switchkins.c code incorporated
in the branch dgarr/s_kins is based on the following
information from prior forum posts:

1) Forum post of 25jan19:
forum.linuxcnc.org/10-advanced-configura...tics?start=90#124848
which seems to refer to this source:
github.com/rushabhGH/linuxcnc/blob/switc...ematics/switchKins.c

2) Updates to above switchKins.c from forum post of 04nov19:
forum.linuxcnc.org/10-advanced-configura...ics?start=170#149538
which includes this patch:
forum.linuxcnc.org/media/kunena/attachme...-homing-option.patch

This patch adds the *_rot_point halpins for XYZAC kinematics.

The code for XYZBC kins (xyzbc-trt-switchkins.c):
Ref: github.com/LinuxCNC/linuxcnc/blob/dgarr/...zbc-trt-switchkins.c
probably needs similar additions.

I can update xyzbc-trt-switchkins.c if someone supplies
a patch for incorporating the required *_rot_point hal pins.

History:

This thread discusses a complicated subject with
several contributors, a number of interested users,
a variety of nomenclature, several false starts and
some reports of success.

My interest with the dgarr/s_kins branch is to provide
a common branch to unify efforts. I will accept patches
by email (d g a r r e t t at panix dot com) and
force-push incorporated patches.

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

More
22 Nov 2019 17:52 #150955 by plopes9000
Replied by plopes9000 on topic TCP 5-axis kinematics
dgarret, your analysis is correct, AC has center of rotation, BC does not.

jsskangas if you could update the bc file with your center of rotation we would cover both.

Once again, thank you dgarret for putting this together.

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

More
22 Nov 2019 19:43 - 22 Nov 2019 19:44 #150961 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Ok.

I will make updated packet from my machine.
I will correct one error in kinematic calculation and will send packet to dgarret.

I will try to get it done during next week.


I have not yet tested this branch and I only took fast look around changes made to code.
Can someone give me a quick heads up.

What command is used to switch between kinematics and can this switch be done when rotary axes are pre-positioned?
Last edit: 22 Nov 2019 19:44 by jsskangas.

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

More
22 Nov 2019 20:03 - 22 Nov 2019 20:05 #150965 by plopes9000
Replied by plopes9000 on topic TCP 5-axis kinematics
From reading the code, the script configs/sim/axis/vismach/5axis/table-rotary-tilting/examples/switchkins.ngc contains a function that does the switch.

so calling
o<switchkins>call[0] ;switch to XYZBC or XYZAC
o<switchkins>call[1] ;switch to TRIVKINS

the call with argument 0 will switch to AC or BC depending on the KINEMATICS loaded:
[KINS]
KINEMATICS = xyzac-trt-switchkins or KINEMATICS = xyzbc-trt-switchkins
Last edit: 22 Nov 2019 20:05 by plopes9000.

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

More
22 Nov 2019 20:04 - 22 Nov 2019 20:09 #150966 by dgarrett
Replied by dgarrett on topic TCP 5-axis kinematics
The simplified kinematics switching method using
the motion module hal pin motion.switchkins-type
requires a user to:
   a) add a subroutine (switchkins.ngc) in a proper
      location per [RS274NGC]SUBROUTINE_PATH (specify
      one of the available analog-out hal pins)

   b) make a hal net like:
      net :kinstype-select <= motion.analog-out-03
      net :kinstype-select => motion.switchkins-type
     (above is for use of analog out pin 3 in 
      switchkins.ngc):

Then the command to switch within gcode is:
o<switckins>call[mode] 

where:
mode==0 for default kinematics (xyzac,xyzbc)
mode==1 for trivkins kinematics


In the provided sim configs:
[RS274NGC]SUBROUTINE_PATH=./examples

So the switckins.ngc file is:

github.com/LinuxCNC/linuxcnc/blob/dgarr/...mples/switchkins.ngc

Other files in the same examples directory should work too:
github.com/LinuxCNC/linuxcnc/tree/dgarr/...ary-tilting/examples


Some may require touch off for Z, see:
github.com/LinuxCNC/linuxcnc/blob/dgarr/...otary-tilting/README



The sim configs gui includes buttons and
a label display to:

1) set to XYZAC (or XYZBC) via a halui mdi pin
or
2) set to trivkins via a halui mdi pin
3) Display the current active kins type

These may be useful for testing using jog
buttons (after homing of course)
Last edit: 22 Nov 2019 20:09 by dgarrett. Reason: Add notes on sim config buttons/label

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

More
22 Nov 2019 20:45 #150970 by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Ok, so there is a sub program that does switching.

M66 a sync command? does some needed trick internally?
then switching a kinematics by hal pin with M68 command
and M66 again

Can we combine this all under one G or M code that is modal, like M128 what is user defined M command?
And M129 to deactivate it.

Would be easier from CAM/post point of view.
And NC-code would be more readable.
M128 is modal, so TCP active state is readable from active modal codes in UI.

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

Time to create page: 0.200 seconds
Powered by Kunena Forum