Scaling power based on % of imposed velocity

More
09 Jun 2024 21:13 #302711 by sin-do-re
Hello!

im currently running a laser setup with qtplasmac where I impose the % power with a potentiometer and voltage display.

but I would like to impose power with the “Cut Amps” parameter from Qtplasmac. This seems to be the most common approach with qtplasmac.

the problem is that on “pierce” and slowdown, the laser leaves the material burned.

I’ve seen Chinese controllers connected to Lightburn or Rdworks to allow for “min-power” and “max-power”, dependant on the % of max velocity, so if the axis is really slow it will decrease the laser power.

How can this be achieved within linuxcnc? Is there a way to enable this function with qtplasmac while still having the max power to be imposed by “Cut-Amps”? Even if laser power is given somewhere else, is there a way to scale it in lower speeds?

in the picture, the problem is visible, but it is much worse in other materials.


any help will be greatly appreciated.
thanks in advance
Attachments:

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

More
09 Jun 2024 21:59 #302713 by PCW
You could use motion.current-vel and the scale component to do this in hal

A better option might be to pass the current velocity through the
lincurve component to allow linearization since there is probably
not an exact linear relation between velocity and power needed
for the best cut
 
The following user(s) said Thank You: tommylight

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

More
21 Jun 2024 10:40 - 21 Jun 2024 10:42 #303480 by sin-do-re
thank you. ive seen your reply to my other post.

im considering this approach. could you please "criticize" it? haha
# Load the necessary HAL components
loadrt scale count=2
loadrt lincurve count=1
addf scale.0 servo-thread
addf scale.1 servo-thread
addf lincurve.0 servo-thread

# Capture the spindle speed output from the G-code command
net spindle-speed motion.spindle-speed-out => scale.1.in

# Connect the current velocity to lincurve
net current-vel motion.current-vel => lincurve.0.in

# Configure lincurve points for velocity to power scaling
setp lincurve.0.velocity-percent 0, 0.2, 0.4, 0.6, 0.8, 1.0  # Adjust these values for velocity percentages
setp lincurve.0.power-scale-percent 0.2, 0.3, 0.4, 0.6, 0.8, 1.0  # Adjust these values for scaling factors (20% at 0 velocity)

# Scale the spindle speed by the lincurve output
net power-scale lincurve.0.out => scale.0.in
net adjusted-power scale.0.out => scale.1.gain

# Scale the adjusted power to the 0-5V analog output range
setp scale.1.gain 5.0  # Adjust this value for the 0-5V range
net final-power scale.1.out => hm2_7i96s.0.7i96s.0.analogout0
Last edit: 21 Jun 2024 10:42 by sin-do-re.

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

More
21 Jun 2024 13:42 #303493 by PCW
That looks like basically what I was suggesting

The 7I96S pin name is not correct though, it should be something like:

net final-power scale.1.out hm2_7i96s.0.pwmgen.00.value

(you also need to enable the PWMgen)

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

More
21 Jun 2024 17:29 #303503 by sin-do-re
this might be a dumb question but why is it called pwmgen if it is an analog output? is it because of the old 7i96 (without the "S"?)

i will try this out soon and update on the results

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

More
21 Jun 2024 20:52 #303513 by PCW
The isolated analog voltage output on the 7I96S
is generated by PWM.

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

Time to create page: 0.244 seconds
Powered by Kunena Forum