Create pos cmd for stepper driver from velocity

More
2 years 4 months ago #303303 by GuiHue
Hi everyone,

I intend to use a EL7031 card to drive a small stepper which in turns operates a peristaltic pump for an MQL system. Before switching to EtherCAT I used a hm2 stepgen in velocity mode which took care of all necessary steps.
I have now realized, that the driver for EL7031 requires a pos-cmd as input. Is there a way within linuxcnc to create pos-cmd from velocity? I thought about using stepgen comps to feed their position-fb into the stepper driver. However, without the make-counts  function I do not see that this would work. I'd rather like to avoid running the make-counts thread to avoid the tuning hazzle that comes with this...

Any ideas?

Please Log in to join the conversation.

More
2 years 4 months ago #303306 by PCW
(assuming you want floating point position)

loadrt sum2
addf sum2.0 servo-thread
net pump_pos sum2.0.out sum2.0.in0
net pump_velocity sum2.0.in1

You can scale the velocity command with gain1
for example:

setp sum2.0.gain1 .001

Sets the velocity scaling to counts per second
(at a 1 ms servo thread period)

Please Log in to join the conversation.

More
2 years 4 months ago #303331 by GuiHue
Thanks, this is delightfully simple. I need to think about overflow of the count variable though. Need to look up numbers first.

Please Log in to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum