Basic XY Screw Mapping - Geo Table

Moderators: TomKerekes, dynomotion

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Mon Jan 31, 2022 2:48 am

Trying. Are you referencing the "solution explorer"? I do not see anything for "source files"

Also, there is a define at the top of the other kinematics classes that I could not find any information regarding. I copied and changed the name but have no idea what it is:

AFX_KINEMATICSBASICMAPPING_H__876A0A72_6EC3_48D0_9040_60AE3DA2F3C7__INCLUDED_

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Mon Jan 31, 2022 2:57 am

I looked all files in the "solution explorer" and saw my .cpp and .h as I scrolled down under GcodeInterpreter. They both had a no symbol. Right clicked on them and "Include in Project." Now it builds without error.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Mon Jan 31, 2022 3:07 am

Scratch that. I don't know what I did, but things seemed weird so I started from scratch.

When first opening your clean BuildAllLibs solution, I do see the source file folder. I can right click and "add -> existing item..." and choose my files.

After adding the lines to the stdafx.h and coordmotion.cpp, it rebuilt without errors. Also way easier to find the files in the explorer window. Not sure what I had done before, but I sure mucked it up well.

Thanks for the redirect. On to figuring out my math now.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Sat Feb 05, 2022 9:51 pm

Tom,

I have made some progress. Stumped right now with some issues relating to reading files.

See attached Kinematics setup file.

When I use GetParameter(), I was not getting it to find the Kinematics.txt file that sits in the KMotion\Data folder. I adjusted the file address in GetParameters() to FILE *f = fopen(".\\KMotion\\Data\\Kinematics.txt", "rt"); and then it worked. Does this break anything else or is there something better that should be done?

Also, my kmotion4.35f directory blew up to about 1.4gb after I built the release. Is that to be expected?

I am fighting with pointers and the version of ReadGeoTable that I am using to pull in the individual screw mapping. I may need some help there if I cannot figure it out shortly.
Attachments
Kinematics.txt
(121 Bytes) Downloaded 58 times

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Sat Feb 05, 2022 10:24 pm

When I use GetParameter(), I was not getting it to find the Kinematics.txt file that sits in the KMotion\Data folder. I adjusted the file address in GetParameters() to FILE *f = fopen(".\\KMotion\\Data\\Kinematics.txt", "rt"); and then it worked. Does this break anything else or is there something better that should be done?
The libraries expect a particular directory structure. When they start up they ask where they are located and are expecting something like:

C:\KMotion435f\KMotion\Debug\GCodeInterpreter.dll
or
C:\KMotion435f\KMotion\Debug\GCodeInterpreter.dll

It then strips off the ending and sets MainPath as C:\KMotion435f\KMotion

GetParameter adds \Data\Kinematics.txt to open the file.

If your project targets the libraries in an odd place that might be the problem. Check where GCodeInterpreter.dll is located and its timestamp shows as the one newly built.

Or set a breakpoint and look to see what file it is trying to open.

Using ".\\KMotion\\Data\\Kinematics.txt" probably isn't a good idea because that is based on the "current directory" which may change if someone browses or something. Also other things may not find things in the expected place.
Also, my kmotion4.35f directory blew up to about 1.4gb after I built the release. Is that to be expected?
yes
Regards,

Tom Kerekes
Dynomotion, Inc.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Sat Feb 05, 2022 10:50 pm

If your project targets the libraries in an odd place that might be the problem. Check where GCodeInterpreter.dll is located and its timestamp shows as the one newly built.
I am building the release since I have to build on a PC not attached to Kflop. The GCodeInterpreter.dll is in the Kmotion\Release path.

Kmotion was able to find the Kinematics.txt file to load the proper kinematics, but GetParameters was not finding it until I forced the path.

I was trying to use the mainpath approach that GetParameters uses to find my map files in the data path as well and it also had failed. For both I had to force as noted. Without, the root path appears to be KMotion435f since it found the files when I stuck them there.

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Sat Feb 05, 2022 11:18 pm

I am building the release since I have to build on a PC not attached to Kflop.
Why not debug this on the PC that is building the code? (it shouldn't need a KFLOP to open the file). Do you know how to debug?

The GCodeInterpreter.dll is in the Kmotion\Release path
Did you mean C:\KMotion435f\KMotion\Release ?

I was trying to use the mainpath approach that GetParameters uses to find my map files in the data path as well and it also had failed. For both I had to force as noted. Without, the root path appears to be KMotion435f since it found the files when I stuck them there.
It isn't clear to me what you are saying
Regards,

Tom Kerekes
Dynomotion, Inc.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Sat Feb 05, 2022 11:21 pm

Tom,

Here are my files. It is not acting well. My best guess is either I have a simple math error or my use of the screw map array is a problem.

My comments with **** within are my red flags of areas that I need to either clean up or have probable errors.

When I run my machine with only the X being mapped, it is jumpy and throws a follow error. When I jog really slow, the DRO reads increasing and decreasing values that never go above 0.1". That is making me think my array adjustment using delete[] and new [] may be the culprit (as in my incorrect use of them).

If you get a chance, please look over my mess. I will be back at it tomorrow with rested eyes.

Thanks
Attachments
XscrewData_inchBasic.txt
(13.89 KiB) Downloaded 58 times
Kinematics.txt
(121 Bytes) Downloaded 49 times
KinematicsBasicMapping.h
(1.92 KiB) Downloaded 65 times
KinematicsBasicMapping.cpp
(8.71 KiB) Downloaded 58 times

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Sat Feb 05, 2022 11:30 pm

Why not debug this on the PC that is building the code? (it shouldn't need a KFLOP to open the file). Do you know how to debug?
I did not realize I could debug without the kflop. I will try that tomorrow.
Did you mean C:\KMotion435f\KMotion\Release ?
yes
It isn't clear to me what you are saying
Sorry. Need sleep. Essentially, C:\KMotion435f\ seems to be root when I use fopen() with file name only, no directory included. I think with your original code, GetParameters found the file when I created C:\Data\kinematics.txt. I would need to retest that to see if it is true.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Sun Feb 06, 2022 7:05 pm

Turns out I have both math and array usage issues. Working on that. I don't have a good grasp on sending my array pointers when I am trying to resize the arrays. I sort of have it working, but have a bigger issue first...

Something is limiting the position to 10.0" even when I completely bypass my adjustments in my TransformCADtoActuators to have it spit back out exactly what it receives. I can run KmotionCNC, initialize, move accurately with corrected screw positions up to 10", then it won't go past without either a follow error or springing back to 10 when I try to jog past. Does that ring any bells?

Post Reply