- Posts: 566
- Thank you received: 0
Is it possible to combine M67 and pyVCP?
What we have for spindle:
We set rotation with M3 S### and after that we can decrease spindle rotation with buttons on panel.
I want to make the same for may analog output. Analog output should regulate power using PWM of laser.
Does it's possible to make such mathematical calculations in pyVCP?
I see my aim as:
1) I create scale in pyVCP with some value "k1"
2) I need to make math calculations P=k1*Q0; (it's floating point calculatiosns, Q0 - is output 0 of M67)
3) Connect P => pwmgen.0.value
And after that this calculations should be fast to work on flow of running G-code with G64 (maximum possible speed).
Does it's possible to realize it? What ways of doing it?
Please Log in to join the conversation.
Please Log in to join the conversation.
forum.linuxcnc.org/plasma-laser/32691-settings-from-g-code-file
Here we had a real time component catching the M67/M68 analog value and sending it to the python screen handler for the Gmoccappy Plasma sim. This allowed setting of a GUI variable from gcode. And yes any maths becomes trivial in Python. (or in the component if real time is required).
Please Log in to join the conversation.
As for rodw answer, it's very interesting, I must study it.
Please Log in to join the conversation.
Spindle override USED
Please Log in to join the conversation.
It's only useful if you want to use laser as cutter. If you want change power "on-line" than in such way your program will stops each time when in G-code be writtent <S###>.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22010
- Thank you received: 3
Me too.aleksamc wrote: No, it's not. I used such way at first.
Please Log in to join the conversation.
rodw wrote: Here we had a real time component catching the M67/M68 analog value and sending it to the python screen handler for the Gmoccappy Plasma sim. This allowed setting of a GUI variable from gcode. And yes any maths becomes trivial in Python. (or in the component if real time is required).
I just want to clarify something here.
If you want realtime control of the laser power then any scaling has to be done in HAL by a realtime component.
It's OK to pass a value out of the GUI in the HAL as a factor, because anything you operate by hand is inherently not realtime or synchronised to motion. But the scaling should be in HAL realtime, not in Python.
M67 is the best way to change laser power in G-code as it does not break path blending, whereas using S or Z can.
But bear in mind that the final laser power setting needs to be an M68, as M67 takes effect the moment that the next axis move starts. And at the end of the program there might not be one.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22010
- Thank you received: 3
I have solved that issue with adding M3 and M5 to gcode and wiring spindle on to pwm enable, and adding G1 X0 y0 z0 M67 E0 Q0 at the end of gcode files, this way even when i hit ESC it disables PWM so the pressure or laser will be off.andypugh wrote: But bear in mind that the final laser power setting needs to be an M68, as M67 takes effect the moment that the next axis move starts. And at the end of the program there might not be one.
Please Log in to join the conversation.
My logic looks like:
It gives me posibility to worke with laser and spindle simultanously. But I'm sure I will never work like this because
spindle makes a lot of dust that can demage laser lense.
Please Log in to join the conversation.
