LinuxCNC S-Curve Accelerations

More
6 years 4 months ago #171741 by PCW
Replied by PCW on topic LinuxCNC S-Curve Accelerations

arvidb wrote: Ok, so the algorithm should make the jerk limit an absolute priority then, and sacrifice feed rate to reach it. Got it.


No, in fact lowered (controlled) jerk often allows faster feed rates at a given error budget
(because of lowered excitation of machine resonances)

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

More
6 years 4 months ago - 6 years 4 months ago #171755 by arvidb
I mean from the perspective of the algorithm that an actual computer program would have to use. The only variable left to touch if both path deviation and jerk are treated as hard limits is the feedrate.

I didn't mean to say that the user would have to sacrifice feedrate compared to some other TP (I have no experience comparing jerk limited vs unlimited TPs), but from the algorithm's point of view, feedrate is the only thing left to be adjusted to keep the other limits within their bounds, i.e. the thing that's "sacrificed". In the same way that feedrate is "sacrificed" to stay within acceleration limits, as you said before.

I'm trying to understand how a jerk limited TP would work; I'm not comparing it to some other TP.
Last edit: 6 years 4 months ago by arvidb.
The following user(s) said Thank You: Nico2017

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

More
6 years 4 months ago #171810 by Todd Zuercher
The planner need needs to use the allowed path deviation to calculate a path with minimum jerk (up to the jerk limit allowed) that lies within the allowed deviation of the programmed path, then control feed rate to make up the difference. (The same way acceleration is compensated for with any change of direction.) As it is now infinite jerk is allowed and the difference between what is calculated and what is reality simply results in an un-calculated following error that the servo loops have to try to compensate for. (The same as the deviation that results while you turn the steering wheel in the car analogy.)
The following user(s) said Thank You: Nico2017

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

More
6 years 4 months ago #172232 by arvidb

cmorley wrote: I was thinking that using s curve in our jogging planner would probably be a good project too.
rapid acceleration is really the name of the game when jogging slowly.
It would surely be easier to to do then the full motion controller.

Chris M

The complete lack of data encapsulation in the source makes this much more difficult than it should be. The simple_tp_t struct is public and is allocated globally(!) as part of emcmot_joint_t and emcmot_axis_t (in motion.h), and code is touching the internal fields everywhere - e.g. handle_jjogwheels() in control.c sets free_tp.max_acc! I think this needs a major overhaul/cleanup before a sane implementation of a more advanced simple_tp can be made.

Is this something that the active developers would approve, or are people fond of their global state? ;)

Another thing that complicates things compared to the full motion planner is that the simple_tp must be able to re-plan motion on the fly: it often receives a new pos_cmd while moving. The planner needs to be able to handle non-zero acceleration and velocity initial state, as well as changing velocity limits while moving. So while a jerk-limited jogging planner might be easier than a full planner, it's still no small task. But yeah, the data encapsulation issue is the real hurdle, I think.

The way to do data encapsulation would be to do a forward declaration of simple_tp_t in simple_tp.h:
Code:
typedef struct simple_tp_t simple_tp_t;
Then change emcmot_joint_t and emcmot_axis_t to contain a pointer to simple_tp_t rather than the actual struct, and initialize the fields by calling a constructor function ("simple_tp_create()" or similar), probably in init_comm_buffers() in motion.c.

If people are very much against memory allocation like this, the required number of structs could be statically pre-allocated by the simple_tp implementation, and a pointer to the pre-allocated fields could be returned by simple_tp_create() (let's call it simple_tp_fetch() instead):
Code:
joint->free_tp = simple_tp_fetch(joint_num);

Then to clean up all the places that directly modifies the internal fields of the planner...

One thing that worries me is this: STRUCTS_IN_SHMEM. It seems these structs are allocated differently depending on this define. If someone could explain the mechanism & reason behind this, I would be grateful.

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

More
6 years 4 months ago - 6 years 4 months ago #172246 by arvidb
Why is a different acceleration limit used when jogging ((*(joint_data->jjog_accel_fraction)) * joint->acc_limit)? The physical machine limits should be the same regardless of control mode?

Edit: see get_pos_cmds() in emc/motion/control.c.
Last edit: 6 years 4 months ago by arvidb.

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

More
6 years 4 months ago #172247 by tommylight
I just know the acceleration while jogging is half of what is set in the ini, also half of when running gcode.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum