MPG Count per click

More
03 Jun 2018 19:02 - 03 Jun 2018 19:08 #111537 by thadwald
MPG Count per click was created by thadwald
I'm not sure that this is the correct forum to ask this on, but I am using an encoder input on the Mesa 7i96 to read an MPG pendant.

I have it working (yay!) thanks to this forum.

My MPG encoder sends a full quadrature per "click," which is read by the controller as 4 clicks. What is the simplest way to correct this? I don't want to just change the scale because it causes the machine to move four steps while the MPG is slowly rolled from one detent to the next.
Last edit: 03 Jun 2018 19:08 by thadwald.

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

More
03 Jun 2018 19:22 - 03 Jun 2018 19:29 #111539 by Sparky961
Replied by Sparky961 on topic MPG Count per click
I remember having a similar issue and posting a question about it here. It also strikes me that PCW gave me an answer having something to do with the setup of the encoder channel.

But do you think for the life of me I can find that thread, despite how hard I've looked......?

EDIT: Found it - I think. It may be helpful, if not specifically, at least to lead you in the right direction. Start reading the thread starting here: forum.linuxcnc.org/27-driver-boards/3045...steps?start=10#70703
Last edit: 03 Jun 2018 19:29 by Sparky961. Reason: Found it.

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

More
03 Jun 2018 19:42 - 03 Jun 2018 19:42 #111542 by PCW
Replied by PCW on topic MPG Count per click
The hardware encoder in the 7I96 does not support 1X mode so you would need to use a software encoder component
(this should be fixed when the INM module is supported, this will support up to 4 MPGs on the generic inputs)
Last edit: 03 Jun 2018 19:42 by PCW.

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

More
03 Jun 2018 20:46 #111553 by jmelson
Replied by jmelson on topic MPG Count per click

The hardware encoder in the 7I96 does not support 1X mode so you would need to use a software encoder component
(this should be fixed when the INM module is supported, this will support up to 4 MPGs on the generic inputs)

No, you don't have to do this. The output from the MPG's encoder counter can simply be divided by 4 to get the desired result.
In fact, at least axis encoders have a scale factor built into the driver. The scale normally defaults to 1.0, just supply a factor of 0.25 to the appropriate encoder's scale factor.

Jon

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

More
03 Jun 2018 22:48 #111569 by thadwald
Replied by thadwald on topic MPG Count per click

The output from the MPG's encoder counter can simply be divided by 4 to get the desired result

Jon


Tell me if I understand this correctly.

My current setup is as such:
Encoder.count => ilowpass.in

And you say I should have something like:
Encoder.count => multiply by .25 => ilowpass.in


I couldn’t find a divide function.

Ignoring the wrong syntax, is this what you meant? What happens when you feed a floating point value into an integer input? Will it automatically round the number? Or just truncate it?

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

More
04 Jun 2018 02:33 #111570 by jmelson
Replied by jmelson on topic MPG Count per click
ilowpass has a scale parameter, It looks like the default for scale is 1024. So, I think if you were to add this line :

setp ilowpass.0.scale 102.4

it should make the MPG encoder count approximately 4 X slower.

I have the scale parameter set to 100 on my system's ilowpass, and then have a multiplexer that divides by different factors depending on the setting of a switch on the pendant.

Jon

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

More
04 Jun 2018 02:40 #111571 by jmelson
Replied by jmelson on topic MPG Count per click
Ah, actually, you can set the jog rate with the pin :
axis.<n>.jog-scale
where <n> is the axis number for the axes you want to set the jog rate.
So, I have a mux that selects between these values :

setp mux4.0.in0 .00000025
setp mux4.0.in1 .0000025
setp mux4.0.in2 .000025
setp mux4.0.in3 0

net jogscale mux4.0.out => axis.0.jog-scale

To select the desired jog rate. The zero disables jogging unless I press a button, so an accidental bump of the MPG won't sent the machine crashing off somewhere.

Jon

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

More
04 Jun 2018 03:32 - 04 Jun 2018 03:41 #111573 by thadwald
Replied by thadwald on topic MPG Count per click


setp mux4.0.in0 .00000025
setp mux4.0.in1 .0000025
setp mux4.0.in2 .000025

Jon


Oh, that’s what you meant. That’s actually exactly what I have mine set to right now. What I’ve noticed, though, is that occasionally the detent causes the wheel to bounce slightly, which results in some oddd and unexpected motion. I admit that this is a minor issue.

So my system is working. What I aim to achieve now, is a one to one relationship between MPG clicks and machine moves.
Last edit: 04 Jun 2018 03:41 by thadwald.

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

More
04 Jun 2018 16:12 #111608 by jmelson
Replied by jmelson on topic MPG Count per click

What I’ve noticed, though, is that occasionally the detent causes the wheel to bounce slightly, which results in some oddd and unexpected motion. I admit that this is a minor issue.

So my system is working. What I aim to achieve now, is a one to one relationship between MPG clicks and machine moves.

OK, you may want to twiddle with the parameters to the ilowpass. I have mine set so that it takes about one second for the last click to come out of the ilowpass, which works out right to prevent the buzzing of the servos. That has gain at .01

Jon

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

Moderators: PCWjmelson
Time to create page: 0.113 seconds
Powered by Kunena Forum