Change laser power based on feedrate?

Moderators: TomKerekes, dynomotion

amowry
Posts: 51
Joined: Fri Jan 26, 2018 1:00 am

Re: Change laser power based on feedrate?

Post by amowry » Thu Jul 23, 2020 4:27 am

Okay, thanks Tom! I may try a few options and see what works best.

amowry
Posts: 51
Joined: Fri Jan 26, 2018 1:00 am

Re: Change laser power based on feedrate?

Post by amowry » Mon Sep 07, 2020 11:11 pm

I'm back to working on this a bit more now, and I'm starting by trying to add a forever loop to my K2_INIT Servo.c program that includes a non-blocking time delay, as you suggested. Right now it just sends an RS232 command (or prints a message) once per second. It works, but when I try to do anything else or speed up the timing, I get a "Timeout waiting on Action to complete" error.

Would this be because there is a user callback running in my K2MC_driver.c program as well? I don't know of any other forever loops, but I might be missing something. I don't really understand how the callback works, and whether there can be another loop running in a different thread.

Thanks Tom!
Attachments
K2_Init Servo.c
(11.48 KiB) Downloaded 108 times
K2MC_driver.c
(3.06 KiB) Downloaded 110 times

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

Re: Change laser power based on feedrate?

Post by TomKerekes » Tue Sep 08, 2020 1:09 am

Hi amowry,

The forever loop is at the beginning of the main function. Because the forever loop loops forever nothing after it will ever be executed. Put the forever loop at the end after all the code that initializes the system.

Because the forever loop executes forever the INIT program will now never complete. If the button that executes it is configured to wait until it finishes after a while "Timeout waiting on Action to complete" error will be displayed. Configure the INIT program to execute the program without waiting.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

amowry
Posts: 51
Joined: Fri Jan 26, 2018 1:00 am

Re: Change laser power based on feedrate?

Post by amowry » Tue Sep 08, 2020 2:33 am

Oops, got it. Thanks Tom!

amowry
Posts: 51
Joined: Fri Jan 26, 2018 1:00 am

Re: Change laser power based on feedrate?

Post by amowry » Tue Sep 08, 2020 8:42 pm

This all worked out great. I'm changing the laser power every 10 mS based on the current feed rate, and it does wonders for smoothing laser engravings, and lets me increase my feed rates considerably. Thanks once again for your help!

Post Reply