Softlimits and scara kinematics

Moderators: TomKerekes, dynomotion

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

Re: Softlimits and scara kinematics

Post by TomKerekes » Fri Sep 23, 2022 6:05 pm

Hi Ibzan,

That looks reasonable to me.

Please use our later Test Version 4.35h

Do you know how to set breakpoints and debug in VS? If so, I'd set a breakpoint in your equations and see if they are actually being executed. Then set the Actuators in KMotion to some simple case (ie Theta1 = 0 degrees and Theta2 = 90 degrees) and see if the transformation to CAD XY is working. If not, step through the equations to see what is wrong.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Softlimits and scara kinematics

Post by Ibzan » Sat Sep 24, 2022 7:59 am

TomKerekes wrote:
Fri Sep 23, 2022 6:05 pm
Hi Ibzan,

That looks reasonable to me.

Please use our later Test Version 4.35h



HTH
I already downloaded the KMotion 435h trial version, but I can no longer compile it in VS2019 or VS2022, I tried to search for the 2015 version but I couldn't download it anywhere. When I compile it, it sends me these errors. (Attached photos).
I don't know if I'm compiling it correctly. :roll: :?:
.
An apology if my doubts are very basic, and thank you very much for taking the time to answer.
Attachments
Captura de pantalla 2022-09-24 023822.png
Captura de pantalla 2022-09-24 023822.png (8.08 KiB) Viewed 527 times
Captura de pantalla 2022-09-24 023728.png
Captura de pantalla 2022-09-24 023705.png

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

Re: Softlimits and scara kinematics

Post by TomKerekes » Sat Sep 24, 2022 6:13 pm

Hi Ibzan,

You should be able to install VS2015 from the Microsoft Archives. I believe VS2015 Update 3 is the best Version. Note the installation option files have been removed from Microsofts on-line server so the Installation must be copied to your file system and installed from there. See here.

You should also be able to use VS2022 as described here.
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 Sep 25, 2022 7:46 am

Hello, Tom.
TomKerekes wrote:
Sat Sep 24, 2022 6:13 pm
Hi Ibzan,


You should also be able to use VS2022 as described here.
Hello, Tom.
Thank you very much for the help.
I already solved the compilation, with the steps that you indicate and I was able to use a different kinematics, but it does strange things to me.
Now I'm trying to debug the code to see what I'm doing wrong. :( :( :cry: :cry:
Attachments
imagen_2022-09-25_023302607.png
Captura de pantalla 2022-09-25 023020.png

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

Re: Softlimits and scara kinematics

Post by Ibzan » Sun Sep 25, 2022 8:25 am

TomKerekes wrote:
Fri Sep 23, 2022 6:05 pm
Hi Ibzan,


Do you know how to set breakpoints and debug in VS? If so, I'd set a breakpoint in your equations and see if they are actually being executed.
The truth is I don't know much about programming, I've used debugging in simple applications but not in these cases.
Steps 1 and 2 of the instructions that I mention cause me confusion. Where do I find KmotionCNC? It mentions that it has to be created, with what extension it has to be generated and how I link it with the new kinematics class, in order to do the debugging. :shock: :shock: :? :?

Very thankful
TomKerekes wrote:
Sat Sep 24, 2022 6:13 pm
1)Build KMotionCNC in Visual Studio in Debug configuration (Build Solution)
2)Set KMotionCNC as Startup Project (right-click on project if not already)
3)Debug | Start Debugging
4)File Open your Kinematics2AxisRobot.cpp
5)Set a breakpoint on first executable line in TransformCADtoActuators() (many ways to do this - a click in the margin is easiest)
6)The breakpoint should be hit immediately, the program halts, and a yellow arrow is shown over the red breakpoint dot)
7)hovering over variables should show the value
8)select variables and right-click | add watch to display in a watch window.
9)add variables x and y to a watch window so they can be altered
10)using the watch window change the x y values to something you know the answer to like in your previous posts
11)single step through the code checking the math as you go
note you can go back to a previous line right-clicking | set next statement
Attachments
Captura de pantalla 2022-09-25 031432.png

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

Re: Softlimits and scara kinematics

Post by TomKerekes » Sun Sep 25, 2022 6:33 pm

Hi Ibzan,

Your code is part of the GCodeInterpeter Library. You can tell Visual Studio to run KMotionCNC which uses this Library by setting this:

Debug.png
Then Debug | Start new instance GCodeInterpreter.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Softlimits and scara kinematics

Post by Ibzan » Thu Sep 29, 2022 8:52 am

TomKerekes wrote:
Sun Sep 25, 2022 6:33 pm
Hi Ibzan,

Your code is part of the GCodeInterpeter Library. You can tell Visual Studio to run KMotionCNC which uses this Library by setting this:


Debug.png

Then Debug | Start new instance GCodeInterpreter.

HTH

Thank you very much, Tom. Your help helped me a lot.
I have already reviewed my equations, and I already have them correct, but now a new problem, arose with the debugger the system works fine, however I compile it again and I want to openthe normal and program it doesn't work correctly.


Am I skipping an important step? :?: :?: :?: :?: :?:
Attachments
111111111111111.png
DEBUG
2222222.png
COMPILE
333333333.png
CLOSE VS

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

Re: Softlimits and scara kinematics

Post by TomKerekes » Thu Sep 29, 2022 4:35 pm

Sorry I don't understand the problem or what you are doing.

Are you trying to run KMotionCNC outside of Visual Studio? From the Debug or Release folder?
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Softlimits and scara kinematics

Post by Ibzan » Thu Sep 29, 2022 6:02 pm

TomKerekes wrote:
Thu Sep 29, 2022 4:35 pm
Sorry I don't understand the problem or what you are doing.

Are you trying to run KMotionCNC outside of Visual Studio? From the Debug or Release folder?
From Visual Studio, when i run it from visual studio KMotionCNC runs fine.For example, I am generating a circle in G code, if I execute it the Planar Robot moves properly and in the G code viewer the figure is correct (figure 1).

If I run it normally, that is to say from the desktop, the robot moves incorrectly and the figure it shows me in G code is incorrect (figure 2 y 3).

After debugging it, I give it complilar. I don't know if I'm missing an important step to update my code?


Thanks again for the help, I hope you understand my doubt or my problem.
Attachments
5.png
Figure 1
5555.png
figure 2
444444.png
figure 3

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

Re: Softlimits and scara kinematics

Post by TomKerekes » 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.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply