grblHAL / core

grblHAL core code and master Wiki
Other
320 stars 84 forks source link

Add a kinematic structure #211

Open ztcg888 opened 1 year ago

ztcg888 commented 1 year ago

I want to add another kinematics structure, such as DARM. I don't know how to add it, or directly modify the corexy kinematics implementation can do it? How to get started?

terjeio commented 1 year ago

How to get started?

Study the existing code? There are two basic approaches, corexy is the simplest with a straightforward transform, wall plotter is a bit more complicated as long lines has to be split up into small segments. Maslow (untested) is similar to wall plotter with the addition of settings and $ commands.

ztcg888 commented 1 year ago

Thank you! My friend, After seeing your reply, I have some confidence, I will try it!

dentikhval commented 1 year ago

How to get started?

Study the existing code? There are two basic approaches, corexy is the simplest with a straightforward transform, wall plotter is a bit more complicated as long lines has to be split up into small segments. Maslow (untested) is similar to wall plotter with the addition of settings and $ commands.

Dear Terje,

I have a working IK (Inverse Kinematics) solution with a clear input (Cartesian coord.) and output (joint angles), and I am sure many robotic arm builders would love it.

I do not fully understand the code structure of GrblHAL, maybe there is someone with a better understanding of all the existing features to implement this kinematic for GrblHAL as a full-featured solution rather than the minimal half-a$$ed implementation I will be able to come up with?

Please do not send me to study the code, I tried and it's too big.

terjeio commented 1 year ago

@dentikhval For the Wall plotter the code to deliver data into the core for motion is here - not very big and is basically what you have to add to your code. The init pass is used to calculate how many linear segments the programmed motion has to be turned into, after that each call to the function returns the intermediate target coordinates until the end target is reached. Perhaps someone with a robotic arm will be able to add this logic to your code? Adding the glue code that connects it to the core should not be too hard.

ztcg888 commented 1 year ago

 Thank you, my friend, and thank you for the way you provided. During this period of time, I am sorting out the process of the g code from receiving to turning into a single step of the motor. The coordinate conversion has not been found out yet. Here is Replacing the linear motion of the motor with an angle, the positive and negative kinematic functions may have been verified, but it is a bit messy when combined into the system. It looks a bit simple, and it is also difficult to debug, mainly because it is still not good for your entire system. Too familiar, but with your help, I think I will debug a little bit until I succeed!

Message ID: @.***>