Generating set amount of steps?

More
10 years 4 months ago #76193 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.

More
10 years 4 months ago #76201 by BigJohnT
Take a look at my stepper winder example.
gnipsel.com/linuxcnc/examples/winder.zip

JT

Please Log in to join the conversation.

More
10 years 4 months ago #76203 by andypugh
One way is this. You can do it from a simple HAL session at the terminal
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
to move the motor. And because the scale is set as 1 then the units are actual steps.

Please Log in to join the conversation.

More
10 years 4 months ago #76232 by chevydan6
so to reverse direction, do I just use -200?

Please Log in to join the conversation.

More
10 years 4 months ago #76233 by andypugh

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
Powered by Kunena Forum