- Posts: 2419
- Thank you received: 2349
Trajectory Planner using Ruckig Lib
- Grotius
- Offline
- Platinum Member
-
Less
More
2 years 2 months ago #306715
by Grotius
Replied by Grotius on topic Trajectory Planner using Ruckig Lib
Hi Arciera,
The feedrate is set from -100 to 0 to 100 % in the gui. It's like adaptive feed.
I have to add a overide like up to 120%, but that's peanut's to do.
If the feedrate is set at 100% the gcode feedrate is exact that value. For jogging it takes the gui settings page feedrate.
So at -100% the motion goe's in reverse, also doing reverse with endvelocity. Taking the vo as endvel.
Testing a surface, this file is huge so i did a memory preview cleanup first :
Ok after testing a few gcode files, i have seen a few things in the optimizing algo. I will document these and report.
The feedrate is set from -100 to 0 to 100 % in the gui. It's like adaptive feed.
I have to add a overide like up to 120%, but that's peanut's to do.
If the feedrate is set at 100% the gcode feedrate is exact that value. For jogging it takes the gui settings page feedrate.
So at -100% the motion goe's in reverse, also doing reverse with endvelocity. Taking the vo as endvel.
Testing a surface, this file is huge so i did a memory preview cleanup first :
Ok after testing a few gcode files, i have seen a few things in the optimizing algo. I will document these and report.
The following user(s) said Thank You: akb1212, Lcvette, Aciera, Darium, hmnijp
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
2 years 2 months ago #306945
by Grotius
Replied by Grotius on topic Trajectory Planner using Ruckig Lib
Hi,
I had to review some path blend code. Step by step, we go forward.
This is a tiny example how to use path blend, tooldir blend, & 3d velocity profile together.
The begin of something good maybe... I am still working on the tooldir, this needs some code review
here and there.
I did a test on the parport production machine, to test the velocity profile. The machine
or my pc is unable to perform a nice 9 axis job. As a result of that,
i am planning to run an ethercat production machine coming day's. This machine still uses stepgen.
However, best is to send just the coordinates to a servo drive. That saves the pc a huge ammount of
calculation time over 9 scurve axis.
I had to review some path blend code. Step by step, we go forward.
This is a tiny example how to use path blend, tooldir blend, & 3d velocity profile together.
The begin of something good maybe... I am still working on the tooldir, this needs some code review
here and there.
I did a test on the parport production machine, to test the velocity profile. The machine
or my pc is unable to perform a nice 9 axis job. As a result of that,
i am planning to run an ethercat production machine coming day's. This machine still uses stepgen.
However, best is to send just the coordinates to a servo drive. That saves the pc a huge ammount of
calculation time over 9 scurve axis.
The following user(s) said Thank You: akb1212, meister, Talla, Lcvette, yrsiddhapura, Aciera
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
2 years 2 months ago #306976
by Aciera
I was under the impression that most of this could be done outside of the realtime thread. The filleting algorithm for example, couldn't that run before actual gcode execution?
Replied by Aciera on topic Trajectory Planner using Ruckig Lib
However, best is to send just the coordinates to a servo drive. That saves the pc a huge ammount of
calculation time over 9 scurve axis.
I was under the impression that most of this could be done outside of the realtime thread. The filleting algorithm for example, couldn't that run before actual gcode execution?
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
2 years 2 months ago #307064
by Grotius
Replied by Grotius on topic Trajectory Planner using Ruckig Lib
Hi Arciera,
I was under the impression that most of this could be done outside of the realtime thread. The filleting algorithm for example, couldn't that run before actual gcode execution?
Yes, all that is done before gcode execution.
It's just the parport machine that run's not good on hal-core.
Now halcore run's a test board with 2 ethercat steppers for x & y axis. But motor's run only very slow.
So i have to figur out what's the problem again.
Will install a new iso on hard disk, then try to run linuxcnc with ethercat. This is tested ok on the testboard
in the past.
I was under the impression that most of this could be done outside of the realtime thread. The filleting algorithm for example, couldn't that run before actual gcode execution?
Yes, all that is done before gcode execution.
It's just the parport machine that run's not good on hal-core.
Now halcore run's a test board with 2 ethercat steppers for x & y axis. But motor's run only very slow.
So i have to figur out what's the problem again.
Will install a new iso on hard disk, then try to run linuxcnc with ethercat. This is tested ok on the testboard
in the past.
The following user(s) said Thank You: akb1212, Lcvette, Aciera
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
2 years 2 months ago #307070
by Grotius
Replied by Grotius on topic Trajectory Planner using Ruckig Lib
Hi,
I found out the problem.
This is a test board i made a few years ago. It uses ethercat and drives stepper motors.
I found out that i can run the testboard on hal-core with a sample script.
This scripts only load's the stepgen.so and the lcec.so. It drives just one motor.
When i set a new position using halcmd : ./halcmd setp stepgen.0.position-cmd 1000
It runs to that position, as it should. The stepper sounds nice, and is quick.
So the underlying problem is the trajectory planner of halcore. This consumes too much time as it
is also added to the servo update thread. It slows down the servo update thread. I think this is the cause
that the production machine on the parport also run's not good.
So i will qreate a chrono timer, to first measure the total time of the trajectory planners cycle.
I expect it will exceed the 1ms time of the servo update cycle, but i don't know for sure at the moment. We will find that out.
Then we have to pin point where the time consumers are located in the trajectory planner.
So far i am happy that the ethercat works ok.
Running on : 6.1.0-23-rt-amd64
I found out the problem.
This is a test board i made a few years ago. It uses ethercat and drives stepper motors.
I found out that i can run the testboard on hal-core with a sample script.
This scripts only load's the stepgen.so and the lcec.so. It drives just one motor.
When i set a new position using halcmd : ./halcmd setp stepgen.0.position-cmd 1000
It runs to that position, as it should. The stepper sounds nice, and is quick.
So the underlying problem is the trajectory planner of halcore. This consumes too much time as it
is also added to the servo update thread. It slows down the servo update thread. I think this is the cause
that the production machine on the parport also run's not good.
So i will qreate a chrono timer, to first measure the total time of the trajectory planners cycle.
I expect it will exceed the 1ms time of the servo update cycle, but i don't know for sure at the moment. We will find that out.
Then we have to pin point where the time consumers are located in the trajectory planner.
So far i am happy that the ethercat works ok.
Running on : 6.1.0-23-rt-amd64
Warning: Spoiler!
Code:
#!/usr/bin/bash
# This test is verified ok, 6 august 2024.
cd ../../../../
echo $(pwd)
PWD_DIR=$(pwd)
# Find libhalcor.so in the ~/lib dir.
sudo ldconfig $PWD_DIR/lib
cd bin
./halclean
./halcmd stop
./halcmd loadrt threads name1=base-thread fp1=0 period1=30000 name2=servo-thread period2=1000000
# Unix command to load the ethercat .xml config
$PWD_DIR/rtlib/./lcec_conf $PWD_DIR/rtlib/ethercat-conf.xml &
./halcmd loadrt lcec
./halcmd net ec-slaves-responding lcec.slaves-responding
./halcmd net ec-link-up lcec.link-up
./halcmd net ec-all-op lcec.all-op
./halcmd addf lcec.read-all base-thread
./halcmd addf lcec.write-all base-thread
./halcmd start
./halcmd show
./halcmd loadrt stepgen step_type=0
./halcmd addf stepgen.make-pulses base-thread
./halcmd addf stepgen.capture-position servo-thread
./halcmd addf stepgen.update-freq servo-thread
# X-AXIS #######################################################
./halcmd setp stepgen.0.position-scale 265.3
./halcmd setp stepgen.0.steplen 1
./halcmd setp stepgen.0.stepspace 1
./halcmd setp stepgen.0.dirhold 15000
./halcmd setp stepgen.0.dirsetup 15000
./halcmd setp stepgen.0.maxaccel 1000
./halcmd setp stepgen.0.enable 1
./halcmd net xstep stepgen.0.step
./halcmd net xdir stepgen.0.dir
## Calculation ##
# drive : 5000 steps / rev
# pitch : 4 mm / rev
# calcutation : 5000 / 4 =
# scale = 1250
./halcmd net xstep lcec.0.output_stepper_1.dout-0
./halcmd net xdir lcec.0.output_stepper_1.dout-1
./halcmd setp lcec.0.output_stepper_1.dout-0-invert 0
# Then to run the motor cd to the ~/bin dir, then:
# ./halcmd setp stepgen.0.position-cmd 1000
The following user(s) said Thank You: akb1212, tommylight, Lcvette, vmihalca, Darium
Please Log in or Create an account to join the conversation.
- Lcvette
- Offline
- Platinum Member
-
Less
More
- Posts: 1682
- Thank you received: 784
2 years 2 months ago #307139
by Lcvette
Replied by Lcvette on topic Trajectory Planner using Ruckig Lib
This is looking amazing! I am impressed with how smooth that boomerang video looked! Absolutely fantastic work my friend! Thank you very very much for your hard work!
Chris
Chris
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
Time to create page: 8.344 seconds