LinuxCNC S-Curve Accelerations

More
29 Jan 2026 10:12 #342154 by ruediger123
Replied by ruediger123 on topic LinuxCNC S-Curve Accelerations
@grandixximo

After commenting out " || (dx - moveL <= dlen2)", the scope looks like this.
Attachments:
The following user(s) said Thank You: grandixximo

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

  • grandixximo
  • grandixximo's Avatar Topic Author
  • Away
  • Elite Member
  • Elite Member
More
29 Jan 2026 10:54 #342155 by grandixximo
Replied by grandixximo on topic LinuxCNC S-Curve Accelerations
 

File Attachment:

File Name: luca-long-...1-29.ngc
File Size:0 KB


test with this, this is dlen2 code

 

this is without

    

we know is not ideal, but at the moment, best we can do
Attachments:
The following user(s) said Thank You: endian, Darium

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

More
29 Jan 2026 17:44 #342163 by endian
Replied by endian on topic LinuxCNC S-Curve Accelerations

My apologize ...
sorry I can not show same speed test because I am currently weeks out of office but we can just multiply or devide values ... because it is linear dependecy during constant speed movemet ... 

I can just customize current images to show exact difference ...  compensation off ferror = 0.125mm at 15m/min ...  compensation on ferror = 0.00009028mm at 1m/min and multiply it by 15 we get 0,0013542mm which is significantly less then 0.125 ..

What I remember from testing by my short eyes it whas something near 0.001mm during that 15m/min testing was done with bentch top setup without any load presented... just AX5106 with AM8xxx motor 

but I can go home for testing this weekend to create exact speed difference testing if it is neccessary

No apologies needed [img]/media/kunena/emoticons/wink.png[/img]
 

I can understand You and YangYang, its added job, but I openly disagree ... its the best time to improve lcnc and solve it at native level for ever, no other proforma hobby solution as now my is...

it should be solution for everyone who not understand it soo well as you guys... my solution of compensation will be even more inaccurate when scurve will be done and implemented ... 

I can not say you what to do, your job, your rules, your output ... thanks for your upgrade to curving
 
The following user(s) said Thank You: grandixximo, besriworld, Darium

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

More
29 Jan 2026 21:47 #342177 by rodw
Replied by rodw on topic LinuxCNC S-Curve Accelerations

The CiA 402 standard provides feedforward objects exactly for this: 0x60B1 (velocity offset) and 0x60B2 (torque offset). The master can send position plus velocity feedforward so the drive can anticipate acceleration. This is the standard's solution, it just needs to be mapped in lcec.
Also, good drives interpolate internally. The servo loop runs faster than the bus cycle (Maxon runs 0.4ms internal vs 1ms bus). The drive doesn't jump between positions, it interpolates. That's what 0x60C2 configures.
 

Can we explore this on another topic when I get to it? I wanted to rewrite dominic's cia402 component to make it easier to maintain and properly deal with homing so it comes into line with the custom homing that wasn't around when it was written. So it would be perfect for inclusion. Could the new TP have output pins that could be taken as input to calculate these?   Or how would we do it? Any conversion/massaging would be done in the revised component.
The following user(s) said Thank You: grandixximo, akb1212, besriworld, Darium, zmrdko

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

  • grandixximo
  • grandixximo's Avatar Topic Author
  • Away
  • Elite Member
  • Elite Member
More
30 Jan 2026 05:39 - 30 Jan 2026 06:02 #342187 by grandixximo
Replied by grandixximo on topic LinuxCNC S-Curve Accelerations
The pins already exist:

joint.N.vel-cmd - velocity command per joint
joint.N.acc-cmd - acceleration command per joint
joint.N.jerk-cmd - jerk command (useful for S-curve)

These are updated every servo cycle after cubic interpolation, so they represent instantaneous commanded values suitable for feedforward.
For your cia402 component rewrite:

0x60B1 (velocity feedforward) can use joint.N.vel-cmd directly
0x60B2 (torque feedforward) needs joint.N.acc-cmd × inertia, you can do this with a mult2 in HAL or inside your component

No TP changes needed. Just wire the existing pins to your component and map them to the PDOs.

At the moment only joint 0-1-2 jerk-cmd is calculated proper I think, later on we will do all.
Last edit: 30 Jan 2026 06:02 by grandixximo.
The following user(s) said Thank You: akb1212, rodw, Darium

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

More
30 Jan 2026 06:54 #342189 by endian
Replied by endian on topic LinuxCNC S-Curve Accelerations

The pins already exist:

joint.N.vel-cmd - velocity command per joint
joint.N.acc-cmd - acceleration command per joint
joint.N.jerk-cmd - jerk command (useful for S-curve)

These are updated every servo cycle after cubic interpolation, so they represent instantaneous commanded values suitable for feedforward.
For your cia402 component rewrite:

0x60B1 (velocity feedforward) can use joint.N.vel-cmd directly
0x60B2 (torque feedforward) needs joint.N.acc-cmd × inertia, you can do this with a mult2 in HAL or inside your component

No TP changes needed. Just wire the existing pins to your component and map them to the PDOs.

At the moment only joint 0-1-2 jerk-cmd is calculated proper I think, later on we will do all.
 

0x60B1 (velocity feedforward) can use joint.N.vel-cmd directly - is equal of FF1 of PID which already exist and its widely used to compensaty cycle delay ... this stuff is from my point of view useless for now

but I am still taking just about pin which allready read position from allredy presented 50ms buffer .. you are providing us from sTP posCmd(t), velCmd(t) (command speed is compensated cycle with PID FF1 and we do no use 60B1 for now), accCmd(t) and jerkCmd(t) and we need for ethercat posExtraCmd(t+2) for ethercat devices which is running in Constant Synchronized Position mode because of absention PID and therefore FF1 absention too (2 cycle lag present of ethercat) - this is just array position value which allready exist in buffer because of time(you notice 50ms) precalculation ... 

and I know this is topic connected with ethercat but it is directly connected to trajectory planner ... Beckhoff, Codesys, Deltaww it has implemented as I said because their native bus is ethercat ... 
The following user(s) said Thank You: Darium

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

  • grandixximo
  • grandixximo's Avatar Topic Author
  • Away
  • Elite Member
  • Elite Member
More
30 Jan 2026 07:57 #342193 by grandixximo
Replied by grandixximo on topic LinuxCNC S-Curve Accelerations

0x60B1 (velocity feedforward) can use joint.N.vel-cmd directly - is equal of FF1 of PID which already exist and its widely used to compensaty cycle delay ... this stuff is from my point of view useless for now

but I am still taking just about pin which allready read position from allredy presented 50ms buffer .. you are providing us from sTP posCmd(t), velCmd(t) (command speed is compensated cycle with PID FF1 and we do no use 60B1 for now), accCmd(t) and jerkCmd(t) and we need for ethercat posExtraCmd(t+2) for ethercat devices which is running in Constant Synchronized Position mode because of absention PID and therefore FF1 absention too (2 cycle lag present of ethercat) - this is just array position value which allready exist in buffer because of time(you notice 50ms) precalculation ... 

and I know this is topic connected with ethercat but it is directly connected to trajectory planner ... Beckhoff, Codesys, Deltaww it has implemented as I said because their native bus is ethercat ... 

 The lookahead buffer stores velocities and segment data, not pre-calculated positions. Positions are computed at RT execution time through interpolation based on progress values that depend on velocity integration each cycle. The future position you want doesn't exist in a buffer waiting to be exposed.Your HAL component using
vel_cmd * dt + 0.5 * acc_cmd * dt²
is actually the correct approach given the architecture. It's not a workaround, it's the right way to predict future position from the data that exists.The TP gives you accurate vel-cmd and acc-cmd every cycle. With S-curve planning these will be even smoother and more predictable than with trapezoidal, so your compensation should work better not worse.
The following user(s) said Thank You: akb1212, rodw, endian, Darium

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

More
30 Jan 2026 08:27 #342195 by rodw
Replied by rodw on topic LinuxCNC S-Curve Accelerations
Very good stuff! I made a start today forum.linuxcnc.org/ethercat/58260-lichua...r-need-help?start=20
is dt = Delta time = servo period?
I'll have to follow you guys a bit more closely!
 
The following user(s) said Thank You: Darium

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

More
30 Jan 2026 08:40 - 30 Jan 2026 08:50 #342196 by endian
Replied by endian on topic LinuxCNC S-Curve Accelerations

Very good stuff! I made a start today forum.linuxcnc.org/ethercat/58260-lichua...r-need-help?start=20
is dt = Delta time = servo period?
I'll have to follow you guys a bit more closely!
 

yes interpolation servo period.. Rod please check this repo  codeberg.org/endian/Beckhoff_AX5ZYZZ_lcec_driver here it is solved at all ... there is a .hal file example and everything needed 
Last edit: 30 Jan 2026 08:50 by endian.
The following user(s) said Thank You: akb1212, rodw

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

More
30 Jan 2026 08:41 - 30 Jan 2026 08:44 #342197 by endian
Replied by endian on topic LinuxCNC S-Curve Accelerations
there is added filtering and influence of real active ferror from feedback but I am not using it because it creating frequencies ... 
Last edit: 30 Jan 2026 08:44 by endian. Reason: editor messing
The following user(s) said Thank You: rodw, zmrdko

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

Time to create page: 0.255 seconds
Powered by Kunena Forum