- Posts: 2419
- Thank you received: 2349
LinuxCNC S-Curve Accelerations
- Grotius
- Offline
- Platinum Member
-
Less
More
3 years 7 months ago #267634
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Spumco,
From user perspective it's a logic explanation from you.
If you look into the previous linked c file, you can see functions like : tp_addline or tp_addcircle or tp_isdone.
In the original tp.c file there is a queue vector that has a size of about 10 lines of gcode.
I speak in therms of gcode to keep it simple. It's actually line, arc data, some speed and acc data etc.
It comes close to a actual gcode line.
Every time tp_done=1, the queue may be updated with new gcode line. It works like a c++ vector operation.
It can add a line, remove a old line from the bucket. The queue is like a tiny program that feeds the component.
For me it's not clear if i don't use the queue bucket to hold the gcode lines, why it's dumping the whole gcode file at once
if i do a tp_isdone request.
The first request goes ok, second request is dump mode.
And it's not clear to me where the tp_addline, tp_addarc requests actually came from?
With the bird eye view, i can search for the functions, but these 2 appear only once.
The goal is to clean up the original tp.c file to something minimal that is working, even without vel,acc etc.
It just has to do a working cycle. May even be without moving the tp itself.
From there i have a nice and clean starting point to integrate the scurve code.
From user perspective it's a logic explanation from you.
If you look into the previous linked c file, you can see functions like : tp_addline or tp_addcircle or tp_isdone.
In the original tp.c file there is a queue vector that has a size of about 10 lines of gcode.
I speak in therms of gcode to keep it simple. It's actually line, arc data, some speed and acc data etc.
It comes close to a actual gcode line.
Every time tp_done=1, the queue may be updated with new gcode line. It works like a c++ vector operation.
It can add a line, remove a old line from the bucket. The queue is like a tiny program that feeds the component.
For me it's not clear if i don't use the queue bucket to hold the gcode lines, why it's dumping the whole gcode file at once
if i do a tp_isdone request.
The first request goes ok, second request is dump mode.
And it's not clear to me where the tp_addline, tp_addarc requests actually came from?
With the bird eye view, i can search for the functions, but these 2 appear only once.
The goal is to clean up the original tp.c file to something minimal that is working, even without vel,acc etc.
It just has to do a working cycle. May even be without moving the tp itself.
From there i have a nice and clean starting point to integrate the scurve code.
The following user(s) said Thank You: spumco, Darium
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
Less
More
- Posts: 12170
- Thank you received: 4153
3 years 7 months ago #267636
by rodw
Replied by rodw on topic LinuxCNC S-Curve Accelerations
Just to highlight that the correct way to build a custom tp is to use a component based on this skeleton
github.com/LinuxCNC/linuxcnc/blob/master...mponents/tpcomp.comp
Docs: linuxcnc.org/docs/2.9/html/man/man9/tpcomp.9.html
I don't see the code yet following this template.
This is also how custom homing modules are created.
Spumco, I don't think this code touches the gcode parsing code but it is also modular too.
There is so much flexibility built into the linuxcnc framework, yet nobody has really attempted to make custom modules
github.com/LinuxCNC/linuxcnc/blob/master...mponents/tpcomp.comp
Docs: linuxcnc.org/docs/2.9/html/man/man9/tpcomp.9.html
I don't see the code yet following this template.
This is also how custom homing modules are created.
Spumco, I don't think this code touches the gcode parsing code but it is also modular too.
There is so much flexibility built into the linuxcnc framework, yet nobody has really attempted to make custom modules
The following user(s) said Thank You: spumco, Darium
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #267637
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Rod,
I don't see the code yet following this template.
It's exaclty following this template. This was the easy part.
I followed the template. Using the tpcomp.comp as starting point was going ok.
Mr garret's comments where perfect starting point. In no time the app was running.
It took me less then one hour.
But then the comments falls back to replacing the original tp.c file to your custom_tp.c file.
Then you are on your own...
The tp.c file is around 3000 lines. Quite a difficult point to start?
The idea was and is to minimalize the tp.c file. So that there is a clear understanding of the program flow.
At the moment i have some insights. But at some points i am missing something.
I don't see the code yet following this template.
It's exaclty following this template. This was the easy part.
I followed the template. Using the tpcomp.comp as starting point was going ok.
Mr garret's comments where perfect starting point. In no time the app was running.
It took me less then one hour.
But then the comments falls back to replacing the original tp.c file to your custom_tp.c file.
Then you are on your own...
The tp.c file is around 3000 lines. Quite a difficult point to start?
The idea was and is to minimalize the tp.c file. So that there is a clear understanding of the program flow.
At the moment i have some insights. But at some points i am missing something.
The following user(s) said Thank You: rodw, Darium
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #267638
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
For the one's who are interested, parts of the scurve lib is already brought to c component style.
It already run's in a component. Exciting, the first part is almost finished.
I had to dive into writing c again.
scurve_c
It already run's in a component. Exciting, the first part is almost finished.
I had to dive into writing c again.
scurve_c
The following user(s) said Thank You: Darium
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #267657
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,
The question is no longer a question.
I added a parameter of type bit for testing.
When this param is set to "true"
it pops a gcode line of the queue.
So for now i will try to keep the queue code intact.
There is still a lot to figur out.
This is good news.
in tcq.c there is a funny text :
Ok then.
The question is no longer a question.
I added a parameter of type bit for testing.
When this param is set to "true"
it pops a gcode line of the queue.
So for now i will try to keep the queue code intact.
There is still a lot to figur out.
This is good news.
Code:
int tpRunCycle(TP_STRUCT * const tp, long period){
...
if(param_test->Pin){
rtapi_print_msg(RTAPI_MSG_ERR,"param set\n");
tc->remove=1;
param_test->Pin=0;
}
// If TC is complete, remove it from the queue.
if (tc->remove) {
tpCompleteSegment(tp, tc);
}
...
}
in tcq.c there is a funny text :
Code:
*\brief queue handling functions for trajectory planner
* These following functions implement the motion queue that
* is fed by tpAddLine/tpAddCircle and consumed by tpRunCycle.
* They have been fully working for a long time and a wise programmer
* won't mess with them.
Ok then.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #267661
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
The following user(s) said Thank You: tommylight, rodw, spumco, Darium
Please Log in or Create an account to join the conversation.
Time to create page: 0.311 seconds