HAL Power Laser
- diegoroman17
- Offline
- Premium Member
- Posts: 140
- Thank you received: 2
I have linuxcnc installed in a laser machine. I am developing a plugin to CorelDraw that permit configure the power min and power max of cut for each color in the drawing. I am using the algorithm of post processor for EMC2 to create the GCode file. With respect to Power Laser I not have a decision yet. I have think create a file with power mins and power max of each layer and give this information to hal for interpolate the power with the velocity Eg. if velocity is 0 -> P is Pmin if velocity is max -> P is Pmax. It is my idea but I dont know if this is possible in HAL. I dont know if is possible read other files of power laser with HAL. I dont know if is possible write any flag in the GCODE for indicate to HAL that read the next line of power laser file. I dont know if can exist a better option for my purpose. Please help me.
I actually control the power laser with Spindle commands with PWM output.
XY axis is with stepper motors.
Z axis dont move.
Dont exist any feedback (encoders,resolvers,etc).
Please Log in or Create an account to join the conversation.
it's usual to use the spindle speed command to control the pwm to control a laser power output .
perhaps altering the feedrate velocity ,combined with as you suggest the spindle pwm level may work as you suggest .
the problem you may find is that gcode is read one line at a time , and therfore previous settings , may or may not be held
i'd be interested to know the outcome also
Please Log in or Create an account to join the conversation.
There is some information on a scheme (Graster) to do this here:hal for interpolate the power with the velocity.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Rastering_With_A_Laser
But it doesn't seem very elegant to me.
I made a start on a HAL component that imported bitmap files directly, but didn't get very far with it.
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
- Posts: 140
- Thank you received: 2
There is some information on a scheme (Graster) to do this here:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Rastering_With_A_Laser
This info is very interesting. I am checking the code but this HAL don't interpolate the PWM output spindle. It can do that exist differences of engraver in the zones of acceleration and desceleration its because the laser is held longer in these areas until the desired velocity. However this code can serve as a basis for something more elaborate
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
- Posts: 140
- Thank you received: 2
perhaps altering the feedrate velocity ,combined with as you suggest the spindle pwm level may work as you suggest .
Is not necessary altering the feedrate velocity. I plan obtain the actual velocity in hal with sqrt(dx^2+dy^2). With stream component in HAL read the power laser file and with this information interpolate the PWM to control the spindle (power laser).
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
- Posts: 140
- Thank you received: 2
www.linuxcnc.org/index.php/russian/compo...9386&limit=6&start=6
and it give me any ideas.
It is possible generate G code to make straight lines (G0 and G1 combination) and combine its with M64/M65 for enable or disable laser(my source power laser have a Enable Pin) along the line. I think that it is possible because LinuxCNC have lookahead. At the begin I should set power of laser with S command. The period of acceleration and deceleration can be compensated with extra space in the axis of move. Its avoid that laser burn more this zones.
I think that with this idea is possible have a better solution. Its avoid to have that create a new hal component and read external mask file.
Please Log in or Create an account to join the conversation.
It is possible generate G code to make straight lines (G0 and G1 combination)
…
Its avoid to have that create a new hal component and read external mask file.
Would you be interested in helping develop an idea I have for a HAL component that loads image files and laser-rasters them? All without G-code or Axis or the rest of LinuxCNC?
Please Log in or Create an account to join the conversation.
- diegoroman17
- Offline
- Premium Member
- Posts: 140
- Thank you received: 2
Would you be interested in helping develop an idea I have for a HAL component that loads image files and laser-rasters them? All without G-code or Axis or the rest of LinuxCNC?
Sure. I am disposed to help in anything that I can contribute.
I have that can the same idea but with CorelDraw evaluating the vector information and generate G-code for raster. it is a part for my thesis.
Please Log in or Create an account to join the conversation.
Sure. I am disposed to help in anything that I can contribute..
Well, I have run out of time on this (I spend most of the next month abroad away from my LinuxCNC machines) so here is a taster of what there is so far (not a lot, to be honest)
If you extract the attached file into the configs directory and then navigate into the directory in a terminal window and
halrun -I -f laser.hal
Then it will load up the UI, realtime component and halscope.
Then, if you set the halscope going and
setp laser_rt.start 1
at the command prompt you ought to be able to see the x and y command positions changing to generate a raster.
What isn't there yet:
A button to start
The stepgens in the HAL file (easy to add). It actually ought to be capable of generating a raster if connected to hardware.
homing
jogging
scaling
(The big one) any link to the actual image data. The GUI will load a file though, and does put it in to shared memory, and the realtime component can see it.
I will get back to it when I am back at home. Feel free to ignore it, or develop it, as you prefer. I was hoping to provide something a little more useful.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.