HAL component for tangential knife

More
14 Apr 2026 11:28 #345534 by rodw
Replied by rodw on topic HAL component for tangential knife
Thanks, I don't know how good a teacher I will be...
I'm almost there on my state_tag_arcs branch at github.com/rodw-au/linuxcnc

I've got all of the calculations tested and working in the interpreter. For some reason, data is getting lost on its way to motion. I will troubleshoot that in the next day or so.

Its been more complicated than I remember. I've got a better method of setting the tags but they are only updated at the beginning of a gcode segment but we want to get real time headings all the way around a G2/G3 arc. To do this, I needed to calculate the heading in real time (eg with the servo thread) in motion. No wonder no-one has tried to do this before!

 

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

More
15 Apr 2026 01:28 - 15 Apr 2026 02:23 #345563 by bedouno
Replied by bedouno on topic HAL component for tangential knife
sir , i am sure of hoe good teacher you are that i follow your work
i see that you are doing very well in your path and sure you will solve the problem , i am trying to think systematically when i say that the loss of the data may be because deffirent time frams between the sender and reciever or the sequencing -sorry about the terms are not accurate , i am a beginner- hope this might help , it is enough to me now to run a customed component to do the job , i am struggling to make it , its performance like mach3 feature is great now , i hope you help me to do such component , i have just made one and compield it but it crashed because of syntax error , i used a c code with primary approach
angle = atan2(y-vel, x-vel)
y-vel = y-vel + y-acc * dt // dt = fperiod
x-vel = x-vel + x-acc * dt // dt = fperiod
for open loop machine - stepper motors
Last edit: 15 Apr 2026 02:23 by bedouno.

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

More
15 Apr 2026 02:52 #345566 by rodw
Replied by rodw on topic HAL component for tangential knife
I have not been able to review this further today but
In the interpreter I have added a couple of procedures here that calculate the headings
github.com/rodw-au/linuxcnc/blob/state-t...erp_convert.cc#L7080

tag_straight has a debugging print line that is correct. There is a simple gcode file here that draws a square
github.com/rodw-au/linuxcnc/blob/state-t.../nc_files/testg2.ngc
and the output in the print statement is perfect.
But the values are altered before it gets to the pins so I wanted to repeat the debugs with these files.

But look at that, I am not calling 
write_canon_state_tag(block,&_setup);
in tag_straight. Hopefully that is what's missing. I've hacked into this procedure so much, I had a clean up that went too far...

the block is written to state tags in
github.com/rodw-au/linuxcnc/blob/state-t...4ngc/interp_write.cc
both the block and the tags

the heading for the arc is calculated in motion at
github.com/rodw-au/linuxcnc/blob/state-t...tion/control.c#L2230
We need to do that because the interpreter tags are static for the life of the segment but on an arc, we need to calculate the heading at the point on the circle at every call of the servo-thread. It seems to be working but I have not validated the data.


Good luck!
 

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

More
15 Apr 2026 02:59 #345567 by bedouno
Replied by bedouno on topic HAL component for tangential knife
dear sir , i hope i can explain my idea in accurately , and hope it is usefull, what if we index the code data vector sent from the interpreter to the motion controler , like a sequence segment to force the motion controller to attach and trigger the heeding calculations to the segment without override , sure ther might be some data or technic in the strcure would be helpfull without adding a new data field

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

More
15 Apr 2026 05:52 #345568 by dm17ry
Replied by dm17ry on topic HAL component for tangential knife
why not just align the C axis with the last segment of the trajectory? with trajectory blending on that worked okish for me on a leather cutting machine.

github.com/yur7aev/linuxcnc/blob/nyx2.8/...ponents/tangent.comp
The following user(s) said Thank You: tommylight

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

More
15 Apr 2026 10:21 #345573 by rodw
Replied by rodw on topic HAL component for tangential knife
Pretty cool machine for somebody who had never seen one. Good for the OP to see there are other solutions.
I was envisaging much more gradual arcs. Maybe that was because I used to get 2mm rubber sheet cut with a tangential knife machine including 6mm dia holes.

When I started this, I wanted the arc radius and Andy asked me to add the tangential heading as by the time I had the radius, the heading was trivial. (so we thought anyway). It will be quite handy.

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

Time to create page: 0.401 seconds
Powered by Kunena Forum