Home to Falling Switch
So, I want the behavior of POSITIVE_HOME_NEGATIVE_MOMENTUM
/NEGATIVE_HOME_POSITIVE_MOMENTUM
but with an active low input.
Based on the documentation, I might hope that FALLING_HOME_POSITIVE_START_NEGATIVE_MOMENTUM
/FALLING_HOME_NEGATIVE_START_POSITIVE_MOMENTUM
might do what I want, but they don’t. (At least, not quite—they use the stage 2 velocity for what I would consider to be stage 1 of homing, which can be a really long move.)
So, I’m trying to use the “rising home” methods but invert the active low input.
Is there a recommended way to invert an input?
Up until now, I’ve been using a pair of user limits, one to trigger when the input is 1 and set a separate user buffer to 0, and another to trigger when the input is 0 and sets the user buffer to 1. (FWIW, I don’t like this strategy, but it did, at least, work. This kludge was crafted before the existence of math blocks. I could probably use a single math block to accomplish what I want.)
Errors
Recently, under some conditions, I’ve been getting RMP errors.
Switch state and expected state did not match. This method should only be used for Home Setups which are High to the Negative Limit. (Error 1000000030) (Axis::Home) (Object 0) (File axis.cpp) (Line 4131) (Version 10.6.4.0)
I’ve most often seen this when the home input goes low before the stage 2 move begins. I don’t see any evidence of that particular event happening.
To complicate matters, I’m trying to home the two motors of a gantry simultaneously. Both have separate “home” inputs (not the RMP kind, just an arbitrary EtherCAT I/O that we use for homing). Both are using the same homing method, but are looking at separate user buffers as their custom config input.
What I observe is that after the home input for one of the axes changes state, the other axis will frequently throw an exception from inside Axis::Home(...)
: RSI_AXIS_LIMIT_UNEXPECTED_STATE
- I’ve inspected the addresses used for the API calls, and the two axes are not using the same input address.
- It doesn’t always happen at the same time, but almost always the user limit for one axis triggers near (25-100ms) when the exception happens.
Question #1
What circumstances can cause RMP to throw this exception?
In the past, when I’ve seen this, it happens because the input goes low before RMP starts the stage 2 move (e.g. overshooting the switch).
I can’t prove that the input ever changed around the time that the exception happened.
Monitoring the firmware values for the inputs as well as the user limit statuses (using recorders) doesn’t show any change.
The blue dotted line is when the input changed. The red dot-dash line is when the exception happened.
Question #2
Are there things I can do that would influence this behavior? IDK why both user limits are changing status when they do. I would have expected only one to do something when the input changes. I’m sure this depends on how I’ve configured them, but the description above is accurate.