Is there a Halpin for the current feedrate
- Aciera
 - 
				
									Topic Author
											 - Offline
 - Administrator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 4557
 - Thank you received: 2029
 
			
	
						01 Jun 2020 07:11				#169623
		by Aciera
	
	
		
			
	
			
			 		
													
	
				Is there a Halpin for the current feedrate was created by Aciera			
			
				I'm using master branch and I'm trying to calculate cutting parameters in HAL for a glade display.
For this calculation I need the current feed rate but can't find it in the HAL pins. I found motion.current-vel but that is not ideal because its only useful when there is actual movement and does not allow for a distinction between rapid moves and moves where the feed rate applies.
Is there really no access to the feed value in HAL?
					For this calculation I need the current feed rate but can't find it in the HAL pins. I found motion.current-vel but that is not ideal because its only useful when there is actual movement and does not allow for a distinction between rapid moves and moves where the feed rate applies.
Is there really no access to the feed value in HAL?
Please Log in or Create an account to join the conversation.
- rodw
 - 
				
											 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 11472
 - Thank you received: 3848
 
			
	
						01 Jun 2020 07:53				#169624
		by rodw
	
	
		
			
	
			
			 		
													
	
				Replied by rodw on topic Is there a Halpin for the current feedrate			
			
				Thats right, the feed rate is thrown away once the gcode is tokenised. current-vel is for that segment only and may or may not be the feedrate.
Cmorely has recently published an experimental branch that publishes it on a pin. I have tried it. I thought it found its way into master. I'll try and look for it tomorrow when I am at my machine as I just compiled master today.
The other pin I would really like to see is the radius of arcs.
					Cmorely has recently published an experimental branch that publishes it on a pin. I have tried it. I thought it found its way into master. I'll try and look for it tomorrow when I am at my machine as I just compiled master today.
The other pin I would really like to see is the radius of arcs.
Please Log in or Create an account to join the conversation.
- rodw
 - 
				
											 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 11472
 - Thank you received: 3848
 
			
	
						01 Jun 2020 07:57				#169625
		by rodw
	
	
		
			
	
			
			 		
													
	
				Replied by rodw on topic Is there a Halpin for the current feedrate			
			
				look for motion.fcode is it there?			
					Please Log in or Create an account to join the conversation.
- rodw
 - 
				
											 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 11472
 - Thank you received: 3848
 
			
	
						01 Jun 2020 08:00				#169626
		by rodw
	
	
		
			
	
	
			 		
													
	
				Replied by rodw on topic Is there a Halpin for the current feedrate			
			
				oops, doe snot seem to be there. This is the fcode branch
github.com/LinuxCNC/linuxcnc/tree/feedcode_message
					github.com/LinuxCNC/linuxcnc/tree/feedcode_message
		The following user(s) said Thank You: Aciera 	
			Please Log in or Create an account to join the conversation.
- Aciera
 - 
				
									Topic Author
											 - Offline
 - Administrator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 4557
 - Thank you received: 2029
 
			
	
						01 Jun 2020 08:33		 -  01 Jun 2020 08:34		#169633
		by Aciera
	
	
		
			
	
	
			 		
													
	
				Replied by Aciera on topic Is there a Halpin for the current feedrate			
			
				Ah, I just realized I'm actually on the switchkins-branch and this puts me out on a limb so to speak.
I guess I'll have to manage with the current-vel.
Thanks
					I guess I'll have to manage with the current-vel.
Thanks
		Last edit: 01 Jun 2020 08:34  by Aciera.			
			Please Log in or Create an account to join the conversation.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						01 Jun 2020 12:38				#169661
		by cmorley
	
	
		
			
	
	
			 		
													
	
				Replied by cmorley on topic Is there a Halpin for the current feedrate			
			
				My feedrate work was not accepted into 2.8 and statetags was merged into master so I have lost track if the work is useful/compatible.
Chris
					Chris
		The following user(s) said Thank You: Aciera 	
			Please Log in or Create an account to join the conversation.
- rodw
 - 
				
											 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 11472
 - Thank you received: 3848
 
			
	
						01 Jun 2020 18:51				#169697
		by rodw
	
	
		
			
				
At least you motivated the release of state tags!
NOW we just need some documentation on how to acess the state tags data (which includes the feedrate) by resolving the known issues where the docs refer to state tags stating it will fix it.....
linuxcnc.org/docs/devel/html/gui/GStat.html#_known_issues
					
	
			
			 		
													
	
				Replied by rodw on topic Is there a Halpin for the current feedrate			
			My feedrate work was not accepted into 2.8 and statetags was merged into master so I have lost track if the work is useful/compatible.
Chris
At least you motivated the release of state tags!
NOW we just need some documentation on how to acess the state tags data (which includes the feedrate) by resolving the known issues where the docs refer to state tags stating it will fix it.....
linuxcnc.org/docs/devel/html/gui/GStat.html#_known_issues
Please Log in or Create an account to join the conversation.
- Aciera
 - 
				
									Topic Author
											 - Offline
 - Administrator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 4557
 - Thank you received: 2029
 
			
	
						02 Jun 2020 05:14				#169770
		by Aciera
	
	
		
			
	
			
			 		
													
	
				Replied by Aciera on topic Is there a Halpin for the current feedrate			
			
				So I could use statetags with a python script but the feedrate might not be the current feedrate because the interpreter looks at the code ahead?			
					Please Log in or Create an account to join the conversation.
- rodw
 - 
				
											 - Offline
 - Platinum Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 11472
 - Thank you received: 3848
 
			
	
						02 Jun 2020 05:37				#169772
		by rodw
	
	
		
			
				
It will be the real feedrate for the currently executing segment! so it will be accurate for right now! The read ahead has no effect as this is at a a deeper level.
When you work it out, please share how you did it.
					
	
			
			 		
													
	
				Replied by rodw on topic Is there a Halpin for the current feedrate			
			So I could use statetags with a python script but the feedrate might not be the current feedrate because the interpreter looks at the code ahead?
It will be the real feedrate for the currently executing segment! so it will be accurate for right now! The read ahead has no effect as this is at a a deeper level.
When you work it out, please share how you did it.
Please Log in or Create an account to join the conversation.
- Aciera
 - 
				
									Topic Author
											 - Offline
 - Administrator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 4557
 - Thank you received: 2029
 
			
	
						02 Jun 2020 16:05		 -  02 Jun 2020 16:09		#169816
		by Aciera
	
	
		
			
	
	
		
	
			 		
													
	
				Replied by Aciera on topic Is there a Halpin for the current feedrate			
			
				Ok, I've played around with gstat a bit:
So I changed the example script in the doc to create a HAL pin called feedrate.current:
	
		
			
		
		
			
	
I then called this script from my postguihal as given in the doc and the pin got created:
And the value also changes as expected.
So this was successful.
However, I noticed that it also gives the feedrate of G0 moves which is what I don't want. This is what I already have by using "current-vel".
I'm actually looking for the "F" value, preferably the one as used in "Feed Override":
This does not change with G0 moves and also does not go to zero when the movement stops.
					So I changed the example script in the doc to create a HAL pin called feedrate.current:
			Warning: Spoiler!		
		
				#!/usr/bin/env python
import hal
from hal_glib import GStat
import gobject
GSTAT = GStat()
# callback to change HAL pin state
def feedrate_changed(obj, data):
h = data
# Make a component and pins
h = hal.component("feedrate")
h.newpin("current", hal.HAL_FLOAT, hal.HAL_OUT)
h.ready()
# connect a GSTAT message to a callback function
GSTAT.connect("current-feed-rate",feedrate_changed)
# force GSTAT to initialize states
GSTAT.forced_update()
# loop till exit
try:
gobject.MainLoop().run()
except KeyboardInterrupt:
raise SystemExit
		import hal
from hal_glib import GStat
import gobject
GSTAT = GStat()
# callback to change HAL pin state
def feedrate_changed(obj, data):
h = data
# Make a component and pins
h = hal.component("feedrate")
h.newpin("current", hal.HAL_FLOAT, hal.HAL_OUT)
h.ready()
# connect a GSTAT message to a callback function
GSTAT.connect("current-feed-rate",feedrate_changed)
# force GSTAT to initialize states
GSTAT.forced_update()
# loop till exit
try:
gobject.MainLoop().run()
except KeyboardInterrupt:
raise SystemExit
I then called this script from my postguihal as given in the doc and the pin got created:
And the value also changes as expected.
So this was successful.
However, I noticed that it also gives the feedrate of G0 moves which is what I don't want. This is what I already have by using "current-vel".
I'm actually looking for the "F" value, preferably the one as used in "Feed Override":
This does not change with G0 moves and also does not go to zero when the movement stops.
Attachments:
		Last edit: 02 Jun 2020 16:09  by Aciera.			
			Please Log in or Create an account to join the conversation.
		Time to create page: 0.438 seconds