Simple/Manual Centre Finder
- Waldemar
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 34
- Thank you received: 11
01 Sep 2025 23:06 #334246
by Waldemar
Replied by Waldemar on topic Simple/Manual Centre Finder
Just been perusing some of the threads on Flex - really interesting. I'll definitely have a closer look..!
The following user(s) said Thank You: JT
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19752
- Thank you received: 4584
04 Sep 2025 22:36 - 04 Sep 2025 23:15 #334448
by andypugh
Replied by andypugh on topic Simple/Manual Centre Finder
This captured my interest, so I made one.
Drop the two attached files into the same folder as your INI file.
Then, in the [DISPLAY] section of the INI file add:Be careful with the buttons, they are not tested on real hardware.Set Zero - should set the coordinate system zero to be the centre of the probed circle (considers G54 etc but not G92 at the moment)GotoZero does a Z-hop of (currently) 20mm then G0 X0 Y0.The diameter measured has 6mm subtracted from it to allow for probe diameter.The Z-hop and probe diameter are constants defined near the top of the python file. Feel free to edit to suit.This uses GladeVCP. As has been suggested elsewhere, there are other VCP frameworks, but Glade works well enough with Axis.
Drop the two attached files into the same folder as your INI file.
Then, in the [DISPLAY] section of the INI file add:
EMBED_TAB_NAME=Centre Finder
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -x {XID} -u ./CentreFinder.py ./CentreFinder.ui
Last edit: 04 Sep 2025 23:15 by andypugh.
The following user(s) said Thank You: Waldemar
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19752
- Thank you received: 4584
04 Sep 2025 22:39 - 04 Sep 2025 23:11 #334450
by andypugh
I have just realised that my thingy requires you to type in the values. That's not as ergonomic as one might hope. Give me a few minutes.
Files updated
Replied by andypugh on topic Simple/Manual Centre Finder
Files updated
Last edit: 04 Sep 2025 23:11 by andypugh.
The following user(s) said Thank You: Waldemar
Please Log in or Create an account to join the conversation.
- Waldemar
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 34
- Thank you received: 11
09 Sep 2025 07:37 #334675
by Waldemar
Replied by Waldemar on topic Simple/Manual Centre Finder
Cheers Andy,
I'll get hold of 2.9.5 and try it out on the sim!
I'll get hold of 2.9.5 and try it out on the sim!
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Premium Member
-
Less
More
- Posts: 125
- Thank you received: 23
04 Nov 2025 22:18 #337844
by pgf
Replied by pgf on topic Simple/Manual Centre Finder
This is a good thread!
My probing support is in sort of a middle ground, niether fully manual, nor fully automatic. My automatic touchoff probes, and my manual touchoffs, all get logged to a file, courtesy LOGAPPEND/LOG/LOG_CLOSE. For a long time that log wasn't used -- it was just a byproduct of some sample code I'd started with over a decade ago.
But earlier this year I had a need to match the machines coordinate system to my workpiece. ((It was easier than trying to get it clamped down in perfect alignment.) So I wrote some (external) code to pull data from that probe logfile. The code took the last couple of touchoff points, and calculated the rotation angle of a line drawn through those points. And then printed the g-code command necessary to adjust the current coordinate system's rotation, i.e. "G10 L2 P0 R $angle". Later, I realized I could also use the log to find the center point between two probes, so I added that. If the two most recent probes were both done in the same direction, then they were likely probing an edge, and it prints the angle of the edge. If they were done in opposite directions, they were likely probing two edges (inside or out) of something whose center I'm interested in.
And then today, after finding this thread, I enhanced it a little more: It can now also look at the last three probes in the log file and give me the center point of the circle they describe.
All without any data entry, or modifications to my existing probing code. It runs from a button on my desktop (i.e. outside of and beside Axis), and puts up a window with its results. I simply copy the g-code commands it gives to the MDI window.
I'm happy to share what I have, but with caveats: a) it's written in shell, because that's what I like to do, and b), it calls out to a calculator program for the floating point. Almost any other language would have avoided 'b'.
Anyway, thanks for the inspiration, and for the center-finding equations.
My probing support is in sort of a middle ground, niether fully manual, nor fully automatic. My automatic touchoff probes, and my manual touchoffs, all get logged to a file, courtesy LOGAPPEND/LOG/LOG_CLOSE. For a long time that log wasn't used -- it was just a byproduct of some sample code I'd started with over a decade ago.
But earlier this year I had a need to match the machines coordinate system to my workpiece. ((It was easier than trying to get it clamped down in perfect alignment.) So I wrote some (external) code to pull data from that probe logfile. The code took the last couple of touchoff points, and calculated the rotation angle of a line drawn through those points. And then printed the g-code command necessary to adjust the current coordinate system's rotation, i.e. "G10 L2 P0 R $angle". Later, I realized I could also use the log to find the center point between two probes, so I added that. If the two most recent probes were both done in the same direction, then they were likely probing an edge, and it prints the angle of the edge. If they were done in opposite directions, they were likely probing two edges (inside or out) of something whose center I'm interested in.
And then today, after finding this thread, I enhanced it a little more: It can now also look at the last three probes in the log file and give me the center point of the circle they describe.
All without any data entry, or modifications to my existing probing code. It runs from a button on my desktop (i.e. outside of and beside Axis), and puts up a window with its results. I simply copy the g-code commands it gives to the MDI window.
I'm happy to share what I have, but with caveats: a) it's written in shell, because that's what I like to do, and b), it calls out to a calculator program for the floating point. Almost any other language would have avoided 'b'.
Anyway, thanks for the inspiration, and for the center-finding equations.
The following user(s) said Thank You: Waldemar
Please Log in or Create an account to join the conversation.
Time to create page: 0.064 seconds