Mesa inm encoder reset

More
4 years 4 months ago #244685 by thadwald
I have some MPGs connected to a mesa card and showing up as inm encoders in the HAL configuration. Unlike the standard MESA encoders, these don't have a reset pin.
I need a way to scale and to reset these counts I can easily scale them using the scale component but I can't figure out how to reset them. Should I use the HAL encoder component instead?

I need to read the scaled output from gcode.

Please Log in to join the conversation.

More
4 years 4 months ago #244693 by PCW
Replied by PCW on topic Mesa inm encoder reset
Yeah, the inm,inmux encoders are really intended for jogging
MPGs which use a relative count

You can reset the output using the offset component
(though you would need to convert from S32 to float first)

Please Log in to join the conversation.

More
4 years 4 months ago #244697 by thadwald
Replied by thadwald on topic Mesa inm encoder reset
so I would need to:
1 convert reset button state, encoder count, and offset to float
2 apply the following arithmetic: offset = offset + (count * -1 * buttonstate)
3 convert offset back to s32

Is there a simpler method?

I have this working satisfactorily with the HAL encoder component. It does lose a few counts when compared to the inm encoder but only if I spin aggressively.

 

Please Log in to join the conversation.

More
4 years 4 months ago #244698 by PCW
Replied by PCW on topic Mesa inm encoder reset
Probably simpler to make a reset component
(that removes the current offset when requested and does the type conversions)

The MPG counters are really intended for normal MPG use
(where the count is always relative)

Please Log in to join the conversation.

More
4 years 4 months ago #244701 by thadwald
Replied by thadwald on topic Mesa inm encoder reset
Thanks. I will look into it if the encoders prove to be too slow.

Please Log in to join the conversation.

More
4 years 4 months ago #244703 by PCW
Replied by PCW on topic Mesa inm encoder reset
I just added reset capability to inm and inmux (in master)

Please Log in to join the conversation.

More
4 years 2 months ago #249197 by thadwald
Replied by thadwald on topic Mesa inm encoder reset
Would it be easy to get this feature it 2.8?

Please Log in to join the conversation.

More
4 years 2 months ago #249207 by PCW
Replied by PCW on topic Mesa inm encoder reset
Somebody on the forum made a branch that does this
(well updated 2.8 with the 2.9 hm2 driver)

If I trusted myself more with git it should not be too hard since
the driver changes don't affect anything else in LinuxCNC

Need to learn a bit about git cherry pick (I've been told that is the way)

Please Log in to join the conversation.

More
4 years 2 months ago #249209 by D.L.
Replied by D.L. on topic Mesa inm encoder reset
[DEL]

Please Log in to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum