Basic XY Screw Mapping - Geo Table

Moderators: TomKerekes, dynomotion

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Sat Apr 09, 2022 3:01 pm

Again that is a classic problem with floating point math you must always assume things wont be exact. 48.8/0.1 may result in something like 487.9999999999999 if you simply convert this to integer the result will be 487. If you add 0.5 to round off or even add 0.000000001 the result will then be 488.
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 » Mon Apr 11, 2022 12:06 am

Thanks again, Tom.

I found you were hiding a nugget from me. Probably just getting a laugh out of my floundering ;) I cleaned up my int error rounding and used your RoundToReasonable() for comparisons of doubles. Now it is better.

I attached the affected c programs in case anyone ever wants them.
Attachments
ScrewMap_CheckX.c
(11.75 KiB) Downloaded 105 times
ScrewMapAxisX.c
(19.11 KiB) Downloaded 100 times

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

Re: Basic XY Screw Mapping - Geo Table

Post by MadTooler » Tue May 24, 2022 9:08 pm

Tom,

The machine has been collecting dust for a handful of weeks waiting for me to finish my mapping process and some sweet spot temperate days.

I am finishing up installing upgraded limit switches and cleaning out a few more cobwebs then should be running all the of programs to capture the map this week.

While running my check program earlier (where it pulls measurements with the map applied), I had a very nasty jump. I happened to be standing at the machine while it was approaching 42.2 or 42.3 I think (see attached). The machine jumped and actually lost position at both the scale and encoder, but did not have a follow error. I want to say there was a very nasty power spike/noise as I was taking a picture at the same time and the jump occurred and what I thought was my flash on the camera may have been a quick surge or a strong flash from the overhead failing fluorescent ballast. I have not seen any other issues like this, but it does put the fear in me that I have some bad math hidden somewhere that will bite me hard when I am machining. Although, I did have another mapping sequence stop due to a follow error.

If you get a chance, could you take a gander at my last posted kinematic to see if there is anything that stands out to you that could possibly cause some extreme jumps?

Thank you.
Attachments
ScrewMappingCheckResults_Y_full_48_800x0_100_75-78degWarmed_04122022_WTF_jumpedAround43andHeardItHappen.pdf
(62.61 KiB) Downloaded 82 times

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

Re: Basic XY Screw Mapping - Geo Table

Post by TomKerekes » Tue May 24, 2022 11:28 pm

I don't see anything obvious.

You might test it moving outside of the range of the table to verify that code works properly.

What is your max following error set at?
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 » Wed May 25, 2022 2:33 am

Thank you for taking a look.

Past tests worked well with before and beyond the map range. I tested it under its development with varying scenarios and it seemed good. I have not tested it lately since I am mapping the full length.

My MaxFollowingError=1000
30,000 encoder steps/inch
Max position error at max follow error would be 1000/30000=0.0333"
From what was recorded at 0.1" increments in my check file, looks like the instant error was within the max follow error, but I assume the control loop brings the position back constantly to the intended position so the maintained error seems weird to me.

The only reason my max follow error is as high as it is because of older mystery spikes in the encoder signals. I use to see rare but occasional 100 step instant spikes. Lots of grounding issues taken care of since, and a bad transformer at the pole by the electric company. Not sure if it has started up again, if so, time to change all the moving wires and e-carriers after almost 30 years of moderate use.

edit: why I initially posted X values and init values when my data was for Y is beyond dumb. Sometimes I unexpectedly broaden my abilities to be an idiot.

I fixed the values above and attached is my full init. Note Homing sets the values for soft limits.
Attachments
Init_PH4x4_CNC_PE.c
(6.75 KiB) Downloaded 89 times

Post Reply