stepgen and joints

More
11 Oct 2019 01:52 #147676 by felixcnc
stepgen and joints was created by felixcnc
Hello,

I have added a stepgen to a puma hal and I was able to output of a joint value to a parallel port using stepgen, the code is more or less like this (they can have typos and errors because I'm typing this from my memory):
loadrt hal_parport cfg="0x378 out"
addf parport.0.write servo-thread

loadrt stepgen step_type=0

net direccion stepgen.0.dir
net paso stepgen.0.step

setp stepgen.0.position-scale 10000
setp stepgen.0.enable.1

addf stepgen.update-freq servo-thread
addf stepgen.make-pulses servo-thread

net eje-0 axis.0.joint-pos-cmd => stepgen.0.position-cmd

I have a few questions regarding output things through a stepgen:
  1. I have a small and not very precise step motor for my tests, with a driver that divide the whole circle in 200 steps. What are the calculations required to use the joint value to output that? (I see the joint figures move very slowly)
  2. How can I extend the pulse time? (because right now I have TONS of very small pulses, and I need to degrade the resolution, so I get less pulses (this is related to the previous question)
  3. Is the axis value the right value to output for a step motor? (I think it's not, but I am not sure what to send to the stepgen.0.position-cmd)

As usual, thank you so much for your help

Cheers

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

More
11 Oct 2019 02:21 - 11 Oct 2019 02:23 #147678 by Leon82
Replied by Leon82 on topic stepgen and joints
Your driver may have a fixed or adjustable microstep setting.

If it's locked at say 10 you would have 2000 steps per rev.

But some will chop it to 25000 steps per rev. They have a dip switch layout you need to set your desired microstep setting. I believe it is the scale setting.

If you use the step conf wizard you can easily play with the settings and test the motor. Then save it and make all future edits in pluma
Last edit: 11 Oct 2019 02:23 by Leon82.

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

More
18 Oct 2019 13:06 #148194 by andypugh
Replied by andypugh on topic stepgen and joints

  • I have a small and not very precise step motor for my tests, with a driver that divide the whole circle in 200 steps. What are the calculations required to use the joint value to output that?

  • Set the stepgen scale parameter ( stepgen.N.position−scale ) to the number of steps per engineering unit.

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

    More
    18 Oct 2019 13:10 #148198 by felixcnc
    Replied by felixcnc on topic stepgen and joints
    Thank you Andy!

    I already found that reading the documentation. But it's cool to update here.

    I guess by the end lf this year I will have something in real life working with LinuxCNC and it's thanks to people like you and this community.

    Thanks!!!

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

    Time to create page: 0.081 seconds
    Powered by Kunena Forum