Pin with currently used motion command

More
26 Nov 2020 12:27 #190329 by RKtech
Hi, I'm working on a laser engraving setup, where I use M64/M65 to power the laser on and of and M68 to set the power for the requested feed rate of the Gx move command. With the pin 'motion.current-vel' and 'motion.requested−vel' I calculate the reduction of the laser power while the laser is accelerating or decelerating, so the laser "strength" is constant over way.
Now I have modified the CAM part of HeeksCAD/HeeksCNC so when there is a switch from (for example) G0 to G1 the M64 (laser on) Command is added and when there is a switch to G0 a M65 (laser off) is added.
This is currentl working as expected, but I like to simplify it a bit (because I didn't like to make changes in the CAM code of an dedicated program if there is no need)

And here is my Question: Is there a pin in linuxCNC where I can get the information if the move is a rapid move or not? so I can put the logic to swich the laser on and off into the linuxCNC part?

Thanks for any ideas.
Rainer

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

More
26 Nov 2020 13:02 - 26 Nov 2020 13:03 #190333 by Aciera
Maybe this is useful?

motion.motion−type OUT S32

These values are from src/emc/nml_intf/motion_types.h

0: Idle (no motion)

1: Traverse

2: Linear feed

3: Arc feed

4: Tool change

5: Probing

6: Rotary axis indexing

linuxcnc.org/docs/html/man/man9/motion.9.html
Last edit: 26 Nov 2020 13:03 by Aciera.
The following user(s) said Thank You: tommylight, RKtech

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

More
26 Nov 2020 19:30 #190355 by RKtech
Thank you for your hint, this was exactly what I was looking for (I have several times read this man page but I always over read this motion-type).

With type 2 and 3 I got what I need, and with this HAL config
setp wcomp.0.min    1.9
setp wcomp.0.max    3.1
net machine-motion-type-s32    motion.motion-type  =>  conv-s32-float.0.in
net machine-motion-type-float  conv-s32-float.0.out => wcomp.0.in
net laser-active-motion     <= wcomp.0.out
I have TRUE/FALSE in the "laser-active-motion" signal and that's what I need. THX
The following user(s) said Thank You: tommylight, Aciera

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

More
26 Nov 2020 19:45 #190360 by tommylight
Well that was quick ! :)
Nicely done.

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

More
26 Nov 2020 19:48 #190361 by Aciera
Thanks for sharing that.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum