Set program zero using XY positioning laser

More
22 Jul 2025 13:53 #332180 by scsmith1451
Set program zero using XY positioning laser was created by scsmith1451
Hi all;

I've been converting from MACH3 to LCNC. In MACH3 I had configured an XY positioning laser using a macro that would allow me to jog to the program zero for a given project, then once positioned at the appropriate point I would click on a button that would calculate the X/Y offsets, move the spindle to the true program zero then set the G54 X/Y DROs to zero. This was very fast and accurate way to perform this task and along with a tool probe to zero the Z axis, program home is quickly established.

I would like to do something similar adding a button in the pyVCP to turn on the laser and once positioned a second button to compute the offsets, move the spindle to program zero, set the X/Y DROs to zero and turn off the laser.

Searching the forum, I've not found any info to work from. Has anyone configured a positioning laser on their system?  I'm a little rusty on my Python, but I can get back into it quickly or would classic ladder be a better option?  Any help would be greatly appreciated.

Kind regards

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
22 Jul 2025 14:59 #332186 by tommylight
Replied by tommylight on topic Set program zero using XY positioning laser
BUTTON_1_NAME = ZERRO\Materialit
BUTTON_1_CODE = G10 L20 P0 X89 Y29.5 \ G53 G0 Z-10
This is just to give you an idea, i use this on my plasma machines with laser cross.

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

More
22 Jul 2025 20:06 #332203 by scsmith1451
Replied by scsmith1451 on topic Set program zero using XY positioning laser
If I understand the BUTTON_1_CODE correctly, the G10 L20 P0 coordinate system is always offset to the fixed values defined by X and Y. How does positioning the cross-hairs to a difference starting position translate the offsets to the new location correctly?

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

More
25 Jul 2025 14:05 #332308 by scsmith1451
Replied by scsmith1451 on topic Set program zero using XY positioning laser
In my process to integrate the X/Y crosshair laser into my test machine configuration, searching the forum I read that gladevcp had a toggle button that sounded like it would work for controlling the laser on/off. Modifying my configuration with pncconf I replace my pyvcp with gladevcp using the default sample with just the spindle speed bar and spindle at speed LED.

Starting LCNC the machine an error was generated indicating that the n_rows property for the gladevcp was not valid. A little more forum searching if found the GTKbugfix.tar.gz archive and following the forum guidance copied the files to their correct location.

Upon restart of LCNC, the gladevcp panel displayed correctly. Excited, I decided to include the sample's Zero X/Y/Z/A buttons via pncconf.

Upon restart the following error was spit out:

ERROR: function 'abs.spindle' not found

Checking the HAL file it appears to be caused by this line:

addf abs.spindle servo-thread

Figuring that this was somehow connected with adding the ZERO buttons, I removed the buttons via pncconf and restarted.

Now LCNC generates the error every time it is started.

I'm befuddled and do not know where to go from here. Anyone have any ideas?

Kind Regards

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
25 Jul 2025 15:59 #332311 by tommylight
Replied by tommylight on topic Set program zero using XY positioning laser
What is the exact error?

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

More
25 Jul 2025 17:32 #332313 by scsmith1451
Replied by scsmith1451 on topic Set program zero using XY positioning laser

Upon restart the following error was spit out:

ERROR: function 'abs.spindle' not found

Checking the HAL file it appears to be caused by this line:

addf abs.spindle servo-thread


 

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

More
25 Jul 2025 18:01 - 25 Jul 2025 18:01 #332316 by PCW
Can If you post your hal/ini files?

The error is likely caused by a missing or mismatched

loadrt abs xxxxxx

line
Last edit: 25 Jul 2025 18:01 by PCW.

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

More
26 Jul 2025 11:25 #332360 by scsmith1451
Replied by scsmith1451 on topic Set program zero using XY positioning laser
Attached are the requested files. 

I have not made any manual changes to either of these files. They are both output from pncconf.

Kind Regards
Attachments:

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

More
26 Jul 2025 13:52 - 26 Jul 2025 13:57 #332365 by PCW
So at the beginning of the hal file
there is a commented out loadrt for the
abs function and later on an addf line
for that function that fails because
the function was never installed.

I suspect this is a bug in this pncconf
version when certain spindle functions are not
used. It turns out the the abs function
is never used, so simplest fix would be to delete
the addf abs.spindle line in the hal file.

#loadrt abs names=abs.spindle
#loadrt lowpass names=lowpass.spindle


addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.a.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf abs.spindle servo-thread
addf lowpass.spindle servo-thread

addf hm2_5i25.0.write servo-thread
setp hm2_5i25.0.dpll.01.timer-us -50
setp hm2_5i25.0.stepgen.timer-number 1

Edit:

Note that the same issue is there with the lowpass function.

I suspect these were added for some some spindle speed display
function, that was not used, and only 1/2 removed from the hal
file boilerplate
Last edit: 26 Jul 2025 13:57 by PCW.

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

Time to create page: 0.106 seconds
Powered by Kunena Forum