Mesa inm encoder reset

More
4 years 4 months ago - 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.
Last edit: 4 years 4 months ago by thadwald.

Please Log in or Create an account 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 or Create an account 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 or Create an account 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 or Create an account 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 or Create an account 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)
The following user(s) said Thank You: thadwald

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

Time to create page: 0.169 seconds
Powered by Kunena Forum