- Posts: 4739
- Thank you received: 2
LinuxCNC S-Curve Accelerations
- Todd Zuercher
- Offline
- Platinum Member
-
Please Log in to join the conversation.
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.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
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:
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):
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 to join the conversation.
Edit: see get_pos_cmds() in emc/motion/control.c.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22009
- Thank you received: 3
Please Log in to join the conversation.
Edit: Seems like a bad idea in that case since it also greatly increases stopping distance.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22009
- Thank you received: 3
Changing the jog acceleration to full value set in the ini, i do not know.
Sorry, i just bumped into that a while back testing some very fast cnc plasma machines i am building here:
forum.linuxcnc.org/show-your-stuff/38547...plasma-build?start=0
RodW also bumped into it at the same time as i did, so we compared some notes and came to the same conclusion you did.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22009
- Thank you received: 3
Well yes and no.arvidb wrote:
Edit: Seems like a bad idea in that case since it also greatly increases stopping distance.
Yes it will change the distance required to stop, but it will stop at the soft limits properly.
No, as it is very easy to repeatedly press a button and cause the machine to jerk badly, especially the bigger machines with a lot of weight to move, if full acceleration is used.
Please Log in to join the conversation.
If you want to experiment there is also a HAL component called simple_tp.
It is used by PnCcnf to simulate jogging control. it was a direct copy of motion's jogging planner (at one time anyways)
Chris
Please Log in to join the conversation.
Please Log in to join the conversation.
Jogging on a powerful machine is a difficult process - as you said it is constantly resets it's end point and must be able to stop by the end of the last planned move.
Add in that turning a jog handle constantly is not a consistent speed, means the axis speed is constantly accelerating, so constantly jerking.
The part that makes it easier to code would be that only one axis must be calculated at a time.
Please Log in to join the conversation.
