- Posts: 112
- Thank you received: 0
Create pos cmd for stepper driver from velocity
2 years 4 months ago #303303
by GuiHue
Create pos cmd for stepper driver from velocity was created 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?
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.
2 years 4 months ago #303306
by PCW
Replied by PCW on topic Create pos cmd for stepper driver from velocity
(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)
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.
2 years 4 months ago #303331
by GuiHue
Replied by GuiHue on topic Create pos cmd for stepper driver from velocity
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
