# Can you get me started on using LinuxCNC on a non-traditional kinematic mechanis

23 Jul 2024 04:13 #305885
Hey kind folks,

Total newby to LinuxCNC and I'm just hoping for a nudge in the right direction. I would like to use Linux CNC to drive novel kinematic mechanism that will eventually resolve two simple XY coordinates. I do know the mathematical equations that resolve a couple of rotational joints with interesting kinematics into the XY coordinate, but I have no idea how to use that math in a way that will eventually wrote back to g codes. I'm sure there are samples of people using non-linear, non-xy mechanisms, but I'm not sure where to start. Any good resources for how I might take a kinematic macadism that is not a traditional thing? Linear XY where I know the math and get that so that g-codes will drive. They make it to properly? Sorry if this question isn't even phrased properly.  Not sure where to begin.

Thanks!

23 Jul 2024 04:49 #305887 by Aciera

23 Jul 2024 21:24 #305926
@aciera,  thank you very much!  - do you have experience with non-trivial kinematics?  The example in the document you sent is actually pretty close to what I'm trying to do with a few exceptions. I note that the forward and inverse transformations transform joint lengths (AB, BD) to Cartesian coordinates.  if the joints were cables wrapped around a drum, would it still be appropriate to transform cable length the cartesian coordinates or would you actually resolve that back to stepper motor steps in order to define a cable length?

24 Jul 2024 05:28 #305944 by Aciera

if the joints were cables wrapped around a drum, would it still be appropriate to transform cable length the cartesian coordinates

Yes, as long as the cable gets wound up uniformly (ie the coil does not change diameter due to stacking of the cable on the drum).

or would you actually resolve that back to stepper motor steps in order to define a cable length?

This is done in the [JOINT_n] section of the ini file. The 'STEP_SCALE' value defines how many steps the motor needs to rotate to move the joint one machine unit (inch/mm).

02 Aug 2024 01:36 #306692
Sorry for the newby questions... Where does the code for non traditional kinematics reside?  I'm pretty sure we've derived the forward and reverse joint transformations but not exactly sure where these are stored?

Thanks

02 Aug 2024 07:21 - 02 Aug 2024 07:31 #306700 by Aciera
Custom kinematics written in C can be found in 'src/emc/kinematics'
github.com/LinuxCNC/linuxcnc/tree/master/src/emc/kinematics

Generally I would suggest to write custom kinematics as a component (.comp). Unless of course you have a compelling reason to use C (and know it well enough). See examples like github.com/LinuxCNC/linuxcnc/blob/master...onents/millturn.comp
or the more complex
github.com/LinuxCNC/linuxcnc/blob/master.../xyzab_tdr_kins.comp

For the latter there is a paper with documentation:

to compile and install a custom kinematic file:
halcompile --install <path/your_component.comp>

(prepend 'sudo' if you are on a package install):
Last edit: 02 Aug 2024 07:31 by Aciera.

09 Aug 2024 20:25 #307383
Sorry... another newb question.

I have written and understand the need for a reverse transformation that converts a desired X,Y location to joint rotations (I have a simple 2-axis system).

We are running in open loop so there is no feedback.

Is there a reason LinuxCNC needs the "forward transformation" (which if I understand correctly, would convert a known joint rotation to LinuxCNC to a specific X,Y location. in an open loop system, what purpose does having both a forward and reverse transformation in your kinematics file do?