Simple/Manual Centre Finder

  • Waldemar
  • Waldemar's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
30 Aug 2025 18:12 - 31 Aug 2025 11:48 #334152 by Waldemar
Simple/Manual Centre Finder was created by Waldemar
Hello all,

I'm a basic user of LCNC - I know it reasonably well, but don't use a tool changer, only have a basic through tool Z probe which gets occasional use - you get the idea: my set-up is pretty rudimentary but I get good results and productive use out of the software.

When I need to find the centre of a circular feature I've been touching a dowel off at three points around a circumference (fag paper or multimeter method) and feeding three sets of X,Y coordinates into a spreadsheet which then works out the centre for me, like so:





Here's the sheet in OpenOffice format.

It works, but I was wondering if there was a way to incorporate a simple centre finder tab into the interface, something that would look a little like this:

 

The first three buttons to touch off the three positions on the circumference and the 'FIND CENTRE' button to perform four ops:

Calculate the X,Y centre coordinates
Lift the Z axis to its G53 0
Move to the calculated X,Y centre
Set G54 (or current WCS) X,Y to 0,0

So I guess there would need to be six variables that get written using date from 'current position' numbered parameters #5420 & #5421

POSA_X
POSA_Y
POSB_X
POSB_Y
POSC_X
POSC_Y

And then the two calculated variables that are used in a subroutine to lift and move the spindle to the centre and zero out X,Y at the new position

CNTR_X
CNTR_Y

I get that this is still clunkier than using a probe, but I honestly have little need for one!  If I have to keep punching the numbers into the spreadsheet then that's fine, but to have this in a tab would be cool.  Am I thinking about this in the right way?

How would you tackle it?

Many thanks.

Wal.
Attachments:
Last edit: 31 Aug 2025 11:48 by Waldemar.
The following user(s) said Thank You: COFHAL

Please Log in or Create an account to join the conversation.

More
31 Aug 2025 16:01 #334185 by andypugh
Replied by andypugh on topic Simple/Manual Centre Finder
Yes, that can be done. I would use GladeVCP because that allows you to automatically run Python code when a control value changes.

My gear hobbing screen has a similar thing, where entering the tooth counts and tooth pitch calculates a number of gear parameters.

There is a zip file here, though I don't know how much help it would be.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing

You basically need 6 entry boxes, and two/three display boxes.
I would be tempted to add a button to automatically G0 to the centre, once found, and maybe another to set the origin.
(The latter two options would involve interacting with LinuxCNC using the Python Interface (probably using Pythin to create G-code command strings)

Please Log in or Create an account to join the conversation.

More
31 Aug 2025 16:02 #334186 by andypugh
Replied by andypugh on topic Simple/Manual Centre Finder
Rather than set-pos buttons, and calculate button, I would bind recalculaiton to the on-change event of the entry boxes.

Please Log in or Create an account to join the conversation.

  • MarkoPolo
  • Away
  • Elite Member
  • Elite Member
More
31 Aug 2025 22:07 #334204 by MarkoPolo
Replied by MarkoPolo on topic Simple/Manual Centre Finder
I used your formulas for calculating the center of a circle and created a widget for qtdragon that does it.
(There's also a Python function that calculates the center from three coordinates.)
You're using axis, so it probably won't be useful to you.

 
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.172 seconds
Powered by Kunena Forum