# Command to Move in Joint mode

03 Feb 2020 09:02 #156427 by Aciera
I'm still working on my 6axis robot configuration. Since moves across singularities can only be achieved in Joint mode I need to switch from world mode to joint mode, then command the move beyond the singularity and switch back to world mode (XYZABC). Now I can do that in Jog mode. But I need to do this inside a Gcode Programm.

Is there a way in Gcode to command a move in Joint mode instead of world mode?

Thanks

03 Feb 2020 15:23 #156442 by bbsr_5a
what hapens if you only move one Axis with G-code
does the other Joints follow
you can switch the Mode via a UserMcode
so you can get there a efficent joint or world move

03 Feb 2020 16:46 - 03 Feb 2020 16:53 #156455 by Aciera
In a regular 3-axis cartesian machine setup each joint moves one and only one axis so axis and joints are identical. The thing is that with a robot arm a move in x y or z axis requires the movement of more than 1 joint.
With LinuxCNC 2.8 joints and axis are separated. This way a gantry can have two joints (or motors) for one axis. Although you would probably not want to move them independently in this case.
Now for a robot moving individual joints independently is quite important because the mathematical calculations behind a move in XYZABC (world coordinates) cannot handle certain moves of the arm.
So when we program a robot we can choose to execute a move in linear-interpolation or in joint-interpolation. If I have to manually jog the robot in joint mode to a new position the use of LinuxCNC for robot applications would be severly limited.
It would look something like this:

G0 J1 90° J2 22° J3 -40° J4 0° J5 -12° J6 360°

Really there would only be something like a rapid move (G0) and a move with a speed command attached (G1)
Last edit: 03 Feb 2020 16:53 by Aciera.

04 Feb 2020 10:33 #156491 by Aciera
With further search I get the impression that the switchkins branch would be the way forward. So one kinematic would handle the matrix transformations from joints to cartesian XYZABC and the other would handle the individual joints.
If anybody has this already set up for a robot arm I would be very interested to hear how that is working out.

14 Feb 2020 13:20 #157355 by andypugh
Have you seen this?

Though I am not sure that this is the best way to do it. It seems that it should be possible to do it inside LinuxCNC independent of the kinematics in use.

17 Feb 2020 09:31 - 17 Feb 2020 09:35 #157574 by Aciera
I'm playing around with the switchkins-branch and it is basically what I am looking for.
However the kinematics seem to be limited to the 5-axis machine set up. I would need to change this to my 6-axis robot and
when I now try to halcompile genserkins.c I get an error "KINS_NOT_SWITCHABLE". As this line has been added to the genserkins.c file.
So it looks to me that the switchkins-branch is not compatilble with genserkins and this is then a dead end for my purpose as I essentially need to switch from genserkins to trivkins.
Last edit: 17 Feb 2020 09:35 by Aciera. Reason: wording, clarification

20 Feb 2020 20:14 - 20 Feb 2020 20:40 #158057 by dgarrett

I'm playing around with the switchkins-branch ...

The dgarr/s_kins branch now includes a kinematics module
(genser-switchkins) for testing:

1) implements genserkins kinematics by default
(6 revolute joints)
2) is switchable to identity kinematics using joint
assignments set by the module parameter 'coordinates'
3) M428 command selects genser kinematics
4) M429 command selects identity kinematics

The only intree sim config using genserkins (puma560.ini)
has been used as the basis for a test config using:
1) [KINS]KINEMATICS=genser-switchkins
2) [RS274] section uses remap_subs for M428,M429
3) [HAL]HALCMD = net :kinstype-select ...
connects motion.switchkins-type pin to an analog out pin
used by M428,M429
4) [HALUI]MDI_COMMANDS provided for pyvcp buttons

sim config is puma560-switchkins.ini:
github.com/LinuxCNC/linuxcnc/blob/dgarr/...ma560-switchkins.ini

Notes:
github.com/LinuxCNC/linuxcnc/blob/dgarr/...ma560-switchkins.txt

The branch is force-pushed when changes are made.

The new kinematics module has not been tested on
hardware, if you test, please let me know --
dgarrett at panix dot com
Last edit: 20 Feb 2020 20:40 by dgarrett.
The following user(s) said Thank You: Todd Zuercher, Aciera

21 Feb 2020 01:53 #158080 by thang
Replied by thang on topic Command to Move in Joint mode

Aciera wrote: I'm playing around with the switchkins-branch and it is basically what I am looking for.
However the kinematics seem to be limited to the 5-axis machine set up. I would need to change this to my 6-axis robot and
when I now try to halcompile genserkins.c I get an error "KINS_NOT_SWITCHABLE". As this line has been added to the genserkins.c file.

Did you edit genserkins? Both genserkins and trivkins function need to be in one kinematic modules.

21 Feb 2020 13:03 #158128 by Aciera
dgarret: Thank you for all your efforts.

I just tried to halcompile the original .c file before I would start to make changes. As my programming abilities in C are rather limited my attempts are still pretty rough.
Ultimately my vision would be to be able to switch between three different kinematics: JOINT, Cartesian-WorldCoordinates and cartesian TOOL-COORDINATES but I have no idea how much of an effort an additional kinematic switch would require, let alone if I would ever be able to code that myself.