Reset Mesa 7i92 encoder count

More
27 Oct 2020 07:06 #187380 by rootboy
Hi guys,

Is there a way to reset the accumulated count from a Mesa 7i92 board? The encoder count in question is:

hm2_7i92.0.encoder.04.count

We added an encoder to help verify that the tool changer indexed into a reasonably close position before proceeding with the next cut. The original unlocking rod extend/retract limits have had problems getting made/unmade when the tool changer rotates too far and prevents the unlocking rod from retracting fully. So I'll use the encoder position to force the tool changer into another go-around if I see that the tool changer is off by too many degrees.

But since it's an incremental encoder the count adds up after each rotation and will eventually get into cumbersome values. So being able to reset the count programmatically would be ideal. If not, I can just use a temporary register in ClassicLadder and store the starting value at tool holder #1 after each rotation and subtract this value from the current count to do the equivalent thing, which will be "Plan B".


Thanks!

John

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

More
27 Oct 2020 13:01 - 27 Oct 2020 13:10 #187410 by Todd Zuercher
I believe there is a hal pin "hm2_7i92.0.encoder.04.reset" that I think would do the job.
linuxcnc.org/docs/html/man/man9/hostmot2.9.html#encoder

But is that going to cause problems with you loosing your home position for the encoder? Another option might be to use the index?
Last edit: 27 Oct 2020 13:10 by Todd Zuercher.
The following user(s) said Thank You: rootboy

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

More
27 Oct 2020 14:58 #187427 by rootboy
Thanks Todd!

I looked all over in the available pins and signals for exactly that and I missed it. :blush:

The encoder doesn't have an index pulse, it's a pretty cheap one. And the curious thing about this 400 PPR encoder is that it puts out 2400 pulses per revolution. A bit of a head scratcher... Mislabelled from the factory perhaps?

So it will pick up two counts somewhere at the start of the machine (not electrical noise however), and from then on out it is a repeatable 2400 count rotation. There are 8 positions on the tool changer so I get 300 counts per index.

As for losing home, it shouldn't be a problem. I'll use wherever it first starts out as the "index". This seems reasonable since it would be in a locked position from its last use. Here's hoping anyway...

It appears to have a +5 to -minus 3 count swing before it gets settled in at which it generally shows +2 counts. Anything outside of the +5 to -3 range would indicate that the tool changer didn't settle in correctly.

My PLC program won't let the program proceed if the locking rod doesn't get back to the locked position, but there isn't all that much movement on the locking rod, and it gets stuck quite frequently before it gets all of the way home. Removing power from the rotate cylinder generally snaps it into place. And the actuator for the locking rod is a trapezoidal ring mounted on a bearing cap at the end of the locking rod. This allows the ring to rotate independently of the locking rod. It looks like they had to make the slopes on the ring pretty gentle to keep from tearing the switch up. But that adds quite a bit bit of uncertainty to where the locking rod will eventually end up.

When (not if) it misses a pocket, it simply does another rotation of the tool changer.

And while the pawl in the tool changer head might be a bit worn, with the locking rod in place there is no play whatsoever in the tool changer. Eventually it will need to be torn down and gone through, but that sounds like a job for a machinist, not a controls engineer. ;)

Keeping the tool changer balanced goes a long ways towards preventing this from happening, and there is even a plaque near the tool changer warning not to run it unbalanced. But for test and debug, I want it in the worst reasonable condition. Once it's debugged then it should always be run with it balanced properly.

So the entire purpose for this is to compensate for the iffyness of the locking rod's limit switch setup. Sort of a "belt and suspenders" approach.


Thanks again for your help!

John
The following user(s) said Thank You: Patrice

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

More
28 Oct 2020 05:05 #187508 by rootboy
Just an update, that worked like a charm. Thanks again!
The following user(s) said Thank You: tommylight

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

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