- Posts: 3
- Thank you received: 0
Generating set amount of steps?
10 years 4 months ago #76193
by chevydan6
Generating set amount of steps? was created by chevydan6
Is there software in LinuxCNC that allows me to generate a set amount of steps? Like enter 350 steps and the motors moves just that amount?
Please Log in to join the conversation.
10 years 4 months ago #76201
by BigJohnT
Replied by BigJohnT on topic Generating set amount of steps?
Please Log in to join the conversation.
10 years 4 months ago #76203
by andypugh
Replied by andypugh on topic Generating set amount of steps?
One way is this. You can do it from a simple HAL session at the terminal
You can probably paste this into a terminal window then carry on, or save it as a file9(somename.hal) and then use
You can now use commands like
to move the motor. And because the scale is set as 1 then the units are actual steps.
Code:
halrun
loadrt stepgen
loadrt threads name1=base-thread period1=100000 name2=servo-thread period2=1000000
addf stepgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf stepgen.update-freq servo-thread
setp stepgen.0.scale 1
setp stepgen.0.maxvel 100
setp stepgen.0.maxaccel 1000
start
You can probably paste this into a terminal window then carry on, or save it as a file9(somename.hal) and then use
Code:
halrun
source somename.hal
You can now use commands like
Code:
setp stepgen.0.position-cmd 200
setp stepgen.0.position-cmd 0
Please Log in to join the conversation.
10 years 4 months ago #76232
by chevydan6
Replied by chevydan6 on topic Generating set amount of steps?
so to reverse direction, do I just use -200?
Please Log in to join the conversation.
10 years 4 months ago #76233
by andypugh
Yes. Or setp scale to -1 if you want.
Replied by andypugh on topic Generating set amount of steps?
chevydan6 wrote: so to reverse direction, do I just use -200?
Yes. Or setp scale to -1 if you want.
Please Log in to join the conversation.
Time to create page: 0.082 seconds
