- Posts: 4
- Thank you received: 0
Pin with currently used motion command
5 years 11 months ago #190329
by RKtech
Pin with currently used motion command was created 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
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 to join the conversation.
5 years 11 months ago #190333
by Aciera
Replied by Aciera on topic Pin with currently used motion command
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
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
Please Log in to join the conversation.
5 years 11 months ago #190355
by RKtech
Replied by RKtech on topic Pin with currently used motion command
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
I have TRUE/FALSE in the "laser-active-motion" signal and that's what I need. THX
With type 2 and 3 I got what I need, and with this HAL config
Code:
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
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
5 years 11 months ago #190360
by tommylight
Replied by tommylight on topic Pin with currently used motion command
Well that was quick ! 
Nicely done.
Nicely done.
Please Log in to join the conversation.
Time to create page: 0.085 seconds
