Mesa inm encoder reset

More
06 Jun 2022 19:14 - 06 Jun 2022 19:28 #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.
Last edit: 06 Jun 2022 19:28 by thadwald.

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

More
06 Jun 2022 21:54 #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 or Create an account to join the conversation.

More
06 Jun 2022 23:19 #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 or Create an account to join the conversation.

More
06 Jun 2022 23:44 #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 or Create an account to join the conversation.

More
07 Jun 2022 01:14 #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 or Create an account to join the conversation.

More
07 Jun 2022 03:29 #244703 by PCW
Replied by PCW on topic Mesa inm encoder reset
I just added reset capability to inm and inmux (in master)
The following user(s) said Thank You: thadwald

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

More
06 Aug 2022 13:26 #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 or Create an account to join the conversation.

More
06 Aug 2022 14:52 #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 or Create an account to join the conversation.

More
06 Aug 2022 15:17 - 04 Sep 2022 15:41 #249209 by D.L.
Replied by D.L. on topic Mesa inm encoder reset
[DEL]
Last edit: 04 Sep 2022 15:41 by D.L..

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

Time to create page: 0.078 seconds
Powered by Kunena Forum