Basic XY Screw Mapping - Geo Table

Moderators: TomKerekes, dynomotion

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Wed Feb 09, 2022 9:21 pm

You might try G0 moves with a very low Jerk setting to have it converge into position gradually. Or the KLP coordinated motion low pass filter.

I think the problem with temperature compensation would be to know what point on the machine the expansion occurs about. Do you know how the lead screw is held? ie rigid on one end but allowed to float on the other? Then there would be the expansion of the frame and whatnot. Maybe it doesn't matter if you assume the temperature doesn't change much for the duration of a single job.
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 » Thu Feb 17, 2022 3:08 am

I got a bit side tracked by another CNC machine design. Too many proverbial squirrels!

My lead screw is rigid at one end and has spring tension at the other to help pull the screw tight as it expands/contracts. I had been thinking about the fact that I have been homing to the floating end since that is where X0 sits. Not sure that matters or is best. Depending on what I am running, that could be more desirable or a more problematic scenario.

The more I think about it, the more I think temp comp could be troublesome. I think getting my mapping data should be at a neutral temp, but the benefits of full time temp compensation may be a mess when I run long (13 hour) full 3d surfacing jobs where I also have table (3/4" 6061 alum) and vacuum plenum (3/4" type1 PVC) and then the material itself. Even more, I usually have dust collection, coolant mister or compressed air, and either vacuum chuck or full spoilboard vacuum running. Trying to temp comp the screw while ignoring all the rest, not sure there is a gain there. Probably more appropriate to try and maintain shop temperature during the job.

We have had a very warm couple of days. I have re run the mapping and checks. I will post the results when I get another few minutes. From a quick glance, it looks pretty good when I map first thing upon turning on the machine and immediately run the check right after. I ran a few dozen full length moves of the screw after the initial check and it may have raised the screw temp a few degrees C. Running a check on it now for reference.

A thought back to my path issue in the GetParameter(). Maybe related, while running KmotionCNC, I sometimes get a notice something about not being able to find the gcode files (I think it has had trouble with the blank files more).
gcodeFileerror.PNG
gcodeFileerror.PNG (4.65 KiB) Viewed 348 times
I figured I screwed up something with the default path from within the machine parameters, but have not yet been able to figure out where. Could this be related and the source of why GetParameter's mainpath does not properly find the data directory?

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Thu Feb 17, 2022 6:04 pm

Yes aluminum has twice the expansion as steel.

That message occurs when you press New File which defaults to userX.c but don't save it. If you then exit KMotion and re-launch KMotion it trys to re-load the non-existent file. I don't think that is related.
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 » Thu Feb 24, 2022 2:35 pm

Here are the results from earlier. The important and more accurate lines on the "check" graphs are the green lines.

The initial measurements were taken when the machine was at 20C or 68F degrees upon initial startup so the screw/machine was as acclimated as possible.
The "cool" check graph was run immediately after the measuring of the screw and with the measurements applied with my basic screw mapping kinematic. It does what I wanted where the green error is very small, at least for my machine, within about 0.0002".
The "warm" check graph was run after I ran the machine back and forth the full travel of the screw for a few dozen passes. Per my thermal camera, the screw temp was raised 3 degrees C or 5.4F. Notice the very linear increase in error for the green line that exactly matches the thermal expansion profile of 1050 steel with that temperature rise!
Due to way too many variables involved with trying to temp correct the screws as well, I am taking the approach of mapping at a more room temp standard of between 68-74F and calling it good. My main interest in considering the additional control was because I am planning to machine a large plenum/vacuum/dowel fixture plate after the mapping is done. My fixture will be made from 3/4" type1 PVC. Considering all the thermal variances I will encounter, it will be a drag when I have to run my machine in temps very far from ideal room temp. Probably a better investment of my time would be in the upgrade of my struggling HVAC to keep temp more controlled.

From here I need to go back over all my code to allow for mapping in a negative direction and with the start of mapping not always at zero. I have determined I need to map my X axis in the opposite direction since my rigid bearings are at the X+ end. Same for Z if I were to ever apply it there too. Y would still be from 0 or Y- end. This will make my code more useful to others as well, if anyone ever wants it.

I also want to fix whatever path issue I have with GetParameter(). You said it should be easy to find. I have dug around but have not had any luck.
Where should I start?

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Thu Feb 24, 2022 4:47 pm

Very interesting. Thanks for sharing.

Regarding Path issue: I would debug it by setting a breakpoint where it creates the filename to open and see exactly what it is doing.
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 » Fri Feb 25, 2022 11:47 pm

Well, I don't understand vstudio debug setup like I thought I might. It gives me errors since I am within the dll and not running the exe. Beyond that, or maybe before it matters, I am not really sure where to be looking or at what for the path issue. Kind of thinking I am losing the interest in fixing it.

I did try stripping down any changes I have made, and even reset my data/ folder to your original, except to add kinematics.txt and my screwmap file, and it still does not find the path with the default fopen in GetParameter(). It looks in "C:\KMotion435f\Data" instead of the correct location "C:\KMotion435f\KMotion\Data."

I didn't change anything else, so don't think this is something I did (this time at least).

Does the "MainPath" used in GetParameter() fopen get initialized in CCoordMotion()? Is that somehow not being run because of my custom kinematic?

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Sat Feb 26, 2022 12:03 am

I forgot to explain. Use the BuildAllLibs.sln in debug configuration to compile and change your code. Then open BuildAllExamples.sln in another copy of VS in Debug Configuration. File Open the file in the dll you want to set the Break Point and set it. Then set as Startup Project something that uses the dlls such as KMotionCNC. Then Start Debugging KMotionCNC. It should hit your breakpoint in the dll. Hover on MainPath to see what it is. Yes it is set in CCoordMotion's constructor

CCoordMotion::CCoordMotion(CKMotionDLL *KM)

If its value is wrong step through the code to see why

HTH
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 » Sun Feb 27, 2022 1:03 am

I did not find "BuildAllExamples.sln". I found "BuildExamples.sln" in "C:\KMotion435f\PC VC Examples\BuildExamples." When I opened that, VS wanted to install some python stuff. I let it, now it blew everything up. over 1200 errors. Starting with "identifier "CString" is undefined GCodeInterpreter."

I don't know what is going on, but I think I will burn it all down. Reload VS and ignore the MainPath problem since I can give it the corrected path. Fixing this is causing much more significant problems.

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Sun Feb 27, 2022 6:04 pm

Oops I meant BuildExamples.sln

You could have just ignored or removed the python example.

CString is a MFC (Microsoft Foundation Class) thing so the MFC option is needed.

But if your workaround works then maybe use it. Moreover I was hoping you would learn to debug. That is virtually like being able to see after running blind.
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 » Sun Feb 27, 2022 6:38 pm

I have debugged with VS before, but it was many years ago. Totally different from what I remembered, but I was also using far smaller projects. I know it is super useful, but I also really can't stand the microsoft stuff and don't want to spend any more time in it than I have to.
CString is a MFC (Microsoft Foundation Class) thing so the MFC option is needed.
I had MFC installed before. Did my allowing of the python to install remove MFC and cause my pain? If not, what typically can cause an issue like this?

I was seeing over 1500 errors when I had none prior. I figure it was really a case where the first error cascaded to make it look worse than it is, but I literally did nothing to the code between no errors and error a plenty.

I uninstalled VS and will re-install later today or tomorrow.

Thanks for your continued help.

Post Reply