Kinematics switch

More
27 Aug 2019 12:33 #143319 by m.bofi
Kinematics switch was created by m.bofi
Hello everyone,

I have a 5dof robot (5 revolute joints) set up on LinuxCNC(custom kinematics, hal...) and what i'm looking for is a way to include joint movement on world mode. Now with joints_axis in master branch i think it is more viable than before.

The way i think it is to make a switch in kinematics setup with a hal pin maybe. I have read "TCP 5-axis kinematics" topic which is quite close. It even has insight on G12.1 command which is implemented on a testing branch and seems pretty promising. Or is there an actual G code command that can directly affect a spedific joint rather than moving on an axis?

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

More
28 Aug 2019 22:51 #143498 by andypugh
Replied by andypugh on topic Kinematics switch
G12.1 (and G12) is unallocated in LinuxCNC, so if you saw a G12 then it was a custom G-code.

Where did you see G12.1 mentioned?

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

More
29 Aug 2019 07:04 - 29 Aug 2019 07:05 #143533 by m.bofi
Replied by m.bofi on topic Kinematics switch
In the topic TCP 5-axis kinematics topic users r.lol and automata mentions the Switch Kins branch and even user pl7i92 in the topic Kinematics Module for ijk Gcode mentions it too. But im not sure how to use it correctly and even if it is applicable in my case. Any thoughts?
Last edit: 29 Aug 2019 07:05 by m.bofi.

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

More
29 Aug 2019 12:11 #143547 by andypugh
Replied by andypugh on topic Kinematics switch
G12 is not present in master:
github.com/LinuxCNC/linuxcnc/blob/master.../interp_array.cc#L28

There was mention of a switchkins branch which added a G12.1 (why not G12?) but I don't see that in the LinuxCNC repository. it seems to only exist here:
github.com/rushabhGH/linuxcnc/tree/switchKins
And that does, indeed, have G12 and G12.1 as valid codes:
github.com/rushabhGH/linuxcnc/blob/switc.../interp_array.cc#L84

I am unsure what the kinematics switch in that commit does (I didn't see any documentation in the commits). It appears to create G-codes and NML messages to switch between kinematics types, but also appears to have HAL pins to change other (or the same?) parameters.

I think it is reasonably easy to create a HAL pin linked to a variable in a kinematics module, and it is also fairly easy to set the value of a HAL pin from a custom M-code. I am thus unclear what the switchkins experimental branch is for, but there is certainly a significant amount of work that has gone in to it.

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

More
29 Aug 2019 21:34 #143596 by m.bofi
Replied by m.bofi on topic Kinematics switch
What i had in mind was to create a custome M-code command which simply sets the pin for the the joint motor to the appropriate value. However i noticed this "Make sure the parallel port pin is not connected to anything in a HAL file." in custom m-code and my plan failed as of course these parralel port pins are present in the HAL file.

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

More
29 Aug 2019 21:47 #143598 by andypugh
Replied by andypugh on topic Kinematics switch

What i had in mind was to create a custome M-code command which simply sets the pin for the the joint motor to the appropriate value. However i noticed this "Make sure the parallel port pin is not connected to anything in a HAL file." in custom m-code and my plan failed as of course these parralel port pins are present in the HAL file.


One solution would be to use a mux2 (probably mux_generic to get a float version) for each joint and then switch between alternative inputs.

But doing it in the kins module is probably easier. The kins module can have a normal / joint pin, and could even handle a slow transition between the commands to avoid following errors. But be careful about that, because it does entail uncommanded joint moves.

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

More
02 Sep 2019 10:01 #143891 by m.bofi
Replied by m.bofi on topic Kinematics switch
Hmm, now we are going to uncharted water. What i really wanted was to have a single program in g-code (with some M comands probably) that can integrate in world mode everything so the user can just create a single program. Straight from the kinematics module how?

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

More
02 Sep 2019 11:17 #143893 by andypugh
Replied by andypugh on topic Kinematics switch
The kinematics module _only_ calculates joint from coordinate and coordinate from joint transforms.

The G-code words that correspond to each coordinate are hard-coded elsewhere.

I can see an argument for the creation of extra G-codes for joint-based motions. Maybe G0.1 Pn and G1.1 Pn where n is the joint number.

I don't think it would be easy as a remap, though unless there is a way to call the forward kinematics from Python.

You can generally _jog_ in joint mode, the Axis GUI, for example, toggles to joint mode when you press the $ key.

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

More
06 Sep 2019 07:30 #144333 by m.bofi
Replied by m.bofi on topic Kinematics switch
Thanks for the help again. I thought of the $ key (i use the Axs GUI as you mentioned) but i wanted to make it easier for the user that wanted to move a specific joint inbetween his other commands and make it possible with one pogram. Right now he has to make 2 programs, one before the jog, run it, press the $ key, jog, press $ again and run the second program.

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

More
11 Sep 2019 00:29 #144761 by andypugh
Replied by andypugh on topic Kinematics switch
Why can't he jog in world mode between the two programs?

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

Time to create page: 0.418 seconds
Powered by Kunena Forum