Struggling with custom kinematics...
- dave.franchino@gmail.com
- Offline
- New Member
- Posts: 9
- Thank you received: 0
LinuxCNC newby here - please be gentle... I'm clearly over my head here...
I am trying to learn to use LinuxCNC to run a 2-axis cable robot - each joint features a "drum" of known diameter. The cables from two drums truncate at a single point.
Eventually I hope to turn this into a low-cost hot-wire foam cutter that would allow you to use G-code to cut out shapes from large sheets of foam. Here is my crude prototype (not working in cartesian coordinates yet).
photos.app.goo.gl/z3gUimXLRd3yP33W6
I have my mechanism up and running using "trivial" kinematics and if I simply hang a weight from the left drum (mapped to the X axis in trivial kinematics) and instruct it to move 10mm, the drum will indeed wrap up enough cable to move the weight up 10mm - so I believe I have correctly computed the parameters to account for the various gear reductions, drum diameter, etc.
So my understanding is that I need to use a custom kinematics file to provide the kinematics / math needed to translate from the desired cartesian coordinates to the resulting joint rotations. The math is a bit complicated because the cables wrap around the drum and I need to account for both the length of the tangent line as well as the part of the cable wrapped around the drum.
Never the less - I believe I have correctly ascertained the math necessary to compute the left and right drum rotation (from home position of 0,0) to achieve a desired X,Y location for the truncation of the two cables. I believe these are inverse kinematics, correct?
Beyond this, I understand LinuxCNC is looking for the "Forward" kinematics - (given a left and right cable length, what is the resulting X,Y location. This math is a bit more complicated and required numerical methods (Newton Raphison - basically "guess and check").
I believe I have "solve" both forward and inverse kinematics conceptually - I have verified that my math is basically working - I wrote a simple program using Processing and I can feed in a desired X,Y location and my Processing program will correctly spit back the change in cable length from home of 0,0. Likewise, I have confirmed that my Forward kinematics seem to be working - I can input the change in cable lengths (from home) and my processing program will output the resulting X,Y.
My custom kinematics (attached) will compile but It's not working yet but I have some conceptual blocks that I could use some assistance on that might help me debug.
the man file states: 3) If required, add hal pins following examples in
the template code
I honestly don't really understand what a hal pin is and whether these are required. I'm running my code on a Raspberry pi if it matters.
I don't really understand why LinuxCNC requires Forward kinematics (even though I think I've solved them). I will be feeding this program G-Code with desired cartesian coordinates and relying on LinuxCNC and my kinematics to resolve these to the desired drum rotations (Inverse kinematics, right?). I don't have any feedback in my device so what does LinuxCNC do with the Forward kinematics?
My inverse kinematics routine computes the drum rotations FROM HOME to a desired X,Y. Is this correct?
I'm not sure how all of this works with "homing" With a conventional CNC I understand you would use limit switches to "home" each of the axis but I don't really have that option since there is no physical "home" for either drum (both of which turn multiple turns). My general approach was going to be to manually "drive" the two drums to the known 0,0 and then manually "home" . Is this viable? Any advice?
My CableKins.comp file is attached. I'm basically breaking out of the forward kinematics since that was erroring out but I'm not getting expected results. If you see any glaring issues I'd appreciate any guidance.
Thanks for any nudges in the right direction!
Please Log in or Create an account to join the conversation.
correctNever the less - I believe I have correctly ascertained the math necessary to compute the left and right drum rotation (from home position of 0,0) to achieve a desired X,Y location for the truncation of the two cables. I believe these are inverse kinematics, correct?
hal pins are used to connect signals in the hal layer. If your kinematic does do not need real time information from hal (eg tool length) then you do not need to add any pins.I honestly don't really understand what a hal pin is and whether these are required. I'm running my code on a Raspberry pi if it matters.
I believe in your case the forward kinematic is only used until the machine is homed. (ie to calculate the initial XY position) But I might be wrong about that.I don't have any feedback in my device so what does LinuxCNC do with the Forward kinematics?
Note: Looks like it is possible to also run either inverse / forward kinematics only (but I have never used that or seen it used):
linuxcnc.org/docs/devel/html/motion/kine...rward-transformation
KINEMATICS_IDENTITY (each joint number corresponds to an axis letter)
KINEMATICS_BOTH (forward and inverse kinematics functions are provided)
KINEMATICS_FORWARD_ONLY
KINEMATICS_INVERSE_ONLY
That is correct, for HOME = (0,0) and provided you have not built any offsets into your model (eg a tool-offset)My inverse kinematics routine computes the drum rotations FROM HOME to a desired X,Y. Is this correct?
So what is the error you are getting?My CableKins.comp file is attached. I'm basically breaking out of the forward kinematics since that was erroring out but I'm not getting expected results. If you see any glaring issues I'd appreciate any guidance.
Please Log in or Create an account to join the conversation.