Softlimits and scara kinematics

Moderators: TomKerekes, dynomotion

Ibzan
Posts: 16
Joined: Thu Sep 22, 2022 9:03 pm

Re: Softlimits and scara kinematics

Post by Ibzan » Thu Sep 29, 2022 9:52 pm

:D
TomKerekes wrote:
Thu Sep 29, 2022 6:28 pm
Visual Studio has various build configurations. Basically Debug and Release. Debug is less optimized and easier to Debug. Release is more optimized but difficult to debug. Debug code is placed in the \KMotion\Debug folder. Release code is placed in the \KMotion\Release folder.

Your desktop icon probably points to the Release folder. If so rebuild in the Release Configuration to recompile the Release code.
Thank you very much, I was able to load it correctly and everything seems to work fine, let's see if in a few days I'll clean up the equations and upload a video of how it works.

Greetings and thanks for the help. :D :geek:

User avatar
TomKerekes
Posts: 2868
Joined: Mon Dec 04, 2017 1:49 am

Re: Softlimits and scara kinematics

Post by TomKerekes » Thu Sep 29, 2022 11:22 pm

Great. Can't wait for the video. Please tag Dynomotion.
Regards,

Tom Kerekes
Dynomotion, Inc.

Ibzan
Posts: 16
Joined: Thu Sep 22, 2022 9:03 pm

Re: Softlimits and scara kinematics

Post by Ibzan » Sun Oct 16, 2022 10:15 pm

TomKerekes wrote:
Thu Sep 29, 2022 11:22 pm
Great. Can't wait for the video. Please tag Dynomotion.
I share these videos of the Planar Robot operation. (It is for testing purposes) I am working to implement it in a more professional way.

[Youtube]https://www.youtube.com/watch?v=F0LN8sB59fc[/youtube]
[youtube]https://www.youtube.com/watch?v=AFPeN_TAvDY[/Youtube]
TomKerekes wrote:
Thu Sep 29, 2022 11:22 pm
What do you mean by Planar Robot? Scara? It seems that has different Kinematics.
I used the kinematics of the Robot Scara as a reference (leave the same name of the scara but the kinematics is different).
TomKerekes wrote:
Thu Sep 29, 2022 11:22 pm
If the path is distorted then some parameter must be wrong (assuming the actuators have small errors).

Have you checked things like the actuators degrees per count?

Have you checked that you are not loosing counts or steps? Check for drift after may back and forth motions.

Otherwise start with simple motions. ie +/- 2inches in X. +/-2 inches in Y. Are distances correct? Are the motions orthogonal?
I will review all these aspects in detail.
TomKerekes wrote:
Thu Sep 29, 2022 11:22 pm
Yes you can use your own Control method. The Control must be performed in real-time in KFLOP (Kinematics are not real time and performed in the PC). Configure the KFLOP axis as No Output and write a User C Program to do your algorithm and write the output based on the Axis's desired Destination.
If I understand correctly, what you are saying is:
1) Write my C program for my new control method to use.
2) Set the Kflop No Output
2) Load my C program with INIT so that it is always running? Taking into account the values ​​of the measurements of the encoders to use them in the control.
Are the steps I indicated correct?
Attachments
imagen_2022-10-16_170442673.png
INIT
images.png
planar Robot
images.png (4.17 KiB) Viewed 2934 times

User avatar
TomKerekes
Posts: 2868
Joined: Mon Dec 04, 2017 1:49 am

Re: Softlimits and scara kinematics

Post by TomKerekes » Sun Oct 16, 2022 10:22 pm

If I understand correctly, what you are saying is:
1) Write my C program for my new control method to use.
2) Set the Kflop No Output
2) Load my C program with INIT so that it is always running? Taking into account the values ​​of the measurements of the encoders to use them in the control.
Are the steps I indicated correct?
Yes merge your algorithm into the Init program at the end in a forever loop.
Regards,

Tom Kerekes
Dynomotion, Inc.

danabradbury
Posts: 2
Joined: Sat Nov 29, 2025 8:50 pm

Re: Softlimits and scara kinematics

Post by danabradbury » Sun Nov 30, 2025 9:56 pm

I'm following this series of posts to setup a scara robot arm. I think I'm close but missing a couple things.

I have copied the provided scara kinematics file and made one change to the arm lengths. But I am missing where I set values for pulses per degree?
Maybe these come from setting up KmotionCNC? I think I could set the values directly in my kinematics file, but I think I'm missing something as the example file reads them in?

scaraScreenShot2.JPG
scaraScreenShot1.JPG

User avatar
TomKerekes
Posts: 2868
Joined: Mon Dec 04, 2017 1:49 am

Re: Softlimits and scara kinematics

Post by TomKerekes » Sun Nov 30, 2025 10:16 pm

Hi Dana,

Yes if you’re using KMotionCNC those can be set in the Tool Setup | Trajectory Planner Screen. Note even though the variable is called CountsPerInch it is actually counts per degree for an angular axis.

Not sure what you mean by the example file reads them in.
Regards,

Tom Kerekes
Dynomotion, Inc.

danabradbury
Posts: 2
Joined: Sat Nov 29, 2025 8:50 pm

Re: Softlimits and scara kinematics

Post by danabradbury » Thu Dec 04, 2025 4:07 pm

Thanks Tom,

Setting the values in the trajectory planner worked. I can now make some xyz motion from KmotionCNC and the results seem reasonable. The image isn't much, but it shows a sharpie drawing straight lines just by jogging x and y and changing the height by jogging z.
PXL_20251204_002305304.jpg
But I'm still missing something, some jogs cause an oscillation that I can't quite explain. The youtube video shows the pen moving in x back towards base, then in y+. Shortly after it starts moving in y it starts to oscillate while I'm still holding the y jog button. When the arms are father out, so a smaller angle between the arms, the y direction works fine.

One thing I'm a little confused about is homing, or more like starting from a known position. I have have done nothing really to tell the machine where is 0,0 or how that translates to angles. And this seems wrong, like I have really skipped a step?

The individual motion of each axis seems very smooth and predictable, for example when I use the console to send move commands, or via c code. Maybe I'm hitting angles where the kinematics are not calculating right? Frankly I'm a little lost, I guess I'm looking for general guidance on what my next trouble shooting step should be?

Thanks
Dana
[youtube]https://www.youtube.com/watch?v=Zl-Qn7YpgXY[/youtube]

User avatar
TomKerekes
Posts: 2868
Joined: Mon Dec 04, 2017 1:49 am

Re: Softlimits and scara kinematics

Post by TomKerekes » Thu Dec 04, 2025 11:46 pm

Hi Dana,

Jogging with non-linear kinematics is actually somewhat more complex than coordinated motion because it can start/stop/change direction unpredictably unlike coordinated motion that can be pre-planned. Let's get the homing sorted out and see how it moves.

I think the axes should homed in a way such that the primary axis should point in the X direction when at 0 and the second axis in line with the primary axis when at 0 like the diagram below as described in the posts above. But you haven't described your geometry to us.

brazo3.png
brazo3.png (58.75 KiB) Viewed 10 times

Does the system operate properly when running GCode or using the Jog 'Step' Buttons (which perform pre-planned coordinated motion)?
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply