Change laser power based on feedrate?
Moderators: TomKerekes, dynomotion
Re: Change laser power based on feedrate?
Okay, thanks Tom! I may try a few options and see what works best.
Re: Change laser power based on feedrate?
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!
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
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Change laser power based on feedrate?
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
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.
Tom Kerekes
Dynomotion, Inc.
Re: Change laser power based on feedrate?
Oops, got it. Thanks Tom!
Re: Change laser power based on feedrate?
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!