- Posts: 12160
- Thank you received: 0
Can a component know the diameter of an arc its cutting
Is it possible for a Hal component to find out the diameter of that arc?
If not, would that info be in the state-tags branch if it is ever released?
I'd like Hal to be able to slow the feedrate if an arc is less then a threshold diameter without resorting to gcode.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22012
- Thank you received: 4
Then again, Linuxcnc is so modular so adding that as another module would make life a bit easier for us.
I assume you need this for plasma cutting as the radius cut ends up worse than the rest of the cuts, and slowing down is just one of the options, mind you, the only viable one.
Please Log in to join the conversation.
determine line numbers that contain arcs, calculate the radius and write it into a separate file,
and then pass them to the real-time component using streamer-halstreamer.
something like that I did before:
Please Log in to join the conversation.
tommylight wrote: That is normally done in CAM, but i get the idea, although i do not like cramming everything under the sun in one app.
Then again, Linuxcnc is so modular so adding that as another module would make life a bit easier for us.
I assume you need this for plasma cutting as the radius cut ends up worse than the rest of the cuts, and slowing down is just one of the options, mind you, the only viable one.
Tommy you guessed it. I've played around with sheetcam cutting rules but had troubles where I had chaincut into a hole to avoid a pierce. But I could not make them work so that it would ignore say a 3mm fillet on a corner that was there to help the Trajectory planner out and activate on a 12mm hole with an opening one side. The Sheetcam OnArc() function can calculate the radius so it can be done there.
The trajectory planner short segment slow downs combined with THC velocity hold disabling does go a long way to fixing most problems but sometimes it does not slow the cut down enough. If I knew the arc radius in real time, I could just use a limit component to limit velocity.
nkp wrote: You can read file_gcode in load_time,
determine line numbers that contain arcs, calculate the radius and write it into a separate file,
and then pass them to the real-time component using streamer-halstreamer.
nkp, thanks for that idea. I have played around with streamer/halstreamer. I never thought of using it like that. I think though that SheetCAM is probably a better place for this one.
From what I know its not possible to do in Hal, but I was hoping somebody might know a bit more or possibly even know something about the statetags branch which might support it. It would be good if it could become a trajectory planner feature for us plasma nerds.
Please Log in to join the conversation.
rodw wrote: Is it possible for a Hal component to find out the diameter of that arc?
It can be calculated from the X and Y positions inside a custom component.
Then output that to a lincurve and put the lincurve into the adaptive feed pin.
1) Compare the new positions to the old to get a dx and dy
2) use atan2 to get the "heading"
3) compare the rate of change of heading to the absolute velocity to determine the radius.
4) Make Profit.
Please Log in to join the conversation.
andypugh wrote:
rodw wrote: Is it possible for a Hal component to find out the diameter of that arc?
It can be calculated from the X and Y positions inside a custom component.
Then output that to a lincurve and put the lincurve into the adaptive feed pin.
1) Compare the new positions to the old to get a dx and dy
2) use atan2 to get the "heading"
3) compare the rate of change of heading to the absolute velocity to determine the radius.
4) Make Profit.
Andy very interesting approach so thank you. I don't understand item 3. Could you elaborate on this?
To me rate of change of heading is
Are you saying just find the difference between heading_rate and current_velocity? How does that work?
Please Log in to join the conversation.
I think we we had calculated omega (w) eg. heading_rate = w (in radians per second)
and LinuxCNC always knows absolute velocity (motion.current_velocity)
So from the formula
Can someone confirm this is correct?
So then we can use lincurve or our own algorithm to set motion.adaptive−feed to slow down on a radius.
Very very cool, thanks Andy!
Please Log in to join the conversation.
v = rw
(vw = w^2.r simplifies to this if you just divide by w)
So r = v/w as you concluded.
Please Log in to join the conversation.
Please Log in to join the conversation.
The logic is right, the arc is identified, the slope/heading/tangent is correctly calculated. I added a heap of debug pins including converting radius to degrees which is easier to understand. If you cut a circle , In halshow you can see the heading increase from 0 to 180 degrees, then change sign and go back to 0. Watching the cut in a sim, and visualising where the tangent intersects the circle, this is exactly what should be happening.
But, the calculated radius varies significantly.
I've attached the component if somebody (maybe even Andy
Please Log in to join the conversation.
