Create pos cmd for stepper driver from velocity

  • GuiHue
  • GuiHue's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
18 Jun 2024 21:37 #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 or Create an account to join the conversation.

More
18 Jun 2024 22:24 - 18 Jun 2024 22:45 #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)
Last edit: 18 Jun 2024 22:45 by PCW.

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

  • GuiHue
  • GuiHue's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
19 Jun 2024 06:47 #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 or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum