motion.adaptive-feed + MPG use

More
29 Apr 2022 15:23 - 29 Apr 2022 15:24 #241646 by robertspark
I know I've seen this discussed a couple of time on the forum with a few threads

I'm looking at the use of motion.adaptive-feed and the use of an MPG to forward and reverse run a file.



I know how motion.adaptive-feed works and requires M52, and works on a range of -1 to 1, with zero being feedhold and 1 being 100% feedrate
linuxcnc.org/docs/devel/html/gcode/m-code.html#mcode:m52

Using Mesa hardware (7i76 + 7i76E) on Mode 2, which exposes the 2x MPGs available on inputs 16, 17, 18 and 19, which then become the enc0.count and enc1.count inputs.
forum.linuxcnc.org/media/kunena/attachme...8/7i76_Anschluss.pdf

The question is.... how does one convert the mpg counts to a velocity, given the (mesa) mpg does not seem to output enc0.velocity.

I'm looking at the realtime components and I'm just not seeing what I should be using.

I appreciate that the count will update at 1khz, and it will increment / decrement based upon the direction that the MPG is moved so (new count - old count) / (time elapsed) will equal velocity 
I would then need to smooth this velocity
And then set and range for the velocity / remap it to a range (from 0 - 1)
then add a negative or positive sign based upon if (new count > old count) OR (new count < old count)
if (new count = old count)  then motion.adaptive-feed = 0 (feedhold).

not looking for someone to do it for me, just looking for pointers please so I can learn (teach a man to fish / programme etc)

These will just be standard 100 count MPG's (I may also have a go at doing it via a XHC HB04 I've got too, but I was looking at the MESA MPG's first as they did not have velocity available as far as I could see).

linuxcnc.org/docs/devel/html/man/man1/xhc-hb04.1.html
Last edit: 29 Apr 2022 15:24 by robertspark.

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

More
30 Apr 2022 19:43 #241730 by robertspark
head slap moment!!

linuxcnc.org/docs/devel/html/hal/comp.ht...-component-generator

ddt component - Compute the derivative of the input function

linuxcnc.org/docs/devel/html/man/man9/ddt.9.html

I didn't know that that "ddt" or "the derivative of the input function" was the change over time / period (someone's grasp of english is obviously better than mine)
The following user(s) said Thank You: tommylight

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

More
01 May 2022 23:02 #241817 by andypugh
I am not sure that you want velocity anyway. Do you really want the system to move proportional to how _fast_ you are winding the knob?

Typically the application would be something like one-turn-clockwise = full speed forwards, and one turn anticlockwise = full speed reverse.

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

More
01 Jul 2022 17:12 #246382 by DoWerna

I wanted to do the same with my lathe.


The component calculates the velocity from the counts/100ms

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

Time to create page: 0.344 seconds
Powered by Kunena Forum