Distance Cut
- islander261
- Offline
- Platinum Member
-
Less
More
- Posts: 757
- Thank you received: 216
05 Jun 2018 17:17 #111686
by islander261
Distance Cut was created by islander261
Hello
I have been struggling trying to get a good totalizer for distance cut. My use for this is to track plasma cutting consumable life. I have tried various combinations of hal components and uspace python code to update my GUI (Gmoccapy) with little overall success. My approaches to date have centered around capturing the motion.distance-to-go value when it changes from 0 and then filtering it based on the motion.motion-type value. While this works while testing in MDI mode as soon as I try with a gcode file it under counts significantly. I know that by using distance to go I will always have slightly short count but I only need resolution to one whole unit so the rounding helps a lot here. Issues that I think I am chasing:
1. Does motion.distance-to-go always actually go to 0 between cut segments?
2. Is motion.motion-type state synchronized with with the change from 0 on motion.distance-to-go?
I have tried searching the forum and looking at the motion source, it is far above my simple coding ability so I don't understand it.
Is there a better way to do this? TIA
John
I have been struggling trying to get a good totalizer for distance cut. My use for this is to track plasma cutting consumable life. I have tried various combinations of hal components and uspace python code to update my GUI (Gmoccapy) with little overall success. My approaches to date have centered around capturing the motion.distance-to-go value when it changes from 0 and then filtering it based on the motion.motion-type value. While this works while testing in MDI mode as soon as I try with a gcode file it under counts significantly. I know that by using distance to go I will always have slightly short count but I only need resolution to one whole unit so the rounding helps a lot here. Issues that I think I am chasing:
1. Does motion.distance-to-go always actually go to 0 between cut segments?
2. Is motion.motion-type state synchronized with with the change from 0 on motion.distance-to-go?
I have tried searching the forum and looking at the motion source, it is far above my simple coding ability so I don't understand it.
Is there a better way to do this? TIA
John
Please Log in or Create an account to join the conversation.
05 Jun 2018 18:26 #111695
by PCW
Replied by PCW on topic Distance Cut
I would just take the current velocity (motion.current-vel) and integrate it
(using the integ component) and disable integration if the torch is not on
(using a mux component)
(using the integ component) and disable integration if the torch is not on
(using a mux component)
Please Log in or Create an account to join the conversation.
06 Jun 2018 17:24 #111772
by andypugh
Replied by andypugh on topic Distance Cut
Another way would be a custom HAL component that looks at position last cycle and position this cycle and totalises using Pythagarus.
You might be able so do it in HAL using the hypot function, if you can find the previous positions on a pin as well as the current. (feedback and command are likely to have the required delta, if you look at the right place in the thread)
You might be able so do it in HAL using the hypot function, if you can find the previous positions on a pin as well as the current. (feedback and command are likely to have the required delta, if you look at the right place in the thread)
Please Log in or Create an account to join the conversation.
06 Jun 2018 22:45 #111796
by rodw
Replied by rodw on topic Distance Cut
I think I'd go with Andy's custom component and also count when ArcOK turns on so you capture the number of pierces. Methods using current velocity might be influenced by the Z axis servoing. Also the distance from one pierce to the other can be measured the same way and I did start to write a component that would set a pin to true if a touch off was required based on the distance since the last pierce so you could roll quite a bit of functionality into the one component.
Please Log in or Create an account to join the conversation.
06 Jun 2018 22:58 #111797
by PCW
Replied by PCW on topic Distance Cut
Z Axis servoing would not be part of motion current velocity if the THC is done using hal offsets
(and there's some evidence now that this is a better way to do THC control than using external offsets)
(and there's some evidence now that this is a better way to do THC control than using external offsets)
The following user(s) said Thank You: tommylight, rodw
Please Log in or Create an account to join the conversation.
06 Jun 2018 23:18 #111798
by rodw
Replied by rodw on topic Distance Cut
It would be good if the integ component had some documentation that described its function for the lay person as even for an electronics engineer (which I'm not), its very terse
linuxcnc.org/docs/html/man/man9/integ.9.html
linuxcnc.org/docs/html/man/man9/integ.9.html
Please Log in or Create an account to join the conversation.
07 Jun 2018 00:24 #111806
by andypugh
Yes, that really is rather more terse than even the other very terse ones.
Here is the code:
github.com/LinuxCNC/linuxcnc/blob/master...omponents/integ.comp
I think that the explicit dependence on fperiod (actual servo thread period) make this unsuitable for accumulating distance travelled, but possibly ideal for integrating current-velocity.
Replied by andypugh on topic Distance Cut
It would be good if the integ component had some documentation that described its function for the lay person as even for an electronics engineer (which I'm not), its very terse
Yes, that really is rather more terse than even the other very terse ones.
Here is the code:
github.com/LinuxCNC/linuxcnc/blob/master...omponents/integ.comp
I think that the explicit dependence on fperiod (actual servo thread period) make this unsuitable for accumulating distance travelled, but possibly ideal for integrating current-velocity.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- islander261
- Offline
- Platinum Member
-
Less
More
- Posts: 757
- Thank you received: 216
07 Jun 2018 14:23 #111882
by islander261
Replied by islander261 on topic Distance Cut
Thanks Guys!
Given the weight behind the replies I am now sure I didn't miss the simple obvious solution. I will continue to tinker with my present approach and see if I can get it to work better.
John
Given the weight behind the replies I am now sure I didn't miss the simple obvious solution. I will continue to tinker with my present approach and see if I can get it to work better.
John
Please Log in or Create an account to join the conversation.
07 Jun 2018 23:04 #111948
by andypugh
Replied by andypugh on topic Distance Cut
Have you tried connecting motion.current-velocity to the input of the integ component? It seems like that actually ought to work.
Please Log in or Create an account to join the conversation.
- islander261
- Offline
- Platinum Member
-
Less
More
- Posts: 757
- Thank you received: 216
08 Jun 2018 03:42 #111959
by islander261
Replied by islander261 on topic Distance Cut
I have not tried to use the integ component. I have changed the comp I wrote to capture each cut and it appears to be working much better now. I know I still don't have a good general case solution but it does appear to work while plasma cutting with the usual sequence of events. The present solution does require a specific event sequence and I have no error checking built in yet. I will post more about when I get a few more sheets under my belt next week. Right now I am busy chasing the "divot" problem which may have some deeper causes.
John
John
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds