Nikolay-Kha / PyCNC

Python CNC machine controller for Raspberry Pi and other ARM Linux boards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Complete explanation about defining 4th axis as laser engraving please

pnumaple opened this issue · comments

Hi dear nikolay and everyone here...
i'm hossein...

i'm so excited from your project. i'm your big fan ... recently i test my LASER WITH DIY Arduino GRBL firmware and the speed of laser engraving for vector files was good , but for rastor files was dramaticly bad , because low buffer and serial connection for arduino Uno and some other reasons . when i saw your project , it makes me so excited (my electrons went to upper band with very high energy) and the mechanism for for solving real time problem is fantastic. Really Conguratulation to you... i have a question ...

I understand the main concepts about your explanation and thank you so much to your complete answer ...thats awesome... as you mentioned in comments, defining 4th axis is the best way to use laser ...
please explain more preciely and step by step for changes in files and pins that have been used...

Hello Hossein,
You would need to add additional axis to your gcode. For example 'L'.
So commands with laser would looks like:
G1X10L100
which would mean that movement should be performed with 100mW(may be even W) power on laser.
You don't have to modify anything in gcode parsing sources, you need to read this axis for any movements in gmachine.py like:
laser_power = gcode.get('C', self._laser_power)
and then pass this argument to interpolation functions. And here is the hardest part. You would need to simulate PWM for your laser according this power and mathematical functions. Then PyCNC convert this to real time pulses with respect to motors acceleration/breaking to laser power. To do this - try to understand how Linear interpolation works here - https://github.com/Nikolay-Kha/PyCNC/blob/master/cnc/pulses.py#L250
Hope this helps.

Thank you so much dear nikolay.
Yesssss.... that's very helpful. very precise and good expalin....
Thanks my bro...