Community

Geared move left one axis behind

We had a very strange occurrence last night where on our geared move one axis didn’t move. This is a move that we run successfully thousands of times a day, but on one move the Z axis didn’t follow (ZL is the leader, and Z, ZR and ZB are the followers). Our code looks like this:

//based on code from gearing.cpp RSI sample code
// Configure the ‘slave’ axes to be a slave to the ‘master’ axis (ZL) at a ratio of 1:1
pZ->GearingEnable(pZL, RSIAxisMasterType::RSIAxisMasterTypeAXIS_ACTUAL_POSITION, 1, 1);
pZR->GearingEnable(pZL, RSIAxisMasterType::RSIAxisMasterTypeAXIS_ACTUAL_POSITION, 1, 1);
pZB->GearingEnable(pZL, RSIAxisMasterType::RSIAxisMasterTypeAXIS_ACTUAL_POSITION, 1, 1);

            auto axisState = pZL->StateGet();
            if (axisState == RSIState::RSIStateERROR || axisState == RSIState::RSIStateSTOPPING_ERROR)
            {
                auto errorSource = pZL->SourceGet();
                auto errorDescription = pZL->SourceNameGet(errorSource);
                ... Report error and EStop
                return false;
            }
           ... Continue to do SCurve move

Should we check the state of all the axes and not just the leader before doing a move?

For safety, you might want to add all of these axes to a MultiAxis object. One great feature of MultiAxis (in firmware) is that all errors are propagated between axes. So you won’t use this MultiAxis for commanding motion, but only for the error propagation feature.

Then you’ll only need to call MultiAxis::StateGet() before commanding your motion. If there are bad states, you’ll want to check the Source/SourceName for each Axis in the MultiAxis.

This adds some complexity to the software when it comes to clearing faults. You’ll have to remove all the axes from the MultiAxis (or call Unmap()) it when clearing faults. It’s probably worth it.