HAL Step accumulation question
- jsummers06
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
29 Jan 2020 16:01 #156092
by jsummers06
HAL Step accumulation question was created by jsummers06
Hopefully this question makes sense to you all and Ive put it in the right place. Im a Software engineer by trade, looking to get into CNC as a hobby. As I was exploring the HAL examples, a question came to me that i haven't seen an answer to. For a simple step gen based controller, rather than generate an individual step pulse for each axis, is there a way to accumulate the steps in each cycle so that they could be synchronized. what i mean is, is there a way to get the step pulses from HAL as a sequence of bitmasks? for example for up to 8 axis the step cycle could be two HAL calls per cycle set_dir(10101111) followed by step(10001000), where a one means step and 0 means dont step. this would seem to be a much faster way to send the pulses in sync via a DMA or serial message. Have I missed something? Does this exist or is it just not worth the effort for some reason?
Please Log in or Create an account to join the conversation.
29 Jan 2020 19:00 #156105
by PCW
Replied by PCW on topic HAL Step accumulation question
This is certainly doable with a hal component.
For example just the scaled d/dt of position waypoints
would give you the steps per servo thread
this could be further processed into convenient
length bitstream samples.
(things like setup and hold delays and the required catch-up
would have to be factored in to the bitstream)
This is not terribly different than the way most current LinuxCNC hardware
step-generators work (most are rate generators with position feedback to accommodate
time base differences and setup/hold delays on reversals)
For example just the scaled d/dt of position waypoints
would give you the steps per servo thread
this could be further processed into convenient
length bitstream samples.
(things like setup and hold delays and the required catch-up
would have to be factored in to the bitstream)
This is not terribly different than the way most current LinuxCNC hardware
step-generators work (most are rate generators with position feedback to accommodate
time base differences and setup/hold delays on reversals)
The following user(s) said Thank You: tommylight, jsummers06
Please Log in or Create an account to join the conversation.
- jsummers06
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
30 Jan 2020 14:53 #156182
by jsummers06
Replied by jsummers06 on topic HAL Step accumulation question
Thanks,
Given that Hardware step generation was already on my radar, i might be better to stick with what I'm given in the stepgen example and then look toward hardware based step generation. If I have to implement the timings myself, I may as well learn to do it on the other end.
Thanks again,
-Jacob
Given that Hardware step generation was already on my radar, i might be better to stick with what I'm given in the stepgen example and then look toward hardware based step generation. If I have to implement the timings myself, I may as well learn to do it on the other end.
Thanks again,
-Jacob
Please Log in or Create an account to join the conversation.
- jsummers06
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
31 Jan 2020 02:14 #156227
by jsummers06
Replied by jsummers06 on topic HAL Step accumulation question
After reading the code in stepgen.c, it looks like i might be able to tease the data I want out of the step pulse loop pretty easily by overriding the user defined step type and managing a shared pinmap. Overriding quadrature mode for my testing would seem to be the easiest way, do you happen to know if everything will still run correctly even if i don't 'connect' the output pins f the stepgen to anything?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
31 Jan 2020 18:41 #156266
by Todd Zuercher
Replied by Todd Zuercher on topic HAL Step accumulation question
it is open loop. Linuxcnc has no way of knowing if the stepgens are connected to anything.
The following user(s) said Thank You: jsummers06
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds